Class ShowResolutionCalibrationWidgetCommand

All Implemented Interfaces:
Command, WidgetCommand

public class ShowResolutionCalibrationWidgetCommand extends InjectedWidgetCommand
Displays a popup widget that provides resolution calibration behaviour.

Expects a PageView instance to be existing. Attaches the instance to the Context in order to make it accessible from the widget.

  • Constructor Details

    • ShowResolutionCalibrationWidgetCommand

      public ShowResolutionCalibrationWidgetCommand()
  • Method Details

    • setPageView

      public void setPageView(PageView pageView)
      Sets the PageView instance.
      pageView - the PageView instance to set.
    • canExecute

      protected boolean canExecute()
      Description copied from class: InjectedCommand
      Subclasses may override this method to perform argument validation beyond the validation that happens automatically during the injection phase. This method is called after the context has been found to match the requirements specified via the @ link Argument} annotations and the arguments have been injected.
      canExecute in class InjectedCommand
      true if the command can/may be executed in the current context, false otherwise.
    • execute

      protected void execute()
      Description copied from class: InjectedCommand
      This method is called in order to execute the command. It is only called, after the arguments have been validated and injected and only if InjectedCommand.canExecute() has returned true.
      execute in class InjectedWidgetCommand
    • createWidget

      protected createWidget()
      Creates and returns the calibration widget.
      Specified by:
      createWidget in class InjectedWidgetCommand
      the resolution calibration widget
    • getCaption

      protected String getCaption()
      Returns the widget caption.
      Specified by:
      getCaption in class InjectedWidgetCommand
      the string that will be used as caption.
    • setHandler

      public void setHandler(WidgetCommand.Handler handler)
      Registers a callback.

      Not needed here. Could be used - e.g. - to close the popup.

      handler - the handler that implements the callback.
    • addScalingLineMarker

      public void addScalingLineMarker(double xPos, String name)
      Configures the command to add a custom marker.
      xPos - x position in inches were the marker will be placed.
      name - the name of the marker.
    • removeMarkers

      public void removeMarkers()
      Removes all markers.