jwo.landserf.gui
Class ThumbnailBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by jwo.landserf.gui.ThumbnailBorder
All Implemented Interfaces:
Serializable, Border

public class ThumbnailBorder
extends AbstractBorder

Creates a customised border for the display of spatial object thumbnails. The style of the border will depend on whether it represents a primary, secondary or unselected object.

Version:
2.3, 6th October, 2007.
Author:
Jo Wood.
See Also:
Serialized Form

Constructor Summary
ThumbnailBorder()
          Creates a border for unselected spatial objects.
ThumbnailBorder(int selection)
          Creates a border for spatial objects with the given selection type.
 
Method Summary
 Color getBaseColour()
          Reports the base colour used for bordering.
 Insets getBorderInsets(Component c)
          Reports the insets of the border.
 Insets getBorderInsets(Component c, Insets insets)
          Reinitialises the insets parameter with this border's current Insets.
 Color getDarkColour()
          Reports the darker version of the base colour used for bordering.
 Color getLightColour()
          Reports the lighter version of the base colour used for bordering.
 boolean isBorderOpaque()
          Reports whether or not the border is opaque.
 void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          Paints the border for the given component with the given position and size.
 
Methods inherited from class javax.swing.border.AbstractBorder
getInteriorRectangle, getInteriorRectangle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThumbnailBorder

public ThumbnailBorder()
Creates a border for unselected spatial objects.


ThumbnailBorder

public ThumbnailBorder(int selection)
Creates a border for spatial objects with the given selection type.

Parameters:
selection - Selection type. Should be one of GISFrame.PRIMARY, GISFrame.SECONDARY or GISFrame.NOT_SELECTED
Method Detail

getBaseColour

public Color getBaseColour()
Reports the base colour used for bordering. This will depend on the selection status of the object represented.

Returns:
Base colour used for bordering (i.e. unmodified by shadowing).

getLightColour

public Color getLightColour()
Reports the lighter version of the base colour used for bordering. This will depend on the selection status of the object represented.

Returns:
Lighter colour used for border shadowing.

getDarkColour

public Color getDarkColour()
Reports the darker version of the base colour used for bordering. This will depend on the selection status of the object represented.

Returns:
Darker colour used for border shadowing.

paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Paints the border for the given component with the given position and size.

Specified by:
paintBorder in interface Border
Overrides:
paintBorder in class AbstractBorder
Parameters:
c - Component on which this border is painted.
g - Graphics context.
x - X position of the painted border.
y - Y position of the painted border.
width - Width of the painted border.
height - Height of the painted border

getBorderInsets

public Insets getBorderInsets(Component c)
Reports the insets of the border.

Specified by:
getBorderInsets in interface Border
Overrides:
getBorderInsets in class AbstractBorder
Parameters:
c - Component for which this border insets apply.
Returns:
Insets used by this border.

getBorderInsets

public Insets getBorderInsets(Component c,
                              Insets insets)
Reinitialises the insets parameter with this border's current Insets.

Overrides:
getBorderInsets in class AbstractBorder
Parameters:
c - Component for which this border insets value applies.
insets - Object to be reinitialized.
Returns:
Initialised insets.

isBorderOpaque

public boolean isBorderOpaque()
Reports whether or not the border is opaque. In this case, it is always opaque.

Specified by:
isBorderOpaque in interface Border
Overrides:
isBorderOpaque in class AbstractBorder
Returns:
True, indicating the border is opaque.


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009