org.simBio.sim.analyzer.graph
Class BasicGraph

java.lang.Object
  extended by org.simBio.core.Component
      extended by org.simBio.core.Parameter
          extended by org.simBio.core.Composite
              extended by org.simBio.core.Analyzer
                  extended by org.simBio.sim.analyzer.VisualizeAnalyzer
                      extended by org.simBio.sim.analyzer.graph.AbstractGraph
                          extended by org.simBio.sim.analyzer.graph.BasicGraph
All Implemented Interfaces:
Node
Direct Known Subclasses:
Graph, RelationGraph

public abstract class BasicGraph
extends AbstractGraph

Graph which displays time series data.

Notice

  1. Supports redrawing
  2. Does not optimise redrawing operations for the screen.
  3. Can be used as a base for the general Graph group.

Version:
$Id: BasicGraph.java,v 1.3 2007/04/07 08:44:07 nsarai Exp $
Author:
misaki

Field Summary
protected  java.awt.Container container
          container of the Viewer which the Graph belongs to
protected  java.awt.Graphics2D graphics2d
          Graphics2D for redrawing during analyze()
protected  TimeSeriesValues values
          storage location of the time series data
 
Fields inherited from class org.simBio.sim.analyzer.graph.AbstractGraph
axisX, axisY, interval, log, maxTime, nextTime, nTarget, nTargetOrigin, page, plotDisplay, plotPrinter, target, targetName, targetScale, targetShortName, thisGraph, valuesBuffer
 
Fields inherited from class org.simBio.core.Parameter
value
 
Constructor Summary
BasicGraph()
           
 
Method Summary
protected  void analyzeSub(double t, double[] valuesBuffer, IPlot plot)
          Plot targets.
 double getTimeMax()
          Get maximum time
 double getTimeMin()
          Get minimum time
 TimeSeriesSingle getTimeSeries(java.lang.Object node)
          Gets a time series class for the specified Node.
protected  void paintGraph(java.awt.Graphics2D graphics2d, IPlot plot)
          Draw graph.
protected  void paintGraphSub(java.awt.Graphics2D graphics2d, IPlot plot)
          Performs graph drawing. Faithfully plots the value of each instant.
protected  void prepare()
          Set link to the targets.
protected  void printGraph(java.awt.Graphics2D graphics2d, IPlot plot)
          Draw graph.
protected  void quit()
          called before destruction,
instanceを破棄する前に呼び出されます。
 void resetBuffer()
          画面状態をリセットする.
protected  void resize(IPlot plot)
          Recalculates the Graph size, based on the size of the current parent window.
protected  void setLinks()
          Link to the Viewer, AxisX, AxisY and count number of the target, get array.
 
Methods inherited from class org.simBio.sim.analyzer.graph.AbstractGraph
analyze, changeScale, doRepaint, drawLine, drawPoint, paintAxises, paintBackground, paintComponent, paintLegend, prepareRepaint, printAxises, printBackground, printComponent, printLegend, setAreaChanged
 
Methods inherited from class org.simBio.sim.analyzer.VisualizeAnalyzer
getColorParameter, getDouble, getFontParameter, getNodeHierarchically, getNodeRecursive, repaint
 
Methods inherited from class org.simBio.core.Composite
accept, getLink, getNode, getNodesIterator, getNodesSize
 
Methods inherited from class org.simBio.core.Parameter
addValue, getValue, getValueString, setInitializer, setValue, setValueString, setValueToField
 
Methods inherited from class org.simBio.core.Component
addDydt, end, getIndent, getIndentedShortName, getName, getName, getParent, getRoot, getShortName, getUnits, isNamed, isPrefixed, logIndented
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.simBio.core.Node
addDydt, addValue, getValue, setValue
 

Field Detail

values

protected TimeSeriesValues values
storage location of the time series data


graphics2d

protected java.awt.Graphics2D graphics2d
Graphics2D for redrawing during analyze()


container

protected java.awt.Container container
container of the Viewer which the Graph belongs to

Constructor Detail

BasicGraph

public BasicGraph()
Method Detail

resetBuffer

public void resetBuffer()
Description copied from class: VisualizeAnalyzer
画面状態をリセットする. 新しいmodelをロードしたり(setLinks())、 時刻を変更した後に計算処理を行ったり(org.simBio.sim.gui.GUI#getJMenuModel()) した際に、呼び出され、描画再描画用のバッファなど、各Nodeで持っている内部状態を リセットします。
下位のnodeを持つ場合については、明示的に呼び出してやるように、super() を 呼ぶようにしてください。

Overrides:
resetBuffer in class VisualizeAnalyzer

quit

protected void quit()
Description copied from class: Component
called before destruction,
instanceを破棄する前に呼び出されます。

Overrides:
quit in class Component

setLinks

protected void setLinks()
Description copied from class: AbstractGraph
Link to the Viewer, AxisX, AxisY and count number of the target, get array.

Overrides:
setLinks in class AbstractGraph
See Also:
Component.setLinks()

prepare

protected void prepare()
Description copied from class: AbstractGraph
Set link to the targets.

Overrides:
prepare in class AbstractGraph
See Also:
Component.prepare()

analyzeSub

protected void analyzeSub(double t,
                          double[] valuesBuffer,
                          IPlot plot)
Plot targets.

Specified by:
analyzeSub in class AbstractGraph
Parameters:
t - time
valuesBuffer - array of calculation results
plot - drawing operation object
See Also:
AbstractGraph.analyzeSub(double, double[], IPlot)

resize

protected void resize(IPlot plot)
Description copied from class: AbstractGraph
Recalculates the Graph size, based on the size of the current parent window.

Overrides:
resize in class AbstractGraph
Parameters:
plot - drawing operation object

paintGraph

protected void paintGraph(java.awt.Graphics2D graphics2d,
                          IPlot plot)
Description copied from class: AbstractGraph
Draw graph.

Specified by:
paintGraph in class AbstractGraph
Parameters:
graphics2d - drawn Graphics
plot - drawing operation object

printGraph

protected void printGraph(java.awt.Graphics2D graphics2d,
                          IPlot plot)
Description copied from class: AbstractGraph
Draw graph. Called by JPanel#printComponent() on Event thread.

Overrides:
printGraph in class AbstractGraph
Parameters:
graphics2d - Graphics which are drawn
plot - drawing operation object

paintGraphSub

protected void paintGraphSub(java.awt.Graphics2D graphics2d,
                             IPlot plot)
Performs graph drawing. Faithfully plots the value of each instant.

Parameters:
graphics2d - Graphics drawing object
plot - drawing operation object

getTimeMax

public double getTimeMax()
Get maximum time

Returns:
maximum time

getTimeMin

public double getTimeMin()
Get minimum time

Returns:
minimum time

getTimeSeries

public TimeSeriesSingle getTimeSeries(java.lang.Object node)
Gets a time series class for the specified Node.

Parameters:
node - Node that you wish to get
Returns:
time series class instance


Copyright © 2002-2008 Cell/Biodinamics simulation project. All Rights Reserved.