Package gov.nasa.worldwind.util.tree
Class BasicFrameAttributes
- java.lang.Object
-
- gov.nasa.worldwind.util.tree.BasicFrameAttributes
-
- All Implemented Interfaces:
FrameAttributes
public class BasicFrameAttributes extends java.lang.Object implements FrameAttributes
Basic implementation ofFrameAttributes
set.
-
-
Field Summary
Fields Modifier and Type Field Description protected double
backgroundOpacity
protected int
cornerRadius
protected java.awt.Font
font
protected java.awt.Color
foregroundColor
protected double
foregroundOpacity
protected java.awt.Color
frameColor1
protected java.awt.Color
frameColor2
protected java.awt.Dimension
iconSize
protected int
iconSpace
protected java.awt.Color
minimizeButtonColor
protected java.awt.Color
scrollBarColor1
protected java.awt.Color
scrollBarColor2
protected java.awt.Color
textColor
protected java.awt.Color
titleBarColor1
protected java.awt.Color
titleBarColor2
-
Constructor Summary
Constructors Constructor Description BasicFrameAttributes()
BasicFrameAttributes(BasicFrameAttributes 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 BasicFrameAttributes
copy()
Returns a new FrameAttributes instance of the same type as this FrameAttributes, who's properties are configured exactly as this FrameAttributes.void
copy(FrameAttributes attributes)
Copies the specified FrameAttributes' properties into this object's properties.boolean
equals(java.lang.Object o)
java.awt.Color[]
getBackgroundColor()
Get the colors that make up the frame's background gradient.double
getBackgroundOpacity()
Get the opacity of the frame.int
getCornerRadius()
Get the radius of the frame corners.java.awt.Font
getFont()
Get the font used to render text.java.awt.Color
getForegroundColor()
Get the color of the text in the frame.double
getForegroundOpacity()
Get the opacity of the text and images in the frame.java.awt.Dimension
getIconSize()
Get the size of the icon in the frame title bar.int
getIconSpace()
Get the amount of space, in pixels, to leave between an icon in the frame and surrounding text and shapes.java.awt.Color
getMinimizeButtonColor()
Get the color of the minimize button drawn in the upper right corner of the frame.java.awt.Color[]
getScrollBarColor()
Get the colors used to draw the frame's scroll bars.java.awt.Color
getTextColor()
Get the color of the text in the frame title bar.java.awt.Color[]
getTitleBarColor()
Get the colors that make up the frame's title bar gradient.int
hashCode()
void
setBackgroundColor(java.awt.Color frameColor1, java.awt.Color frameColor2)
Set the colors in the background gradient of the frame.void
setBackgroundOpacity(double frameOpacity)
Set the opacity of the frame.void
setCornerRadius(int cornerRadius)
Set the radius of the frame corners.void
setFont(java.awt.Font font)
Set the font used to render text.void
setForegroundColor(java.awt.Color textColor)
Set the color of the text in the frame.void
setForegroundOpacity(double textOpacity)
Set the opacity of the frame text and images.void
setIconSize(java.awt.Dimension iconSize)
Set the size of each icon in the frame title bar.void
setIconSpace(int iconSpace)
Set the amount of space, in pixels, to leave between an icon in the frame and surrounding text and shapes.void
setMinimizeButtonColor(java.awt.Color minimizeButtonColor)
Set the color of the minimize button drawn in the upper right corner of the frame.void
setScrollBarColor(java.awt.Color color1, java.awt.Color color2)
Set the colors in the scroll bar gradient.void
setTextColor(java.awt.Color textColor)
Set the color of the text in the frame title bar.void
setTitleBarColor(java.awt.Color color1, java.awt.Color color2)
Set the colors in the title bar gradient.
-
-
-
Field Detail
-
backgroundOpacity
protected double backgroundOpacity
-
frameColor1
protected java.awt.Color frameColor1
-
frameColor2
protected java.awt.Color frameColor2
-
titleBarColor1
protected java.awt.Color titleBarColor1
-
titleBarColor2
protected java.awt.Color titleBarColor2
-
scrollBarColor1
protected java.awt.Color scrollBarColor1
-
scrollBarColor2
protected java.awt.Color scrollBarColor2
-
minimizeButtonColor
protected java.awt.Color minimizeButtonColor
-
foregroundOpacity
protected double foregroundOpacity
-
foregroundColor
protected java.awt.Color foregroundColor
-
textColor
protected java.awt.Color textColor
-
font
protected java.awt.Font font
-
iconSize
protected java.awt.Dimension iconSize
-
iconSpace
protected int iconSpace
-
cornerRadius
protected int cornerRadius
-
-
Constructor Detail
-
BasicFrameAttributes
public BasicFrameAttributes()
-
BasicFrameAttributes
public BasicFrameAttributes(BasicFrameAttributes attributes)
Create a new attributes object with the same configuration as an existing attributes object.- Parameters:
attributes
- Object to copy configuration from.
-
-
Method Detail
-
getForegroundColor
public java.awt.Color getForegroundColor()
Get the color of the text in the frame.- Specified by:
getForegroundColor
in interfaceFrameAttributes
- Returns:
- The foreground color.
- See Also:
FrameAttributes.setForegroundColor(java.awt.Color)
-
setForegroundColor
public void setForegroundColor(java.awt.Color textColor)
Set the color of the text in the frame.- Specified by:
setForegroundColor
in interfaceFrameAttributes
- Parameters:
textColor
- New foreground color.- See Also:
FrameAttributes.getForegroundColor()
-
getFont
public java.awt.Font getFont()
Get the font used to render text.- Specified by:
getFont
in interfaceFrameAttributes
- Returns:
- frame font.
- See Also:
FrameAttributes.setFont(java.awt.Font)
-
setFont
public void setFont(java.awt.Font font)
Set the font used to render text.- Specified by:
setFont
in interfaceFrameAttributes
- Parameters:
font
- New frame font.- See Also:
FrameAttributes.getFont()
-
getTextColor
public java.awt.Color getTextColor()
Get the color of the text in the frame title bar.- Specified by:
getTextColor
in interfaceFrameAttributes
- Returns:
- The color of text in the tree frame.
-
setTextColor
public void setTextColor(java.awt.Color textColor)
Set the color of the text in the frame title bar.- Specified by:
setTextColor
in interfaceFrameAttributes
- Parameters:
textColor
- The new color of text in the tree frame.
-
getIconSize
public java.awt.Dimension getIconSize()
Get the size of the icon in the frame title bar.- Specified by:
getIconSize
in interfaceFrameAttributes
- Returns:
- Icon size.
- See Also:
FrameAttributes.setIconSize(java.awt.Dimension)
-
setIconSize
public void setIconSize(java.awt.Dimension iconSize)
Set the size of each icon in the frame title bar.- Specified by:
setIconSize
in interfaceFrameAttributes
- Parameters:
iconSize
- New size.- See Also:
FrameAttributes.getIconSize()
-
getIconSpace
public int getIconSpace()
Get the amount of space, in pixels, to leave between an icon in the frame and surrounding text and shapes.- Specified by:
getIconSpace
in interfaceFrameAttributes
- Returns:
- Icon space in pixels.
- See Also:
FrameAttributes.setIconSpace(int)
-
setIconSpace
public void setIconSpace(int iconSpace)
Set the amount of space, in pixels, to leave between an icon in the frame and surrounding text and shapes.- Specified by:
setIconSpace
in interfaceFrameAttributes
- Parameters:
iconSpace
- Icon space in pixels.- See Also:
FrameAttributes.getIconSpace()
-
getForegroundOpacity
public double getForegroundOpacity()
Get the opacity of the text and images in the frame.- Specified by:
getForegroundOpacity
in interfaceFrameAttributes
- Returns:
- Opacity of text and images.
- See Also:
FrameAttributes.setForegroundOpacity(double)
,FrameAttributes.getBackgroundOpacity()
-
setForegroundOpacity
public void setForegroundOpacity(double textOpacity)
Set the opacity of the frame text and images.- Specified by:
setForegroundOpacity
in interfaceFrameAttributes
- Parameters:
textOpacity
- New opacity.- See Also:
FrameAttributes.getForegroundOpacity()
,FrameAttributes.setBackgroundOpacity(double)
-
getBackgroundOpacity
public double getBackgroundOpacity()
Get the opacity of the frame.- Specified by:
getBackgroundOpacity
in interfaceFrameAttributes
- Returns:
- Frame opacity.
- See Also:
FrameAttributes.setBackgroundOpacity(double)
-
setBackgroundOpacity
public void setBackgroundOpacity(double frameOpacity)
Set the opacity of the frame.- Specified by:
setBackgroundOpacity
in interfaceFrameAttributes
- Parameters:
frameOpacity
- New frame opacity.- See Also:
FrameAttributes.getBackgroundOpacity()
-
getBackgroundColor
public java.awt.Color[] getBackgroundColor()
Get the colors that make up the frame's background gradient.- Specified by:
getBackgroundColor
in interfaceFrameAttributes
- Returns:
- Two element array containing the colors in the background gradient.
- See Also:
FrameAttributes.setBackgroundColor(java.awt.Color, java.awt.Color)
-
setTitleBarColor
public void setTitleBarColor(java.awt.Color color1, java.awt.Color color2)
Set the colors in the title bar gradient.- Specified by:
setTitleBarColor
in interfaceFrameAttributes
- Parameters:
color1
- First color in the title bar gradient.color2
- Second color in the title bar gradient.- See Also:
FrameAttributes.getTitleBarColor()
-
getTitleBarColor
public java.awt.Color[] getTitleBarColor()
Get the colors that make up the frame's title bar gradient.- Specified by:
getTitleBarColor
in interfaceFrameAttributes
- Returns:
- Two element array containing the colors in the title bar gradient.
- See Also:
FrameAttributes.setTitleBarColor(java.awt.Color, java.awt.Color)
-
getScrollBarColor
public java.awt.Color[] getScrollBarColor()
Get the colors used to draw the frame's scroll bars.- Specified by:
getScrollBarColor
in interfaceFrameAttributes
- Returns:
- Two element array containing the colors in the scroll bar gradient.
- See Also:
FrameAttributes.setScrollBarColor(java.awt.Color, java.awt.Color)
-
setScrollBarColor
public void setScrollBarColor(java.awt.Color color1, java.awt.Color color2)
Set the colors in the scroll bar gradient.- Specified by:
setScrollBarColor
in interfaceFrameAttributes
- Parameters:
color1
- First color in the scroll bar gradient.color2
- Second color in the scroll bar gradient.- See Also:
FrameAttributes.getScrollBarColor()
-
getMinimizeButtonColor
public java.awt.Color getMinimizeButtonColor()
Get the color of the minimize button drawn in the upper right corner of the frame.- Specified by:
getMinimizeButtonColor
in interfaceFrameAttributes
- Returns:
- Color of the minimize button.
-
setMinimizeButtonColor
public void setMinimizeButtonColor(java.awt.Color minimizeButtonColor)
Set the color of the minimize button drawn in the upper right corner of the frame.- Specified by:
setMinimizeButtonColor
in interfaceFrameAttributes
- Parameters:
minimizeButtonColor
- Color of the minimize button.
-
setBackgroundColor
public void setBackgroundColor(java.awt.Color frameColor1, java.awt.Color frameColor2)
Set the colors in the background gradient of the frame.- Specified by:
setBackgroundColor
in interfaceFrameAttributes
- Parameters:
frameColor1
- First color in frame gradient.frameColor2
- Second color in frame gradient.- See Also:
FrameAttributes.getBackgroundColor()
-
getCornerRadius
public int getCornerRadius()
Get the radius of the frame corners. A value ofzero
means square corners.- Specified by:
getCornerRadius
in interfaceFrameAttributes
- Returns:
- The radius of the frame corners, in pixels.
-
setCornerRadius
public void setCornerRadius(int cornerRadius)
Set the radius of the frame corners.- Specified by:
setCornerRadius
in interfaceFrameAttributes
- Parameters:
cornerRadius
- New radius, in pixels. A value ofzero
means square corners.
-
copy
public BasicFrameAttributes copy()
Returns a new FrameAttributes instance of the same type as this FrameAttributes, who's properties are configured exactly as this FrameAttributes.- Specified by:
copy
in interfaceFrameAttributes
- Returns:
- a copy of this FrameAttributes.
-
copy
public void copy(FrameAttributes attributes)
Copies the specified FrameAttributes' properties into this object's properties. This does nothing if the specified attributes is null.- Specified by:
copy
in interfaceFrameAttributes
- 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
-
-