Class Object2D

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
Chart2D

public abstract class Object2D extends JComponent
An abstract class for the common methods of Chart2D, Clocks2D, and Progress2D objects. An Object2D object is one with an enclosing area and a title. Changes through its set methods are updated upon next repaint() or getImage() calls.
See Also:
  • Field Details

    • MAX_SIZE_DEFAULT

      public static final Dimension MAX_SIZE_DEFAULT
      The default is new Dimension (1024, 768).
    • MIN_SIZE_DEFAULT

      public static final Dimension MIN_SIZE_DEFAULT
      The default is new Dimension (1, 1).
  • Constructor Details

    • Object2D

      public Object2D()
      Creates an Object2D object with its defaults. An Object2DProperties object must be set for this object before it is used.
  • Method Details

    • setObject2DProperties

      public final void setObject2DProperties(Object2DProperties props)
      Sets the Object2DProperties for this Object2D.
      Parameters:
      props - The Object2DProperties.
    • setPreferredSize

      public abstract void setPreferredSize(Dimension size)
      Sets a custom preferred size for the chart. This custom size will override the preferred size calculations that normally occurr. If null is passed, the preferred size calculations will be reinstated.
      Overrides:
      setPreferredSize in class JComponent
      Parameters:
      size - The custom preferred size for this chart.
    • setMaximumSize

      public final void setMaximumSize(Dimension size)
      Sets the maximum size of this object.
      Overrides:
      setMaximumSize in class JComponent
      Parameters:
      size - The maximum size.
    • setMinimumSize

      public final void setMinimumSize(Dimension size)
      Sets the minimum size of this object.
      Overrides:
      setMinimumSize in class JComponent
      Parameters:
      size - The minimum size.
    • getObject2DProperties

      public final Object2DProperties getObject2DProperties()
      Gets the Object2DProperties for this Object2D.
      Returns:
      The Object2DProperties.
    • getPreferredSize

      public abstract Dimension getPreferredSize()
      Gets the preferred size of the chart. The preferred size is within the maximum and minimum sizes of the chart. Much calculation is performed when calling this method.
      Overrides:
      getPreferredSize in class JComponent
      Returns:
      The preferred minimum size of the chart.
    • getImage

      public abstract BufferedImage getImage()
      Gets a buffered image of the chart.
      Returns:
      An image of this chart
    • pack

      public abstract void pack()
      Causes the object to reinintialize to it's preferred size.
    • validate

      public abstract boolean validate(boolean debug)
      Validates the properties of this object. If debug is true then prints a messages indicating whether each property is valid. Returns true if all the properties were valid and false otherwise.
      Parameters:
      debug - If true then will print status messages.
      Returns:
      If true then valid.