ilog.views.diagrammer.application
Class IlvDiagrammerAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by ilog.views.util.swing.context.ComponentAction
          extended by ilog.views.diagrammer.application.IlvDiagrammerAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
IlvDiagrammerAction.FileAction, IlvDiagrammerAction.ToggleAction, IlvDiagrammerPaletteAction

public abstract class IlvDiagrammerAction
extends ilog.views.util.swing.context.ComponentAction

This class is a base class for Swing Actions that can be used to control and edit an IlvDiagrammer instance.

Typical Diagrammer applications will use the predefined actions that are provided as static constants: copy, paste, etc. Here is a typical code sample to use these actions in a menu bar:

     // Create a menu:
     JMenuBar menuBar = new JMenuBar();
     JMenu fileMenu = new JMenu("File");
     menuBar.add(fileMenu);

     // Create a menu item for the "Open" action:
     fileMenu.add(IlvDiagrammerAction.open);
 

See also the IlvDiagrammerToolBar class and its subclasses, and the IlvDiagrammerMenu class and its subclasses to easily create toolbars and menus containing Diagrammer actions.

More advanced applications can create their own subclasses of IlvDiagrammerAction.

The IlvDiagrammerAction class has the following capabilities in addition to those of the standard Swing Action class:

See Also:
Serialized Form

Nested Class Summary
static interface IlvDiagrammerAction.ErrorHandler
          This interface is used to change the way Diagrammer actions handle exceptions.
static class IlvDiagrammerAction.FileAction
          A base class for I/O actions
static class IlvDiagrammerAction.Handler
          This class can be used to redefine the behavior of a predefined action.
static class IlvDiagrammerAction.StatusEvent
          The event passed to the methods of IlvDiagrammerAction.StatusListener objects.
static interface IlvDiagrammerAction.StatusListener
          This listener is typically used to display information related to Diagrammer actions in a status bar.
static class IlvDiagrammerAction.ToggleAction
          This subclass of IlvDiagrammerAction can be used as a base class for custom selectable (or "toggle") actions.
 
Field Summary
static IlvDiagrammerAction _new
          This action clears the diagram component.
static IlvDiagrammerAction about
          This action shows a default "About" dialog.
static String ABOUT_APPLICATION_NAME
          This key can be used to set the application name that will be displayed by the about action.
static IlvDiagrammerAction alignBottom
          This action calls the IlvDiagrammer.alignBottom() method.
static IlvDiagrammerAction alignHorizontalCenter
          This action calls the IlvDiagrammer.alignHorizontalCenter() method.
static IlvDiagrammerAction alignLeft
          This action calls the IlvDiagrammer.alignLeft() method.
static IlvDiagrammerAction alignRight
          This action calls the IlvDiagrammer.alignRight() method.
static IlvDiagrammerAction alignTop
          This action calls the IlvDiagrammer.alignTop() method.
static IlvDiagrammerAction alignVerticalCenter
          This action calls the IlvDiagrammer.alignVerticalCenter() method.
static IlvDiagrammerAction autoEditLabel
          This action toggles the "auto-edit-label" flag on or off.
static IlvDiagrammerAction autoLabelLayout
          This action toggles automatic layout of labels on or off.
static IlvDiagrammerAction autoLinkLayout
          This action toggles automatic layout of links on or off.
static IlvDiagrammerAction autoNodeLayout
          This action toggles automatic layout of nodes on or off.
static IlvDiagrammerAction callBuilder
          This action invokes the Diagrammer Designer application (if it is available).
static IlvDiagrammerAction clearPrintArea
          This action calls the IlvDiagrammer.clearPrintArea() method.
static IlvDiagrammerAction close
          This action does nothing by default: multi-document applications should set a handler on this action to implement its actual behavior, for example closing the internal frame containing the diagram.
static IlvDiagrammerAction copy
          This action calls the IlvDiagrammer.copy() method of the diagram component.
static IlvDiagrammerAction createLink
          This action prompts for a tag name (type) and creates a new link with this tag.
static IlvDiagrammerAction createNode
          This action prompts for a tag name (type) and creates a new node with this tag.
static IlvDiagrammerAction cut
          This action calls the IlvDiagrammer.cut() method of the diagram component.
