org.simBio.sim.analyzer.graph.plot
Class AbstractPlot

java.lang.Object
  extended by org.simBio.sim.analyzer.graph.plot.AbstractPlot
All Implemented Interfaces:
IPlot
Direct Known Subclasses:
PlotDisplay, PlotPrinter

public abstract class AbstractPlot
extends java.lang.Object
implements IPlot

グラフ、描画対象(画面/プリンタ)毎の描画処理を行うための基底クラス.

Author:
misaki

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.simBio.sim.analyzer.graph.plot.IPlot
IPlot.Item
 
Field Summary
protected  IPlot.Item legend
           
protected  int nTarget
           
protected  int nTargetOrigin
           
protected  AbstractGraph parent
           
protected  java.awt.Rectangle rectangleBounds
           
protected  java.awt.Rectangle rectanglePage
           
protected  java.awt.Rectangle rectangleView
           
protected  IPlot.Item title
           
 
Constructor Summary
AbstractPlot(AbstractGraph parent)
           
 
Method Summary
 void drawLine(java.awt.Graphics2D graphics2d, double x1, double y1, double x2, double y2, int nGraph)
          線を描画する.
protected  java.awt.Color getColor(int nGraph)
          系列番号毎の描画色を取得する.
 IPlot.Item getLegend()
          凡例描画用のItemオブジェクトを取得する.
 java.awt.Rectangle getRectangleBounds()
          グラフ・タイトル・凡例の描画領域を取得する.
 java.awt.Rectangle getRectanglePage()
          ページ全体の領域を取得する.
 java.awt.Rectangle getRectangleView()
          グラフ本体の描画領域を取得する.
 IPlot.Item getTitle()
          タイトル描画用のItemオブジェクトを取得する.
 void init(int nTarget, int nTargetOrigin)
          初期化を行う.
 void setRectanglePage(java.awt.Rectangle rect)
          ページ全体の領域をセットする.
 void setSizePage(java.awt.Dimension size)
          左上座標を(0,0)として、ページ全体のサイズをセットする.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.simBio.sim.analyzer.graph.plot.IPlot
drawPoint, prepareLegend, prepareTitle
 

Field Detail

nTargetOrigin

protected int nTargetOrigin

nTarget

protected int nTarget

parent

protected AbstractGraph parent

legend

protected IPlot.Item legend

title

protected IPlot.Item title

rectangleView

protected java.awt.Rectangle rectangleView

rectangleBounds

protected java.awt.Rectangle rectangleBounds

rectanglePage

protected java.awt.Rectangle rectanglePage
Constructor Detail

AbstractPlot

public AbstractPlot(AbstractGraph parent)
Parameters:
parent - 描画対象のGraphオブジェクト
Method Detail

init

public void init(int nTarget,
                 int nTargetOrigin)
Description copied from interface: IPlot
初期化を行う.

Specified by:
init in interface IPlot
Parameters:
nTarget - 描画する系列数
nTargetOrigin - 描画する系列の最小値

drawLine

public void drawLine(java.awt.Graphics2D graphics2d,
                     double x1,
                     double y1,
                     double x2,
                     double y2,
                     int nGraph)
Description copied from interface: IPlot
線を描画する.
  1. 高速に描画するために、最適化処理を入れている。
  2. 本メソッドは、グラフ枠、目盛り等の描画には使用しないこと。

Specified by:
drawLine in interface IPlot
Parameters:
graphics2d - 描画対象のGraphics2D
x1 - 始点X座標
y1 - 始点Y座標
x2 - 終点X座標
y2 - 終点Y座標
nGraph - グラフの系列番号(0..n)

getColor

protected java.awt.Color getColor(int nGraph)
系列番号毎の描画色を取得する.

Parameters:
nGraph - 系列番号
Returns:
表示する色コード

getTitle

public IPlot.Item getTitle()
Description copied from interface: IPlot
タイトル描画用のItemオブジェクトを取得する.

Specified by:
getTitle in interface IPlot
Returns:
タイトル描画用のItemオブジェクト

getLegend

public IPlot.Item getLegend()
Description copied from interface: IPlot
凡例描画用のItemオブジェクトを取得する.

Specified by:
getLegend in interface IPlot
Returns:
凡例描画用のItemオブジェクト

getRectangleView

public java.awt.Rectangle getRectangleView()
Description copied from interface: IPlot
グラフ本体の描画領域を取得する. グラフ領域の設定時は、本メソッドで取得したRectangleに対して設定すること。

Specified by:
getRectangleView in interface IPlot
Returns:
グラフ本体の描画領域

getRectangleBounds

public java.awt.Rectangle getRectangleBounds()
Description copied from interface: IPlot
グラフ・タイトル・凡例の描画領域を取得する. グラフ領域の設定時は、本メソッドで取得したRectangleに対して設定すること。

Specified by:
getRectangleBounds in interface IPlot
Returns:
グラフ・タイトル・凡例の描画領域

setRectanglePage

public void setRectanglePage(java.awt.Rectangle rect)
Description copied from interface: IPlot
ページ全体の領域をセットする.

Specified by:
setRectanglePage in interface IPlot

setSizePage

public void setSizePage(java.awt.Dimension size)
Description copied from interface: IPlot
左上座標を(0,0)として、ページ全体のサイズをセットする.

Specified by:
setSizePage in interface IPlot

getRectanglePage

public java.awt.Rectangle getRectanglePage()
Description copied from interface: IPlot
ページ全体の領域を取得する.

Specified by:
getRectanglePage in interface IPlot
Returns:
ページ全体の領域


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