Package net.sourceforge.chart2d
Class GraphChart2D
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
net.sourceforge.chart2d.Object2D
net.sourceforge.chart2d.Chart2D
net.sourceforge.chart2d.GraphChart2D
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable
An abstract class for the common methods of LBChart2D and LLChart2D.
A GraphChart2D object is an area that contains axes and one or more overlaid graphs.
Changes through its set methods are updated upon next repaint() or getImage() calls.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class net.sourceforge.chart2d.Object2D
MAX_SIZE_DEFAULT, MIN_SIZE_DEFAULTFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddDataset(Dataset dataset) Adds a Dataset object to this chart.final voidaddGraphProperties(GraphProperties graphProps) Adds a GraphProperties object to this chart.final voidaddMultiColorsProperties(MultiColorsProperties multiColorsProps) Adds a MultiColorsProperties object to this chart.final voidaddWarningRegionProperties(WarningRegionProperties warningRegionProps) Adds a WarningRegionProperties object to this chart.final DatasetgetDataset(int i) Gets a dataset based on the order the dataset was added.final GraphChart2DPropertiesGets the GraphChart2DProperties for this Chart2D.final GraphPropertiesgetGraphProperties(int i) Gets a graph properties based on the order the graph properties were added.final MultiColorsPropertiesgetMultiColorsProperties(int i) Gets a multiColorsProps based on the order the multiColorsProps was added.final WarningRegionPropertiesgetWarningRegionProperties(int i) Gets a warning region properties based on the order the properties were added.final voidremoveDataset(Dataset dataset) Removes a Dataset object from this chart.final voidremoveGraphProperties(GraphProperties graphProps) Removes GraphProperties object from this chart.final voidremoveMultiColorsProperties(MultiColorsProperties multiColorsProps) Removes a MultiColorsProperties object from this chart.final voidremoveWarningRegionProperties(WarningRegionProperties warningRegionProps) Removes a warning region with the specified properties to this chart.final voidSets the GraphChart2DProperties for this GraphChart2D.final voidsetLayoutRatios(float graphW, float graphH, float legendW) Sets the allocation of space to each component of a graph chart.Methods inherited from class net.sourceforge.chart2d.Chart2D
getChart2DProperties, getLegendProperties, setChart2DProperties, setLegendPropertiesMethods inherited from class net.sourceforge.chart2d.Object2D
getImage, getObject2DProperties, getPreferredSize, pack, setMaximumSize, setMinimumSize, setObject2DProperties, setPreferredSize, validateMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
GraphChart2D
public GraphChart2D()Creates a GraphChart2D object with its defaults. A GraphChart2DProperties object must be set for this object before it is used. A GraphProperties object must be added for this object before it is used. A Dataset object must be added for this object before it is used. A MultiColorsProperties object must be added for this object before it is used.
-
-
Method Details
-
setGraphChart2DProperties
Sets the GraphChart2DProperties for this GraphChart2D.- Parameters:
props- The GraphChart2DProperties.
-
setLayoutRatios
public final void setLayoutRatios(float graphW, float graphH, float legendW) Sets the allocation of space to each component of a graph chart. There are four components: numbers axis, labels axis, graph, and legend. The ratios of the axes can be determined from the ratios of the graph and the legend. Depending on the chart type, the left and bottom axes can be the numbers axis and labels axis. The width of the left axis is 1f - graphW - legendW. The width of the bottom axis is graphW. The height of the left axis is graphH. The ratio of the legend height is always 1f.- Parameters:
graphW- The ratio of graph width to total.graphH- The ratio of graph height to total.legendW- The ratio of graph width to total.legendH- The ratio of legend height to total.
-
getGraphChart2DProperties
Gets the GraphChart2DProperties for this Chart2D.- Parameters:
props- The GraphChart2DProperties.
-
getGraphProperties
Gets a graph properties based on the order the graph properties were added. First added is number zero.- Returns:
- The graph properties object added to this chart.
-
getDataset
Gets a dataset based on the order the dataset was added. First added is number zero.- Returns:
- The dataset added to this chart.
-
getMultiColorsProperties
Gets a multiColorsProps based on the order the multiColorsProps was added. First added is number zero.- Returns:
- The multiColorsProps added to this chart.
-
getWarningRegionProperties
Gets a warning region properties based on the order the properties were added. First added is number zero.- Returns:
- The warning region properties object added to this chart.
-
addGraphProperties
Adds a GraphProperties object to this chart.- Parameters:
graphProps- The graph properties to add to this chart.
-
addDataset
Adds a Dataset object to this chart.- Parameters:
dataset- The dataset to add to this chart.
-
addMultiColorsProperties
Adds a MultiColorsProperties object to this chart.- Parameters:
multiColorsProps- The multi colors properties to add to this chart.
-
addWarningRegionProperties
Adds a WarningRegionProperties object to this chart.- Parameters:
warningRegion- The warning region properties to add to this chart.
-
removeGraphProperties
Removes GraphProperties object from this chart.- Parameters:
graphProps- The graph properties to remove from this chart.
-
removeDataset
Removes a Dataset object from this chart.- Parameters:
dataset- The dataset to remove from this chart.
-
removeMultiColorsProperties
Removes a MultiColorsProperties object from this chart.- Parameters:
multiColorsProperties- The multi colors properties to remove from this chart.
-
removeWarningRegionProperties
Removes a warning region with the specified properties to this chart.- Parameters:
warningRegion- The warning region to remove from this chart.
-