static IlvDiagrammerAction delete
          This action calls the IlvDiagrammer.delete() method of the diagram component.
static IlvDiagrammerAction distributeHorizontally
          This action calls the IlvDiagrammer.distributeHorizontally() method.
static IlvDiagrammerAction distributeVertically
          This action calls the IlvDiagrammer.distributeVertically() method.
static IlvDiagrammerAction duplicate
          This action calls the IlvDiagrammer.duplicate() method of the diagram component.
static IlvDiagrammerAction editing
          This action toggles editing mode on or off.
static IlvDiagrammerAction editLabel
          This action toggles label editing mode on or off.
static IlvDiagrammerAction exit
          This action calls System.exit(0).
static IlvDiagrammerAction fitToContents
          This action calls the IlvDiagrammer.fitToContents() method of the diagram component.
static IlvDiagrammerAction grid
          This action shows or hides the grid.
static IlvDiagrammerAction gridSpacing
          This action opens a dialog box to change the spacing of the grid.
static IlvDiagrammerAction group
          This action calls the IlvDiagrammer.group() method of the diagram component.
static IlvDiagrammerAction help
          This action shows a default "Help" dialog.
static IlvDiagrammerAction layoutAllNodes
          This action calls the IlvDiagrammer.layoutAllNodes() method of the diagram component.
static IlvDiagrammerAction layoutSelectedNodes
          This action calls the IlvDiagrammer.layoutSelectedNodes() method of the diagram component.
static IlvDiagrammerAction open
          This action is similar to read, except that if there is no current diagram component, or if the current diagram component is not empty, the _new action is called before loading the data file.
static IlvDiagrammerAction openStyleSheet
          This action shows a file chooser, and applies the selected style sheet to the diagram component.
static IlvDiagrammerAction pageSetup
          This action calls the IlvDiagrammer.pageSetup() method.
static IlvDiagrammerAction pan
          This action toggles the "pan" mode of the diagram component.
static IlvDiagrammerAction paste
          This action calls the IlvDiagrammer.paste() method of the diagram component.
static IlvDiagrammerAction printPreview
          This action calls the IlvDiagrammer.printPreview() method.
static IlvDiagrammerAction printToBitmap
          This action calls the IlvDiagrammer.printToBitmap(java.io.File) method.
static IlvDiagrammerAction printWithDialog
          This action calls the IlvDiagrammer.print(boolean, boolean, ilog.views.diagrammer.IlvDiagrammer.PrinterExceptionHandler) method with showPrintDialog set to true.
static IlvDiagrammerAction printWithoutDialog
          This action calls the IlvDiagrammer.print(boolean, boolean, ilog.views.diagrammer.IlvDiagrammer.PrinterExceptionHandler) method with showPrintDialog set to false.
static IlvDiagrammerAction read
          This action shows a file chooser and reads the selected XML file into the diagram component.
static IlvDiagrammerAction redo
          This action calls the IlvDiagrammer.redo() method of the diagram component.
static IlvDiagrammerAction refresh
          This action reloads the current style sheet of the diagram component.
static IlvDiagrammerAction resetZoom
          This action calls the IlvDiagrammer.resetZoom() method of the diagram component.
static IlvDiagrammerAction resizing
          This action toggles resizing mode on or off.
static IlvDiagrammerAction save
          This action saves the diagram to the currently loaded XML file.
static IlvDiagrammerAction saveAs
          This action shows a file chooser and writes the diagram to the selected XML file.
static IlvDiagrammerAction select
          This action toggles the "selection" mode of the diagram component.
static IlvDiagrammerAction selectAll
          This action calls the IlvDiagrammer.selectAll() method of the diagram component.
static IlvDiagrammerAction setPrintArea
          This action calls the IlvDiagrammer.setPrintArea() method.
static IlvDiagrammerAction stickyModes
          This action toggles the "sticky modes" flag on or off.
static IlvDiagrammerAction undo
          This action calls the IlvDiagrammer.undo() method of the diagram component.
static IlvDiagrammerAction ungroup
          This action calls the IlvDiagrammer.ungroup() method of the diagram component.
static IlvDiagrammerAction zoom
          This action toggles the "zoom" mode of the diagram component.
