Class ALcdKML22ViewFitAction

java.lang.Object
com.luciad.gui.ALcdAction
com.luciad.format.kml22.view.ALcdKML22ViewFitAction
All Implemented Interfaces:
ILcdAction, ILcdPropertyChangeSource, ActionListener, Serializable, EventListener
Direct Known Subclasses:
TLcdKML22GXYViewFitAction, TLspKML22ViewFitAction

public abstract class ALcdKML22ViewFitAction extends ALcdAction

An abstract class that defines a common interface for fit-to-object actions in KML 2.2

Some KML22 features define a Camera or a LookAt element. This view fit action checks if any of these elements are present. If not, then it will perform a generic view fit on the feature itself.

Since:
10.0
See Also:
  • Constructor Details

    • ALcdKML22ViewFitAction

      public ALcdKML22ViewFitAction(ILcdView aView, String aName)
      Creates a new instance of this abstract fit action with a given name.
      Parameters:
      aView - an ILcdView. Can be null
      aName - a name for the abstract fit action
  • Method Details

    • setObjectToFit

      public void setObjectToFit(Object aObjectToFit)

      Sets the object this view-fit action should fit on.

      Note: This method does not actually perform the fit action, it simply changes the object that the next fit action will be performed on.

      To fit on an object, use the actionPerformed(java.awt.event.ActionEvent) method

      Parameters:
      aObjectToFit - An object on which this action should fit
      See Also:
    • getObjectToFit

      public Object getObjectToFit()
      Returns the object on which this action should perform view-fit events.
      Returns:
      The object on which this action will fit
      See Also:
    • setView

      public void setView(ILcdView aView)

      Sets the view this view fit action should fit on.

      Parameters:
      aView - a view to fit on
    • getView

      public ILcdView getView()

      Gets the view this view fit action fits on

      Returns:
      an ILcdView
    • canPerformFit

      public abstract boolean canPerformFit(Object aObject, ILcdView aView)
      Checks whether this view fit action can perform a fit.
      Parameters:
      aObject - An Object to fit on.
      aView - An ILcdView to fit on aObject;
      Returns:
      true if a fit action can be performed; false otherwise
    • performFit

      public abstract void performFit(Object aObject, ILcdView aView)
      Performs the fit action
      Parameters:
      aObject - An Object to fit on.
      aView - An ILcdView to fit on aObject;
    • actionPerformed

      public abstract void actionPerformed(ActionEvent aActionEvent)
      Performs the view-fit action on the object set by setObjectToFit(Object), in the view set by setView(ILcdView)
      Parameters:
      aActionEvent - The action event associated with this action. Can be null.