Package net.sourceforge.chart2d
Class Object2DProperties
java.lang.Object
net.sourceforge.chart2d.Object2DProperties
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
FieldsModifier and TypeFieldDescriptionstatic final intSignifies bottom.static final intSignifies left.static final intSignifies none.static final ColorThe default is new Color (215, 215, 215).static final booleanThe default is true.static final intThe default is TOP.static final ColorThe default is Color.black.static final booleanThe default is true.static final intThe default is 2.static final booleanThe default is true.static final intThe default is 5.static final booleanThe default is true.static final booleanThe default is true.static final intThe default is 3.static final booleanThe default is true.static final ColorThe default is Color.black.static final StringThe default is "SansSerif".static final intThe default is 12.static final intThe default is Font.PLAIN.static final StringThe default is "".static final intSignifies right.static final intSignifies top. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a Object2DProperties object with the documented default values.Object2DProperties(Object2DProperties object2DProps) Creates a Object2DProperties object with property values copied from another object. -
Method Summary
Modifier and TypeMethodDescriptionfinal ColorGets the color of the background for the object.final booleanGets whether the object will have a painted background or not.final intGets the light source of the object's background.final ColorGets the color of the object's border.final booleanGets whether a border around the object will exist.final intGets the thickness of the border for the model size of the object.final booleanGets whether a gap between the border or edge of the object and the object's interior components exists.final intGets the thickness of the object's gap for the model size of the object.final booleanGets whether a object's components will grow or shrink as the size of the space allocated to the object grows or shrinks.final booleanGets whether a gap below the title and the rest of the object's components exists.final intGets the thickness of the gap below the title and the rest of the object's components for the object's model size.final booleanGets whether the object is to have a title.final ColorGets the color of the font for the object's title.final StringGets the name of the font for the object's title.final intGets the point of the font of the title for the object at its model size.final intGets the style of the font for the object's title.final StringGets the text for the object's title.final booleanisFontNameExists(String name) Returns true if the font name exists in the graphics enviornment.final voidsetObject2DProperties(Object2DProperties object2DProps) Sets all properties to be the values of another Object2DProperties object.final voidSets all properties to their default values.final voidsetObjectBackgroundColor(Color color) Sets the color of the background for the object.final voidsetObjectBackgroundExistence(boolean existence) Sets whether the object will have a painted background or not.final voidsetObjectBackgroundLightSource(int source) Sets the light source of the object's background.final voidsetObjectBorderColor(Color color) Sets the color of the object's border.final voidsetObjectBorderExistence(boolean existence) Sets whether a border around the object will exist.final voidsetObjectBorderThicknessModel(int thickness) Sets the thickness of the border for the model size of the object.final voidsetObjectGapExistence(boolean existence) Sets whether a gap between the border or edge of the object and the object's interior components exists.final voidsetObjectGapThicknessModel(int thickness) Sets the thickness of the object's gap for the model size of the object.final voidsetObjectMagnifyWhenResize(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.final voidsetObjectTitleBetweenRestGapExistence(boolean existence) Sets whether a gap below the title and the rest of the object's components exists.final voidsetObjectTitleBetweenRestGapThicknessModel(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.final voidsetObjectTitleExistence(boolean existence) Sets whether the object is to have a title.final voidsetObjectTitleFontColor(Color color) Sets the color of the font for the object's title.final voidsetObjectTitleFontName(String name) Sets the name of the font for the object's title.final voidsetObjectTitleFontPointModel(int point) Sets the point of the font of the title for the object at its model size.final voidsetObjectTitleFontStyle(int style) Sets the style of the font for the object's title.final voidsetObjectTitleText(String text) Sets the text for the object's title.
-
Field Details
-
LEFT
public static final int LEFTSignifies left.- See Also:
-
RIGHT
public static final int RIGHTSignifies right.- See Also:
-
TOP
public static final int TOPSignifies top.- See Also:
-
BOTTOM
public static final int BOTTOMSignifies bottom.- See Also:
-
NONE
public static final int NONESignifies none.- See Also:
-
OBJECT_MAGNIFY_WHEN_RESIZE_DEFAULT
public static final boolean OBJECT_MAGNIFY_WHEN_RESIZE_DEFAULTThe default is true.- See Also:
-
OBJECT_BORDER_EXISTENCE_DEFAULT
public static final boolean OBJECT_BORDER_EXISTENCE_DEFAULTThe default is true.- See Also:
-
OBJECT_BORDER_THICKNESS_MODEL_DEFAULT
public static final int OBJECT_BORDER_THICKNESS_MODEL_DEFAULTThe default is 2.- See Also:
-
OBJECT_BORDER_COLOR_DEFAULT
The default is Color.black. -
OBJECT_GAP_EXISTENCE_DEFAULT
public static final boolean OBJECT_GAP_EXISTENCE_DEFAULTThe default is true.- See Also:
-
OBJECT_GAP_THICKNESS_MODEL_DEFAULT
public static final int OBJECT_GAP_THICKNESS_MODEL_DEFAULTThe default is 5.- See Also:
-
OBJECT_BACKGROUND_EXISTENCE_DEFAULT
public static final boolean OBJECT_BACKGROUND_EXISTENCE_DEFAULTThe default is true.- See Also:
-
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_DEFAULTThe default is TOP.- See Also:
-
OBJECT_TITLE_EXISTENCE_DEFAULT
public static final boolean OBJECT_TITLE_EXISTENCE_DEFAULTThe default is true.- See Also:
-
OBJECT_TITLE_TEXT_DEFAULT
The default is "".- See Also:
-
OBJECT_TITLE_FONT_POINT_MODEL_DEFAULT
public static final int OBJECT_TITLE_FONT_POINT_MODEL_DEFAULTThe default is 12.- See Also:
-
OBJECT_TITLE_FONT_NAME_DEFAULT
The default is "SansSerif".- See Also:
-
OBJECT_TITLE_FONT_COLOR_DEFAULT
The default is Color.black. -
OBJECT_TITLE_FONT_STYLE_DEFAULT
public static final int OBJECT_TITLE_FONT_STYLE_DEFAULTThe default is Font.PLAIN.- See Also:
-
OBJECT_TITLE_BETWEEN_REST_GAP_EXISTENCE_DEFAULT
public static final boolean OBJECT_TITLE_BETWEEN_REST_GAP_EXISTENCE_DEFAULTThe default is true.- See Also:
-
OBJECT_TITLE_BETWEEN_REST_GAP_THICKNESS_MODEL_DEFAULT
public static final int OBJECT_TITLE_BETWEEN_REST_GAP_THICKNESS_MODEL_DEFAULTThe default is 3.- See Also:
-
-
Constructor Details
-
Object2DProperties
public Object2DProperties()Creates a Object2DProperties object with the documented default values. -
Object2DProperties
Creates a Object2DProperties object with property values copied from another object. The copying is a deep copy.- Parameters:
object2DProps- The properties to copy.
-
-
Method Details
-
setObject2DPropertiesToDefaults
public final void setObject2DPropertiesToDefaults()Sets all properties to their default values. -
setObject2DProperties
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
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
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
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
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
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
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
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
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
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
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
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.
-