pivot.wtk.skin
Class FlowPaneSkin

java.lang.Object
  extended by pivot.wtk.skin.ComponentSkin
      extended by pivot.wtk.skin.ContainerSkin
          extended by pivot.wtk.skin.FlowPaneSkin
All Implemented Interfaces:
ComponentKeyListener, ComponentLayoutListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ConstrainedVisual, ContainerListener, FlowPaneListener, Skin, Visual
Direct Known Subclasses:
TerraFlowPaneSkin

public class FlowPaneSkin
extends ContainerSkin
implements FlowPaneListener

Flow pane skin.

TODO Cache preferred component sizes when alignment is justified, so we don't need to recalculate them during layout.

Author:
gbrown

Nested Class Summary
 
Nested classes/interfaces inherited from class pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentListener
ComponentListener.Adapter
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter
 
Field Summary
 
Fields inherited from class pivot.wtk.skin.ComponentSkin
SHOW_TOOLTIP_TIMEOUT
 
Constructor Summary
FlowPaneSkin()
           
 
Method Summary
 HorizontalAlignment getHorizontalAlignment()
           
 Insets getPadding()
           
 int getPreferredHeight(int width)
          Returns the visual's preferred height given the provided width constraint.
 Dimensions getPreferredSize()
          Returns the visual's unconstrained preferred size.
 int getPreferredWidth(int height)
          Returns the visual's preferred width given the provided height constraint.
 int getSpacing()
           
 VerticalAlignment getVerticalAlignment()
           
 void install(Component component)
          Associates a skin with a component.
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 void orientationChanged(FlowPane flowPane)
          Called when a flow pane's orientation has changed.
 void setHorizontalAlignment(HorizontalAlignment horizontalAlignment)
           
 void setHorizontalAlignment(String horizontalAlignment)
           
 void setPadding(Dictionary<String,?> padding)
           
 void setPadding(Insets padding)
           
 void setPadding(int padding)
           
 void setPadding(Number padding)
           
 void setSpacing(int spacing)
           
 void setSpacing(Number spacing)
           
 void setVerticalAlignment(String verticalAlignment)
           
 void setVerticalAlignment(VerticalAlignment verticalAlignment)
           
 void uninstall()
          Dissociates a skin from a component.
 
Methods inherited from class pivot.wtk.skin.ContainerSkin
componentInserted, componentsRemoved, contextKeyChanged, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, isOpaque, paint, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint
 
Methods inherited from class pivot.wtk.skin.ComponentSkin
cursorChanged, displayableChanged, enabledChanged, focusedChanged, getComponent, getHeight, getWidth, invalidateComponent, keyPressed, keyReleased, keyTyped, locationChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, styleUpdated, tooltipTextChanged, visibleChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowPaneSkin

public FlowPaneSkin()
Method Detail

install

public void install(Component component)
Description copied from interface: Skin
Associates a skin with a component.

Specified by:
install in interface Skin
Overrides:
install in class ContainerSkin
Parameters:
component - The component to which the skin is being attached.

uninstall

public void uninstall()
Description copied from interface: Skin
Dissociates a skin from a component.

Specified by:
uninstall in interface Skin
Overrides:
uninstall in class ContainerSkin

getPreferredWidth

public int getPreferredWidth(int height)
Description copied from interface: ConstrainedVisual
Returns the visual's preferred width given the provided height constraint.

Specified by:
getPreferredWidth in interface ConstrainedVisual
Overrides:
getPreferredWidth in class ContainerSkin
Parameters:
height - The height by which to constrain the preferred width, or -1 for no constraint.

getPreferredHeight

public int getPreferredHeight(int width)
Description copied from interface: ConstrainedVisual
Returns the visual's preferred height given the provided width constraint.

Specified by:
getPreferredHeight in interface ConstrainedVisual
Overrides:
getPreferredHeight in class ContainerSkin
Parameters:
width - The width by which to constrain the preferred height, or -1 for no constraint.

getPreferredSize

public Dimensions getPreferredSize()
Description copied from interface: ConstrainedVisual
Returns the visual's unconstrained preferred size.

Specified by:
getPreferredSize in interface ConstrainedVisual
Overrides:
getPreferredSize in class ComponentSkin

layout

public void layout()
Description copied from interface: Skin
If the component on which the skin is installed is a container, lays out the container's children.

Specified by:
layout in interface Skin

getHorizontalAlignment

public HorizontalAlignment getHorizontalAlignment()

setHorizontalAlignment

public void setHorizontalAlignment(HorizontalAlignment horizontalAlignment)

setHorizontalAlignment

public final void setHorizontalAlignment(String horizontalAlignment)

getVerticalAlignment

public VerticalAlignment getVerticalAlignment()

setVerticalAlignment

public void setVerticalAlignment(VerticalAlignment verticalAlignment)

setVerticalAlignment

public final void setVerticalAlignment(String verticalAlignment)

getPadding

public Insets getPadding()

setPadding

public void setPadding(Insets padding)

setPadding

public final void setPadding(Dictionary<String,?> padding)

setPadding

public final void setPadding(int padding)

setPadding

public final void setPadding(Number padding)

getSpacing

public int getSpacing()

setSpacing

public void setSpacing(int spacing)

setSpacing

public final void setSpacing(Number spacing)

orientationChanged

public void orientationChanged(FlowPane flowPane)
Description copied from interface: FlowPaneListener
Called when a flow pane's orientation has changed.

Specified by:
orientationChanged in interface FlowPaneListener