org.apache.pivot.wtk.skin
Class BorderSkin

java.lang.Object
  extended by org.apache.pivot.wtk.skin.ComponentSkin
      extended by org.apache.pivot.wtk.skin.ContainerSkin
          extended by org.apache.pivot.wtk.skin.BorderSkin
All Implemented Interfaces:
BorderListener, ComponentKeyListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ConstrainedVisual, ContainerListener, Skin, Visual
Direct Known Subclasses:
TerraBorderSkin

public class BorderSkin
extends ContainerSkin
implements BorderListener

Border skin.

TODO Add styles to support different border styles (e.g. inset, outset) or create subclasses for these border types.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.BorderListener
BorderListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter
 
Field Summary
 
Fields inherited from class org.apache.pivot.wtk.skin.ComponentSkin
SHOW_TOOLTIP_TIMEOUT
 
Constructor Summary
BorderSkin()
           
 
Method Summary
 void contentChanged(Border border, Component previousContent)
          Called when a border's content component has changed.
 Color getColor()
           
 CornerRadii getCornerRadii()
           
 Font getFont()
           
 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 getThickness()
           
 Color getTitleColor()
           
 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 paint(Graphics2D graphics)
          Paints the visual.
 void setColor(Color color)
           
 void setColor(String color)
           
 void setCornerRadii(CornerRadii cornerRadii)
           
 void setCornerRadii(Dictionary<String,?> cornerRadii)
           
 void setCornerRadii(int cornerRadii)
           
 void setCornerRadii(Number cornerRadii)
           
 void setCornerRadii(String cornerRadii)
           
 void setFont(Font font)
           
 void setFont(String font)
           
 void setPadding(Dictionary<String,?> padding)
           
 void setPadding(Insets padding)
           
 void setPadding(int padding)
           
 void setPadding(Number padding)
           
 void setPadding(String padding)
           
 void setThickness(int thickness)
           
 void setThickness(Number thickness)
           
 void setTitleColor(Color titleColor)
           
 void setTitleColor(String titleColor)
           
 void titleChanged(Border border, String previousTitle)
          Called when a border's title has changed.
 void uninstall()
          Dissociates a skin from a component.
 
Methods inherited from class org.apache.pivot.wtk.skin.ContainerSkin
componentInserted, componentsRemoved, contextKeyChanged, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, isOpaque, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint
 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
cursorChanged, dragSourceChanged, dropTargetChanged, enabledChanged, focusedChanged, getComponent, getHeight, getWidth, invalidateComponent, keyPressed, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, parentChanged, preferredHeightLimitsChanged, preferredSizeChanged, preferredWidthLimitsChanged, repaintComponent, 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

BorderSkin

public BorderSkin()
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

paint

public void paint(Graphics2D graphics)
Description copied from interface: Visual
Paints the visual.

Specified by:
paint in interface Visual
Overrides:
paint in class ContainerSkin
Parameters:
graphics - The graphics context in which to paint the visual.

getFont

public Font getFont()

setFont

public void setFont(Font font)

setFont

public final void setFont(String font)

getColor

public Color getColor()

setColor

public void setColor(Color color)

setColor

public final void setColor(String color)

getTitleColor

public Color getTitleColor()

setTitleColor

public void setTitleColor(Color titleColor)

setTitleColor

public final void setTitleColor(String titleColor)

getThickness

public int getThickness()

setThickness

public void setThickness(int thickness)

setThickness

public void setThickness(Number thickness)

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 void setPadding(Number padding)

setPadding

public final void setPadding(String padding)

getCornerRadii

public CornerRadii getCornerRadii()

setCornerRadii

public void setCornerRadii(CornerRadii cornerRadii)

setCornerRadii

public final void setCornerRadii(Dictionary<String,?> cornerRadii)

setCornerRadii

public final void setCornerRadii(int cornerRadii)

setCornerRadii

public final void setCornerRadii(Number cornerRadii)

setCornerRadii

public final void setCornerRadii(String cornerRadii)

titleChanged

public void titleChanged(Border border,
                         String previousTitle)
Description copied from interface: BorderListener
Called when a border's title has changed.

Specified by:
titleChanged in interface BorderListener

contentChanged

public void contentChanged(Border border,
                           Component previousContent)
Description copied from interface: BorderListener
Called when a border's content component has changed.

Specified by:
contentChanged in interface BorderListener