http://www.jpicedt.org

jpicedt
Class JPicEdt

java.lang.Object
  extended by jpicedt.JPicEdt

public class JPicEdt
extends Object

Application main class (this class is not shipped in the jpicedt library)

Since:
jPicEdt 1.3.2
Version:
$Id: JPicEdt.java,v 1.51 2013/03/27 06:53:21 vincentb1 Exp $
Author:
Sylvain Reynal

Nested Class Summary
static class JPicEdt.AboutAction
          Opens the "about..." dialog box
static class JPicEdt.ContentTypeAction
          Set the content-type of the currently active board
static class JPicEdt.ExitAction
          Exit jPicEdt
static class JPicEdt.FileCloseAction
          Close the active board
static class JPicEdt.FileNewAction
          Create a new board from scratch, performing operation in a separate thread.
static class JPicEdt.FileOpenAction
          Open a board from disk, performing I/O operations in a separate thread
static class JPicEdt.FileReloadAction
          Reload the active board from disk, performing I/O operation in a separate thread.
static class JPicEdt.FileSaveAction
          save a frame content to disk, performing I/O operations in a separate thread
static class JPicEdt.FileSaveAllAction
          Save all open boards to disk.
static class JPicEdt.FileSaveAsAction
          Save the active board to disk with a new file name, performing I/O operations in a separate thread
static class JPicEdt.FragmentInsertAction
          Insert a fragment into the active board, performing I/O operation in a separate thread.
static class JPicEdt.FragmentSaveAction
          save the selection content of the active board to disk as a "fragment"
static class JPicEdt.MemoryMonitorAction
          Display memory information
static class JPicEdt.OpenBSHConsoleAction
          Open a BeanShell console
static class JPicEdt.PageFormatAction
          Set the format of the currently active board
static class JPicEdt.PreferencesAction
          Open the "preferences" dialog box
static class JPicEdt.RedoAction
          Redoes last action
static class JPicEdt.RedrawAction
          Redraws (aka repaint()) active internal frame
static class JPicEdt.RunExternalCommandAction
          run an external process
static class JPicEdt.ShowErrorLogAction
          open a frame containing the error.log file
static class JPicEdt.ShowHelpAction
          open a frame containing the help (HTML formatted) page.
static class JPicEdt.ShowLicenseAction
          open a frame containing the (HTML formatted) GPL license page.
static class JPicEdt.ToggleAttributesPanelAction
          Toggle the visibility of the attributes editor
static class JPicEdt.ToggleConvexZonePanelAction
          Toggle the visibility of the convexe zone palette
static class JPicEdt.ToggleToolkitPanelAction
          Toggle the visibility of the toolkit panel
static class JPicEdt.UndoAction
          Undoes last action
static class JPicEdt.ViewLaTeXFileAction
          Display the LaTeX content of the active board in a Dialog Box
static class JPicEdt.WindowCascadeAction
          Cascades internal frames
static class JPicEdt.WindowTileHorAction
          Tiles internal frames horizontally
static class JPicEdt.WindowTileVertAction
          Tiles internal frames vertically
 
Field Summary
static String DEFAULT_TMPDIR
          default platform tmp dir
static String KEY_TMPDIR
          key used to fetch the user's temp dir from a Properties object
static String MANUAL_FORMAT_HTML
           
static String MANUAL_FORMAT_HTML_ONE_FILE
           
static String MANUAL_FORMAT_KEY
           
static String MANUAL_FORMAT_PDF
           
 
Method Summary
static boolean closeBoard(PEDrawingBoard board)
          Close the given board, or the currently active board if "board" is null.
static ActionDispatcher getActionDispatcher()
           
static ActionRegistry getActionRegistry()
          Return an ActionMap that holds GUI action for the entire application.
static PECanvas getActiveCanvas()
          Return the currently active PECanvas (ie hosted by the currently active PEDrawinBoard), or null if no board is currently active.
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.
static PEDrawingBoard getActiveDrawingBoard()
          Return the currently active PEDrawingBoard, or null if none is active.
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.
static Clipboard getClipboard()
          Return a static reference to the local ClipBoard shared across all instance of this EditorKit.