static IlvDiagrammerAction zoomIn
          This action calls the IlvDiagrammer.zoomIn() method of the diagram component.
static IlvDiagrammerAction zoomOut
          This action calls the IlvDiagrammer.zoomOut() method of the diagram component.
 
Fields inherited from class ilog.views.util.swing.context.ComponentAction
hideToolbarButtonBordersOnOceanTheme
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
protected IlvDiagrammerAction(String prefix)
          Creates a new Diagrammer action.
protected IlvDiagrammerAction(String prefix, ResourceBundle bundle)
          Creates a new Diagrammer action.
 
Method Summary
static void addActionToUpdate(IlvDiagrammerAction action)
          Adds an action that must be updated when the state of an IlvDiagrammer component changes.
static void addStatusListener(IlvDiagrammerAction.StatusListener listener)
          Adds an action status listener.
 void call(IlvDiagrammer diagrammer)
          Calls an action explicitly on a specified diagram component.
static URL chooseFile(Component parent, boolean save, ResourceBundle bundle, String titleKey, String[] suffixes, String[] descriptionKeys)
           
static JFileChooser getActionFileChooser()
           
protected  ResourceBundle getDefaultResourceBundle()
          Returns the default resource bundle used if no resource bundle is specified in the constructor.
static File getDefaultSelectedFile()
          Returns the default file selected by the file chooser.
static IlvDiagrammerAction.ErrorHandler getErrorHandler()
          Returns the error handler for the Diagrammer actions.
static File getFileChooserDirectory()
          Returns the current directory of the file chooser.
protected static String getString(ResourceBundle bundle, String key)
           
protected  boolean isEnabled(Component target)
          This method is called to determine whether this action is currently enabled.
protected abstract  boolean isEnabled(IlvDiagrammer diagrammer)
          This method is called to determine whether this action is currently enabled.
protected  boolean isSelected(Component target)
          This method is called to determine whether this action is currently selected.
protected  boolean isSelected(IlvDiagrammer diagrammer)
          This method is called to determine whether this action is currently selected.
 void perform(ActionEvent e, Component target)
          This method is called when the action is performed.
abstract  void perform(ActionEvent e, IlvDiagrammer diagrammer)
          This method is called when the action is performed.
static void removeActionToUpdate(IlvDiagrammerAction action)
          Removes an action from the list of actions that must be updated when the state of an IlvDiagrammer component changes.
static void removeStatusListener(IlvDiagrammerAction.StatusListener listener)
          Removes an action status listener.
static void setDefaultSelectedFile(File selectedFile)
          Sets the default file to be selected by the file chooser.
static void setErrorHandler(IlvDiagrammerAction.ErrorHandler errorHandler)
          Sets the error handler for the Diagrammer actions.
static void setFileChooserDirectory(File lastDirectory)
          Changes the current directory of the file chooser.
 void setHandler(IlvDiagrammerAction.Handler actionHandler)
          Sets an action listener for this action.
protected  void update(Component target)
          Updates the state of this action.
protected  void update(IlvDiagrammer diagrammer)
          Updates the state of this action.
static void updateActions(Component component, IlvDiagrammer diagrammer)
          Updates all the actions linked to buttons contained in the specified component hierarchy.
 
Methods inherited from class ilog.views.util.swing.context.ComponentAction
actionPerformed, addActionToUpdate, addPropertyChangeListener, addStatusListener, call, clone, createMenuItem, createToolBarButton, delayedUpdateActions, error, fireActionFinished, fireActionStarted, getActionErrorHandler, getPrefix, getResourceBundle, getSmallIconSize, init, isSelectable, isSelected, removeActions, removeActionToUpdate, removeStatusListener, setActionErrorHandler, setHandler, setSelected, setSmallIconSize, updateActions
 
Methods inherited from class javax.swing.AbstractAction
firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

select

public static IlvDiagrammerAction select
This action toggles the "selection" mode of the diagram component.

See Also:
IlvDiagrammer.setSelectMode(boolean)

cut

public static final IlvDiagrammerAction cut
This action calls the IlvDiagrammer.cut() method of the diagram component.


copy

public static final IlvDiagrammerAction copy
This action calls the IlvDiagrammer.copy() method of the diagram component.


