Package net.sourceforge.chart2d

# Class Object2DProperties

java.lang.Object
net.sourceforge.chart2d.Object2DProperties

public final class Object2DProperties extends Object
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

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `BOTTOM`
  Signifies bottom.
  `static final int`
  `LEFT`
  Signifies left.
  `static final int`
  `NONE`
  Signifies none.
  `static final Color`
  `OBJECT_BACKGROUND_COLOR_DEFAULT`
  The default is new Color (215, 215, 215).
  `static final boolean`
  `OBJECT_BACKGROUND_EXISTENCE_DEFAULT`
  The default is true.
  `static final int`
  `OBJECT_BACKGROUND_LIGHT_SOURCE_DEFAULT`
  The default is TOP.
  `static final Color`
  `OBJECT_BORDER_COLOR_DEFAULT`
  The default is Color.black.
  `static final boolean`
  `OBJECT_BORDER_EXISTENCE_DEFAULT`
  The default is true.
  `static final int`
  `OBJECT_BORDER_THICKNESS_MODEL_DEFAULT`
  The default is 2.
  `static final boolean`
  `OBJECT_GAP_EXISTENCE_DEFAULT`
  The default is true.
  `static final int`
  `OBJECT_GAP_THICKNESS_MODEL_DEFAULT`
  The default is 5.
  `static final boolean`
  `OBJECT_MAGNIFY_WHEN_RESIZE_DEFAULT`
  The default is true.
  `static final boolean`
  `OBJECT_TITLE_BETWEEN_REST_GAP_EXISTENCE_DEFAULT`
  The default is true.
  `static final int`
  `OBJECT_TITLE_BETWEEN_REST_GAP_THICKNESS_MODEL_DEFAULT`
  The default is 3.
  `static final boolean`
  `OBJECT_TITLE_EXISTENCE_DEFAULT`
  The default is true.
  `static final Color`
  `OBJECT_TITLE_FONT_COLOR_DEFAULT`
  The default is Color.black.
  `static final String`
  `OBJECT_TITLE_FONT_NAME_DEFAULT`
  The default is "SansSerif".
  `static final int`
  `OBJECT_TITLE_FONT_POINT_MODEL_DEFAULT`
  The default is 12.
  `static final int`
  `OBJECT_TITLE_FONT_STYLE_DEFAULT`
  The default is Font.PLAIN.
  `static final String`
  `OBJECT_TITLE_TEXT_DEFAULT`
  The default is "".
  `static final int`
  `RIGHT`
  Signifies right.
  `static final int`
  `TOP`
  Signifies top.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Object2DProperties()`
  Creates 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 Type
  Method
  Description
  `final Color`
  `getObjectBackgroundColor()`
  Gets the color of the background for the object.
  `final boolean`
  `getObjectBackgroundExistence()`
  Gets whether the object will have a painted background or not.
  `final int`
  `getObjectBackgroundLightSource()`
  Gets the light source of the object's background.
  `final Color`
  `getObjectBorderColor()`
  Gets the color of the object's border.
  `final boolean`
  `getObjectBorderExistence()`
  Gets whether a border around the object will exist.
  `final int`
  `getObjectBorderThicknessModel()`
  Gets the thickness of the border for the model size of the object.
  `final boolean`
  `getObjectGapExistence()`
  Gets whether a gap between the border or edge of the object and the object's interior components exists.
  `final int`
  `getObjectGapThicknessModel()`
  Gets the thickness of the object's gap for the model size of the object.
  `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.
  `final boolean`
  `getObjectTitleBetweenRestGapExistence()`
  Gets whether a gap below the title and the rest of the object's components exists.
  `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.
  `final boolean`
  `getObjectTitleExistence()`
  Gets whether the object is to have a title.
  `final Color`
  `getObjectTitleFontColor()`
  Gets the color of the font for the object's title.
  `final String`
  `getObjectTitleFontName()`
  Gets the name of the font for the object's title.
  `final int`
  `getObjectTitleFontPointModel()`
  Gets the point of the font of the title for the object at its model size.
  `final int`
  `getObjectTitleFontStyle()`
  Gets the style of the font for the object's title.
  `final String`
  `getObjectTitleText()`
  Gets the text for the object's title.
  `final boolean`
  `isFontNameExists(String name)`
  Returns true if the font name exists in the graphics enviornment.
  `final void`
  `setObject2DProperties(Object2DProperties object2DProps)`
  Sets all properties to be the values of another Object2DProperties object.
  `final void`
  `setObject2DPropertiesToDefaults()`
  Sets all properties to their default values.
  `final void`
  `setObjectBackgroundColor(Color color)`
  Sets the color of the background for the object.
  `final void`
  `setObjectBackgroundExistence(boolean existence)`
  Sets whether the object will have a painted background or not.
  `final void`
  `setObjectBackgroundLightSource(int source)`
  Sets the light source of the object's background.
  `final void`
  `setObjectBorderColor(Color color)`
  Sets the color of the object's border.
  `final void`
  `setObjectBorderExistence(boolean existence)`
  Sets whether a border around the object will exist.
  `final void`
  `setObjectBorderThicknessModel(int thickness)`
  Sets the thickness of the border for the model size of the object.
  `final void`
  `setObjectGapExistence(boolean existence)`
  Sets whether a gap between the border or edge of the object and the object's interior components exists.
  `final void`
  `setObjectGapThicknessModel(int thickness)`
  Sets the thickness of the object's gap for the model size of the object.
  `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.
  `final void`
  `setObjectTitleBetweenRestGapExistence(boolean existence)`
  Sets whether a gap below the title and the rest of the object's components exists.
  `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.
  `final void`
  `setObjectTitleExistence(boolean existence)`
  Sets whether the object is to have a title.
  `final void`
  `setObjectTitleFontColor(Color color)`
  Sets the color of the font for the object's title.
  `final void`
  `setObjectTitleFontName(String name)`
  Sets the name of the font for the object's title.
  `final void`
  `setObjectTitleFontPointModel(int point)`
  Sets the point of the font of the title for the object at its model size.
  `final void`
  `setObjectTitleFontStyle(int style)`
  Sets the style of the font for the object's title.
  `final void`
  `setObjectTitleText(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 Details

  - ### 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 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 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 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 String OBJECT_TITLE_FONT_NAME_DEFAULT
    The default is "SansSerif".
    See Also:
      - Constant Field Values

  - ### OBJECT_TITLE_FONT_COLOR_DEFAULT

    public static final 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 Details

  - ### Object2DProperties

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

  - ### Object2DProperties

    public Object2DProperties(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 Details

  - ### setObject2DPropertiesToDefaults

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

  - ### setObject2DProperties

    public final void setObject2DProperties(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(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(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(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(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(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 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 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 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 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 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(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.