static MDIManager getMDIManager()
           
static Parser getParser()
          Return the default parser used for parsing standard JPicEdt's formats, ie currently LaTeX, epic/eepic, and PsTricks.
static Properties getPreferences()
          Return the Properties object that holds user preferences across the entire application.
static boolean getProperty(String key, boolean def)
          Convenience for retrieving a boolean property from User's preferences
static Color getProperty(String key, Color def)
          Convenience for retrieving a Colour property from User's preferences
static double getProperty(String key, double def)
          Convenience for retrieving a double property from User's preferences
static int getProperty(String key, int def)
          Convenience for retrieving a int property from User's preferences
static String getProperty(String key, String def)
          Convenience for retrieving a String property from User's preferences
static YesNoAskMe getProperty(String key, YesNoAskMe def)
          Commodité pour retiré une propriété oui/no/me-demander des préférences utilisateur.
static File getTmpDir()
           
static String getUserSettingsDirectory()
           
static void insertFragment(String path, PicPoint insertionPoint)
          Insère un fragment chagé du disque dans la plance active.
static void main(String[] args)
           
static void newBoard()
          Create a new drawing board and add it to the desktop
static void openBoard(String path)
          Create a new board initialized from a file on disk, then add it to the desktop
static void reloadBoard()
          Reload the active board from disk
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.
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)
static void saveFragment()
          Save the active board selection as a fragment to disk
static void setMDIManager(MDIManager aMdiManager)
          set the MDI manager that should be used for jPicEdt
static void setProperty(String key, YesNoAskMe value)
           
static void setTmpDir(String location)
          set the current tmp dir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MANUAL_FORMAT_KEY

public static final String MANUAL_FORMAT_KEY
See Also:
Constant Field Values

MANUAL_FORMAT_HTML_ONE_FILE

public static final String MANUAL_FORMAT_HTML_ONE_FILE
See Also:
Constant Field Values

MANUAL_FORMAT_HTML

public static final String MANUAL_FORMAT_HTML
See Also:
Constant Field Values

MANUAL_FORMAT_PDF

public static final String MANUAL_FORMAT_PDF
See Also:
Constant Field Values

KEY_TMPDIR

public static final 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 String DEFAULT_TMPDIR
default platform tmp dir

Method Detail

main

public static void main(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

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(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(String path,
                                  PicPoint insertionPoint)
Insère un fragment chagé du disque dans la plance active.

Parameters:
path - le chemin du fragment sur le disque ; si null, invite l'utilisateur à le saisir.
insertionPoint - point d'insertion du fragment ; si null, l'insertion est à (0,0).
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 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 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(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 Color getProperty(String key,
                                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(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.getPercentInstance to convert it to a double.

getProperty

public static int getProperty(String key,
                              int def)
Convenience for retrieving a int property from User's preferences

Returns:
an integer parsed from the value associated with the given key, or "def" in key wasn't found.

getProperty

public static String getProperty(String key,
                                 String def)
Convenience for retrieving a String property from User's preferences

Returns:
a String parsed from the value associated with the given key, or "def" in key wasn't found.

getProperty

public static YesNoAskMe getProperty(String key,
                                     YesNoAskMe def)
Commodité pour retiré une propriété oui/no/me-demander des préférences utilisateur.

Parameters:
key - Clef identifiant la propriété
def - Valeur par défaut à utiliser si la clef n'est pas définie.
Returns:
Une valeur YesNoAskMe.
Since:
jPicEdt 1.6

setProperty

public static void setProperty(String key,
                               YesNoAskMe value)

getUserSettingsDirectory

public static String getUserSettingsDirectory()
Returns:
the user-settings directory, for instance "~/.jpicedt" on unix.

getTmpDir

public static File getTmpDir()
Returns:
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(String location)
set the current tmp dir


http://www.jpicedt.org

Submit a bug : syd@jpicedt.org