com.azalient.api.ui.edit
Interface IEditAction

All Superinterfaces:
Action, ActionListener, Comparable<IEditAction>, EventListener

public interface IEditAction
extends Action, Comparable<IEditAction>

An editing action, available in the action pane and from the right-mouse context menu in the main window

(To Do) Allow the API user to create additional editing actions


Nested Class Summary
static class IEditAction.EditLevel
          The level of editing enabled form the menu on the action pane
static class IEditAction.NetCallMechanism
          The call mechanism for network-based (model-based) actions
static class IEditAction.ObjectCallMechanism
          The call mechanism for object-based actions.
 
Field Summary
static String DASH
           
static String HEADING_SEP
           
static double MIN_LINK_LENGTH
           
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Method Summary
 void active(boolean v)
          Set this action to be active or inactive
 IUndoable alwaysAvailableAction(IViewport viewport)
          Execute the (always available) action, given a handle to the viewport
 boolean applyToProxy()
          Returns true if this action should be applied to a proxy object
 Class<?> associateClass()
          USe this to define the type of objects, when selected, that will enable the action
 boolean availableNow()
          Returns true if this action is available now - this is a general purpose filter, for use by any type
 boolean availableWhenNothingPicked()
          Returns true if this action is available if there are no selections in the main window
 boolean availableWhenSelectionsExist()
          Returns true if this action is available if there is one or more selection in the main window
 void exec()
          Execute this action
 IActionable[] filteredNetActionables(IActionable[] selected)
          Return an array of actionables after filtering for the net conditions
 IActionable[] filteredObjectActionables(IActionable[] selected)
          Return an array of actionables after filtering for the object conditions
 Icon icon(boolean buttonPressed)
          Return the icon to show for the action, either when pressed, or when not pressed
 boolean inLevel(IEditAction.EditLevel level)
          Returns true if this action is included in the given editing level
 boolean isActive()
          Returns true if this action is currently active (taking account of current selections)
 int keyCode()
          Returns the integer key code for the hot-key for this action, or zero if none
 void keyCodeSet(int mod, int keycode)
          Sets the modifier and key code for the hot-key for this action
 int keyModifiers()
          Returns the integer modifier code for the hot-key for this action, or zero if none
 String keyText()
          The description of the hot-key definition in the format [modifier-keycode]
 String keyText2()
          The description of the hot-key definition in the format m-keycode
 String name()
          The name of the action - the description that appears in the action pane and on the context menu
 IUndoable netAction(IViewport viewport, IActionable[] actionables)
          Execute the model-wide "net" action action, given a handle to the viewport, and an array of actionables (the selected objects)
 int netCallFirstCount()
          Return the number of selected objects required if this is a NetCallMechanism.CALL_WITH_FIRST_N action
 IEditAction.NetCallMechanism netCallMechanism()
          Return the NetCallMechanism for this action (ALL or FIRST_N), or NO_CALL if it is an ObjectCall action
 boolean netFilter(ArrayList<IActionable> list)
          Filter the given list of actions for this NetCall action
 boolean netFilter(IActionable a)
          Filter the given action for this NetCall action
 IEditAction.ObjectCallMechanism objectCallMechanism()
          Return the ObjectCallMechanism for this action (ALL or FIRST_1), or NO_CALL if it is a NetCall action
 boolean objectFilter(IActionable a)
          Use this to further filter the selected objects.
 IActionable[] substituteActionables(IActionable[] filteredActionables)
          This allows a user-defined object to swap a proxy object for each selected core object, so that the action is then called on the proxy.
 boolean testByFilter()
          Returns true if this action should be tested by filter
 
Methods inherited from interface javax.swing.Action
addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

DASH

static final String DASH
See Also:
Constant Field Values

HEADING_SEP

static final String HEADING_SEP
See Also:
Constant Field Values

MIN_LINK_LENGTH

static final double MIN_LINK_LENGTH
See Also:
Constant Field Values
Method Detail

name

String name()
The name of the action - the description that appears in the action pane and on the context menu


availableWhenNothingPicked

boolean availableWhenNothingPicked()
Returns true if this action is available if there are no selections in the main window


availableWhenSelectionsExist

boolean availableWhenSelectionsExist()
Returns true if this action is available if there is one or more selection in the main window


availableNow

boolean availableNow()
Returns true if this action is available now - this is a general purpose filter, for use by any type


icon

Icon icon(boolean buttonPressed)
Return the icon to show for the action, either when pressed, or when not pressed


filteredNetActionables

IActionable[] filteredNetActionables(IActionable[] selected)
Return an array of actionables after filtering for the net conditions


filteredObjectActionables

IActionable[] filteredObjectActionables(IActionable[] selected)
Return an array of actionables after filtering for the object conditions


objectCallMechanism

IEditAction.ObjectCallMechanism objectCallMechanism()
Return the ObjectCallMechanism for this action (ALL or FIRST_1), or NO_CALL if it is a NetCall action


netCallMechanism

IEditAction.NetCallMechanism netCallMechanism()
Return the NetCallMechanism for this action (ALL or FIRST_N), or NO_CALL if it is an ObjectCall action


netCallFirstCount

int netCallFirstCount()
Return the number of selected objects required if this is a NetCallMechanism.CALL_WITH_FIRST_N action


associateClass

Class<?> associateClass()
USe this to define the type of objects, when selected, that will enable the action


objectFilter

boolean objectFilter(IActionable a)
Use this to further filter the selected objects. For example, associateClass() might filter all selections of type ILane, and then this would select pairs of lanes that were adjacent.


netFilter

boolean netFilter(IActionable a)
Filter the given action for this NetCall action


netFilter

boolean netFilter(ArrayList<IActionable> list)
Filter the given list of actions for this NetCall action


substituteActionables

IActionable[] substituteActionables(IActionable[] filteredActionables)
This allows a user-defined object to swap a proxy object for each selected core object, so that the action is then called on the proxy. For example, if you want to create a crossing on the selected link, you need to create a proxy for the link so that your "Add Crossing" action is directed to the proxy, because if it goes to the link object it will be ignored.


alwaysAvailableAction

IUndoable alwaysAvailableAction(IViewport viewport)
Execute the (always available) action, given a handle to the viewport


netAction

IUndoable netAction(IViewport viewport,
                    IActionable[] actionables)
Execute the model-wide "net" action action, given a handle to the viewport, and an array of actionables (the selected objects)


testByFilter

boolean testByFilter()
Returns true if this action should be tested by filter


applyToProxy

boolean applyToProxy()
Returns true if this action should be applied to a proxy object


inLevel

boolean inLevel(IEditAction.EditLevel level)
Returns true if this action is included in the given editing level


isActive

boolean isActive()
Returns true if this action is currently active (taking account of current selections)


active

void active(boolean v)
Set this action to be active or inactive


exec

void exec()
Execute this action


keyText

String keyText()
The description of the hot-key definition in the format [modifier-keycode]


keyText2

String keyText2()
The description of the hot-key definition in the format m-keycode


keyCode

int keyCode()
Returns the integer key code for the hot-key for this action, or zero if none


keyModifiers

int keyModifiers()
Returns the integer modifier code for the hot-key for this action, or zero if none


keyCodeSet

void keyCodeSet(int mod,
                int keycode)
Sets the modifier and key code for the hot-key for this action