net.sourceforge.chart2d
Class Object2DProperties

java.lang.Object
  |
  +--net.sourceforge.chart2d.Properties
        |
        +--net.sourceforge.chart2d.Object2DProperties

public final class Object2DProperties
extends net.sourceforge.chart2d.Properties

A data structure for holding the properties common to all Object2D objects. A Object2D object is one with an encolosing area and title. Pass this to any number of Object2D objects.


Field Summary
static int BOTTOM
          Signifies bottom.
static int LEFT
          Signifies left.
static int NONE
          Signifies none.
static java.awt.Color OBJECT_BACKGROUND_COLOR_DEFAULT
          The default is new Color (215, 215, 215).
static boolean OBJECT_BACKGROUND_EXISTENCE_DEFAULT
          The default is true.
static int OBJECT_BACKGROUND_LIGHT_SOURCE_DEFAULT
          The default is TOP.
static java.awt.Color OBJECT_BORDER_COLOR_DEFAULT
          The default is Color.black.
static boolean OBJECT_BORDER_EXISTENCE_DEFAULT
          The default is true.
static int OBJECT_BORDER_THICKNESS_MODEL_DEFAULT
          The default is 2.
static boolean OBJECT_GAP_EXISTENCE_DEFAULT
          The default is true.
static int OBJECT_GAP_THICKNESS_MODEL_DEFAULT
          The default is 5.
static boolean OBJECT_MAGNIFY_WHEN_RESIZE_DEFAULT
          The default is true.
static boolean OBJECT_TITLE_BETWEEN_REST_GAP_EXISTENCE_DEFAULT
          The default is true.
static int OBJECT_TITLE_BETWEEN_REST_GAP_THICKNESS_MODEL_DEFAULT
          The default is 3.
static boolean OBJECT_TITLE_EXISTENCE_DEFAULT
          The default is true.
static java.awt.Color OBJECT_TITLE_FONT_COLOR_DEFAULT
          The default is Color.black.
static java.lang.String OBJECT_TITLE_FONT_NAME_DEFAULT
          The default is "SansSerif".
static int OBJECT_TITLE_FONT_POINT_MODEL_DEFAULT
          The default is 12.
static int OBJECT_TITLE_FONT_STYLE_DEFAULT
          The default is Font.PLAIN.
static java.lang.String OBJECT_TITLE_TEXT_DEFAULT
          The default is "".
static int RIGHT
          Signifies right.
static int TOP
          Signifies top.
 
Constructor Summary
Object2DProperties()
          Creates a Object2DProperties object with the documented default values.
Object2DProperties(net.sourceforge.chart2d.Object2DProperties object2DProps)
          Creates a Object2DProperties object with property values copied from another object.
 
Method Summary
 java.awt.Color getObjectBackgroundColor()
          Gets the color of the background for the object.
 boolean getObjectBackgroundExistence()
          Gets whether the object will have a painted background or not.
 int getObjectBackgroundLightSource()
          Gets the light source of the object's background.
 java.awt.Color getObjectBorderColor()
          Gets the color of the object's border.
 boolean getObjectBorderExistence()
          Gets whether a border around the object will exist.
 int getObjectBorderThicknessModel()
          Gets the thickness of the border for the model size of the object.
 boolean getObjectGapExistence()
          Gets whether a gap between the border or edge of the object and the object's interior components exists.
 int getObjectGapThicknessModel()
          Gets the thickness of the object's gap for the model size of the object.
 boolean getObjectMagnifyWhenResize()
          Gets whether a object's components will grow or shrink as the size of the space allocated to the object grows or shrinks.
 boolean getObjectTitleBetweenRestGapExistence()
          Gets whether a gap below the title and the rest of the object's components exists.
 int getObjectTitleBetweenRestGapThicknessModel()
          Gets the thickness of the gap below the title and the rest of the object's components for the object's model size.
 boolean getObjectTitleExistence()
          Gets whether the object is to have a title.
 java.awt.Color getObjectTitleFontColor()
          Gets the color of the font for the object's title.
 java.lang.String getObjectTitleFontName()
          Gets the name of the font for the object's title.
 int getObjectTitleFontPointModel()
          Gets the point of the font of the title for the object at its model size.
 int getObjectTitleFontStyle()
          Gets the style of the font for the object's title.
 java.lang.String getObjectTitleText()
          Gets the text for the object's title.
 boolean isFontNameExists(java.lang.String name)
          Returns true if the font name exists in the graphics enviornment.
 void setObject2DProperties(net.sourceforge.chart2d.Object2DProperties object2DProps)
          Sets all properties to be the values of another Object2DProperties object.
 void setObject2DPropertiesToDefaults()
          Sets all properties to their default values.
 void setObjectBackgroundColor(java.awt.Color color)
          Sets the color of the background for the object.
 void setObjectBackgroundExistence(boolean existence)
          Sets whether the object will have a painted background or not.
 void setObjectBackgroundLightSource(int source)
          Sets the light source of the object's background.
 void setObjectBorderColor(java.awt.Color color)
          Sets the color of the object's border.
 void setObjectBorderExistence(boolean existence)
          Sets whether a border around the object will exist.
 void setObjectBorderThicknessModel(int thickness)
          Sets the thickness of the border for the model size of the object.
 void setObjectGapExistence(boolean existence)
          Sets whether a gap between the border or edge of the object and the object's interior components exists.
 void setObjectGapThicknessModel(int thickness)
          Sets the thickness of the object's gap for the model size of the object.
 void setObjectMagnifyWhenResize(boolean magnify)
          Sets whether a object's components will grow or shrink as the size of the space allocated to the object grows or shrinks.
 void setObjectTitleBetweenRestGapExistence(boolean existence)
          Sets whether a gap below the title and the rest of the object's components exists.
 void setObjectTitleBetweenRestGapThicknessModel(int thickness)
          Sets the thickness of the gap below the title and the rest of the object's components for the object's model size.
 void setObjectTitleExistence(boolean existence)
          Sets whether the object is to have a title.
 void setObjectTitleFontColor(java.awt.Color color)
          Sets the color of the font for the object's title.
 void setObjectTitleFontName(java.lang.String name)
          Sets the name of the font for the object's title.
 void setObjectTitleFontPointModel(int point)
          Sets the point of the font of the title for the object at its model size.
 void setObjectTitleFontStyle(int style)
          Sets the style of the font for the object's title.
 void setObjectTitleText(java.lang.String text)
          Sets the text for the object's title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
