Package io.guise.framework.component
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
,java.util.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 Summary
Constructors Constructor Description AbstractFlyoverStrategy(S component)
Component constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description S
getComponent()
Extent
getExtent(Flow flow)
Returns the extent of the indicated flow.Extent
getLineExtent()
Effect
getOpenEffect()
Extent
getPageExtent()
java.lang.String
getStyleID()
java.math.BigDecimal
getTetherBearing()
void
mouseEntered(MouseEnterEvent mouseEvent)
Called when the mouse enters the target.void
mouseExited(MouseExitEvent mouseEvent)
Called when the mouse exits the target.void
setExtent(Flow flow, Extent newExtent)
Sets the extent of a given flow.void
setLineExtent(Extent newExtent)
Sets the requested line extent (width in left-to-right top-to-bottom orientation) of the flyover component.void
setOpenEffect(Effect newOpenEffect)
Sets the effect used for opening the flyover.void
setPageExtent(Extent newExtent)
Sets the requested page extent (height in left-to-right top-to-bottom orientation) of the flyover component.void
setStyleID(java.lang.String newStyleID)
Identifies the style for the flyover component.void
setTetherBearing(java.math.BigDecimal newTetherBearing)
Sets the bearing of the tether in relation to the frame.-
Methods inherited from class io.guise.framework.event.MouseAdapter
mouseClicked
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.guise.framework.component.Component.FlyoverStrategy
closeFlyover, openFlyover
-
Methods inherited from interface io.guise.framework.event.MouseListener
mouseClicked
-
-
-
-
Constructor Detail
-
AbstractFlyoverStrategy
public AbstractFlyoverStrategy(S component)
Component constructor.- Parameters:
component
- The component for which this object will control flyovers.- Throws:
java.lang.NullPointerException
- if the given component isnull
.
-
-
Method Detail
-
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 interfaceComponent.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 interfaceComponent.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, ornull
there is no extent preference.- Throws:
java.lang.NullPointerException
- if the given flow isnull
.
-
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 interfaceComponent.FlyoverStrategy<S extends Component>
- Parameters:
newExtent
- The new requested line extent of the flyover component, ornull
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 interfaceComponent.FlyoverStrategy<S extends Component>
- Parameters:
newExtent
- The new requested page extent of the flyover component, ornull
there is no page extent preference.
-
getStyleID
public java.lang.String getStyleID()
- Specified by:
getStyleID
in interfaceComponent.FlyoverStrategy<S extends Component>
- Returns:
- The style identifier of the flyover, or
null
if there is no style ID.
-
setStyleID
public void setStyleID(java.lang.String newStyleID)
Description copied from interface:Component.FlyoverStrategy
Identifies the style for the flyover component.- Specified by:
setStyleID
in interfaceComponent.FlyoverStrategy<S extends Component>
- Parameters:
newStyleID
- The style identifier of the flyover, ornull
if there is no style ID.
-
getTetherBearing
public java.math.BigDecimal getTetherBearing()
- Returns:
- The bearing of the tether in relation to the frame.
-
setTetherBearing
public void setTetherBearing(java.math.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:
java.lang.NullPointerException
- if the given bearing isnull
.java.lang.IllegalArgumentException
- if the given bearing is greater than 360.
-
getOpenEffect
public Effect getOpenEffect()
- Specified by:
getOpenEffect
in interfaceComponent.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 interfaceComponent.FlyoverStrategy<S extends Component>
- Parameters:
newOpenEffect
- The new effect used for opening the flyover, ornull
if there should be no open effect.- See Also:
Frame.OPEN_EFFECT_PROPERTY
-
mouseEntered
public void mouseEntered(MouseEnterEvent mouseEvent)
Called when the mouse enters the target.This implementation opens the flyover.
- Specified by:
mouseEntered
in interfaceMouseListener
- Overrides:
mouseEntered
in classMouseAdapter
- Parameters:
mouseEvent
- The event providing mouse information- See Also:
Component.FlyoverStrategy.openFlyover()
-
mouseExited
public void mouseExited(MouseExitEvent mouseEvent)
Called when the mouse exits the target.This implementation closes any open flyover.
- Specified by:
mouseExited
in interfaceMouseListener
- Overrides:
mouseExited
in classMouseAdapter
- Parameters:
mouseEvent
- The event providing mouse information- See Also:
Component.FlyoverStrategy.closeFlyover()
-
-