delete

public static final IlvDiagrammerAction delete
This action calls the IlvDiagrammer.delete() method of the diagram component.


duplicate

public static final IlvDiagrammerAction duplicate
This action calls the IlvDiagrammer.duplicate() method of the diagram component.


paste

public static final IlvDiagrammerAction paste
This action calls the IlvDiagrammer.paste() method of the diagram component.


selectAll

public static final IlvDiagrammerAction selectAll
This action calls the IlvDiagrammer.selectAll() method of the diagram component.


undo

public static final IlvDiagrammerAction undo
This action calls the IlvDiagrammer.undo() method of the diagram component.


redo

public static final IlvDiagrammerAction redo
This action calls the IlvDiagrammer.redo() method of the diagram component.


group

public static final IlvDiagrammerAction group
This action calls the IlvDiagrammer.group() method of the diagram component.


ungroup

public static final IlvDiagrammerAction ungroup
This action calls the IlvDiagrammer.ungroup() method of the diagram component.


zoomIn

public static final IlvDiagrammerAction zoomIn
This action calls the IlvDiagrammer.zoomIn() method of the diagram component.


zoomOut

public static final IlvDiagrammerAction zoomOut
This action calls the IlvDiagrammer.zoomOut() method of the diagram component.


resetZoom

public static final IlvDiagrammerAction resetZoom
This action calls the IlvDiagrammer.resetZoom() method of the diagram component.


fitToContents

public static final IlvDiagrammerAction fitToContents
This action calls the IlvDiagrammer.fitToContents() method of the diagram component.


zoom

public static final IlvDiagrammerAction zoom
This action toggles the "zoom" mode of the diagram component.

See Also:
IlvDiagrammer.setZoomMode(boolean)

pan

public static final IlvDiagrammerAction pan
This action toggles the "pan" mode of the diagram component.

See Also:
IlvDiagrammer.setPanMode(boolean)

layoutAllNodes

public static final IlvDiagrammerAction layoutAllNodes
This action calls the IlvDiagrammer.layoutAllNodes() method of the diagram component.


layoutSelectedNodes

public static final IlvDiagrammerAction layoutSelectedNodes
This action calls the IlvDiagrammer.layoutSelectedNodes() method of the diagram component.


autoNodeLayout

public static final IlvDiagrammerAction autoNodeLayout
This action toggles automatic layout of nodes on or off.

See Also:
IlvDiagrammer.setAutomaticNodeLayout(boolean)

autoLinkLayout

public static final IlvDiagrammerAction autoLinkLayout
This action toggles automatic layout of links on or off.

See Also:
IlvDiagrammer.setAutomaticLinkLayout(boolean)

autoLabelLayout

public static final IlvDiagrammerAction autoLabelLayout
This action toggles automatic layout of labels on or off.

See Also:
IlvDiagrammer.setAutomaticLabelLayout(boolean)

editLabel

public static final IlvDiagrammerAction editLabel
This action toggles label editing mode on or off.

See Also:
IlvDiagrammer.setEditLabelMode(boolean)

editing

public static final IlvDiagrammerAction editing
This action toggles editing mode on or off.

See Also:
IlvDiagrammer.setEditingAllowed(boolean)

resizing

public static final IlvDiagrammerAction resizing
This action toggles resizing mode on or off.

See Also:
IlvDiagrammer.setResizingAllowed(boolean)

stickyModes

public static final IlvDiagrammerAction stickyModes
This action toggles the "sticky modes" flag on or off.

See Also:
IlvDiagrammer.setStickyModes(boolean)

autoEditLabel

public static final IlvDiagrammerAction autoEditLabel
This action toggles the "auto-edit-label" flag on or off.

See Also:
IlvDiagrammer.setAutoEditLabel(boolean)

_new

public static final IlvDiagrammerAction _new
This action clears the diagram component. Multi-document applications should set a handler on this action to implement its actual behavior, for example creating a new internal frame for the new diagram.

See Also:
setHandler(ilog.views.diagrammer.application.IlvDiagrammerAction.Handler)

close

public static final IlvDiagrammerAction close
This action does nothing by default: multi-document applications should set a handler on this action to implement its actual behavior, for example closing the internal frame containing the diagram.