Signifies left.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Signifies right.

See Also:
Constant Field Values

TOP

public static final int TOP
Signifies top.

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Signifies bottom.

See Also:
Constant Field Values

NONE

public static final int NONE
Signifies none.

See Also:
Constant Field Values

OBJECT_MAGNIFY_WHEN_RESIZE_DEFAULT

public static final boolean OBJECT_MAGNIFY_WHEN_RESIZE_DEFAULT
The default is true.

See Also:
Constant Field Values

OBJECT_BORDER_EXISTENCE_DEFAULT

public static final boolean OBJECT_BORDER_EXISTENCE_DEFAULT
The default is true.

See Also:
Constant Field Values

OBJECT_BORDER_THICKNESS_MODEL_DEFAULT

public static final int OBJECT_BORDER_THICKNESS_MODEL_DEFAULT
The default is 2.

See Also:
Constant Field Values

OBJECT_BORDER_COLOR_DEFAULT

public static final java.awt.Color OBJECT_BORDER_COLOR_DEFAULT
The default is Color.black.


OBJECT_GAP_EXISTENCE_DEFAULT

public static final boolean OBJECT_GAP_EXISTENCE_DEFAULT
The default is true.

See Also:
Constant Field Values

OBJECT_GAP_THICKNESS_MODEL_DEFAULT

public static final int OBJECT_GAP_THICKNESS_MODEL_DEFAULT
The default is 5.

See Also:
Constant Field Values

OBJECT_BACKGROUND_EXISTENCE_DEFAULT

public static final boolean OBJECT_BACKGROUND_EXISTENCE_DEFAULT
The default is true.

See Also:
Constant Field Values

OBJECT_BACKGROUND_COLOR_DEFAULT

public static final java.awt.Color OBJECT_BACKGROUND_COLOR_DEFAULT
The default is new Color (215, 215, 215).


OBJECT_BACKGROUND_LIGHT_SOURCE_DEFAULT

public static final int OBJECT_BACKGROUND_LIGHT_SOURCE_DEFAULT
The default is TOP.

See Also:
Constant Field Values

OBJECT_TITLE_EXISTENCE_DEFAULT

public static final boolean OBJECT_TITLE_EXISTENCE_DEFAULT
The default is true.

See Also:
Constant Field Values

OBJECT_TITLE_TEXT_DEFAULT

public static final java.lang.String OBJECT_TITLE_TEXT_DEFAULT
The default is "".

See Also:
Constant Field Values

OBJECT_TITLE_FONT_POINT_MODEL_DEFAULT

public static final int OBJECT_TITLE_FONT_POINT_MODEL_DEFAULT
The default is 12.

See Also:
Constant Field Values

