Package jpicedt
Class JPicEdt
- java.lang.Object
-
- jpicedt.JPicEdt
-
public class JPicEdt extends java.lang.ObjectApplication main class (this class is not shipped in the jpicedt library)- Since:
- jPicEdt 1.3.2
- Version:
- $Id: JPicEdt.java,v 1.31.2.1 2007/09/02 11:55:59 reynal Exp $
- Author:
- Sylvain Reynal
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJPicEdt.AboutActionOpens the "about..." dialog boxstatic classJPicEdt.ContentTypeActionSet the content-type of the currently active boardstatic classJPicEdt.ExitActionExit jPicEdtstatic classJPicEdt.FileCloseActionClose the active boardstatic classJPicEdt.FileNewActionCreate a new board from scratch, performing operation in a separate thread.static classJPicEdt.FileOpenActionOpen a board from disk, performing I/O operations in a separate threadstatic classJPicEdt.FileReloadActionReload the active board from disk, performing I/O operation in a separate thread.static classJPicEdt.FileSaveActionsave a frame content to disk, performing I/O operations in a separate threadstatic classJPicEdt.FileSaveAllActionSave all open boards to disk.static classJPicEdt.FileSaveAsActionSave the active board to disk with a new file name, performing I/O operations in a separate threadstatic classJPicEdt.FragmentInsertActionInsert a fragment into the active board, performing I/O operation in a separate thread.static classJPicEdt.FragmentSaveActionsave the selection content of the active board to disk as a "fragment"static classJPicEdt.MemoryMonitorActionDisplay memory informationstatic classJPicEdt.OpenBSHConsoleActionOpen a BeanShell consolestatic classJPicEdt.PageFormatActionSet the format of the currently active boardstatic classJPicEdt.PreferencesActionOpen the "preferences" dialog boxstatic classJPicEdt.RedoActionRedoes last actionstatic classJPicEdt.RedrawActionRedraws (aka repaint()) active internal framestatic classJPicEdt.RunExternalCommandActionrun an external processstatic classJPicEdt.ShowErrorLogActionopen a frame containing the error.log filestatic classJPicEdt.ShowHelpActionopen a frame containing the help (HTML formatted) page.static classJPicEdt.ShowLicenseActionopen a frame containing the (HTML formatted) GPL license page.static classJPicEdt.ToggleAttributesPanelActionToggle the visibility of the attributes editorstatic classJPicEdt.ToggleToolkitPanelActionToggle the visibility of the toolkit panelstatic classJPicEdt.UndoActionUndoes last actionstatic classJPicEdt.ViewLaTeXFileActionDisplay the LaTeX content of the active board in a Dialog Boxstatic classJPicEdt.WindowCascadeActionCascades internal framesstatic classJPicEdt.WindowTileHorActionTiles internal frames horizontallystatic classJPicEdt.WindowTileVertActionTiles internal frames vertically
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_TMPDIRdefault platform tmp dirstatic java.lang.StringKEY_TMPDIRkey used to fetch the user's temp dir from a Properties object
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancloseBoard(PEDrawingBoard board)Close the given board, or the currently active board if "board" is null.static ActionDispatchergetActionDispatcher()static ActionRegistrygetActionRegistry()Return an ActionMap that holds GUI action for the entire application.static PECanvasgetActiveCanvas()Return the currently active PECanvas (ie hosted by the currently active PEDrawinBoard), or null if no board is currently active.static DrawinggetActiveDrawing()Return the Drawing attached to the currently active PECanvas (ie hosted by the currently active PEDrawinBoard), or null if no board is currently active.static PEDrawingBoardgetActiveDrawingBoard()Return the currently active PEDrawingBoard, or null if none is active.static EditorKitgetActiveEditorKit()Return the EditorKit attached to the currently active PECanvas (ie hosted by the currently active PEDrawinBoard), or null if no board is currently active.static java.awt.datatransfer.ClipboardgetClipboard()Return a static reference to the local ClipBoard shared across all instance of this EditorKit.static MDIManagergetMDIManager()static ParsergetParser()Return the default parser used for parsing standard JPicEdt's formats, ie currently LaTeX, epic/eepic, and PsTricks.static java.util.PropertiesgetPreferences()Return the Properties object that holds user preferences across the entire application.static booleangetProperty(java.lang.String key, boolean def)Convenience for retrieving a boolean property from User's preferencesstatic doublegetProperty(java.lang.String key, double def)Convenience for retrieving a double property from User's preferencesstatic intgetProperty(java.lang.String key, int def)Convenience for retrieving a int property from User's preferences Return a integer parsed from the value associated with the given key, or "def" in key wasn't found.static java.awt.ColorgetProperty(java.lang.String key, java.awt.Color def)Convenience for retrieving a Colour property from User's preferencesstatic java.lang.StringgetProperty(java.lang.String key, java.lang.String def)Convenience for retrieving a String property from User's preferences Return a String parsed from the value associated with the given key, or "def" in key wasn't found.static java.io.FilegetTmpDir()Return the user tmp dir, or the platform standard tmp dir if user didn't set one, or null if none is standardly defined.static java.lang.StringgetUserSettingsDirectory()Return the user-settings directory, for instance "~/.jpicedt" on unix.static voidinsertFragment(java.lang.String path)Insert a fragment loaded from disk in the active boardstatic voidmain(java.lang.String[] args)static voidnewBoard()Create a new drawing board and add it to the desktopstatic voidopenBoard(java.lang.String path)Create a new board initialized from a file on disk, then add it to the desktopstatic voidreloadBoard()Reload the active board from diskstatic voidsaveAllBoards()Save all open boards to disk, possibly prompting user for a file name for those boards which haven't been saved to disk before.static voidsaveBoard(boolean alwaysPromptUser)Save the active board to disk ; prompt user if this board hasn't been saved yet, or if alwaysPromptUser is true (e.g.static voidsaveFragment()Save the active board selection as a fragment to diskstatic voidsetMDIManager(java.lang.String mdiStr)Changes the current MDI Manager tostatic voidsetMDIManager(MDIManager aMdiManager)set the MDI manager that should be used for jPicEdtstatic voidsetTmpDir(java.lang.String location)set the current tmp dir
-
-
-
Field Detail
-
KEY_TMPDIR
public static final java.lang.String KEY_TMPDIR
key used to fetch the user's temp dir from a Properties object- See Also:
- Constant Field Values
-
DEFAULT_TMPDIR
public static final java.lang.String DEFAULT_TMPDIR
default platform tmp dir
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
- Parameters:
args- Command line arguments -> name of files to load into the application on startup (there's no limitation on the number of files to load) Any pathname, either relative, or absolute, is valid.
-
setMDIManager
public static void setMDIManager(MDIManager aMdiManager)
set the MDI manager that should be used for jPicEdt- Since:
- jPicEdt 1.3.2
-
getMDIManager
public static MDIManager getMDIManager()
- Returns:
- the current MDI manager for jPicEdt
- Since:
- jPicEdt 1.3.2
-
setMDIManager
public static void setMDIManager(java.lang.String mdiStr)
Changes the current MDI Manager to
-
getActionDispatcher
public static ActionDispatcher getActionDispatcher()
- Returns:
- the ActionDispatcher responsible for delegating action dispatching to the currently installed MDIManager
-
newBoard
public static void newBoard()
Create a new drawing board and add it to the desktop- Since:
- jPicEdt 1.3.2
-
openBoard
public static void openBoard(java.lang.String path)
Create a new board initialized from a file on disk, then add it to the desktop- Parameters:
path- the location of the file on disk ; if null, prompt user.- Since:
- jPicEdt 1.3.2
-
reloadBoard
public static void reloadBoard()
Reload the active board from disk- Since:
- jPicEdt 1.3.2
-
closeBoard
public static boolean closeBoard(PEDrawingBoard board)
Close the given board, or the currently active board if "board" is null.- Returns:
- false if operation failed
- Since:
- jPicEdt 1.3.2
-
insertFragment
public static void insertFragment(java.lang.String path)
Insert a fragment loaded from disk in the active board- Parameters:
path- the location of the fragment on disk ; if null, prompt user.- Since:
- jPicEdt 1.3.2
-
saveBoard
public static void saveBoard(boolean alwaysPromptUser)
Save the active board to disk ; prompt user if this board hasn't been saved yet, or if alwaysPromptUser is true (e.g. used as a "save as..." action)- Since:
- jPicEdt 1.3.2
-
saveAllBoards
public static void saveAllBoards()
Save all open boards to disk, possibly prompting user for a file name for those boards which haven't been saved to disk before.- Since:
- jPicEdt 1.3.2
-
saveFragment
public static void saveFragment()
Save the active board selection as a fragment to disk- Since:
- jPicEdt 1.3.2
-
getPreferences
public static java.util.Properties getPreferences()
Return the Properties object that holds user preferences across the entire application.
-
getActionRegistry
public static ActionRegistry getActionRegistry()
Return an ActionMap that holds GUI action for the entire application.
-
getParser
public static Parser getParser()
Return the default parser used for parsing standard JPicEdt's formats, ie currently LaTeX, epic/eepic, and PsTricks.
-
getActiveDrawingBoard
public static PEDrawingBoard getActiveDrawingBoard()
Return the currently active PEDrawingBoard, or null if none is active.
-
getActiveCanvas
public static PECanvas getActiveCanvas()
Return the currently active PECanvas (ie hosted by the currently active PEDrawinBoard), or null if no board is currently active.
-
getActiveEditorKit
public static EditorKit getActiveEditorKit()
Return the EditorKit attached to the currently active PECanvas (ie hosted by the currently active PEDrawinBoard), or null if no board is currently active.
-
getActiveDrawing
public static Drawing getActiveDrawing()
Return the Drawing attached to the currently active PECanvas (ie hosted by the currently active PEDrawinBoard), or null if no board is currently active.
-
getClipboard
public static java.awt.datatransfer.Clipboard getClipboard()
Return a static reference to the local ClipBoard shared across all instance of this EditorKit. This may be, for example, given as an argument to "copy()" and related methods in PECanvas. Alternatively, one can use the System's clipboard (see java.awt.Toolkit), yet some information may be lost since this later mechanism relies on formatting/parsing.
-
getProperty
public static boolean getProperty(java.lang.String key, boolean def)Convenience for retrieving a boolean property from User's preferences- Returns:
- a boolean built from the value fetched from the given key, or the "def" value if the key wasn't found
-
getProperty
public static java.awt.Color getProperty(java.lang.String key, java.awt.Color def)Convenience for retrieving a Colour property from User's preferences- Returns:
- a Color built from the value fetched from the given key, or the "def" value if the key wasn't found
-
getProperty
public static double getProperty(java.lang.String key, double def)Convenience for retrieving a double property from User's preferences- Returns:
- a double parsed from the value associated with the given key in the given Properties.
returns "def" in key wasn't found, or if a parsing error occured. If "value" contains
a "%" sign, we use a
NumberFormat.getPercentInstanceto convert it to a double.
-
getProperty
public static int getProperty(java.lang.String key, int def)Convenience for retrieving a int property from User's preferences Return a integer parsed from the value associated with the given key, or "def" in key wasn't found.
-
getProperty
public static java.lang.String getProperty(java.lang.String key, java.lang.String def)Convenience for retrieving a String property from User's preferences Return a String parsed from the value associated with the given key, or "def" in key wasn't found.
-
getUserSettingsDirectory
public static java.lang.String getUserSettingsDirectory()
Return the user-settings directory, for instance "~/.jpicedt" on unix.
-
getTmpDir
public static java.io.File getTmpDir()
Return the user tmp dir, or the platform standard tmp dir if user didn't set one, or null if none is standardly defined.
-
setTmpDir
public static void setTmpDir(java.lang.String location)
set the current tmp dir
-
-