NASA World Wind

gov.nasa.worldwind.util.tree
Interface TreeAttributes

All Known Implementing Classes:
BasicTreeAttributes

public interface TreeAttributes

Attributes to control how a Tree is rendered. The class captures a set of attributes found in a typical tree layout, but some layouts may not use all of these properties.

See Also:
TreeLayout

Method Summary
 TreeAttributes 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.
 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.
 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 size)
          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.
 

Method Detail

copy

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

Returns:
a copy of this TreeAttributes.

copy

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

Parameters:
attributes - the attributes to copy.

getCheckBoxColor

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

Returns:
two element array of the colors that make up the checkbox gradient.

getColor

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

Returns:
Text color.
See Also:
setColor(java.awt.Color)

getDescriptionFont

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

Returns:
Font for node description.

getFont

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

Returns:
Tree font.
See Also:
setFont(java.awt.Font)

getIconSize

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.

Returns:
Icon size.
See Also:
setIconSize(java.awt.Dimension)

getIconSpace

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

Returns:
Icon space in pixels.
See Also:
setIconSpace(int)

getRowSpacing

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

Returns:
Space in pixels between rows.
See Also:
setRowSpacing(int)

isRootVisible

boolean isRootVisible()
Should be root node be drawn?

Returns:
True if the root node should be drawn.
See Also:
setRootVisible(boolean)

setCheckBoxColor

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.

Parameters:
color1 - first color in the checkbox gradient.
color2 - second color in the checkbox gradient.

setColor

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

Parameters:
textColor - New text color.
See Also:
getColor()

setDescriptionFont

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

Parameters:
font - New font for descriptions.

setFont

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

Parameters:
font - New tree font.
See Also:
getFont()

setIconSize

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

Parameters:
size - New size.
See Also:
getIconSize()

setIconSpace

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

Parameters:
iconSpace - Icon space in pixels.
See Also:
getIconSpace()

setRootVisible

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

Parameters:
visible - True if the root node should be drawn.
See Also:
isRootVisible()

setRowSpacing

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

Parameters:
spacing - Row spacing.
See Also:
getRowSpacing()

NASA World Wind