OBJECT_TITLE_FONT_NAME_DEFAULT

public static final java.lang.String OBJECT_TITLE_FONT_NAME_DEFAULT
The default is "SansSerif".

See Also:
Constant Field Values

OBJECT_TITLE_FONT_COLOR_DEFAULT

public static final java.awt.Color OBJECT_TITLE_FONT_COLOR_DEFAULT
The default is Color.black.


OBJECT_TITLE_FONT_STYLE_DEFAULT

public static final int OBJECT_TITLE_FONT_STYLE_DEFAULT
The default is Font.PLAIN.

See Also:
Constant Field Values

OBJECT_TITLE_BETWEEN_REST_GAP_EXISTENCE_DEFAULT

public static final boolean OBJECT_TITLE_BETWEEN_REST_GAP_EXISTENCE_DEFAULT
The default is true.

See Also:
Constant Field Values

OBJECT_TITLE_BETWEEN_REST_GAP_THICKNESS_MODEL_DEFAULT

public static final int OBJECT_TITLE_BETWEEN_REST_GAP_THICKNESS_MODEL_DEFAULT
The default is 3.

See Also:
Constant Field Values
Constructor Detail

Object2DProperties

public Object2DProperties()
Creates a Object2DProperties object with the documented default values.


Object2DProperties

public Object2DProperties(net.sourceforge.chart2d.Object2DProperties object2DProps)
Creates a Object2DProperties object with property values copied from another object. The copying is a deep copy.

Parameters:
object2DProps - The properties to copy.
Method Detail

setObject2DPropertiesToDefaults

public final void setObject2DPropertiesToDefaults()
Sets all properties to their default values.


setObject2DProperties

public final void setObject2DProperties(net.sourceforge.chart2d.Object2DProperties object2DProps)
Sets all properties to be the values of another Object2DProperties object. The copying is a deep copy.

Parameters:
object2DProps - The properties to copy.

setObjectMagnifyWhenResize

