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.
      Parameters:
      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.
      Overrides:
      canExecute in class InjectedCommand
      Returns:
      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.
      Overrides:
      execute in class InjectedWidgetCommand
    • createWidget

      protected com.google.gwt.user.client.ui.IsWidget createWidget()
      Creates and returns the calibration widget.
      Specified by:
      createWidget in class InjectedWidgetCommand
      Returns:
      the resolution calibration widget
    • getCaption

      protected String getCaption()
      Returns the widget caption.
      Specified by:
      getCaption in class InjectedWidgetCommand
      Returns:
      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.

      Parameters:
      handler - the handler that implements the callback.
    • addScalingLineMarker

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

      public void removeMarkers()
      Removes all markers.