jsynoptic.base
Interface SelectionContextualActionProvider

All Superinterfaces:
ContextualActionProvider
All Known Implementing Classes:
Abstract1DShape, Abstract2DShape, ConnectionShape, EllipseShape, HistoryShape.HookedTextShape, ImageShape, Java3dShape, LinesShape, Plot, PolygonShape, RectangleShape, SvgShape, TextShape, TimePlot, TimePlot

public interface SelectionContextualActionProvider
extends ContextualActionProvider

Implementing objects can provide actions on the current shape selection

Author:
zxpletran007

Field Summary
 
Fields inherited from interface jsynoptic.base.ContextualActionProvider
EDITOR_CONTEXT, MOUSE_OUT_CONTEXT, MOUSE_OVER_CONTEXT, MOUSE_PRESSED_CONTEXT, SHAPELIST_CONTEXT, SOURCELIST_CONTEXT
 
Method Summary
 boolean doCollectiveAction(DiagramSelection sel, double x, double y, java.lang.Object o, java.lang.String action, javax.swing.undo.CompoundEdit undoableEdit)
          Do one of the collective actions previously declared by getCollectiveActions.
 java.util.LinkedHashMap getCollectiveActions(DiagramSelection sel, double x, double y, java.lang.Object o, int context)
          Return list of possible collective actions
 
Methods inherited from interface jsynoptic.base.ContextualActionProvider
canDoAction, doAction, getActions
 

Method Detail

getCollectiveActions

java.util.LinkedHashMap getCollectiveActions(DiagramSelection sel,
                                             double x,
                                             double y,
                                             java.lang.Object o,
                                             int context)
Return list of possible collective actions

Parameters:
sel - the current selection
x - Coordinate, mouse position in the same unit as contains(x,y)
y - Coordinate, mouse position in the same unit as contains(x,y)
o - Object the collective actions should work on. Possibly null => default or all actions
context - one of the context defined in the ContextualActionProvider class
Returns:
The list of possible actions, possibly empty.The map values contains when applicable parent sub menus and icons

doCollectiveAction

boolean doCollectiveAction(DiagramSelection sel,
                           double x,
                           double y,
                           java.lang.Object o,
                           java.lang.String action,
                           javax.swing.undo.CompoundEdit undoableEdit)
Do one of the collective actions previously declared by getCollectiveActions.

Parameters:
sel - sel the current selection
x - Coordinate, for example mouse position
y - Coordinate, for example mouse position
o - Object the action should work on.
action - action An action returned by a previous getCollectiveActions call with the same x, y, o parameters
undoableEdit - undoableEdit The current compound edit for undo/redo operation. If the action is undoable, the required edits shall be added to this current compound edit.
Returns:
true if the collectiveaction could be performed