|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectts.graph.GraphImage
public abstract class GraphImage
グラフ画像作成クラス。
グラフを描画し、それをファイルやストリームに出力するための抽象クラスである。
フィールドの概要 | |
---|---|
protected static int |
B
下のインデックスを示す定数。 |
protected static int |
H
高さのインデックスを示す定数。 |
protected static int |
L
左のインデックスを示す定数。 |
protected static int |
R
右のインデックスを示す定数。 |
protected static int |
T
上のインデックスを示す定数。 |
static java.lang.String |
TYPE_JPEG
JPEG形式を示す画像タイプ値。 |
static java.lang.String |
TYPE_PNG
PNG形式を示す画像タイプ値。 |
protected static int |
W
幅のインデックスを示す定数。 |
コンストラクタの概要 | |
---|---|
GraphImage()
デフォルト・コンストラクタ。 |
メソッドの概要 | |
---|---|
java.io.File |
createImageFile(java.lang.String type,
java.io.File file)
グラフを描画した画像ファイルを作成する。 |
java.io.File |
createImageFile(java.lang.String type,
java.lang.String path)
グラフを描画した画像ファイルを作成する。 |
protected void |
drawArc(float x,
float y,
float rx,
float ry,
float startAngle,
float endAngle)
弧を描画する。 |
protected void |
drawBackGround()
背景を描画する。 |
protected void |
drawBorder(java.awt.Rectangle rc)
描画領域の境界線を描画する。 |
protected void |
drawCircle(float x,
float y,
float r)
円を描画する。 |
protected void |
drawEllipse(float x,
float y,
float rx,
float ry)
楕円を描画する。 |
protected abstract void |
drawGraph(java.awt.Rectangle drawnBounds)
グラフを描画する。 |
protected void |
drawLine(float x0,
float y0,
float x1,
float y1)
直線を描画する。 |
protected void |
drawPolygon(float[] x,
float[] y)
多角形を描画する。 |
protected void |
drawPolyLine(float[] x,
float[] y)
折れ線を描画する。 |
protected void |
drawRect(float x0,
float y0,
float x1,
float y1)
四角を描画する。 |
protected void |
drawText(java.lang.String text,
float x,
float y)
文字列を描画する。 |
protected void |
drawText(java.lang.String text,
float x,
float y,
float deg)
文字列を角度を付けて描画する。 |
protected void |
fillArc(float x,
float y,
float rx,
float ry,
float startAngle,
float endAngle)
塗りつぶされた弧を描画する。 |
protected void |
fillCircle(float x,
float y,
float r)
塗りつぶされた円を描画する。 |
protected void |
fillEllipse(float x,
float y,
float rx,
float ry)
塗りつぶされた楕円を描画する。 |
protected void |
fillPolygon(float[] x,
float[] y)
塗りつぶされた多角形を描画する。 |
protected void |
fillRect(float x0,
float y0,
float x1,
float y1)
塗りつぶされた四角を描画する。 |
java.awt.Rectangle |
getDrawnBounds()
グラフの描画領域を求める。 |
int |
getHeight()
画像の高さを取得する。 |
int[] |
getMargin()
グラフ描画領域に対するマージンを格納した配列を取得する。 |
protected float[] |
getTextDrawnBounds(java.lang.String text,
float x,
float y)
文字列を描画する時の領域を取得する。 |
protected float[] |
getTextDrawnBounds(java.lang.String text,
float x,
float y,
float deg)
文字列を描画する時の領域を取得する。 |
protected float[] |
getTextSize(java.lang.String text)
文字列のサイズを取得する。 |
int |
getWidth()
画像の幅を取得する。 |
protected java.awt.Graphics2D |
graphics()
描画に使用しているグラフィックス・オブジェクトを取得する。 |
void |
outputImage(java.lang.String type,
java.io.OutputStream ostream)
グラフを描画して出力ストリームに出力する。 |
protected void |
setAntiAliasing(boolean on)
図形のアンチエイリアシングの有効・無効を設定する。 |
void |
setBgColor(java.awt.Color color)
背景色を設定する。 |
void |
setBorderStyle(LineStyle style)
境界線のスタイルを設定する。 |
protected FillStyle |
setFillStyle(FillStyle fillStyle)
塗りつぶしのスタイルを設定する。 |
protected LineStyle |
setLineStyle(LineStyle lineStyle)
線のスタイルを設定する。 |
void |
setMargin(int left,
int top,
int right,
int bottom)
グラフ描画領域に対するマージンを設定する。 |
protected void |
setOrigin(int x,
int y)
画像に対する描画領域の原点に設定する。 |
protected void |
setScale(double sx,
double sy)
画像に対する描画領域の倍率を設定する。 |
void |
setSize(int w,
int h)
画像のサイズを設定する。 |
protected void |
setTextAntiAliasing(boolean on)
テキストのアンチエイリアシングの有効・無効を設定する。 |
protected TextStyle |
setTextStyle(TextStyle textStyle)
テキストのスタイルを設定する。 |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
---|
public static final java.lang.String TYPE_PNG
public static final java.lang.String TYPE_JPEG
protected static final int W
protected static final int H
protected static final int L
protected static final int T
protected static final int R
protected static final int B
コンストラクタの詳細 |
---|
public GraphImage()
メソッドの詳細 |
---|
public void setSize(int w, int h)
w
- 画像の幅。h
- 画像の高さ。public int getWidth()
public int getHeight()
public void setMargin(int left, int top, int right, int bottom)
left
- 左側のマージン。top
- 上側のマージン。right
- 右側のマージン。bottom
- 下側のマージン。public int[] getMargin()
public void setBgColor(java.awt.Color color)
color
- 背景色。public void setBorderStyle(LineStyle style)
style
- 境界線のスタイル。public java.awt.Rectangle getDrawnBounds()
Rectangle
オブジェクト。public java.io.File createImageFile(java.lang.String type, java.lang.String path) throws java.io.IOException
type
- 画像タイプ。path
- ファイル・パス。
java.io.IOException
- ファイルの出力中に例外が発生した場合。public java.io.File createImageFile(java.lang.String type, java.io.File file) throws java.io.IOException
type
- 画像タイプ。file
- 画像ファイルのFile
オブジェクト。
java.io.IOException
- ファイルの出力中に例外が発生した場合。public void outputImage(java.lang.String type, java.io.OutputStream ostream) throws java.io.IOException
type
- 画像タイプ。ostream
- 出力ストリーム。
java.io.IOException
- ストリームへの出力中に例外が発生した場合。protected abstract void drawGraph(java.awt.Rectangle drawnBounds)
drawnBounds
- 描画領域。protected java.awt.Graphics2D graphics()
protected void setAntiAliasing(boolean on)
on
- アンチエイリアシングを有効にする場合はtrueを指定する。protected void setTextAntiAliasing(boolean on)
on
- アンチエイリアシングを有効にする場合はtrueを指定する。protected LineStyle setLineStyle(LineStyle lineStyle)
lineStyle
- 線のスタイル。
protected FillStyle setFillStyle(FillStyle fillStyle)
fillStyle
- 塗りつぶしのスタイル。
protected TextStyle setTextStyle(TextStyle textStyle)
textStyle
- テキストのスタイルを設定する。
protected void setOrigin(int x, int y)
x
- 画像上の水平方向の座標。y
- 画像上の垂直方向の座標。protected void setScale(double sx, double sy)
sx
- 画像に対する水平方向の倍率。sy
- 画像に対する垂直方向の倍率。protected void drawBackGround()
protected void drawBorder(java.awt.Rectangle rc)
rc
- 描画領域。protected void drawLine(float x0, float y0, float x1, float y1)
x0
- 直線の始点のx座標。y0
- 直線の始点のy座標。x1
- 直線の終点のx座標。y1
- 直線の終点のy座標。protected void drawRect(float x0, float y0, float x1, float y1)
x0
- 四角の左端のx座標。y0
- 四角の上端のy座標。x1
- 四角の右端のx座標。y1
- 四角の下端のy座標。protected void fillRect(float x0, float y0, float x1, float y1)
x0
- 四角の左端のx座標。y0
- 四角の上端のy座標。x1
- 四角の右端のx座標。y1
- 四角の下端のy座標。protected void drawPolyLine(float[] x, float[] y)
x
- 点のx座標の配列。y
- 点のy座標の配列。
java.lang.IllegalArgumentException
- x座標の配列とy座標の配列のサイズが異なる
場合。protected void drawPolygon(float[] x, float[] y)
x
- 頂点のx座標の配列。y
- 頂点のy座標の配列。
java.lang.IllegalArgumentException
- x座標の配列とy座標の配列のサイズが異なる
場合。protected void fillPolygon(float[] x, float[] y)
x
- 頂点のx座標の配列。y
- 頂点のy座標の配列。
java.lang.IllegalArgumentException
- x座標の配列とy座標の配列のサイズが異なる
場合。protected void drawCircle(float x, float y, float r)
x
- 中心のx座標。y
- 中心のy座標。r
- 半径。protected void fillCircle(float x, float y, float r)
x
- 中心のx座標。y
- 中心のy座標。r
- 半径。protected void drawEllipse(float x, float y, float rx, float ry)
x
- 中心のx座標。y
- 中心のy座標。rx
- x方向の半径。ry
- y方向の半径。protected void fillEllipse(float x, float y, float rx, float ry)
x
- 中心のx座標。y
- 中心のy座標。rx
- x方向の半径。ry
- y方向の半径。protected void drawArc(float x, float y, float rx, float ry, float startAngle, float endAngle)
x
- 中心のx座標。y
- 中心のy座標。rx
- x方向の半径。ry
- y方向の半径。startAngle
- 開始角度 [deg]。endAngle
- 開始角度 [deg]。protected void fillArc(float x, float y, float rx, float ry, float startAngle, float endAngle)
x
- 中心のx座標。y
- 中心のy座標。rx
- x方向の半径。ry
- y方向の半径。startAngle
- 開始角度 [deg]。endAngle
- 開始角度 [deg]。protected void drawText(java.lang.String text, float x, float y)
setScale(float,float)
メソッドで倍率を設定した場合、文字列の表示位置はそれに合わせて変化する
が、フォント・サイズは変化しない。
text
- 描画する文字列。x
- 文字列の左上のx座標。y
- 文字列の左上のy座標。protected void drawText(java.lang.String text, float x, float y, float deg)
text
- 描画する文字列。x
- 文字列の左上のx座標。y
- 文字列の左上のy座標。deg
- 文字列を傾ける角度 [deg]。protected float[] getTextSize(java.lang.String text)
text
- 文字列。
protected float[] getTextDrawnBounds(java.lang.String text, float x, float y)
text
- 文字列。x
- 文字列の描画位置のx座標。y
- 文字列の描画位置のy座標。
protected float[] getTextDrawnBounds(java.lang.String text, float x, float y, float deg)
text
- 文字列。x
- 文字列の描画位置のx座標。y
- 文字列の描画位置のy座標。deg
- 文字列を傾ける角度 [deg]。
|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |