public final class ActionFactory extends Object
Instances of the built-in actions could be shared by multiple widgets.
Modifier and Type | Method and Description |
---|---|
static WidgetAction |
createAcceptAction(AcceptProvider provider)
Creates a accept action with a specified accept logic provider.
|
static WidgetAction |
createActionMapAction()
Creates an action which handles keys and popup menu.
|
static WidgetAction |
createActionMapAction(InputMap inputMap,
ActionMap actionMap)
Creates an action which handles keys and popup menu.
|
static WidgetAction |
createAddRemoveControlPointAction()
Creates a add-remove control point action with a default sensitivity.
|
static WidgetAction |
createAddRemoveControlPointAction(double createSensitivity,
double deleteSensitivity)
Creates a add-remove control point action with a specified sensitivity.
|
static WidgetAction |
createAddRemoveControlPointAction(double createSensitivity,
double deleteSensitivity,
ConnectionWidget.RoutingPolicy routingPolicy)
Creates a add-remove control point action with a specified sensitivity.
|
static WidgetAction |
createAlignWithMoveAction(AlignWithWidgetCollector collector,
LayerWidget interractionLayer,
AlignWithMoveDecorator decorator)
Creates a align-with move action.
|
static WidgetAction |
createAlignWithMoveAction(AlignWithWidgetCollector collector,
LayerWidget interractionLayer,
AlignWithMoveDecorator decorator,
boolean outerBounds)
Creates a align-with move action.
|
static WidgetAction |
createAlignWithMoveAction(LayerWidget collectionLayer,
LayerWidget interractionLayer,
AlignWithMoveDecorator decorator)
Creates a align-with move action.
|
static WidgetAction |
createAlignWithMoveAction(LayerWidget collectionLayer,
LayerWidget interractionLayer,
AlignWithMoveDecorator decorator,
boolean outerBounds)
Creates a align-with move action.
|
static WidgetAction |
createAlignWithResizeAction(AlignWithWidgetCollector collector,
LayerWidget interractionLayer,
AlignWithMoveDecorator decorator)
Creates a align-with resize action.
|
static WidgetAction |
createAlignWithResizeAction(AlignWithWidgetCollector collector,
LayerWidget interractionLayer,
AlignWithMoveDecorator decorator,
boolean outerBounds)
Creates a align-with resize action.
|
static WidgetAction |
createAlignWithResizeAction(LayerWidget collectionLayer,
LayerWidget interractionLayer,
AlignWithMoveDecorator decorator)
Creates a align-with resize action.
|
static WidgetAction |
createAlignWithResizeAction(LayerWidget collectionLayer,
LayerWidget interractionLayer,
AlignWithMoveDecorator decorator,
boolean outerBounds)
Creates a align-with resize action.
|
static WidgetAction |
createCenteredZoomAction(double zoomMultiplier)
Creates a action that controls a zoom factor of a scene where the action is assigned.
|
static WidgetAction |
createConnectAction(ConnectDecorator decorator,
LayerWidget interractionLayer,
ConnectProvider provider)
Creates a connect action with a specific decorator.
|
static WidgetAction |
createConnectAction(LayerWidget interractionLayer,
ConnectProvider provider)
Creates a connect action with a default decorator.
|
static WidgetAction |
createContiguousSelectAction(ContiguousSelectProvider provider)
Creates a contiguous select action.
|
static WidgetAction |
createCycleFocusAction(CycleFocusProvider provider)
Creates a cycle focus action.
|
static WidgetAction |
createCycleObjectSceneFocusAction()
Creates a cycle focus action which switches focused object on a object scene.
|
static AlignWithMoveDecorator |
createDefaultAlignWithMoveDecorator()
Creates a default align-with move decorator.
|
static ConnectDecorator |
createDefaultConnectDecorator()
Creates a default connect decorator
|
static MoveProvider |
createDefaultMoveProvider()
Creates a default move provider where the logic controls the preferredLocation of a widget where the action is assigned to.
|
static ReconnectDecorator |
createDefaultReconnectDecorator()
Creates a default reconnect decorator
|
static RectangularSelectDecorator |
createDefaultRectangularSelectDecorator(Scene scene)
Creates a default rectangular select decorator.
|
static ResizeControlPointResolver |
createDefaultResizeControlPointResolver()
Creates a default resize control point resolver which is used in resize action.
|
static ResizeProvider |
createDefaultResizeProvider()
Creates a default resize provider which controls preferredBounds of a widget where an action is assigned.
|
static WidgetAction |
createEditAction(EditProvider provider)
Creates an edit action.
|
static WidgetAction |
createExtendedConnectAction(ConnectDecorator decorator,
LayerWidget interractionLayer,
ConnectProvider provider)
Creates an extended connect action with a specific decorator.
|
static WidgetAction |
createExtendedConnectAction(ConnectDecorator decorator,
LayerWidget interractionLayer,
ConnectProvider provider,
int modifiers)
Creates an extended connect action with a specific decorator which can be invoked only with specified modifiers (usually it is
MouseEvent.CTRL_MASK ). |
static WidgetAction |
createExtendedConnectAction(LayerWidget interractionLayer,
ConnectProvider provider)
Creates an extended connect action with a default decorator.
|
static WidgetAction |
createForwardKeyEventsAction(Widget forwardToWidget,
String forwardToTool)
This action is used for forwarding key events to another widget.
|
static WidgetAction |
createFreeMoveControlPointAction()
Creates a move control point (of a connection widget) action with no movement restriction.
|
static MoveControlPointProvider |
createFreeMoveControlPointProvider()
Creates a free (without any restriction) move control point (of a ConnectionWidget) provider.
|
static MoveStrategy |
createFreeMoveStrategy()
Creates a free (without any restriction) move strategy
|
static ResizeStrategy |
createFreeResizeStategy()
Creates a free (without any restriction) resize strategy
|
static WidgetAction |
createHoverAction(HoverProvider provider)
Creates a hover action using a hover provider.
|
static WidgetAction |
createHoverAction(TwoStateHoverProvider provider)
Creates a hover action using a two-stated hover provider.
|
static <C extends JComponent> |
createInplaceEditorAction(InplaceEditorProvider<C> provider)
Creates an in-place editor action for a specific provider.
|
static WidgetAction |
createInplaceEditorAction(TextFieldInplaceEditor editor)
Creates a text in-place editor action visualized using JTextField.
|
static WidgetAction |
createInplaceEditorAction(TextFieldInplaceEditor editor,
EnumSet<InplaceEditorProvider.ExpansionDirection> expansionDirections)
Creates a text in-place editor action visualized using JTextField.
|
static WidgetAction |
createMouseCenteredZoomAction(double zoomMultiplier)
Creates a action that controls a zoom factor of a scene where the action is assigned.
|
static WidgetAction |
createMoveAction()
Creates a move action with a default (free) strategy.
|
static WidgetAction |
createMoveAction(MoveStrategy strategy,
MoveProvider provider)
Creates a move action with a specified strategy and provider.
|
static WidgetAction |
createMoveControlPointAction(MoveControlPointProvider provider)
Creates a move control point (of a connection widget) action with a specified provider.
|
static WidgetAction |
createMoveControlPointAction(MoveControlPointProvider provider,
ConnectionWidget.RoutingPolicy routingPolicy)
Creates a move control point (of a connection widget) action with a specified provider.
|
static RectangularSelectProvider |
createObjectSceneRectangularSelectProvider(ObjectScene scene)
Creates a rectangular select provider which controls a selection of an object scene.
|
static WidgetAction |
createOrthogonalMoveControlPointAction()
Creates a move control point (of a connection widget) action with is used at ConnectionWidget with OrthogonalSearchRouter.
|
static MoveControlPointProvider |
createOrthogonalMoveControlPointProvider()
Creates a orthogonal move control point provider which is usually used with ConnectionWidget with OrthogonalSearchRouter.
|
static WidgetAction |
createPanAction()
Creates a scene view panning action.
|
static WidgetAction |
createPopupMenuAction(PopupMenuProvider provider)
Creates a popup menu action with a speicied provider.
|
static WidgetAction |
createReconnectAction(ReconnectDecorator decorator,
ReconnectProvider provider)
Creates a reconnect action with a specific decorator and logic provider.
|
static WidgetAction |
createReconnectAction(ReconnectProvider provider)
Creates a reconnect action with a default decorator.
|
static WidgetAction |
createRectangularSelectAction(ObjectScene scene,
LayerWidget interractionLayer)
Creates a rectangular select action for a specified object scene with a default decorator.
|
static WidgetAction |
createRectangularSelectAction(RectangularSelectDecorator decorator,
LayerWidget interractionLayer,
RectangularSelectProvider provider)
Creates a rectangular select action with a specified decorator and logic provider.
|
static WidgetAction |
createResizeAction()
Creates a resize action with a default (free without any restriction) strategy and default logic provider (the action affect preferredBounds of a widget where it is assigned)
default resize control point resolver.
|
static WidgetAction |
createResizeAction(ResizeStrategy strategy,
ResizeControlPointResolver resolver,
ResizeProvider provider)
Creates a resize action with a specified resize strategy and provider.
|
static WidgetAction |
createResizeAction(ResizeStrategy strategy,
ResizeProvider provider)
Creates a resize action with a specified resize strategy and provider and default resize control point resolver.
|
static WidgetAction |
createSelectAction(SelectProvider provider)
Creates a select action.
|
static WidgetAction |
createSelectAction(SelectProvider provider,
boolean selectOnRightClick)
Creates a select action.
|
static MoveStrategy |
createSnapToGridMoveStrategy(int horizontalGridSize,
int verticalGridSize)
Creates a snap-to-grid move strategy.
|
static WidgetAction |
createSwitchCardAction(Widget cardLayoutWidget)
Creates a switch card action with controls an active card of a widget where a card layout is used.
|
static WidgetAction |
createWheelPanAction()
Creates a scene view panning action using mouse-wheel.
|
static WidgetAction |
createZoomAction()
Creates a action that controls a zoom factor of a scene where the action is assigned.
|
static WidgetAction |
createZoomAction(double zoomMultiplier,
boolean animated)
Creates a action that controls a zoom factor of a scene where the action is assigned.
|
static InplaceEditorProvider.EditorController |
getInplaceEditorController(WidgetAction inplaceEditorAction)
Returns an editor controller for a specified inplace-editor-action created by
ActionFactory.createInplaceEditorAction method. |
public static WidgetAction createAcceptAction(AcceptProvider provider)
provider
- the accept logic providerpublic static WidgetAction createActionMapAction()
public static WidgetAction createActionMapAction(InputMap inputMap, ActionMap actionMap)
inputMap
- the input mapactionMap
- the action mappublic static WidgetAction createAddRemoveControlPointAction()
public static WidgetAction createAddRemoveControlPointAction(double createSensitivity, double deleteSensitivity)
createSensitivity
- the create sensitivitydeleteSensitivity
- the delete sensitivitypublic static WidgetAction createAddRemoveControlPointAction(double createSensitivity, double deleteSensitivity, ConnectionWidget.RoutingPolicy routingPolicy)
createSensitivity
- the create sensitivitydeleteSensitivity
- the delete sensitivityroutingPolicy
- the routing policy that is automatically set to a connection widget with control points modified by this action;
if null, then routing policy is not setpublic static WidgetAction createAlignWithMoveAction(LayerWidget collectionLayer, LayerWidget interractionLayer, AlignWithMoveDecorator decorator)
collectionLayer
- the layer with objects that the alignment is checked against.interractionLayer
- the interraction layer where the align-with hint lines are placeddecorator
- the align-with move decoratorpublic static WidgetAction createAlignWithMoveAction(LayerWidget collectionLayer, LayerWidget interractionLayer, AlignWithMoveDecorator decorator, boolean outerBounds)
collectionLayer
- the layer with objects that the alignment is checked against.interractionLayer
- the interraction layer where the align-with hint lines are placeddecorator
- the align-with move decoratorouterBounds
- if true, then the align-with is check against whole bounds of widgets in collection layer;
if false, then the align-with is check against client area (widget bounds without border insetspublic static WidgetAction createAlignWithMoveAction(AlignWithWidgetCollector collector, LayerWidget interractionLayer, AlignWithMoveDecorator decorator)
collector
- the collector of objects that the alignment is checked against.interractionLayer
- the interraction layer where the align-with hint lines are placeddecorator
- the align-with move decoratorpublic static WidgetAction createAlignWithMoveAction(AlignWithWidgetCollector collector, LayerWidget interractionLayer, AlignWithMoveDecorator decorator, boolean outerBounds)
collector
- the collector of objects that the alignment is checked against.interractionLayer
- the interraction layer where the align-with hint lines are placeddecorator
- the align-with move decoratorouterBounds
- if true, then the align-with is check against whole bounds of widgets in collection layer;
if false, then the align-with is check against client area (widget bounds without border insetspublic static WidgetAction createAlignWithResizeAction(LayerWidget collectionLayer, LayerWidget interractionLayer, AlignWithMoveDecorator decorator)
collectionLayer
- the layer with objects that the alignment is checked against.interractionLayer
- the interraction layer where the align-with hint lines are placeddecorator
- the align-with move decoratorpublic static WidgetAction createAlignWithResizeAction(LayerWidget collectionLayer, LayerWidget interractionLayer, AlignWithMoveDecorator decorator, boolean outerBounds)
collectionLayer
- the layer with objects that the alignment is checked against.interractionLayer
- the interraction layer where the align-with hint lines are placeddecorator
- the align-with move decoratorouterBounds
- if true, then the align-with is check against whole bounds of widgets in collection layer;
if false, then the align-with is check against client area (widget bounds without border insetspublic static WidgetAction createAlignWithResizeAction(AlignWithWidgetCollector collector, LayerWidget interractionLayer, AlignWithMoveDecorator decorator)
collector
- the collector of objects that the alignment is checked against.interractionLayer
- the interraction layer where the align-with hint lines are placeddecorator
- the align-with move decoratorpublic static WidgetAction createAlignWithResizeAction(AlignWithWidgetCollector collector, LayerWidget interractionLayer, AlignWithMoveDecorator decorator, boolean outerBounds)
collector
- the collector of objects that the alignment is checked against.interractionLayer
- the interraction layer where the align-with hint lines are placeddecorator
- the align-with move decoratorouterBounds
- if true, then the align-with is check against whole bounds of widgets in collection layer;
if false, then the align-with is check against client area (widget bounds without border insetspublic static WidgetAction createConnectAction(LayerWidget interractionLayer, ConnectProvider provider)
interractionLayer
- the interraction layer where the temporary connection is visualization placed.provider
- the connect logic providerpublic static WidgetAction createConnectAction(ConnectDecorator decorator, LayerWidget interractionLayer, ConnectProvider provider)
decorator
- the connect decorator; if null, then the default decorator is usedinterractionLayer
- the interraction layer where the temporary connection is visualization placed.provider
- the connect logic providerpublic static WidgetAction createExtendedConnectAction(LayerWidget interractionLayer, ConnectProvider provider)
interractionLayer
- the interraction layer where the temporary connection is visualization placed.provider
- the connect logic providerpublic static WidgetAction createExtendedConnectAction(ConnectDecorator decorator, LayerWidget interractionLayer, ConnectProvider provider)
decorator
- the connect decorator; if null, then the default decorator is usedinterractionLayer
- the interraction layer where the temporary connection is visualization placed.provider
- the connect logic providerpublic static WidgetAction createExtendedConnectAction(ConnectDecorator decorator, LayerWidget interractionLayer, ConnectProvider provider, int modifiers)
MouseEvent.CTRL_MASK
).decorator
- the connect decorator; if null, then the default decorator is usedinterractionLayer
- the interraction layer where the temporary connection is visualization placed.provider
- the connect logic providermodifiers
- the invocation modifierspublic static WidgetAction createEditAction(EditProvider provider)
provider
- the edit logic provider.public static WidgetAction createHoverAction(HoverProvider provider)
provider
- the hover logic providerpublic static WidgetAction createHoverAction(TwoStateHoverProvider provider)
provider
- the two-stated hover logic providerpublic static WidgetAction createInplaceEditorAction(TextFieldInplaceEditor editor)
editor
- the editor logicpublic static WidgetAction createInplaceEditorAction(TextFieldInplaceEditor editor, EnumSet<InplaceEditorProvider.ExpansionDirection> expansionDirections)
editor
- the editor logicexpansionDirections
- the expansion directionspublic static <C extends JComponent> WidgetAction createInplaceEditorAction(InplaceEditorProvider<C> provider)
provider
- the in-place editor providerpublic static WidgetAction createMoveAction()
public static WidgetAction createMoveAction(MoveStrategy strategy, MoveProvider provider)
strategy
- the move strategy; if null, then default (free) move strategy is used.provider
- the move logic provider; if null, then defaual move logic provider is used
(provides movement for a widget where it is assigned).public static WidgetAction createFreeMoveControlPointAction()
public static WidgetAction createOrthogonalMoveControlPointAction()
public static WidgetAction createMoveControlPointAction(MoveControlPointProvider provider)
provider
- the move control point providerpublic static WidgetAction createMoveControlPointAction(MoveControlPointProvider provider, ConnectionWidget.RoutingPolicy routingPolicy)
provider
- the move control point providerroutingPolicy
- the routing policy that is automatically set to a connection widget with control points modified by this action;
if null, then routing policy is not setpublic static WidgetAction createPanAction()
public static WidgetAction createWheelPanAction()
public static WidgetAction createPopupMenuAction(PopupMenuProvider provider)
provider
- the popup menu providerpublic static WidgetAction createReconnectAction(ReconnectProvider provider)
provider
- the reconnect logic providerpublic static WidgetAction createReconnectAction(ReconnectDecorator decorator, ReconnectProvider provider)
decorator
- the reccont decoratorprovider
- the reconnect logic providerpublic static WidgetAction createRectangularSelectAction(ObjectScene scene, LayerWidget interractionLayer)
scene
- the object scene which the selection will be controlled by the actioninterractionLayer
- the interraction layer where the selection rectangle will be visualizedpublic static WidgetAction createRectangularSelectAction(RectangularSelectDecorator decorator, LayerWidget interractionLayer, RectangularSelectProvider provider)
decorator
- the rectangular select decoratorinterractionLayer
- the interraction layer where the selection rectangle will be visualizedprovider
- the rectangular select logic providerpublic static WidgetAction createResizeAction()
public static WidgetAction createResizeAction(ResizeStrategy strategy, ResizeProvider provider)
strategy
- the resize strategy; if null, then the default (free without any restriction) strategy is usedprovider
- the resize logic provider; if null, then the default logic provider is used
(the action affect preferredBounds of a widget where it is assigned)public static WidgetAction createResizeAction(ResizeStrategy strategy, ResizeControlPointResolver resolver, ResizeProvider provider)
strategy
- the resize strategy; if null, then the default (free without any restriction) strategy is usedresolver
- the resize control point resolver; if null, then the default (points are at corners and center of edges) is usedprovider
- the resize logic provider; if null, then the default logic provider is used
(the action affect preferredBounds of a widget where it is assigned)public static WidgetAction createSelectAction(SelectProvider provider, boolean selectOnRightClick)
provider
- the select logic providerselectOnRightClick
- whether or not to first select the underlying widget with a right-click.public static WidgetAction createSelectAction(SelectProvider provider)
provider
- the select logic providerpublic static WidgetAction createContiguousSelectAction(ContiguousSelectProvider provider)
provider
- the contiguous select logic providerpublic static WidgetAction createSwitchCardAction(Widget cardLayoutWidget)
cardLayoutWidget
- the widget where a card layout is usedpublic static WidgetAction createZoomAction()
public static WidgetAction createZoomAction(double zoomMultiplier, boolean animated)
zoomMultiplier
- the zoom multiplier of each zoom stepanimated
- if true, then the zoom factor changed is animatedpublic static MoveStrategy createFreeMoveStrategy()
public static MoveStrategy createSnapToGridMoveStrategy(int horizontalGridSize, int verticalGridSize)
horizontalGridSize
- the horizontal grid sizeverticalGridSize
- the vertical grid sizepublic static MoveProvider createDefaultMoveProvider()
public static AlignWithMoveDecorator createDefaultAlignWithMoveDecorator()
public static MoveControlPointProvider createFreeMoveControlPointProvider()
public static MoveControlPointProvider createOrthogonalMoveControlPointProvider()
public static RectangularSelectDecorator createDefaultRectangularSelectDecorator(Scene scene)
scene
- the scene where an action is usedpublic static RectangularSelectProvider createObjectSceneRectangularSelectProvider(ObjectScene scene)
scene
- the object scene where an action is usedpublic static ConnectDecorator createDefaultConnectDecorator()
public static ReconnectDecorator createDefaultReconnectDecorator()
public static ResizeStrategy createFreeResizeStategy()
public static ResizeProvider createDefaultResizeProvider()
public static ResizeControlPointResolver createDefaultResizeControlPointResolver()
public static WidgetAction createCycleObjectSceneFocusAction()
public static WidgetAction createCycleFocusAction(CycleFocusProvider provider)
provider
- the cycle focus providerpublic static WidgetAction createForwardKeyEventsAction(Widget forwardToWidget, String forwardToTool)
forwardToWidget
- the widget to which events are forwardedforwardToTool
- the tool to which events are forwarded; if null, then default action chain is usedpublic static InplaceEditorProvider.EditorController getInplaceEditorController(WidgetAction inplaceEditorAction)
ActionFactory.createInplaceEditorAction
method.inplaceEditorAction
- the inplace-editor actionpublic static WidgetAction createCenteredZoomAction(double zoomMultiplier)
zoomMultiplier
- the zoom multiplierpublic static WidgetAction createMouseCenteredZoomAction(double zoomMultiplier)
zoomMultiplier
- the zoom multiplierBuilt on June 4 2024. | Copyright © 2017-2024 Apache Software Foundation. All Rights Reserved.