Class AbstractComponent.AbstractFlyoverStrategy<S extends Component>

java.lang.Object
io.guise.framework.event.MouseAdapter
io.guise.framework.component.AbstractComponent.AbstractFlyoverStrategy<S>
Type Parameters:
S - The type of component for which this object is to control flyovers.
All Implemented Interfaces:
Component.FlyoverStrategy<S>, GuiseEventListener, MouseListener, EventListener
Direct Known Subclasses:
AbstractComponent.AbstractFlyoverFrameStrategy
Enclosing class:
AbstractComponent

public abstract static class AbstractComponent.AbstractFlyoverStrategy<S extends Component> extends MouseAdapter implements Component.FlyoverStrategy<S>
An abstract implementation of a strategy for showing and hiding flyovers in response to mouse events.
Author:
Garret Wilson
  • Constructor Details

    • AbstractFlyoverStrategy

      public AbstractFlyoverStrategy(S component)
      Component constructor.
      Parameters:
      component - The component for which this object will control flyovers.
      Throws:
      NullPointerException - if the given component is null.
  • Method Details

    • getComponent

      public S getComponent()
      Returns:
      The component for which this object will control flyovers.
    • getExtent

      public Extent getExtent(Flow flow)
      Returns the extent of the indicated flow.
      Parameters:
      flow - The flow for which an extent should be returned.
      Returns:
      The extent of the given flow.
    • getLineExtent

      public Extent getLineExtent()
      Specified by:
      getLineExtent in interface Component.FlyoverStrategy<S extends Component>
      Returns:
      The requested line extent (width in left-to-right top-to-bottom orientation) of the flyover component, or null if no preferred line extent has been specified.
    • getPageExtent

      public Extent getPageExtent()
      Specified by:
      getPageExtent in interface Component.FlyoverStrategy<S extends Component>
      Returns:
      The requested page extent (height in left-to-right top-to-bottom orientation) of the flyover component, or null if no preferred page extent has been specified.
    • setExtent

      public void setExtent(Flow flow, Extent newExtent)
      Sets the extent of a given flow. The extent of each flow represents a bound property.
      Parameters:
      flow - The flow for which the extent should be set.
      newExtent - The new requested extent of the flyover, or null there is no extent preference.
      Throws:
      NullPointerException - if the given flow is null.
    • setLineExtent

      public void setLineExtent(Extent newExtent)
      Description copied from interface: Component.FlyoverStrategy
      Sets the requested line extent (width in left-to-right top-to-bottom orientation) of the flyover component.
      Specified by:
      setLineExtent in interface Component.FlyoverStrategy<S extends Component>
      Parameters:
      newExtent - The new requested line extent of the flyover component, or null there is no line extent preference.
    • setPageExtent

      public void setPageExtent(Extent newExtent)
      Description copied from interface: Component.FlyoverStrategy
      Sets the requested page extent (height in left-to-right top-to-bottom orientation) of the flyover component.
      Specified by:
      setPageExtent in interface Component.FlyoverStrategy<S extends Component>
      Parameters:
      newExtent - The new requested page extent of the flyover component, or null there is no page extent preference.
    • getStyleID

      public String getStyleID()
      Specified by:
      getStyleID in interface Component.FlyoverStrategy<S extends Component>
      Returns:
      The style identifier of the flyover, or null if there is no style ID.
    • setStyleID

      public void setStyleID(String newStyleID)
      Description copied from interface: Component.FlyoverStrategy
      Identifies the style for the flyover component.
      Specified by:
      setStyleID in interface Component.FlyoverStrategy<S extends Component>
      Parameters:
      newStyleID - The style identifier of the flyover, or null if there is no style ID.
    • getTetherBearing

      public BigDecimal getTetherBearing()
      Returns:
      The bearing of the tether in relation to the frame.
    • setTetherBearing

      public void setTetherBearing(BigDecimal newTetherBearing)
      Sets the bearing of the tether in relation to the frame.
      Parameters:
      newTetherBearing - The new bearing of the tether in relation to the frame.
      Throws:
      NullPointerException - if the given bearing is null.
      IllegalArgumentException - if the given bearing is greater than 360.
    • getOpenEffect

      public Effect getOpenEffect()
      Specified by:
      getOpenEffect in interface Component.FlyoverStrategy<S extends Component>
      Returns:
      The effect used for opening the flyover, or null if there is no open effect.
    • setOpenEffect

      public void setOpenEffect(Effect newOpenEffect)
      Description copied from interface: Component.FlyoverStrategy
      Sets the effect used for opening the flyover.
      Specified by:
      setOpenEffect in interface Component.FlyoverStrategy<S extends Component>
      Parameters:
      newOpenEffect - The new effect used for opening the flyover, or null if there should be no open effect.
      See Also:
    • mouseEntered

      public void mouseEntered(MouseEnterEvent mouseEvent)
      Called when the mouse enters the target.

      This implementation opens the flyover.

      Specified by:
      mouseEntered in interface MouseListener
      Overrides:
      mouseEntered in class MouseAdapter
      Parameters:
      mouseEvent - The event providing mouse information
      See Also:
    • mouseExited

      public void mouseExited(MouseExitEvent mouseEvent)
      Called when the mouse exits the target.

      This implementation closes any open flyover.

      Specified by:
      mouseExited in interface MouseListener
      Overrides:
      mouseExited in class MouseAdapter
      Parameters:
      mouseEvent - The event providing mouse information
      See Also: