Package gov.nasa.worldwind.util.tree
Class BasicTreeAttributes
- java.lang.Object
-
- gov.nasa.worldwind.util.tree.BasicTreeAttributes
-
- All Implemented Interfaces:
TreeAttributes
public class BasicTreeAttributes extends java.lang.Object implements TreeAttributes
Basic implementation ofTreeAttributes
set.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Color
checkBoxColor1
protected java.awt.Color
checkBoxColor2
protected java.awt.Font
descriptionFont
protected java.awt.Font
font
protected java.awt.Dimension
iconSize
protected int
iconSpace
protected boolean
rootVisible
protected int
rowSpacing
protected java.awt.Color
textColor
-
Constructor Summary
Constructors Constructor Description BasicTreeAttributes()
BasicTreeAttributes(TreeAttributes attributes)
Create a new attributes object with the same configuration as an existing attributes object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(java.lang.Object o)
java.awt.Color[]
getCheckBoxColor()
Get the color of filled checkboxes that indicate if nodes are selected.java.awt.Color
getColor()
Get the color of the text in the tree.java.awt.Font
getDescriptionFont()
Get the font used to render the node description.java.awt.Font
getFont()
Get the font used to render text.java.awt.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(java.awt.Color color1, java.awt.Color color2)
Set the color of filled checkboxes that indicate if a node is selected.void
setColor(java.awt.Color textColor)
Set the color of the text in the tree.void
setDescriptionFont(java.awt.Font font)
Set the font used to render the node descriptions.void
setFont(java.awt.Font font)
Set the font used to render text.void
setIconSize(java.awt.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.
-
-
-
Field Detail
-
rootVisible
protected boolean rootVisible
-
textColor
protected java.awt.Color textColor
-
font
protected java.awt.Font font
-
descriptionFont
protected java.awt.Font descriptionFont
-
rowSpacing
protected int rowSpacing
-
checkBoxColor1
protected java.awt.Color checkBoxColor1
-
checkBoxColor2
protected java.awt.Color checkBoxColor2
-
iconSize
protected java.awt.Dimension iconSize
-
iconSpace
protected int iconSpace
-
-
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
-
isRootVisible
public boolean isRootVisible()
Should be root node be drawn?- Specified by:
isRootVisible
in interfaceTreeAttributes
- Returns:
- True if the root node should be drawn.
- See Also:
TreeAttributes.setRootVisible(boolean)
-
setRootVisible
public void setRootVisible(boolean visible)
Set the root node to visibile or not visible.- Specified by:
setRootVisible
in interfaceTreeAttributes
- Parameters:
visible
- True if the root node should be drawn.- See Also:
TreeAttributes.isRootVisible()
-
getColor
public java.awt.Color getColor()
Get the color of the text in the tree.- Specified by:
getColor
in interfaceTreeAttributes
- Returns:
- Text color.
- See Also:
TreeAttributes.setColor(java.awt.Color)
-
setColor
public void setColor(java.awt.Color textColor)
Set the color of the text in the tree.- Specified by:
setColor
in interfaceTreeAttributes
- Parameters:
textColor
- New text color.- See Also:
TreeAttributes.getColor()
-
getFont
public java.awt.Font getFont()
Get the font used to render text.- Specified by:
getFont
in interfaceTreeAttributes
- Returns:
- Tree font.
- See Also:
TreeAttributes.setFont(java.awt.Font)
-
getDescriptionFont
public java.awt.Font getDescriptionFont()
Get the font used to render the node description.- Specified by:
getDescriptionFont
in interfaceTreeAttributes
- Returns:
- Font for node description.
-
setDescriptionFont
public void setDescriptionFont(java.awt.Font font)
Set the font used to render the node descriptions.- Specified by:
setDescriptionFont
in interfaceTreeAttributes
- Parameters:
font
- New font for descriptions.
-
setFont
public void setFont(java.awt.Font font)
Set the font used to render text.- Specified by:
setFont
in interfaceTreeAttributes
- Parameters:
font
- New tree font.- See Also:
TreeAttributes.getFont()
-
getRowSpacing
public int getRowSpacing()
Get the space, in pixels, to leave between rows in the tree.- Specified by:
getRowSpacing
in interfaceTreeAttributes
- Returns:
- Space in pixels between rows.
- See Also:
TreeAttributes.setRowSpacing(int)
-
setRowSpacing
public void setRowSpacing(int spacing)
Set the space, in pixels, to leave between rows in the tree.- Specified by:
setRowSpacing
in interfaceTreeAttributes
- Parameters:
spacing
- Row spacing.- See Also:
TreeAttributes.getRowSpacing()
-
getIconSize
public java.awt.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 interfaceTreeAttributes
- Returns:
- Icon size.
- See Also:
TreeAttributes.setIconSize(java.awt.Dimension)
-
setIconSize
public void setIconSize(java.awt.Dimension iconSize)
Set the size of each icon in the tree.- Specified by:
setIconSize
in interfaceTreeAttributes
- Parameters:
iconSize
- New size.- See Also:
TreeAttributes.getIconSize()
-
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 interfaceTreeAttributes
- Returns:
- Icon space in pixels.
- See Also:
TreeAttributes.setIconSpace(int)
-
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 interfaceTreeAttributes
- Parameters:
iconSpace
- Icon space in pixels.- See Also:
TreeAttributes.getIconSpace()
-
getCheckBoxColor
public java.awt.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 interfaceTreeAttributes
- Returns:
- two element array of the colors that make up the checkbox gradient.
-
setCheckBoxColor
public void setCheckBoxColor(java.awt.Color color1, java.awt.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 interfaceTreeAttributes
- Parameters:
color1
- first color in the checkbox gradient.color2
- second color in the checkbox gradient.
-
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 interfaceTreeAttributes
- 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 interfaceTreeAttributes
- Parameters:
attributes
- the attributes to copy.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-