|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.analysis.plot.OpenGraph
public abstract class OpenGraph
The base class for the Ptolemy based open source charting components: OpenSequenceGraph and OpenHistogram. OpenGraph encapsulates a RepastPlot object, provides some reasonable defaults. It also implements ZoomListener, and adds a KeyListener to the plot in order to correctly undo a zoom with the 'r' key.
| Field Summary | |
|---|---|
static int |
CIRCLE
|
static int |
CROSS
|
static int |
DIAMOND
|
protected java.lang.String |
fileName
|
static int |
FILLED_CIRCLE
|
static int |
FILLED_DIAMOND
|
static int |
FILLED_SQUARE
|
static int |
FILLED_TRIANGLE
|
protected javax.swing.JFrame |
frame
|
static int |
HISTOGRAM
|
protected boolean |
inNormalState
|
protected java.awt.Point |
location
|
protected SimModel |
model
|
protected MovieMaker |
movieMaker
|
protected RepastPlot |
plot
|
static int |
PLUS_SIGN
|
static int |
SEQUENCE
|
static int |
SQUARE
|
protected java.lang.String |
title
|
static int |
TRIANGLE
|
protected double |
xIncr
|
protected double |
xMax
|
protected double |
xMin
|
protected double |
yIncr
|
protected double |
yMax
|
protected double |
yMin
|
| Fields inherited from interface uchicago.src.sim.gui.MediaProducer |
|---|
MPEG, QUICK_TIME |
| Constructor Summary | |
|---|---|
OpenGraph(java.lang.String title)
Creates an OpenGraph with the specified title and sets up some reasonable defaults. |
|
| Method Summary | |
|---|---|
void |
addMovieFrame()
Adds the currently displayed image as frame to a movie. setMovieName must be called before this method is called. |
void |
closeMovie()
Closes the movie, writing any remaining frames to the file. |
protected BinDataSource |
createBinDataSource(java.lang.Object target,
java.lang.String methodName)
Dynamically creates a BinDataSource wrapping the method call to the specified methodName on the specified target in BinDataSource.getBinValue(Object obj). |
protected BinDataSource |
createListBinDataSource(java.lang.Object listObj,
java.lang.String listObjMethodName)
|
protected Sequence |
createSequence(java.lang.Object feedFrom,
java.lang.String methodName)
Creates a Sequence, wrapping a call of specified methodName on the feedFrom object in Sequence.getSValue(). |
void |
display()
Displays this graph. |
void |
dispose()
Dispose of this graph. |
java.lang.String[] |
getAxisTitles()
Returns the axis titles as a String[] where the first element is x-axis label and the second is the y-axis label. |
java.awt.Dimension |
getSize()
Gets the size of the plot. |
java.lang.String |
getTitle()
Returns the title of this graph. |
double |
getXIncrement()
Get the the amount to increase or decrease the x-axis scale when a x value is out of the range of the current scale. |
double[] |
getXRange()
Returns the range of the x-axis as a double[] where the min is the 0th elements and the max the 1st. |
double |
getYIncrement()
Get the the amount to increase or decrease the y-axis scale when a y value is out of the range of the current scale. |
double[] |
getYRange()
Gets the range of the y-axis as a double[] where the min is the 0th elements and the max the 1st. |
abstract void |
record()
|
void |
setAxisTitles(java.lang.String xAxis,
java.lang.String yAxis)
Sets the axis titles. |
void |
setBars(double width,
double offset)
Sets the width and offset of the bars. |
void |
setLocation(int x,
int y)
Sets the screen location for this OpenGraph. |
void |
setMovieName(java.lang.String fileName,
java.lang.String movieType)
Sets the name and type of a movie. |
void |
setSize(int width,
int height)
Sets the size of the plot. |
void |
setSnapshotFileName(java.lang.String name)
|
void |
setXIncrement(double incr)
Sets the amount to increase or decrease the x-axis scale when a x value is out of the range of the current scale. |
void |
setXRange(double min,
double max)
Sets the initial range of the X-axis. |
void |
setXTick(double position,
java.lang.String label)
Associates a label with a particular x-axis tick. |
void |
setYIncrement(double incr)
Sets the amount to increase or decrease the y-axis scale when a y value is out of the range of the current scale. |
void |
setYRange(double min,
double max)
Sets the initial range of the y-axis. |
void |
step()
Records and updates the graph display. |
void |
takeSnapshot()
|
abstract void |
updateGraph()
|
void |
updateXTick(double position,
java.lang.String label,
int index)
Updates an x-axis tick label with a new one. |
void |
zoom(int x,
int y)
Zoom listener interface. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SEQUENCE
public static final int HISTOGRAM
public static final int FILLED_CIRCLE
public static final int CROSS
public static final int SQUARE
public static final int FILLED_TRIANGLE
public static final int DIAMOND
public static final int CIRCLE
public static final int PLUS_SIGN
public static final int FILLED_SQUARE
public static final int TRIANGLE
public static final int FILLED_DIAMOND
protected javax.swing.JFrame frame
protected boolean inNormalState
protected double xMin
protected double xMax
protected double yMin
protected double yMax
protected double xIncr
protected double yIncr
protected RepastPlot plot
protected SimModel model
protected java.awt.Point location
protected MovieMaker movieMaker
protected java.lang.String title
protected java.lang.String fileName
| Constructor Detail |
|---|
public OpenGraph(java.lang.String title)
| Method Detail |
|---|
public void setXRange(double min,
double max)
min - the minimum value of the rangemax - the maximum value of the rangepublic double[] getXRange()
public void setYRange(double min,
double max)
min - the minimum value of the rangemax - the maximum value of the rangepublic double[] getYRange()
public void setSize(int width,
int height)
width - the width of the plotheight - the height of the plotpublic java.awt.Dimension getSize()
public void setLocation(int x,
int y)
x - the x screen coordinatey - the y screen coordinatepublic java.lang.String getTitle()
public void setYIncrement(double incr)
public double getYIncrement()
public void setXIncrement(double incr)
public double getXIncrement()
public void setAxisTitles(java.lang.String xAxis,
java.lang.String yAxis)
xAxis - the title for the xAxisyAxis - the title for the yAxispublic java.lang.String[] getAxisTitles()
public void setXTick(double position,
java.lang.String label)
position - the position of the ticklabel - the label for that tick
public void updateXTick(double position,
java.lang.String label,
int index)
public void setBars(double width,
double offset)
public void step()
public abstract void record()
public abstract void updateGraph()
public void zoom(int x,
int y)
zoom in interface ZoomListenerpublic void display()
public void dispose()
protected BinDataSource createBinDataSource(java.lang.Object target,
java.lang.String methodName)
target - the target of the method callmethodName - the name of the method to call
BinDataSource
protected BinDataSource createListBinDataSource(java.lang.Object listObj,
java.lang.String listObjMethodName)
protected Sequence createSequence(java.lang.Object feedFrom,
java.lang.String methodName)
feedFrom - the target of the method callmethodName - the name of the method to call
Sequencepublic void takeSnapshot()
takeSnapshot in interface MediaProducerpublic void setSnapshotFileName(java.lang.String name)
setSnapshotFileName in interface MediaProducer
public void setMovieName(java.lang.String fileName,
java.lang.String movieType)
setMovieName in interface MediaProducerfileName - the name of the moviemovieType - the type of movie (e.g. DisplaySurface.QUICK_TIME)public void addMovieFrame()
addMovieFrame in interface MediaProducerpublic void closeMovie()
closeMovie in interface MediaProducer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||