NASA World Wind

gov.nasa.worldwind.util.tree
Class BasicTreeAttributes

java.lang.Object
  extended by gov.nasa.worldwind.util.tree.BasicTreeAttributes
All Implemented Interfaces:
TreeAttributes

public class BasicTreeAttributes
extends Object
implements TreeAttributes

Basic implementation of TreeAttributes set.


Field Summary
protected  Color checkBoxColor1
           
protected  Color checkBoxColor2
           
protected  Font descriptionFont
           
protected  Font font
           
protected  Dimension iconSize
           
protected  int iconSpace
           
protected  boolean rootVisible
           
protected  int rowSpacing
           
protected  Color textColor
           
 
Constructor Summary
BasicTreeAttributes()
           
BasicTreeAttributes(TreeAttributes attributes)
          Create a new attributes object with the same configuration as an existing attributes object.
 
Method Summary
 BasicTreeAttributes copy()
          Returns a new TreeAttributes instance of the same type as this TreeAttributes, who's properties are configured exactly as this TreeAttributes.
 void copy(TreeAttributes attributes)
          Copies the specified TreeAttributes' properties into this object's properties.
 boolean equals(Object o)
           
 Color[] getCheckBoxColor()
          Get the color of filled checkboxes that indicate if nodes are selected.
 Color getColor()
          Get the color of the text in the tree.
 Font getDescriptionFont()
          Get the font used to render the node description.
 Font getFont()
          Get the font used to render text.
 Dimension getIconSize()
          Get the size of each icon in the tree.
 int getIconSpace()
          Get the amount of space, in pixels, to leave between an icon in the tree and surrounding text and shapes.
 int getRowSpacing()
          Get the space, in pixels, to leave between rows in the tree.
 int hashCode()
           
 boolean isRootVisible()
          Should be root node be drawn?
 void setCheckBoxColor(Color color1, Color color2)
          Set the color of filled checkboxes that indicate if a node is selected.
 void setColor(Color textColor)
          Set the color of the text in the tree.
 void setDescriptionFont(Font font)
          Set the font used to render the node descriptions.
 void setFont(Font font)
          Set the font used to render text.
 void setIconSize(Dimension iconSize)
          Set the size of each icon in the tree.
 void setIconSpace(int iconSpace)
          Set the amount of space, in pixels, to leave between an icon in the tree and surrounding text and shapes.
 void setRootVisible(boolean visible)
          Set the root node to visibile or not visible.
 void setRowSpacing(int spacing)
          Set the space, in pixels, to leave between rows in the tree.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checkBoxColor1

protected Color checkBoxColor1

checkBoxColor2

protected Color checkBoxColor2

descriptionFont

protected Font descriptionFont

font

protected Font font

iconSize

protected Dimension iconSize

iconSpace

protected int iconSpace

rootVisible

protected boolean rootVisible

rowSpacing

protected int rowSpacing

textColor

protected Color textColor
Constructor Detail

BasicTreeAttributes

public BasicTreeAttributes()

BasicTreeAttributes

public BasicTreeAttributes(TreeAttributes attributes)
Create a new attributes object with the same configuration as an existing attributes object.

Parameters:
attributes - Object to copy configuration from.
Method Detail

copy

public BasicTreeAttributes copy()
Returns a new TreeAttributes instance of the same type as this TreeAttributes, who's properties are configured exactly as this TreeAttributes.

Specified by:
copy in interface TreeAttributes
Returns:
a copy of this TreeAttributes.

copy

public void copy(TreeAttributes attributes)
Copies the specified TreeAttributes' properties into this object's properties. This does nothing if the specified attributes is null.

Specified by:
copy in interface TreeAttributes
Parameters:
attributes - the attributes to copy.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getCheckBoxColor

public Color[] getCheckBoxColor()
Get the color of filled checkboxes that indicate if nodes are selected. The checkboxes are drawn as a gradient of two colors.