See Also:
setHandler(ilog.views.diagrammer.application.IlvDiagrammerAction.Handler)

read

public static final IlvDiagrammerAction read
This action shows a file chooser and reads the selected XML file into the diagram component.

See Also:
IlvDiagrammer.setDataFile(java.net.URL)

open

public static final IlvDiagrammerAction open
This action is similar to read, except that if there is no current diagram component, or if the current diagram component is not empty, the _new action is called before loading the data file.

See Also:
read, _new, IlvDiagrammer.setDataFile(java.net.URL)

saveAs

public static final IlvDiagrammerAction saveAs
This action shows a file chooser and writes the diagram to the selected XML file.

See Also:
IlvDiagrammer.writeDataFile(String)

save

public static final IlvDiagrammerAction save
This action saves the diagram to the currently loaded XML file. If the diagram was not read from a file, and if it has not yet been saved to a file, a file chooser is shown to select the output file.

See Also:
IlvDiagrammer.writeDataFile(String)

openStyleSheet

public static final IlvDiagrammerAction openStyleSheet
This action shows a file chooser, and applies the selected style sheet to the diagram component.

See Also:
IlvDiagrammer.setStyleSheet(java.net.URL)

refresh

public static final IlvDiagrammerAction refresh
This action reloads the current style sheet of the diagram component.

See Also:
IlvDiagrammer.refresh()

exit

public static final IlvDiagrammerAction exit
This action calls System.exit(0). You can override this simplistic implementation by adding a listener to this action, using the setHandler(ilog.views.diagrammer.application.IlvDiagrammerAction.Handler) method.


about

public static final IlvDiagrammerAction about
This action shows a default "About" dialog. You can override this implementation by adding a listener to this action, using the setHandler(ilog.views.diagrammer.application.IlvDiagrammerAction.Handler) method.


ABOUT_APPLICATION_NAME

public static final String ABOUT_APPLICATION_NAME
This key can be used to set the application name that will be displayed by the about action. For example:
    IlvDiagrammerAction.about.putValue(ABOUT_APPLICATION_NAME, "My demo");
 
The string "My demo" will be displayed in the "About" dialog.

Since:
JViews 6.5
See Also:
Constant Field Values

help

public static final IlvDiagrammerAction help
This action shows a default "Help" dialog. You can override this implementation by adding a listener to this action, using the setHandler(ilog.views.diagrammer.application.IlvDiagrammerAction.Handler) method.


pageSetup

public static final IlvDiagrammerAction pageSetup
This action calls the IlvDiagrammer.pageSetup() method.


printPreview

public static final IlvDiagrammerAction printPreview
This action calls the IlvDiagrammer.printPreview() method.


setPrintArea

public static final IlvDiagrammerAction setPrintArea
This action calls the IlvDiagrammer.setPrintArea() method.


clearPrintArea

public static final IlvDiagrammerAction clearPrintArea
This action calls the IlvDiagrammer.clearPrintArea() method.


printWithDialog

public static final IlvDiagrammerAction printWithDialog
This action calls the IlvDiagrammer.print(boolean, boolean, ilog.views.diagrammer.IlvDiagrammer.PrinterExceptionHandler) method with showPrintDialog set to true.


printWithoutDialog

public static final IlvDiagrammerAction printWithoutDialog
This action calls the IlvDiagrammer.print(boolean, boolean, ilog.views.diagrammer.IlvDiagrammer.PrinterExceptionHandler) method with showPrintDialog set to false.


printToBitmap

public static final IlvDiagrammerAction printToBitmap
This action calls the IlvDiagrammer.printToBitmap(java.io.File) method.


callBuilder

public static final IlvDiagrammerAction callBuilder
This action invokes the Diagrammer Designer application (if it is available).


grid

public static final IlvDiagrammerAction grid
This action shows or hides the grid.


gridSpacing

public static final IlvDiagrammerAction gridSpacing
This action opens a dialog box to change the spacing of the grid.


alignLeft

public static final IlvDiagrammerAction alignLeft
This action calls the IlvDiagrammer.alignLeft() method.


alignRight

public static final IlvDiagrammerAction alignRight
This action calls the IlvDiagrammer.alignRight() method.


