com.guiseframework.component
Class AbstractComponent.AbstractFlyoverStrategy<S extends Component>

java.lang.Object
  extended by com.guiseframework.event.MouseAdapter
      extended by com.guiseframework.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
AbstractComponent.AbstractFlyoverStrategy(S component)
          Component constructor.
 
Method Summary
 S getComponent()
           
 Extent getExtent(Flow flow)
          Returns the extent of the indicated flow.
 Extent getLineExtent()
          Returns the extent of the line flow.
 Effect getOpenEffect()
           
 Extent getPageExtent()
          Returns the extent of the page flow.
 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 source.
 void setExtent(Flow flow, Extent newExtent)
          Sets the extent of a given flow.
 void setLineExtent(Extent newExtent)
          Sets the extent of the line flow.
 void setOpenEffect(Effect newOpenEffect)
          Sets the effect used for opening the flyover.
 void setPageExtent(Extent newExtent)
          Sets the extent of the page flow.
 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 com.guiseframework.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 com.guiseframework.component.Component.FlyoverStrategy
closeFlyover, openFlyover
 
Methods inherited from interface com.guiseframework.event.MouseListener
mouseClicked
 

Constructor Detail

AbstractComponent.AbstractFlyoverStrategy

public AbstractComponent.AbstractFlyoverStrategy(S component)
Component constructor.

Parameters:
component - The component for which this object will control flyovers.
Throws:
java.lang.NullPointerException - if the given component is null.
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()
Returns the extent of the line flow. In left-to-right top-to-bottom orientation, this is commonly known as the width.

Specified by:
getLineExtent in interface Component.FlyoverStrategy<S extends Component>
Returns:
The extent of the flow, or null if no preferred extent has been specified

getPageExtent

public Extent getPageExtent()
Returns the extent of the page flow. In left-to-right top-to-bottom orientation, this is commonly known as the height.

Specified by:
getPageExtent in interface Component.FlyoverStrategy<S extends Component>
Returns:
The extent of the flow, or null if no preferred 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:
java.lang.NullPointerException - if the given flow is null.

setLineExtent

public void setLineExtent(Extent newExtent)
Sets the extent of the line flow. In left-to-right top-to-bottom orientation, this is commonly known as the width. This is a bound property.

Specified by:
setLineExtent in interface Component.FlyoverStrategy<S extends Component>
Parameters:
newExtent - The new requested extent of the flyover, or null there is no extent preference.

setPageExtent

public void setPageExtent(Extent newExtent)
Sets the extent of the page flow. In left-to-right top-to-bottom orientation, this is commonly known as the height. This is a bound property.

Specified by:
setPageExtent in interface Component.FlyoverStrategy<S extends Component>
Parameters:
newExtent - The new requested extent of the flyover, or null there is no extent preference.

getStyleID

public java.lang.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(java.lang.String newStyleID)
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 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 is null.
java.lang.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)
Sets the effect used for opening the flyover.

Specified by:
setOpenEffect in interface Component.FlyoverStrategy<S extends Component>
Parameters:
newEffect - The new effect used for opening the flyover, or null 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 interface MouseListener
Overrides:
mouseEntered in class MouseAdapter
Parameters:
mouseEvent - The event providing mouse information
See Also:
Component.FlyoverStrategy.openFlyover()

mouseExited

public void mouseExited(MouseExitEvent mouseEvent)
Called when the mouse exits the source. 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:
Component.FlyoverStrategy.closeFlyover()


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.