|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--jclass.base.BaseComponent
|
+--jclass.base.TransientComponent
|
+--jclass.chart.JCChart
|
+--jclass.chart.BaseChart
|
+--edu.brook.ascape.view.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. Requires KLGroup JCChart.
| Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Field Summary | |
protected boolean |
awaitingUpdate
Are we waiting for the paint method to be called before an update? |
protected int |
chartType
The chart type this view is using. |
protected ChartCustomizer |
customizer
The panel responsible for customizing this chart. |
protected ViewFrameBridge |
frame
The frame, if any, that this iew is displayed within |
static int |
HISTOGRAM
Histogram (bar graph) chart type. |
protected java.lang.String |
name
The name of the view. |
static int |
PIE
Pie chart type. |
protected GraphicsRecorder |
recorder
A recorder for the graphic of this view. |
protected boolean |
recordNext
Are we waiting for a record to occur? |
protected Scape |
scape
The scape that we are principally charting. |
static int |
TIME_SERIES
Time series (line graph) chart type. |
protected ChartViewModel |
viewModel
The view model that we are delegating to. |
| Fields inherited from class jclass.chart.BaseChart |
AUTOMATIC,
axesOrientationStrings,
axesOrientationValues,
dataSource,
DAYS,
EAST,
HORIZONTAL,
HOURS,
MAX,
MIN,
MINUTES,
MONTHS,
NORTH,
NORTHEAST,
NORTHWEST,
ORIENT_INVERTED_X_NORMAL_Y_NORMAL,
ORIENT_INVERTED_X_NORMAL_Y_REVERSED,
ORIENT_INVERTED_X_REVERSED_Y_NORMAL,
ORIENT_INVERTED_X_REVERSED_Y_REVERSED,
ORIENT_X_NORMAL_Y_NORMAL,
ORIENT_X_NORMAL_Y_REVERSED,
ORIENT_X_REVERSED_Y_NORMAL,
ORIENT_X_REVERSED_Y_REVERSED,
ORIGIN,
POINT_LABELS,
ROTATE_270,
ROTATE_90,
ROTATE_NONE,
SECONDS,
SOUTH,
SOUTHEAST,
SOUTHWEST,
tableModel,
TIME_LABELS,
VALUE,
VALUE_ANCHORED,
VALUE_LABELS,
VERTICAL,
WEEKS,
WEST,
YEARS |
| Fields inherited from class jclass.chart.JCChart |
AREA,
BAR,
cancelKey,
CANDLE,
chartArea,
currentDwellLabel,
customizerName,
data,
dataviewHashtable,
dwellLabels,
ENCODE_GIF,
ENCODE_PNG,
eventAction_strings,
eventAction_values,
eventMod_strings,
eventMod_values,
fillColorIndex,
FILLED_RADAR,
footer,
header,
HILO,
HILO_OPEN_CLOSE,
indexHashtable,
labels,
legend,
lineColorIndex,
listeners,
margins,
NONE,
pickListeners,
PIE,
PLOT,
POLAR,
RADAR,
resetKey,
SCATTER_PLOT,
STACKING_AREA,
STACKING_BAR,
symbolColorIndex,
symbolShapeIndex,
triggers |
| Fields inherited from class jclass.base.TransientComponent |
draw_gc,
highlight,
highlight_color,
mouse_down_event_timestamp,
popdown_event_timestamp,
pref_height,
pref_width,
traversable |
| Fields inherited from class jclass.base.BaseComponent |
applet,
applet_context,
BELL,
border,
border_style,
BS,
clipToScreen,
dblbuffer_image,
dblbuffer_image_gc,
DELETE,
do_repaint,
double_buffer,
ENTER,
ESC,
has_focus,
images,
in_repaint,
insets,
LOCK,
needs_layout,
NOVALUE,
paint_rect,
realized,
rect,
TAB,
use_system_colors,
userdata |
| 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 |
| 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 |
addScape(Scape scape)
Sets the scape that this chart and, by delegation, its view model, is viewing. |
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 |
addSeries(java.lang.String valueName,
java.awt.Color color,
boolean continuous)
Adds a series to the chart being viewed. |
void |
build()
Prepare the component view, once the view's scape has been created. |
void |
clearSeries()
Clears all series selections from the chart being viewed. |
void |
displayViewCustomizer()
Displays a window for altering the setting for this chart. |
GraphicsRecorder |
getGraphicsRecorder()
Returns a recorder that can be used to record the graphics of this view. |
java.lang.String |
getName()
Returns a name for the view as defined by set name. |
Scape |
getScape()
Returns the scape this chart views. |
ViewFrameBridge |
getViewFrame()
Returns the frame this view occupies, null if none. |
ChartViewModel |
getViewModel()
Returns the view model that this chart view is displaying. |
boolean |
isShowLegend()
Is the legend showing? |
void |
paint(java.awt.Graphics g)
Paints the chart. |
void |
removeScape(Scape scape)
Removes the scape from the view model. |
void |
removeSeries(java.lang.String valueName)
Removes a series from the chart being viewed. |
protected void |
requestPaintUpdate()
Instructs the chart view that it is waiting for a a paint and should request an update the next time one occurs. |
void |
requestRecord()
Instructs the chart view to call a graphics recorder at the next paint if one exists. |
void |
scapeUpdated(ScapeEvent scapeEvent)
Delegates the scap eupdate event to the view model, informing it that the scape has been updated. |
void |
setChartType(int chartType)
Sets the chart type, creating the appropriate delegate view model and adding the scape to it. |
void |
setGraphicsRecorder(GraphicsRecorder recorder)
Sets the recorder that can be used to record the graphics of this view. |
void |
setName(java.lang.String name)
Sets the name of this view. |
void |
setShowLegend(boolean showing)
Show the legend? True by default. |
void |
setViewFrame(ViewFrameBridge frame)
Sets the frame this view appears in. |
java.lang.String |
toString()
Returns a short description of this view. |
| Methods inherited from class jclass.chart.BaseChart |
getAxisOrientation,
getChartType,
getFooterText,
getHeaderText,
getLegendAnchor,
getLegendIsShowing,
getLegendOrientation,
getMargins,
getSwingDataModel,
getView3D,
getXAxisAnnotationMethod,
getXAxisGridIsShowing,
getXAxisIsLogarithmic,
getXAxisIsShowing,
getXAxisMax,
getXAxisMin,
getXAxisMinMax,
getXAxisNumSpacing,
getXAxisTitleText,
getYAxisAnnotationMethod,
getYAxisGridIsShowing,
getYAxisIsLogarithmic,
getYAxisIsShowing,
getYAxisMax,
getYAxisMin,
getYAxisMinMax,
getYAxisNumSpacing,
getYAxisTitleText,
setAxisOrientation,
setFooterText,
setHeaderText,
setLegendAnchor,
setLegendIsShowing,
setLegendOrientation,
setMargins,
setSwingDataModel,
setView3D,
setXAxisAnnotationMethod,
setXAxisGridIsShowing,
setXAxisIsLogarithmic,
setXAxisIsShowing,
setXAxisMax,
setXAxisMin,
setXAxisMinMax,
setXAxisNumSpacing,
setXAxisTitleText,
setYAxisAnnotationMethod,
setYAxisGridIsShowing,
setYAxisIsLogarithmic,
setYAxisIsShowing,
setYAxisMax,
setYAxisMin,
setYAxisMinMax,
setYAxisNumSpacing,
setYAxisTitleText |
| Methods inherited from class jclass.chart.JCChart |
addChartLabel,
addChartListener,
addDataView,
addNotify,
addPickListener,
addToDwellLabels,
addTrigger,
appendChartLabel,
cancel,
chartDataChange,
deleteChartLabel,
findDataView,
getAbout,
getAllowUserChanges,
getApplet,
getBorderType,
getBorderWidth,
getBottomMargin,
getCancelKey,
getChanged,
getChanged,
getChartArea,
getChartLabels,
getChartLabels,
getConverter,
getCustomizerName,
getDataView,
getDataView,
getFillColorIndex,
getFooter,
getHeader,
getIsBatched,
getLeftMargin,
getLegend,
getLineColorIndex,
getNumChartLabels,
getNumData,
getNumTriggers,
getResetKey,
getRightMargin,
getSaveParamStream,
getSymbolColorIndex,
getSymbolShapeIndex,
getTopMargin,
getTrigger,
getVersion,
getWarningDialog,
insets,
isChanged,
isChanged,
isNetscape,
keyDown,
keyPressed,
keyReleased,
keyTyped,
launchPropertyPage,
layout,
loadParams,
loadParams,
locateChartRegion,
main,
makeChart,
markAllChartLabelsForRecalc,
minimumSize,
mouseClicked,
mouseDown,
mouseDrag,
mouseDragged,
mouseEntered,
mouseExit,
mouseExited,
mouseMove,
mouseMoved,
mousePressed,
mouseReleased,
mouseUp,
paintComponent,
pick,
preferredSize,
printAll,
processMouseEvent,
recalc,
recalcChangedChartLabels,
removeAllChartLabels,
removeChartLabel,
removeChartListener,
removeDataView,
removeFromDwellLabels,
removePickListener,
removeTrigger,
requestFocus,
reset,
resetDefaults,
rotate,
rotateEnd,
rotateStart,
saveChartAs,
saveChartAsGif,
saveChartAsPng,
saveParams,
scale,
setAbout,
setAllowUserChanges,
setBackground,
setBorderType,
setBorderWidth,
setBottomMargin,
setCancelKey,
setChanged,
setChanged,
setChartArea,
setChartLabels,
setChartLabels,
setCustomizerName,
setDataView,
setDataView,
setFillColorIndex,
setFont,
setFooter,
setForeground,
setHeader,
setIsBatched,
setLeftMargin,
setLegend,
setLineColorIndex,
setResetKey,
setRightMargin,
setSaveParamStream,
setSymbolColorIndex,
setSymbolShapeIndex,
setTopMargin,
setTrigger,
setVersion,
setWarningDialog,
snapshot,
timerExpired,
translate,
translateStart,
unpick,
unpick,
update,
zoom |
| Methods inherited from class jclass.base.TransientComponent |
clipGCToAncestors,
convertEvent,
disable,
drawBorder,
drawHighlight,
drawHighlight,
drawHighlightAndBorder,
enable,
getDrawingArea,
getDrawingArea,
getDrawingAreaHeight,
getDrawingAreaWidth,
getHighlightColor,
getHighlightThickness,
getPaintRect,
getPreferredHeightInternal,
getPreferredWidthInternal,
gotFocus102,
isBustedVM,
isFocusTraversable,
isTraversable,
lostFocus102,
preferredHeight,
preferredWidth,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
setBounds,
setBounds,
setCursor,
setHighlightColor,
setHighlightThickness,
setPreferredSize,
setPreferredSize,
setTraversable |
| Methods inherited from class jclass.base.BaseComponent |
copyArea,
createImage,
createImage,
createImage,
dispose,
fillBackground,
getApplet,
getAppletContext,
getAppletContext,
getAWTLock,
getBorderStyle,
getBorderThickness,
getClipToScreen,
getDoubleBuffer,
getDoubleBufferGraphics,
getDoubleBufferImage,
getFrame,
getFrame,
getInsets,
getShadowThickness,
getUserData,
getUserDataInt,
getVisibleScreenLoc,
getWindow,
hasFocus,
intersects,
isRealized,
isShowing,
paintImmediately,
removeNotify,
repaint,
repaint,
repaint,
repaint,
setBorderStyle,
setBorderThickness,
setClipToScreen,
setDoubleBuffer,
setInsets,
setShadowThickness,
setUserData,
translateFromParent,
translateToParent,
update,
updateParent,
useSystemColors,
validate |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getAccessibleContext,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getUIClassID,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
isDoubleBuffered,
isFocusCycleRoot,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paintBorder,
paintChildren,
paintImmediately,
paramString,
processComponentKeyEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
requestDefaultFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
updateUI |
| Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
invalidate,
isAncestorOf,
list,
list,
locate,
paintComponents,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setLayout,
validateTree |
| Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
disableEvents,
dispatchEvent,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isValid,
isVisible,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseEnter,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
processComponentEvent,
processInputMethodEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
repaint,
resize,
resize,
setComponentOrientation,
setCursor,
setDropTarget,
setLocale,
setLocation,
setLocation,
setSize,
setSize,
show,
show,
size,
transferFocus |
| Methods inherited from class java.lang.Object |
clone,
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
protected int chartType
protected ChartViewModel viewModel
protected ChartCustomizer customizer
protected Scape scape
protected ViewFrameBridge frame
protected java.lang.String name
protected GraphicsRecorder recorder
protected boolean recordNext
protected boolean awaitingUpdate
| Constructor Detail |
public ChartView()
public ChartView(int chartType)
chartType - the charttype symbolpublic ChartView(java.lang.String name)
name - a name for the chart series
public ChartView(int chartType,
java.lang.String name)
chartType - the charttype symbolname - a name for the chart series| Method Detail |
public void build()
public java.lang.String getName()
public final void setName(java.lang.String name)
name - a user relevant name for this viewpublic java.lang.String toString()
public void displayViewCustomizer()
public void setChartType(int chartType)
chartType - the symbol for the chart type to setpublic boolean isShowLegend()
public void setShowLegend(boolean showing)
showing - true to show legend, false to hide it.public ChartViewModel getViewModel()
public void addSeries(java.lang.String valueName)
valueName - the name of the series to add
public 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 chart
public void addSeries(java.lang.String valueName,
java.awt.Color color,
boolean continuous)
valueName - the name of the series to addColor - the color to use for the series in the chartboolean - should the series be drawn as a line or series of symbols?public void removeSeries(java.lang.String valueName)
valueName - the name of the series to removepublic void clearSeries()
valueName - the name of the series to removepublic Scape getScape()
public void addScape(Scape scape)
throws java.util.TooManyListenersException
the - scape this cahrt is viewingpublic void removeScape(Scape scape)
scape - the scape to remove, or nullpublic ViewFrameBridge getViewFrame()
public void setViewFrame(ViewFrameBridge frame)
public GraphicsRecorder getGraphicsRecorder()
public void setGraphicsRecorder(GraphicsRecorder recorder)
public void requestRecord()
protected void requestPaintUpdate()
public void scapeUpdated(ScapeEvent scapeEvent)
event - the scape setup eventpublic void paint(java.awt.Graphics g)
g - the graphics context.
|
(c) 1998-2000 The Brookings Insitution Webpage |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||