net.sourceforge.chart2d
Class Object2D

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--net.sourceforge.chart2d.Object2D
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
Chart2D

public abstract class Object2D
extends javax.swing.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:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.awt.Dimension MAX_SIZE_DEFAULT
          The default is new Dimension (1024, 768).
static java.awt.Dimension MIN_SIZE_DEFAULT
          The default is new Dimension (1, 1).
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Object2D()
          Creates an Object2D object with its defaults.
 
Method Summary
abstract  java.awt.image.BufferedImage getImage()
          Gets a buffered image of the chart.
 net.sourceforge.chart2d.Object2DProperties getObject2DProperties()
          Gets the Object2DProperties for this Object2D.
abstract  java.awt.Dimension getPreferredSize()
          Gets the preferred size of the chart.
abstract  void pack()
          Causes the object to reinintialize to it's preferred size.
 void setMaximumSize(java.awt.Dimension size)
          Sets the maximum size of this object.
 void setMinimumSize(java.awt.Dimension size)
          Sets the minimum size of this object.
 void setObject2DProperties(net.sourceforge.chart2d.Object2DProperties props)
          Sets the Object2DProperties for this Object2D.
abstract  void setPreferredSize(java.awt.Dimension size)
          Sets a custom preferred size for the chart.
abstract  boolean validate(boolean debug)
          Validates the properties of this object.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_SIZE_DEFAULT

public static final java.awt.Dimension MAX_SIZE_DEFAULT
The default is new Dimension (1024, 768).


MIN_SIZE_DEFAULT

public static final java.awt.Dimension MIN_SIZE_DEFAULT
The default is new Dimension (1, 1).

Constructor Detail

Object2D

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

Method Detail

setObject2DProperties

public final void setObject2DProperties(net.sourceforge.chart2d.Object2DProperties props)
Sets the Object2DProperties for this Object2D.

Parameters:
props - The Object2DProperties.

setPreferredSize

public abstract void setPreferredSize(java.awt.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 javax.swing.JComponent
Parameters:
size - The custom preferred size for this chart.

setMaximumSize

public final void setMaximumSize(java.awt.Dimension size)
Sets the maximum size of this object.

Overrides:
setMaximumSize in class javax.swing.JComponent
Parameters:
size - The maximum size.

setMinimumSize

public final void setMinimumSize(java.awt.Dimension size)
Sets the minimum size of this object.

Overrides:
setMinimumSize in class javax.swing.JComponent
Parameters:
size - The minimum size.

getObject2DProperties

public final net.sourceforge.chart2d.Object2DProperties getObject2DProperties()
Gets the Object2DProperties for this Object2D.

Returns:
The Object2DProperties.

getPreferredSize

public abstract java.awt.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 javax.swing.JComponent
Returns:
The preferred minimum size of the chart.

getImage

public abstract java.awt.image.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.