|
Venice 0.751beta | |||||||||
| 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
nz.org.venice.chart.Chart
New swing component that allows creation of charts. This charting component supports graphing levels and also highlighting of a graph region.
ChartModule,
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 |
| 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 | |
Chart()
Create a new Chart component. |
|
| Method Summary | |
void |
add(Graph graph,
int index)
Chart a new graph at the given level. |
java.lang.Comparable |
calculateEndX()
Find the highest X value in all the graphs we are going to chart |
java.lang.Comparable |
calculateStartX()
Find the lowest X value in all the graphs we are going to chart |
void |
clearHighlightedRegion()
Clear the highlighted region. |
boolean |
contains(int x,
int y)
Return whether the x,y coordinate is within this component. |
int |
count()
Return the number of graphs in the chart. |
boolean |
dataAvailable()
|
boolean |
dataAvailable(Graph g)
|
ChartDrawingModel |
getChartDrawingModel()
|
double |
getDifference(java.lang.Integer x,
java.lang.Integer y,
int index)
Generate the equation of the line passing through points specified by index, and return the difference between those points and x,y |
java.lang.Comparable |
getEndX()
Get the last X value that appears in the chart. |
java.awt.Color |
getGraphColour(Graph graph)
Return the colour that the given graph will be drawn. |
java.lang.Comparable |
getHighlightedEnd()
Get the end X of the highlighted region. |
java.lang.Comparable |
getHighlightedStart()
Get the start X of the highlighted region. |
java.awt.image.BufferedImage |
getImage()
|
int |
getLevelAtPoint(int point)
|
java.util.Vector |
getLevels()
Return all the graphs for each level. |
boolean |
getOrientation()
Return the viewing orientation |
int |
getSpanDays()
|
java.lang.Comparable |
getStartX()
Get the first X value that appears in the chart. |
java.util.Vector |
getSymbols()
Return the window symbols. |
java.lang.String |
getTitle()
Return the window title. |
ChartTracking |
getTracker()
|
java.lang.String |
getUIClassID()
Returns a string that specifies the name of the l&f class that renders this component. |
java.lang.Comparable |
getXAtPoint(int x)
Return the X value at the given x coordinate. |
java.util.Vector |
getXRange()
Get the range of X values which appear in the chart. |
java.lang.Double |
getYAtPoint(int y)
Return the Y value at the given y coordinate. |
void |
handleAnnotation(Graph graph,
boolean enabled)
Set whether the given graph should display its annotations. |
boolean |
isAnnotated(Graph graph)
Query whether the given graph is displaying its annotations. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
Coordinate |
move(java.lang.Integer x,
java.lang.Integer y)
Find the line intersecting at x,y. |
void |
moveTo(int daysFromStart)
|
void |
remove(Graph graph)
Remove the graph from the chart. |
void |
replace(Graph oldGraph,
Graph newGraph)
Replace the graph from the chart with another graph |
void |
resetBuffer()
Reset the double buffer, forcing the graph to redraw. |
void |
setChartDrawingModel(ChartDrawingModel drawnElements)
|
void |
setDrawnLineEnd(java.lang.Comparable dataX,
java.lang.Double dataY,
java.lang.Integer absY)
Sets the end point of a drawn line. |
void |
setDrawnLineStart(java.lang.Comparable dataX,
java.lang.Double dataY,
java.lang.Integer absY)
Sets the end point of a drawn line. |
void |
setErase(java.lang.Comparable dataX,
java.lang.Double dataY,
java.lang.Integer absY)
Find the graph element intersecting at x,y and delete it |
void |
setHighlightedEnd(java.lang.Comparable x)
Sets the end X point of the highlighted region. |
void |
setHighlightedStart(java.lang.Comparable x)
Sets the start X point of the highlighted region. |
void |
setOrientation(boolean orientation)
Set the viewing orientation of the chart. |
void |
setPoint(java.lang.Comparable dataX,
java.lang.Double dataY,
java.lang.Integer absY)
Puts a point on a chart. |
void |
setPoint(Coordinate coord)
Puts a point on a chart. |
void |
setText(java.lang.String text,
java.lang.Comparable dataX,
java.lang.Double dataY,
java.lang.Integer absY)
Put text at x,y. |
void |
setTracker(ChartTracking tracker)
|
void |
setUI(BasicChartUI ui)
Sets the L&F object that renders this component. |
protected void |
setXRange(java.lang.Comparable startX,
java.lang.Comparable endX)
|
void |
updateCursor()
|
void |
updateUI()
Resets the UI property to a value from the current look and feel. |
void |
zoomToDefaultRegion()
Draw the graph back at its default zoom. |
void |
zoomToHighlightedRegion()
Draw the graph zoomed into the given highlighted region. |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, 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, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, 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, 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, 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 |
| Constructor Detail |
public Chart()
| Method Detail |
public int getSpanDays()
public void moveTo(int daysFromStart)
protected void setXRange(java.lang.Comparable startX,
java.lang.Comparable endX)
public java.util.Vector getXRange()
Vector of Comparablespublic java.lang.Comparable getStartX()
public java.lang.Comparable getEndX()
public java.lang.Comparable calculateStartX()
public java.lang.Comparable calculateEndX()
public void handleAnnotation(Graph graph,
boolean enabled)
graph - the graph to modifyenabled - true to turn on graph annotations;
false to turn them offpublic boolean isAnnotated(Graph graph)
graph - the graph to query
true if the graph is displaying its annotations;
false otherwise
public void add(Graph graph,
int index)
graph - the new graph to chartindex - the level indexpublic int count()
public void remove(Graph graph)
graph - the graph to remove
public void replace(Graph oldGraph,
Graph newGraph)
oldGraph - the graph to removenewGraph - the replacemnet graphpublic java.util.Vector getLevels()
Vector where each element represents a
a graph level. Each element in the Vector
is another Vector containing the graphs at that
level.public java.awt.Color getGraphColour(Graph graph)
graph - the graph to query
public void setUI(BasicChartUI ui)
ui - the ButtonUI L&F objectpublic void updateUI()
public java.lang.Comparable getXAtPoint(int x)
x - an x coordinate on the screen
public java.lang.Double getYAtPoint(int y)
y - an x coordinate on the screen
public boolean contains(int x,
int y)
x - the x coordinatey - the y coordinate
true if the point is within this component;
false otherwise.public java.lang.String getUIClassID()
public void setHighlightedStart(java.lang.Comparable x)
x - the starting x valuepublic void setHighlightedEnd(java.lang.Comparable x)
x - the starting x value
public void setDrawnLineStart(java.lang.Comparable dataX,
java.lang.Double dataY,
java.lang.Integer absY)
dataX - the x data point corresponding to the start of the linedataY - the y data point corresponding to the start of the line.absY - the absolute y coordinate of the start of the line
public void setDrawnLineEnd(java.lang.Comparable dataX,
java.lang.Double dataY,
java.lang.Integer absY)
dataX - the x data point corresponding to the end of the linedataY - the y data point corresponding to the end of the line.absY - the absolute y coordinate of the end of the linepublic void setPoint(Coordinate coord)
coord - the coordinate
public void setPoint(java.lang.Comparable dataX,
java.lang.Double dataY,
java.lang.Integer absY)
dataX - the x coordinatedataY - the relative y coordinateabsY - the absolute y coordinatepublic void setTracker(ChartTracking tracker)
public ChartTracking getTracker()
public void updateCursor()
public double getDifference(java.lang.Integer x,
java.lang.Integer y,
int index)
x - the x coordinatey - the y coordinateindex - the index a drawn line
public void setErase(java.lang.Comparable dataX,
java.lang.Double dataY,
java.lang.Integer absY)
dataX - the x data corresponding to the selected pointdataY - the y data corresponding to the selected pointabsY - the y coordinate of the selected point
public Coordinate move(java.lang.Integer x,
java.lang.Integer y)
x - The X Coordinate of the selected point.y - The Y Coordinate of the selected point.
public void setText(java.lang.String text,
java.lang.Comparable dataX,
java.lang.Double dataY,
java.lang.Integer absY)
text - The text to place on the chartdataX - The relative X coordinate of the selected pointdataY - The relative Y coordinate of the selected pointabsY - The absolute y coordinate of the selected pointpublic java.lang.Comparable getHighlightedStart()
public java.lang.Comparable getHighlightedEnd()
public ChartDrawingModel getChartDrawingModel()
public void setChartDrawingModel(ChartDrawingModel drawnElements)
public void clearHighlightedRegion()
public void zoomToHighlightedRegion()
throws ChartOutOfBoundsException
ChartOutOfBoundsExceptionpublic void zoomToDefaultRegion()
public void resetBuffer()
public java.lang.String getTitle()
public java.util.Vector getSymbols()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic java.awt.image.BufferedImage getImage()
public boolean dataAvailable(Graph g)
public boolean dataAvailable()
public void setOrientation(boolean orientation)
orientation - A boolean value. If true, chart is drawn from top to
bottom, otherwise bottom up.public boolean getOrientation()
public int getLevelAtPoint(int point)
|
Venice 0.751beta | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||