alignTop

public static final IlvDiagrammerAction alignTop
This action calls the IlvDiagrammer.alignTop() method.


alignBottom

public static final IlvDiagrammerAction alignBottom
This action calls the IlvDiagrammer.alignBottom() method.


alignHorizontalCenter

public static final IlvDiagrammerAction alignHorizontalCenter
This action calls the IlvDiagrammer.alignHorizontalCenter() method.


alignVerticalCenter

public static final IlvDiagrammerAction alignVerticalCenter
This action calls the IlvDiagrammer.alignVerticalCenter() method.


distributeHorizontally

public static final IlvDiagrammerAction distributeHorizontally
This action calls the IlvDiagrammer.distributeHorizontally() method.


distributeVertically

public static final IlvDiagrammerAction distributeVertically
This action calls the IlvDiagrammer.distributeVertically() method.


createNode

public static final IlvDiagrammerAction createNode
This action prompts for a tag name (type) and creates a new node with this tag.


createLink

public static final IlvDiagrammerAction createLink
This action prompts for a tag name (type) and creates a new link with this tag.

Constructor Detail

IlvDiagrammerAction

protected IlvDiagrammerAction(String prefix,
                              ResourceBundle bundle)
Creates a new Diagrammer action.

The action is designated by a key prefix. All the properties of the action (name, short description, icon, and so on) will be retrieved from a resource bundle using the key prefix concatenated with the property name of the action ("Name", "ShortDescription", and so on).

Here is an example of what the property file should contain for an action with the prefix "Diagrammer.Action.Open":

 Diagrammer.Action.Open.Name = Open...
 Diagrammer.Action.Open.ShortDescription = Open File
 Diagrammer.Action.Open.LongDescription = Opens a data file
 Diagrammer.Action.Open.SmallIcon = open.png
 Diagrammer.Action.Open.AcceleratorKey = control O
 Diagrammer.Action.Open.MnemonicKey = O
 

Parameters:
prefix - The prefix key for the action, for example "Diagrammer.Action.Open".
bundle - The resource bundle that will be used to retrieve the properties of the action. If this parameter is null, the default resource bundle is used.

IlvDiagrammerAction

protected IlvDiagrammerAction(String prefix)
Creates a new Diagrammer action. This constructor uses the default resource bundle for the default locale.

Parameters:
prefix - The prefix key for the action, for example "Diagrammer.Action.Open".
Method Detail

getDefaultResourceBundle

protected ResourceBundle getDefaultResourceBundle()
Returns the default resource bundle used if no resource bundle is specified in the constructor.

Overrides:
getDefaultResourceBundle in class ilog.views.util.swing.context.ComponentAction
Since:
JViews 7.5

isEnabled

protected final boolean isEnabled(Component target)
                           throws Exception
Description copied from class: ilog.views.util.swing.context.ComponentAction
This method is called to determine whether this action is currently enabled.

Specified by:
isEnabled in class ilog.views.util.swing.context.ComponentAction
Parameters:
target - The Component instance on which the action is to be performed (may be null if there is no current component).
Throws:
Exception - When an error occurs while getting the state of the action.

isSelected

protected final boolean isSelected(Component target)
                            throws Exception
Description copied from class: ilog.views.util.swing.context.ComponentAction
This method is called to determine whether this action is currently selected.

The default implementation returns false.

Overrides:
isSelected in class ilog.views.util.swing.context.ComponentAction
Parameters:
target - The Component instance on which the action is to be performed (may be null if there is no current component).
Throws:
Exception - When an error occurs while getting the action's state.

perform

public final void perform(ActionEvent e,
                          Component target)
                   throws Exception
Description copied from class: ilog.views.util.swing.context.ComponentAction
This method is called when the action is performed. This is the method that must be overridden by subclasses of ComponentAction to implement the action.

This method should not be called directly. If you need to call an action in your code, use the ComponentAction.call(java.awt.Component) method instead.

Specified by:
perform in class ilog.views.util.swing.context.ComponentAction
Parameters:
e - The action event that caused this action to be performed.
target - The Component instance on which the action is to be performed (may be null if there is no current component).
Throws:
Exception - When an error occurs while performing the action.

update

