Class AbstractDrawingViewAction

All Implemented Interfaces:
EventListener, javafx.event.EventHandler<javafx.event.ActionEvent>, Action, PropertyBean, Disableable
Direct Known Subclasses:
AddToGroupAction, AlignBottomAction, AlignHorizontalAction, AlignLeftAction, AlignRightAction, AlignTopAction, AlignVerticalAction, BringForwardAction, BringToFrontAction, DistributeHorizontallyAction, DistributeVerticallyAction, GroupAction, RemoveFromGroupAction, RemoveTransformationsAction, SelectChildrenAction, SelectSameAction, SendBackwardAction, SendToBackAction, UngroupAction

public abstract class AbstractDrawingViewAction extends AbstractAction
This abstract class can be extended to implement an Action that acts on behalf of the selected figures of a DrawingView.

By default the disabled state of this action reflects the disabled state of the active DrawingView. If no drawing view is active, this action is disabled.

Author:
Werner Randelshofer
  • Field Details

  • Constructor Details

    • AbstractDrawingViewAction

      public AbstractDrawingViewAction(DrawingEditor editor)
      Creates an action which acts on the selected figures on the current view of the specified editor.
      Parameters:
      editor - the drawing editor
  • Method Details

    • forwardUndoableEdit

      public void forwardUndoableEdit(UndoableEditEvent event)
    • getEditor

      public DrawingEditor getEditor()
      Gets the drawing editor.
      Returns:
      the drawing editor
    • getView

      protected @Nullable DrawingView getView()
      Gets the active drawing view of the drawing editor.
      Returns:
      the active drawing view. Returns null if the editor is null no drawing view is active.
    • onActionPerformed

      protected void onActionPerformed(javafx.event.ActionEvent event)
      Specified by:
      onActionPerformed in class AbstractAction
    • onActionPerformed

      protected abstract void onActionPerformed(javafx.event.ActionEvent even, DrawingView view)