|
Kagetaka | |||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectnet.hizlab.kagetaka.rendering.block.Block
ブロック要素を表します。
フィールドの概要 | |
protected Insets |
border
ボーダー幅 |
int |
bottom
親ブロックに対してのブロックの下側の位置 |
protected ContainerBlock |
container
コンテナブロック |
protected int |
contentHeight
子要素の高さ |
protected Vector |
contents
子のブロックリスト |
protected Block |
defaultBlock
デフォルトの追加先ブロック |
int |
drawBottom
描画に必要なブロックの下側の位置 |
protected Drawkit |
drawkit
ドローキット |
int |
drawLeft
描画に必要なブロックの左側の位置 |
int |
drawRight
描画に必要なブロックの右側の位置 |
int |
drawTop
描画に必要なブロックの上側の位置 |
protected Insets |
frame
枠の大きさ |
protected int |
frameHeight
フレームの高さ( frame.top + frame.bottom ) |
protected int |
frameWidth
フレームの幅( frame.left + frame.right ) |
protected int |
height
ブロック内容物の高さ |
protected boolean |
isAdoptee
親が匿名ブロックかどうか |
protected boolean |
isEmpty
空のブロックかどうか |
int |
left
親ブロックに対してのブロックの左側の位置 |
Insets |
margin
マージン幅 |
static int |
MARGIN_BOTTOM
下マージン |
static int |
MARGIN_LEFT
左マージン |
static int |
MARGIN_RIGHT
右マージン |
static int |
MARGIN_TOP
上マージン |
static int |
MARKER_AFTER
after 用マーカー |
static int |
MARKER_BEFORE
before 用マーカー |
int |
maxHeight
ブロック全体の最大の高さ |
int |
minHeight
ブロック全体の最小の高さ |
protected Insets |
padding
パディング幅 |
protected Block |
parent
親ブロック |
protected int |
preferredHeight
ブロック内容物の推奨の高さ |
protected int |
preferredWidth
ブロック内容物の推奨の幅 |
int |
right
親ブロックに対してのブロックの右側の位置 |
protected static int |
SIZE_AUTO
サイズ自動 |
protected static int |
SIZE_NONE
サイズ無視 |
protected static int |
SIZE_PERCENT
サイズパーセント指定 |
Status |
status
ステータス |
int |
top
親ブロックに対してのブロックの上側の位置 |
protected int |
width
ブロック内容物の幅 |
コンストラクタの概要 | |
protected |
Block(Drawkit drawkit,
Status status,
ContainerBlock container,
Block parent)
ブロックを作成します。 |
メソッドの概要 | |
abstract void |
analyze(int minParentHeight,
int maxParentHeight)
自分のサイズの最小と最大の高さを算出します。 |
void |
appendBlock(Block block)
インラインブロックを追加します。 |
void |
appendFloat(FloatBlock block)
フロートブロックを追加します。 |
void |
appendForm(FormItem item)
フォームアイテムを追加します。 |
void |
appendImage(String src,
String alt,
Value width,
Value height,
int border,
int floatType)
画像を追加します。 |
void |
appendNewLine()
確定済み行を描画します。 |
void |
appendString(String text)
文字列を描画します。 |
protected void |
calculateFrame(int parentHeight)
ボーダー以外のフレーム関係のサイズを算出します。 |
protected void |
calculatePreferred()
ブロック内容物の推奨サイズを算出します。 |
Block |
commitBlock()
ブロックをコミットし、その親のブロックを返します。 |
protected Block |
commitChild()
最後の子のブロックがコミットしたときに呼び出され、 子のブロックに対する親(大抵は自分自身)を返す必要があります。 |
protected void |
commitDefaultBlock()
デフォルトの追加先ブロック defaultBlock をコミットします。 |
void |
commitRow()
テーブルの行を終了します。 |
Block |
createBlock(Status status,
Status markerStatus)
ブロックを作成し、作成したブロックを返します。 |
protected Block |
createBlockInternal(Status status,
Status markerStatus)
ブロックを作成し、作成したブロックを返します。 |
protected void |
draw(Canvas canvas,
int x,
int y)
ブロックを描画します。 |
protected void |
drawBackground(Canvas canvas,
int x,
int y)
背景画像・背景色を描画します。 |
protected void |
drawBorder(Canvas canvas,
int x,
int y)
ボーダーを描画します。 |
protected void |
drawContent(Canvas canvas,
int x,
int y)
内容物を描画します。 |
protected void |
ensureDefaultBlock()
デフォルトの追加先ブロック defaultBlock が存在するかを
チェックします。 |
protected Line |
getFirstLine()
最初の行を返します。 |
protected int |
getFrameHeight(int parentHeight)
フレーム(マージン + ボーダー + パディング)の高さを返します。 |
int |
getMargin(int parentHeight,
int sense)
validate(int, int, int, int, int, int) する前に、
マージンの幅を知りたい場合に、マージン幅を返します。
|
protected int |
getMarginOffset(int left,
int right)
マージン同士の打ち消しをして差分を返します。 |
Dimension |
getPreferredSize()
推奨サイズを返します。 |
protected void |
invalidate()
現在の計算を無効にして、再計算対象にします。 |
protected void |
layoutBlock(int newHeight,
int containerX,
int containerY)
指定された高さになるように、自分のブロック、及び下位のブロックを 調節します。 |
void |
setRuby(int mode)
ルビのモードを変更します。 |
void |
statusChanged(Status status)
ステータスが変更された場合。 |
String |
toString()
文字列表現を返します。 |
void |
validate(int parentHeight,
int prevLeftMargin,
int x,
int y,
int containerX,
int containerY)
再整形を行います。 |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
フィールドの詳細 |
protected Insets border
public int bottom
protected ContainerBlock container
protected int contentHeight
protected Vector contents
protected Block defaultBlock
public int drawBottom
protected Drawkit drawkit
public int drawLeft
public int drawRight
public int drawTop
protected Insets frame
protected int frameHeight
frame.top + frame.bottom
)
protected int frameWidth
frame.left + frame.right
)
protected int height
protected boolean isAdoptee
protected boolean isEmpty
public int left
public Insets margin
public static final int MARGIN_BOTTOM
public static final int MARGIN_LEFT
public static final int MARGIN_RIGHT
public static final int MARGIN_TOP
public static final int MARKER_AFTER
public static final int MARKER_BEFORE
public int maxHeight
public int minHeight
protected Insets padding
protected Block parent
protected int preferredHeight
protected int preferredWidth
public int right
protected static final int SIZE_AUTO
protected static final int SIZE_NONE
protected static final int SIZE_PERCENT
public Status status
public int top
protected int width
コンストラクタの詳細 |
protected Block(Drawkit drawkit, Status status, ContainerBlock container, Block parent)
drawkit
- ドローキットstatus
- ステータスcontainer
- コンテナブロックparent
- 親ブロックメソッドの詳細 |
public abstract void analyze(int minParentHeight, int maxParentHeight)
minHeight
、maxHeight
に設定します。
minParentHeight
- 親フレームの最小高
(親包含ブロックの最小の height
)maxParentHeight
- 親フレームの最大高
(親包含ブロックの最大の height
)public void appendBlock(Block block)
block
- インラインブロックpublic void appendFloat(FloatBlock block)
block
- フロートブロックpublic void appendForm(FormItem item)
item
- アイテムpublic void appendImage(String src, String alt, Value width, Value height, int border, int floatType)
src
- ソースalt
- 代替文字列width
- 幅height
- 高さborder
- ボーダーfloatType
- フロートタイプpublic void appendNewLine()
public void appendString(String text)
text
- 文字列protected void calculateFrame(int parentHeight)
margin
、padding
、frame
、
frameWidth
、frameHeight
に設定します。
parentHeight
- 親ブロックの内容物の高さprotected void calculatePreferred()
preferredWidth
、preferredHeight
に設定します。
public Block commitBlock()
protected Block commitChild()
protected void commitDefaultBlock()
defaultBlock
をコミットします。
public void commitRow()
public Block createBlock(Status status, Status markerStatus)
status
- ステータスmarkerStatus
- マーカーステータス。
マーカーが無い場合は null
protected final Block createBlockInternal(Status status, Status markerStatus)
status
- ステータスmarkerStatus
- マーカーステータス。
マーカーが無い場合は null
protected void draw(Canvas canvas, int x, int y)
canvas
- 描画するキャンバスx
- 親ブロック内容物の、キャンバス左上からの X 軸y
- 親ブロック内容物の、キャンバス左上からの Y 軸protected void drawBackground(Canvas canvas, int x, int y)
canvas
- キャンバスx
- 自ブロックの、キャンバス左上からの X 軸y
- 自ブロックの、キャンバス左上からの Y 軸protected void drawBorder(Canvas canvas, int x, int y)
canvas
- キャンバスx
- 自ブロックの、キャンバス左上からの X 軸y
- 自ブロックの、キャンバス左上からの Y 軸protected void drawContent(Canvas canvas, int x, int y)
canvas
- キャンバスx
- 自ブロック内容物の、キャンバス左上からの X 軸y
- 自ブロック内容物の、キャンバス左上からの Y 軸protected void ensureDefaultBlock()
defaultBlock
が存在するかを
チェックします。無い場合は作成する必要があります。
protected Line getFirstLine()
このメソッドは validate
後に使用できます。
protected int getFrameHeight(int parentHeight)
このメソッドはいつでも使用できます。
parentHeight
- 親ブロックの内容物の高さ
public int getMargin(int parentHeight, int sense)
validate(int, int, int, int, int, int)
する前に、
マージンの幅を知りたい場合に、マージン幅を返します。
このメソッドはいつでも使用できます。
parentHeight
- 親ブロックの内容物の高さsense
- 向き
protected final int getMarginOffset(int left, int right)
left
- 右のブロックの左マージンright
- 左のブロックの右マージン
public final Dimension getPreferredSize()
このメソッドはいつでも使用できます。
protected void invalidate()
protected void layoutBlock(int newHeight, int containerX, int containerY)
width
、bottom
、left
、
drawTop
、drawRight
、
drawBottom
、drawLeft
に設定し内容物の高さは newHeight
以上になってはいけません。
このメソッドはブロックの大きさが変わるたびに呼び出されます。
newHeight
- 既に計算済みの内容物の高さcontainerX
- コンテナブロックから自ブロック右上に対する XcontainerY
- コンテナブロックから自ブロック右上に対する Ypublic void setRuby(int mode)
mode
- ルビのモードpublic void statusChanged(Status status)
status
- 新しいステータスpublic String toString()
public void validate(int parentHeight, int prevLeftMargin, int x, int y, int containerX, int containerY)
height
、top
、right
、
contentHeight
フィールドと
calculateFrame(int)
、layoutBlock(int, int, int)
メソッドが設定するフィールドを、設定する必要があります。
parentHeight
- フレーム等を含めた新しい高さ
(親包含ブロックの height
)。
この高さ以内になるべく全てが収まるように再整形を行うprevLeftMargin
- 前のブロックの左マージンx
- 親包含ブロックから自ブロック右上に対する Xy
- 親包含ブロックから自ブロック右上に対する YcontainerX
- コンテナブロックから親ブロック右上に対する XcontainerY
- コンテナブロックから親ブロック右上に対する Y
|
Kagetaka | |||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
Copyright (c) 2002-2004 The Kagetaka Project 'November 20, 2004'