public final void setObjectMagnifyWhenResize(boolean magnify)
Sets whether a object's components will grow or shrink as the size of the space allocated to the object grows or shrinks. The Object's preferred size will be the model size (i.e. the size at which it isn't magnified).

Parameters:
magnify - If true, the object will be magnified on resize.

setObjectBorderExistence

public final void setObjectBorderExistence(boolean existence)
Sets whether a border around the object will exist.

Parameters:
existence - If true, then a object border exists.

setObjectBorderThicknessModel

public final void setObjectBorderThicknessModel(int thickness)
Sets the thickness of the border for the model size of the object.

Parameters:
thickness - The model thickness of the object's border.

setObjectBorderColor

public final void setObjectBorderColor(java.awt.Color color)
Sets the color of the object's border.

Parameters:
color - The color of the border.

setObjectGapExistence

public final void setObjectGapExistence(boolean existence)
Sets whether a gap between the border or edge of the object and the object's interior components exists.

Parameters:
existence - If true, then a gap exists.

setObjectGapThicknessModel

public final void setObjectGapThicknessModel(int thickness)
Sets the thickness of the object's gap for the model size of the object.

Parameters:
thickness - The model thickness of the object's gap.

setObjectBackgroundExistence

public final void setObjectBackgroundExistence(boolean existence)
Sets whether the object will have a painted background or not. If not, then the background of the content pane to which the object was added will show through which by default is gray, or if the object was not added to a content pane but only a BufferedImage of the object is obtained, then the background will be the default background of BufferedImage which is black. The existence of a background can improve performance considerably.

Parameters:
existence - If true, a background for the object will be painted.

setObjectBackgroundColor

public final void setObjectBackgroundColor(java.awt.Color color)
Sets the color of the background for the object.

Parameters:
color - The color of the object's background.

setObjectBackgroundLightSource

public final void setObjectBackgroundLightSource(int source)
Sets the light source of the object's background. If there is a light source, the side of the source will be one shade brighter than the specified background color. Use the TOP, BOTTOM, LEFT, RIGHT, and NONE fields.

Parameters:
source - The source of the light.

setObjectTitleExistence

public final void setObjectTitleExistence(boolean existence)
Sets whether the object is to have a title.

Parameters:
existence - If true, then the object will have a title.

setObjectTitleText

public final void setObjectTitleText(java.lang.String text)
Sets the text for the object's title.

Parameters:
text - The text for the object's title.

setObjectTitleFontPointModel

public final void setObjectTitleFontPointModel(int point)
Sets the point of the font of the title for the object at its model size.

Parameters:
point - The model font point for the object's title.

setObjectTitleFontName

public final void setObjectTitleFontName(java.lang.String name)
Sets the name of the font for the object's title. Accepts all values accepted by java.awt.Font.

Parameters:
name - The name of the font for the object's title.

setObjectTitleFontColor

public final void setObjectTitleFontColor(java.awt.Color color)
Sets the color of the font for the object's title.

Parameters:
color - The color of the font for the object's title.

setObjectTitleFontStyle

public final void setObjectTitleFontStyle(int style)
Sets the style of the font for the object's title. Accepts all values that java.awt.Font accepts.

Parameters:
style - The style of the font for the object's title.

setObjectTitleBetweenRestGapExistence

public final void setObjectTitleBetweenRestGapExistence(boolean existence)
Sets whether a gap below the title and the rest of the object's components exists.

Parameters:
existence - If true, then a gap exists.

setObjectTitleBetweenRestGapThicknessModel

public final void setObjectTitleBetweenRestGapThicknessModel(int thickness)
Sets the thickness of the gap below the title and the rest of the object's components for the object's model size.

Parameters:
thickness - The model thickness of the gap.

getObjectMagnifyWhenResize

public final boolean getObjectMagnifyWhenResize()
Gets whether a object's components will grow or shrink as the size of the space allocated to the object grows or shrinks.

Returns:
If true, the object will be magnified on resize.

getObjectBorderExistence

public final boolean getObjectBorderExistence()
Gets whether a border around the object will exist.

Returns:
If true, then a object border exists.

getObjectBorderThicknessModel

public final int getObjectBorderThicknessModel()
Gets the thickness of the border for the model size of the object.

Returns:
The model thickness of the object's border.

getObjectBorderColor

public final java.awt.Color getObjectBorderColor()
Gets the color of the object's border.

Returns:
The color of the border.

getObjectGapExistence

public final boolean getObjectGapExistence()
Gets whether a gap between the border or edge of the object and the object's interior components exists.

Returns:
If true, then a gap exists.

getObjectGapThicknessModel

public final int getObjectGapThicknessModel()
Gets the thickness of the object's gap for the model size of the object.

Returns:
The model thickness of the object's gap.

getObjectBackgroundExistence

public final boolean getObjectBackgroundExistence()
Gets whether the object will have a painted background or not. If not, then the background of the content pane to which the object was added will show through which by default is gray, or if the object was not added to a content pane but only a BufferedImage of the object is obtained, then the background will be the default background of BufferedImage which is black. Painting the background improves performance considerably.

Returns:
If true, a background for the object will be painted.

getObjectBackgroundColor

public final java.awt.Color getObjectBackgroundColor()
Gets the color of the background for the object.

Returns:
The color of the object's background.

getObjectBackgroundLightSource

public final int getObjectBackgroundLightSource()
Gets the light source of the object's background. If there is a light source, the side of the source will be one shade brighter than the specified background color. Use the TOP, BOTTOM, LEFT, RIGHT, and NONE fields.

Returns:
The source of the light.

getObjectTitleExistence

public final boolean getObjectTitleExistence()
Gets whether the object is to have a title.

Returns:
If true, then the object will have a title.

getObjectTitleText

public final java.lang.String getObjectTitleText()
Gets the text for the object's title.

Returns:
The text for the object's title.

getObjectTitleFontPointModel

public final int getObjectTitleFontPointModel()
Gets the point of the font of the title for the object at its model size.

Returns:
The model font point for the object's title.

getObjectTitleFontName

public final java.lang.String getObjectTitleFontName()
Gets the name of the font for the object's title. Accepts all values accepted by java.awt.Font.

Returns:
The name of the font for the object's title.

getObjectTitleFontColor

public final java.awt.Color getObjectTitleFontColor()
Gets the color of the font for the object's title.

Returns:
The color of the font for the object's title.

getObjectTitleFontStyle

public final int getObjectTitleFontStyle()
Gets the style of the font for the object's title. Accepts all values that java.awt.Font accepts.

Returns:
The style of the font for the object's title.

getObjectTitleBetweenRestGapExistence

public final boolean getObjectTitleBetweenRestGapExistence()
Gets whether a gap below the title and the rest of the object's components exists.

Returns:
If true, then a gap exists.

getObjectTitleBetweenRestGapThicknessModel

public final int getObjectTitleBetweenRestGapThicknessModel()
Gets the thickness of the gap below the title and the rest of the object's components for the object's model size.

Returns:
The model thickness of the gap.

isFontNameExists

public final boolean isFontNameExists(java.lang.String name)
Returns true if the font name exists in the graphics enviornment.

Parameters:
name - The name of the font to determine the existence of.
Returns:
boolean If true, then the font name exists.