Class AbstractDocumentCommand

All Implemented Interfaces:
Direct Known Subclasses:
AbstractAnnotationCommand, AbstractServerOperationCommand, AbstractToggleSearchCommand, AttachGridCommand, CreateAnnotationCommand, FitPageOnceCommand, GradationCurveCommand, HighlightTextCommand, RedoCommand, ResampleFilterCommand, RotateCommand, SpinCommand, UndoCommand, ZoomCommand, ZoomToCommand

public abstract class AbstractDocumentCommand extends AbstractMouseCommand
Abstract superclass for all commands, which need a viewer and a document for functionality.
  • Constructor Details

    • AbstractDocumentCommand

      public AbstractDocumentCommand()
  • Method Details

    • canExecute

      protected boolean canExecute()
      Checks if this command can be executed.
      canExecute in class AbstractPageViewCommand
      true, if InjectedCommand.execute(java.util.Collection<java.lang.Object>) can be called, false else
    • getDocument

      protected Document getDocument()
      the Document of the PageView
    • setScope

      public void setScope(AbstractDocumentCommand.Scope scope)
      Sets the scope of this command.

      Supported scopes are PAGEVIEW (default), DOCUMENT and PAGE

      scope - the scope to be configured
    • getScope

      public AbstractDocumentCommand.Scope getScope()
      Returns the current scope of this command.
      the current scope of this command
    • getRenderControls

      protected RenderControls getRenderControls(boolean create)
      Return a RenderControls for the current scope.

      Depending on the scope this method will either return the document controls of the current document or the page controls for the current page in the target PageView.

      create - if the command should work in a per-page way ( getScope() == AbstractDocumentCommand.Scope.PAGE) and no page control is available, this parameter decides whether to create a new render controls for the page or to return the document render controls.
    • getID

      public String getID()
      Description copied from interface: Command
      The ID of the command. This is typically the command class name. If the Command is parameterized the ID should comprise the class name + parameter information.
      the ID of the command