Specified by:
getCheckBoxColor in interface TreeAttributes
Returns:
two element array of the colors that make up the checkbox gradient.

getColor

public Color getColor()
Get the color of the text in the tree.

Specified by:
getColor in interface TreeAttributes
Returns:
Text color.
See Also:
TreeAttributes.setColor(java.awt.Color)

getDescriptionFont

public Font getDescriptionFont()
Get the font used to render the node description.

Specified by:
getDescriptionFont in interface TreeAttributes
Returns:
Font for node description.

getFont

public Font getFont()
Get the font used to render text.

Specified by:
getFont in interface TreeAttributes
Returns:
Tree font.
See Also:
TreeAttributes.setFont(java.awt.Font)

getIconSize

public Dimension getIconSize()
Get the size of each icon in the tree. If the icon images do not match this size, they will be scaled to fit.

Specified by:
getIconSize in interface TreeAttributes
Returns:
Icon size.
See Also:
TreeAttributes.setIconSize(java.awt.Dimension)

getIconSpace

public int getIconSpace()
Get the amount of space, in pixels, to leave between an icon in the tree and surrounding text and shapes.

Specified by:
getIconSpace in interface TreeAttributes
Returns:
Icon space in pixels.
See Also:
TreeAttributes.setIconSpace(int)

getRowSpacing

public int getRowSpacing()
Get the space, in pixels, to leave between rows in the tree.

Specified by:
getRowSpacing in interface TreeAttributes
Returns:
Space in pixels between rows.
See Also:
TreeAttributes.setRowSpacing(int)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

isRootVisible

public boolean isRootVisible()
Should be root node be drawn?

Specified by:
isRootVisible in interface TreeAttributes
Returns:
True if the root node should be drawn.
See Also:
TreeAttributes.setRootVisible(boolean)

setCheckBoxColor

public void setCheckBoxColor(Color color1,
                             Color color2)
Set the color of filled checkboxes that indicate if a node is selected. The checkboxes are drawn as a gradient of two colors.

Specified by:
setCheckBoxColor in interface TreeAttributes
Parameters:
color1 - first color in the checkbox gradient.
color2 - second color in the checkbox gradient.

setColor

public void setColor(Color textColor)
Set the color of the text in the tree.

Specified by:
setColor in interface TreeAttributes
Parameters:
textColor - New text color.
See Also:
TreeAttributes.getColor()

setDescriptionFont

public void setDescriptionFont(Font font)
Set the font used to render the node descriptions.

Specified by:
setDescriptionFont in interface TreeAttributes
Parameters:
font - New font for descriptions.

setFont

public void setFont(Font font)
Set the font used to render text.

Specified by:
setFont in interface TreeAttributes
Parameters:
font - New tree font.
See Also:
TreeAttributes.getFont()

setIconSize

public void setIconSize(Dimension iconSize)
Set the size of each icon in the tree.

Specified by:
setIconSize in interface TreeAttributes
Parameters:
iconSize - New size.
See Also:
TreeAttributes.getIconSize()

setIconSpace

public void setIconSpace(int iconSpace)
Set the amount of space, in pixels, to leave between an icon in the tree and surrounding text and shapes.

Specified by:
setIconSpace in interface TreeAttributes
Parameters:
iconSpace - Icon space in pixels.
See Also:
TreeAttributes.getIconSpace()

setRootVisible

public void setRootVisible(boolean visible)
Set the root node to visibile or not visible.

Specified by:
setRootVisible in interface TreeAttributes
Parameters:
visible - True if the root node should be drawn.
See Also:
TreeAttributes.isRootVisible()

setRowSpacing

public void setRowSpacing(int spacing)
Set the space, in pixels, to leave between rows in the tree.

Specified by:
setRowSpacing in interface TreeAttributes
Parameters:
spacing - Row spacing.
See Also:
TreeAttributes.getRowSpacing()

NASA World Wind