protected final void update(Component target)
Description copied from class: ilog.views.util.swing.context.ComponentAction
Updates the state of this action. The default implementation updates the "selected" and "enabled" states of the action, based on the results of the ComponentAction.isSelected() and ComponentAction.isEnabled(java.awt.Component) methods.

Overrides:
update in class ilog.views.util.swing.context.ComponentAction
Parameters:
target - The component on which the action is to be performed.

perform

public abstract void perform(ActionEvent e,
                             IlvDiagrammer diagrammer)
                      throws Exception
This method is called when the action is performed. This is the method that must be overridden by subclasses of IlvDiagrammerAction to implement the action.

This method should not be called directly. If you need to call an action in your code, use the call(ilog.views.diagrammer.IlvDiagrammer) method instead.

Parameters:
e - The action event that caused this action to be performed.
diagrammer - The IlvDiagrammer instance on which the action is to be performed (may be null if there is no current diagram component).
Throws:
Exception - When an error occurs while performing the action.

call

public void call(IlvDiagrammer diagrammer)
Calls an action explicitly on a specified diagram component.

This method can be used to "fake" the activation of the action by code.

The action is performed as if a toolbar button was pressed or a menu item associated with this action was selected while the specified diagram component was the current one in its hierarchy.

Parameters:
diagrammer - The diagram component on which the action will be performed.

isEnabled

protected abstract boolean isEnabled(IlvDiagrammer diagrammer)
                              throws Exception
This method is called to determine whether this action is currently enabled.

Parameters:
diagrammer - The IlvDiagrammer instance on which the action is to be performed (may be null if there is no current diagram component).
Returns:
true if action is enabled
Throws:
Exception - When an error occurs while getting the state of the action.

isSelected

protected boolean isSelected(IlvDiagrammer diagrammer)
                      throws Exception
This method is called to determine whether this action is currently selected.

The default implementation returns false.

Parameters:
diagrammer - The IlvDiagrammer instance on which the action is to be performed (may be null if there is no current diagram component).
Returns:
true if action is selected
Throws:
Exception - When an error occurs while getting the action's state.

getString

protected static String getString(ResourceBundle bundle,
                                  String key)
Internal method or field: do not use!

update

protected void update(IlvDiagrammer diagrammer)
Updates the state of this action. The default implementation updates the "selected" and "enabled" states of the action, based on the results of the isSelected(IlvDiagrammer) and isEnabled(IlvDiagrammer) methods.

Parameters:
diagrammer - The diagram component on which the action is to be performed.

setHandler

public void setHandler(IlvDiagrammerAction.Handler actionHandler)
Sets an action listener for this action. If an action has an action handler, its perform(ActionEvent, IlvDiagrammer) and update(IlvDiagrammer) methods are not called: instead, the IlvDiagrammerAction.Handler.perform(IlvDiagrammerAction, IlvDiagrammer, ActionEvent) and IlvDiagrammerAction.Handler.update(IlvDiagrammerAction, IlvDiagrammer) methods of its handler are called. Action handlers can choose whether or not to call the original perform(ActionEvent, IlvDiagrammer) or update(IlvDiagrammer) method.

This mechanism is useful to modify or augment the behavior of an action, without having to redefine the whole action or replace it in predefined toolbars. It is also useful to define the behavior of "placeholder" actions such as exit.

Parameters:
actionHandler - The action handler to set for this action.

getActionFileChooser

public static JFileChooser getActionFileChooser()
Internal method or field: do not use!

getFileChooserDirectory

public static File getFileChooserDirectory()
Returns the current directory of the file chooser.

Returns:
directory

setFileChooserDirectory

public static void setFileChooserDirectory(File lastDirectory)
Changes the current directory of the file chooser.

Parameters:
lastDirectory -

getDefaultSelectedFile

public static File getDefaultSelectedFile()
Returns the default file selected by the file chooser.

Returns:
The default file selected by the file chooser.
Since:
JViews 8.0

setDefaultSelectedFile

public static void setDefaultSelectedFile(File selectedFile)
Sets the default file to be selected by the file chooser.

Parameters:
selectedFile - The default file to be selected by the file chooser.
Since:
JViews 8.0

chooseFile

public static URL chooseFile(Component&nb