public class CompositeBxUnit extends Object
Constructor and Description |
---|
CompositeBxUnit(String name,
BxUnit... units)
建构子。
|
Modifier and Type | Method and Description |
---|---|
void |
addHead(BxUnit unit)
在原本的单元最前增加新的单元。
|
void |
addTail(BxUnit unit)
在原本的单元最後增加新的单元。
|
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() |
public void addHead(BxUnit unit)
unit
- 单元。public void addTail(BxUnit unit)
unit
- 单元。public int getX()
public int getY()
public void offsetX(int offset)
offset
- X 座标。public void offsetY(int offset)
offset
- Y 座标。public BxUnit[] getUnits()
public Font getFont()
public void setFont(Font font)
font
- 字型。public Color getForeground()
public void setForeground(Color foreground)
foreground
- 前景色。public Rectangle arrange(Rectangle container, int x, int y, boolean center)
container
- 原区域大小。x
- 此单元配置 X 座标。y
- 此单元配置 X 座标。center
- 置中。public void draw(Graphics2D g2d)
g2d
- 图布。public void preview(Graphics2D g2d, int areaX, int areaY)
Copyright © 2020 onbon4j. All rights reserved.