|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Canvas
org.jscience.architecture.traffic.simulation.statistics.TrackingView
public abstract class TrackingView
A TrackingView shows a certain tracking graph.
| Nested Class Summary | |
|---|---|
protected class |
TrackingView.MyMouseListener
Listens to mouse clicks on this TrackingView. |
| Nested classes/interfaces inherited from class java.awt.Canvas |
|---|
java.awt.Canvas.AccessibleAWTCanvas |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected java.awt.image.BufferedImage |
buffer
The back buffer |
protected java.awt.Color[] |
colors
Colors used to draw the graph. |
protected int |
curIndex
Current index in trackData[][]. |
protected int |
endCycle
The cycle the end of the x-axis currently represents |
protected java.lang.String |
highlightCycle
String containing highlighted cycle text |
protected int |
highlightIndex
Index to the point in trackData to highlight. |
protected java.lang.String[] |
highlightText
Strings to draw in upper right corner. |
protected static int |
MAX_DATA
Determines how many samples are tracked. |
protected int |
MAX_TRACK
Determines how many different data flows can be tracked. |
protected float |
maximum
Highest valued sampled. |
static java.lang.String |
SEP
The separator used when saving data. |
protected boolean[] |
show
Determines whether a graph is drawn or not. |
protected int |
startCycle
The cycle this view started tracking |
protected int |
trackCount
Current count: sample if trackCount == trackRate. |
protected float[][] |
trackData
The history of tracking data |
protected int |
trackRate
Sample rate: each trackRate cycles, a sample is taken. |
protected float |
xStep
Used to determine where the user clicked the mouse. |
| 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 | |
|---|---|
TrackingView(int _startCycle)
Creates a new TrackingView. |
|
| Method Summary | |
|---|---|
protected void |
collapseData()
Collapses trackData and changes other variables accordingly. |
void |
drawBuffer()
Draws the buffer. |
protected java.awt.Color[] |
getColors()
Determines the colors of the tracking graphs. |
abstract java.lang.String |
getDescription()
Returns the description for this tracking window. |
protected int |
getMaxTrack()
Determines the number of tracking graphs. |
protected abstract java.lang.String |
getSourceDesc(int sourceIndex)
Returns a short description of the specified source. |
int |
getStartCycle()
Returns the cycle this window started tracking |
protected abstract java.lang.String |
getYLabel()
Returns the Y-axis label |
protected void |
init(int _startCycle)
DOCUMENT ME! |
protected abstract float |
nextSample(int sourceIndex)
Returns the next sample to be 'tracked'. |
void |
paint(java.awt.Graphics g)
Draws the data in the graphics buffer onto the screen. |
void |
redraw()
Redraws the buffer and paints it to the screen. |
void |
reset()
DOCUMENT ME! |
void |
saveData(java.lang.String filename,
SimModel model)
Save data to a CSV file. |
void |
setBounds(int x,
int y,
int width,
int height)
DOCUMENT ME! |
void |
setSize(int width,
int height)
Sets the size for this View |
void |
setStartCycle(int cycle)
Sets the cycle this window started tracking |
void |
showGraph(int index,
boolean b)
Either shows or hides tracking graph index. |
void |
update(java.awt.Graphics g)
Override default update() to avoid flickering. |
void |
update(java.util.Observable o,
java.lang.Object arg)
This method is called by the notifyObservers()
method in the Model representing the infrastructure. |
| Methods inherited from class java.awt.Canvas |
|---|
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String SEP
protected static final int MAX_DATA
protected int MAX_TRACK
protected java.awt.Color[] colors
protected boolean[] show
protected java.awt.image.BufferedImage buffer
protected float[][] trackData
protected int startCycle
protected int endCycle
protected float xStep
protected int highlightIndex
protected java.lang.String[] highlightText
protected java.lang.String highlightCycle
protected int curIndex
protected float maximum
protected int trackRate
protected int trackCount
| Constructor Detail |
|---|
public TrackingView(int _startCycle)
TrackingView. A TrackingView is
a component displaying a tracking graph.
_startCycle - The cycle this view starts tracking.| Method Detail |
|---|
protected void init(int _startCycle)
_startCycle - DOCUMENT ME!public void reset()
public int getStartCycle()
public void setStartCycle(int cycle)
cycle - DOCUMENT ME!protected int getMaxTrack()
protected java.awt.Color[] getColors()
public void showGraph(int index,
boolean b)
index.
index - DOCUMENT ME!b - DOCUMENT ME!protected abstract float nextSample(int sourceIndex)
sourceIndex - DOCUMENT ME!
protected abstract java.lang.String getSourceDesc(int sourceIndex)
sourceIndex - DOCUMENT ME!
public abstract java.lang.String getDescription()
protected abstract java.lang.String getYLabel()
public void update(java.util.Observable o,
java.lang.Object arg)
notifyObservers()
method in the Model representing the infrastructure.
update in interface java.util.Observero - The observed Model.arg - Optional arguments.public void redraw()
public void drawBuffer()
public void update(java.awt.Graphics g)
update in class java.awt.Canvasg - DOCUMENT ME!public void paint(java.awt.Graphics g)
paint in class java.awt.Canvasg - the Graphics objects of this view.
public void setSize(int width,
int height)
View
setSize in class java.awt.Componentwidth - the new widthheight - the new height
public void setBounds(int x,
int y,
int width,
int height)
setBounds in class java.awt.Componentx - DOCUMENT ME!y - DOCUMENT ME!width - DOCUMENT ME!height - DOCUMENT ME!protected void collapseData()
public void saveData(java.lang.String filename,
SimModel model)
throws java.io.IOException
filename - DOCUMENT ME!model - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||