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 ofTreeAttributesset.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.ColorcheckBoxColor1protected java.awt.ColorcheckBoxColor2protected java.awt.FontdescriptionFontprotected java.awt.Fontfontprotected java.awt.DimensioniconSizeprotected inticonSpaceprotected booleanrootVisibleprotected introwSpacingprotected java.awt.ColortextColor
-
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 BasicTreeAttributescopy()Returns a new TreeAttributes instance of the same type as this TreeAttributes, who's properties are configured exactly as this TreeAttributes.voidcopy(TreeAttributes attributes)Copies the specified TreeAttributes' properties into this object's properties.booleanequals(java.lang.Object o)java.awt.Color[]getCheckBoxColor()Get the color of filled checkboxes that indicate if nodes are selected.java.awt.ColorgetColor()Get the color of the text in the tree.java.awt.FontgetDescriptionFont()Get the font used to render the node description.java.awt.FontgetFont()Get the font used to render text.java.awt.DimensiongetIconSize()Get the size of each icon in the tree.intgetIconSpace()Get the amount of space, in pixels, to leave between an icon in the tree and surrounding text and shapes.intgetRowSpacing()Get the space, in pixels, to leave between rows in the tree.inthashCode()booleanisRootVisible()Should be root node be drawn?voidsetCheckBoxColor(java.awt.Color color1, java.awt.Color color2)Set the color of filled checkboxes that indicate if a node is selected.voidsetColor(java.awt.Color textColor)Set the color of the text in the tree.voidsetDescriptionFont(java.awt.Font font)Set the font used to render the node descriptions.voidsetFont(java.awt.Font font)Set the font used to render text.voidsetIconSize(java.awt.Dimension iconSize)Set the size of each icon in the tree.voidsetIconSpace(int iconSpace)Set the amount of space, in pixels, to leave between an icon in the tree and surrounding text and shapes.voidsetRootVisible(boolean visible)Set the root node to visibile or not visible.voidsetRowSpacing(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:
isRootVisiblein 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:
setRootVisiblein 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:
getColorin 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:
setColorin 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:
getFontin 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:
getDescriptionFontin 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:
setDescriptionFontin interfaceTreeAttributes- Parameters:
font- New font for descriptions.
-
setFont
public void setFont(java.awt.Font font)
Set the font used to render text.- Specified by:
setFontin 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:
getRowSpacingin 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:
setRowSpacingin 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:
getIconSizein 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:
setIconSizein 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:
getIconSpacein 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:
setIconSpacein 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:
getCheckBoxColorin 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:
setCheckBoxColorin 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:
copyin 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:
copyin interfaceTreeAttributes- Parameters:
attributes- the attributes to copy.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-