|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.ascape.view.vis.PanelView
org.ascape.view.vis.ChartView
public class ChartView
A chart view of a scape. Delegates many functions, including scape listener, to subclasses of ChartViewModel. This view uses KL Group's JChart; if you want to use other charting packages, let us know, we'd like to generalize further so that multiple charting packages can be used. Uses JFreeChart.
Nested Class Summary | |
---|---|
class |
ChartView.PieChartDataset
The Class PieChartDataset. |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
ALL_POINTS
Symbol for 'display all data points.' |
static int |
HISTOGRAM
Histogram (bar graph) chart type. |
static int |
PIE
Pie chart type. |
static int |
TIME_SERIES
Time series (line graph) chart type. |
Fields inherited from class org.ascape.view.vis.PanelView |
---|
delegate, iterationsPerRedraw, name, scape |
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 | |
---|---|
ChartView()
Construct a chart view of default time series type. |
|
ChartView(int chartType)
Construct a chart view with a specicifed chart type. |
|
ChartView(int chartType,
java.lang.String name)
Construct a chart view of default time series type. |
|
ChartView(java.lang.String name)
Construct a chart view of default time series type. |
Method Summary | |
---|---|
void |
addSeries(java.lang.String valueName)
Adds a series to the chart being viewed. |
void |
addSeries(java.lang.String valueName,
java.awt.Color color)
Adds a series to the chart being viewed. |
void |
clearSeries()
Clears all series selections from the chart being viewed. |
void |
displayCustomizer()
Displays a window for altering the setting for this chart. |
com.jrefinery.chart.JFreeChart |
getChart()
Gets the chart. |
int |
getChartType()
Gets the chartType. |
BaseCustomizer |
getCustomizer()
Returns the customizer for this view. |
DataViewSelection |
getDataSelection()
Gets the dataSelection. |
int |
getDisplayPoints()
Gets the displayPoints. |
javax.swing.ImageIcon |
getIcon()
Return an icon that can be used to represent this frame. |
com.jrefinery.chart.JFreeChartPanel |
getPanel()
Gets the panel. |
java.awt.Color |
getPlotBackground()
Gets the plot background. |
double |
getVerticalAxisMax()
Gets the vertical axis max. |
double |
getVerticalAxisMin()
Gets the vertical axis min. |
boolean |
isForcePosVerticalAxisMinToZero()
Checks if is force pos vertical axis min to zero. |
boolean |
isLegendShowing()
Checks if is legend showing. |
void |
paintChildren(java.awt.Graphics g)
|
void |
readExternal(java.io.ObjectInput in)
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. |
void |
removeCustomizer()
Removes the customizer for this chart. |
void |
removeSeries(java.lang.String valueName)
Removes a series from the chart being viewed. |
void |
scapeAdded(ScapeEvent scapeEvent)
Notifies the view that the scape has added it. |
void |
scapeDeserialized(ScapeEvent scapeEvent)
Method called once a model is deserialized. |
void |
scapeRemoved(ScapeEvent scapeEvent)
Notifies the listener that the scape has removed it. |
void |
setBackground(java.awt.Color fg)
|
void |
setChartType(int chartType)
Sets the chartType. |
void |
setCustomizer(ChartCustomizer customizer)
Sets the customizer for this view. |
void |
setDataSelection(DataViewSelection dataSelection)
Sets the dataSelection. |
void |
setDisplayPoints(int displayPoints)
Sets the displayPoints. |
void |
setForcePosVerticalAxisMinToZero(boolean forcePosVerticalAxisMinToZero)
Sets the force pos vertical axis min to zero. |
void |
setForeground(java.awt.Color fg)
|
void |
setLegendShowing(boolean legendShowing)
Sets the legend showing. |
void |
setName(java.lang.String name)
Sets the name of this view. |
void |
setPlotBackground(java.awt.Color bg)
Sets the plot background. |
void |
setVerticalAxisMax(double verticalAxisMax)
Sets the vertical axis max. |
void |
setVerticalAxisMin(double verticalAxisMin)
Sets the vertical axis min. |
void |
update(java.util.Observable observed,
java.lang.Object arg)
Notifies this view model that a change (in the selected group, typically) has occured. |
void |
updateScapeGraphics()
Called when scape reports an update event. |
void |
writeExternal(java.io.ObjectOutput out)
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays. |
Methods inherited from class org.ascape.view.vis.PanelView |
---|
build, clone, environmentQuiting, forceScapeNotify, getDelegate, getIterationsPerRedraw, getName, getPreferredSizeWithin, getScape, getViewFrame, iconUpdated, isGraphic, isLifeOfScape, notifyScapeUpdated, onChangeIterationsPerRedraw, paintComponent, scapeClosing, scapeInitialized, scapeIterated, scapeNotification, scapeSetup, scapeStarted, scapeStopped, setDelegate, setIterationsPerRedraw, setMovieRecorder, setViewFrame, toString |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintImmediately, paintImmediately, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods 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, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TIME_SERIES
public static final int HISTOGRAM
public static final int PIE
public static final int ALL_POINTS
Constructor Detail |
---|
public ChartView()
public ChartView(int chartType)
chartType
- the charttype symbolpublic ChartView(java.lang.String name)
name
- a name for the chart seriespublic ChartView(int chartType, java.lang.String name)
chartType
- the charttype symbolname
- a name for the chart seriesMethod Detail |
---|
public void displayCustomizer()
public void removeCustomizer()
public final void setName(java.lang.String name)
setName
in class PanelView
name
- a user relevant name for this viewpublic BaseCustomizer getCustomizer()
public void setCustomizer(ChartCustomizer customizer)
customizer
- the customizer to usepublic int getChartType()
public void setChartType(int chartType)
chartType
- The chartType to setpublic boolean isLegendShowing()
public void setLegendShowing(boolean legendShowing)
legendShowing
- the new legend showingpublic void addSeries(java.lang.String valueName)
valueName
- the name of the series to addpublic void addSeries(java.lang.String valueName, java.awt.Color color)
valueName
- the name of the series to addcolor
- the color to use for the series in the chartpublic void removeSeries(java.lang.String valueName)
valueName
- the name of the series to removepublic void clearSeries()
public void scapeAdded(ScapeEvent scapeEvent) throws java.util.TooManyListenersException
scapeAdded
in interface ScapeListener
scapeAdded
in class PanelView
scapeEvent
- the scape added notification event
java.util.TooManyListenersException
- on attempt to add this listener to another scape when one has
already been assigned
java.util.TooManyListenersException
- the too many listeners exceptionpublic void scapeRemoved(ScapeEvent scapeEvent)
scapeRemoved
in interface ScapeListener
scapeRemoved
in class PanelView
scapeEvent
- the scape removed notification eventscapeAdded
public void update(java.util.Observable observed, java.lang.Object arg)
update
in interface java.util.Observer
observed
- the observedarg
- the argpublic DataViewSelection getDataSelection()
public void setDataSelection(DataViewSelection dataSelection)
dataSelection
- The dataSelection to setpublic int getDisplayPoints()
public void setDisplayPoints(int displayPoints)
displayPoints
- The displayPoints to setpublic com.jrefinery.chart.JFreeChartPanel getPanel()
public com.jrefinery.chart.JFreeChart getChart()
public java.awt.Color getPlotBackground()
public void setPlotBackground(java.awt.Color bg)
bg
- the new plot backgroundpublic void setBackground(java.awt.Color fg)
setBackground
in class javax.swing.JComponent
public void setForeground(java.awt.Color fg)
setForeground
in class javax.swing.JComponent
public boolean isForcePosVerticalAxisMinToZero()
public void setForcePosVerticalAxisMinToZero(boolean forcePosVerticalAxisMinToZero)
forcePosVerticalAxisMinToZero
- the new force pos vertical axis min to zeropublic double getVerticalAxisMin()
public void setVerticalAxisMin(double verticalAxisMin)
verticalAxisMin
- the new vertical axis minpublic double getVerticalAxisMax()
public void setVerticalAxisMax(double verticalAxisMax)
verticalAxisMax
- the new vertical axis maxpublic void updateScapeGraphics()
PanelView
updateScapeGraphics
in interface ComponentView
updateScapeGraphics
in class PanelView
public void paintChildren(java.awt.Graphics g)
paintChildren
in class javax.swing.JComponent
public void scapeDeserialized(ScapeEvent scapeEvent)
scapeDeserialized
in interface ScapeListener
scapeDeserialized
in class PanelView
scapeEvent
- the scape eventpublic void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
PanelView
writeExternal
in interface java.io.Externalizable
writeExternal
in class PanelView
out
- the stream to write the object to
java.io.IOException
- Signals that an I/O exception has occurred.public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
PanelView
readExternal
in interface java.io.Externalizable
readExternal
in class PanelView
in
- the stream to read data from in order to restore the object
java.io.IOException
- Signals that an I/O exception has occurred.
java.lang.ClassNotFoundException
- the class not found exceptionpublic javax.swing.ImageIcon getIcon()
getIcon
in interface ComponentView
getIcon
in class PanelView
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |