onbon.bx06.area.unit
类 CompositeBxUnit

java.lang.Object
  继承者 onbon.bx06.area.unit.CompositeBxUnit

public class CompositeBxUnit
extends Object

组合式单元。

作者:
ONBON

构造方法摘要
CompositeBxUnit(String name, BxUnit... units)
          建构子。
 
方法摘要
 Rectangle arrange(Rectangle container, int x, int y, boolean center)
          重整计算各单元的座标。
 void draw(Graphics2D g2d)
          绘制底图。
 Font getFont()
          取得字型。
 Color getForeground()
          取得前景色。
 BxUnit[] getUnits()
          被组合的单元。
 int getX()
          取得相对于时间区域 X 座标的 X 座标。
 int getY()
          取得相对于时间区域 Y 座标的 Y 座标。
 void offsetX(int offset)
          偏移 X 座标。
 void offsetY(int offset)
          偏移 Y 座标。
 void preview(Graphics2D g2d, int areaX, int areaY)
          绘制底图。
 void setFont(Font font)
          设定字型。
 void setForeground(Color foreground)
          设定前景色。
 String toString()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

CompositeBxUnit

public CompositeBxUnit(String name,
                       BxUnit... units)
建构子。

参数:
name - 名称。
units - 被组合的单元。
方法详细信息

offsetX

public void offsetX(int offset)
偏移 X 座标。

参数:
offset - X 座标。

offsetY

public void offsetY(int offset)
偏移 Y 座标。

参数:
offset - Y 座标。

getX

public int getX()
取得相对于时间区域 X 座标的 X 座标。

返回:
X 座标。

getY

public int getY()
取得相对于时间区域 Y 座标的 Y 座标。

返回:
Y 座标。

getUnits

public BxUnit[] getUnits()
被组合的单元。

返回:
单元。

getFont

public Font getFont()
取得字型。

返回:
字型。

setFont

public void setFont(Font font)
设定字型。

参数:
font - 字型。

getForeground

public Color getForeground()
取得前景色。

返回:
前景色。

setForeground

public void setForeground(Color foreground)
设定前景色。

参数:
foreground - 前景色。

arrange

public Rectangle arrange(Rectangle container,
                         int x,
                         int y,
                         boolean center)
重整计算各单元的座标。

参数:
container - 原区域大小。
x - 此单元配置 X 座标。
y - 此单元配置 X 座标。
center - 置中。
返回:
新区域大小。

preview

public void preview(Graphics2D g2d,
                    int areaX,
                    int areaY)
绘制底图。

参数:
g2d - 图布。
areaX - 区域 X 座标。
areaY - 区域 Y 座标。

draw

public void draw(Graphics2D g2d)
绘制底图。

参数:
g2d - 图布。

toString

public String toString()
覆盖:
类 Object 中的 toString


Copyright © 2018 onbon. All rights reserved.