public class BackgroundElement extends java.lang.Object implements Basic
Modifier and Type | Field and Description |
---|---|
static int |
TEXT_POSITION_BottomLeft |
static int |
TEXT_POSITION_BottomMiddle |
static int |
TEXT_POSITION_BottomRight |
static int |
TEXT_POSITION_Middle |
static int |
TEXT_POSITION_MiddleLeft |
static int |
TEXT_POSITION_MiddleRight |
static int |
TEXT_POSITION_TopLeft |
static int |
TEXT_POSITION_TopMiddle |
static int |
TEXT_POSITION_TopRight |
static int |
TEXT_Size_Big |
static int |
TEXT_Size_Normal |
static int |
TEXT_Size_Small |
static int |
TEXT_Style_Bold |
static int |
TEXT_Style_Italic |
static int |
TEXT_Style_Plain |
Constructor and Description |
---|
BackgroundElement(Model model,
java.lang.String id,
java.lang.String text,
int textSize,
int textStyle,
double level,
java.lang.String imageId)
Background element to paint a string
|
BackgroundElement(Model model,
java.lang.String id,
java.lang.String text,
int textPosition,
int textSize,
int textStyle,
double level,
java.lang.String imageId)
Background element with all features
|
Modifier and Type | Method and Description |
---|---|
Grafic |
createGrafic(java.lang.String viewId,
java.awt.Point middle,
java.awt.Color fg,
java.awt.Color bg)
create grafic of background element with fixed middle point
The size is the size, that the text need to display
|
Grafic |
createGrafic(java.lang.String viewId,
java.awt.Point middle,
java.awt.Color fg,
java.awt.Color bg,
java.awt.Dimension size)
create grafic of background element with fixed middle point and fixed size
|
Grafic |
createGrafic(java.lang.String viewId,
java.awt.Point topLeft,
java.awt.Point bottomRight,
java.awt.Color fg,
java.awt.Color bg)
create grafic of background element with fixed corners
|
Grafic |
getGrafic()
get ProcessGrafic, created before
|
java.lang.String |
getId()
get id of background element
|
java.lang.String |
getImageId()
Get ImageId, may be null
This id is a key in this.getModel().getImage(id)
|
double |
getLevel()
Get level of background element.
|
Model |
getModel() |
java.lang.String |
getName()
get name of background element
|
java.lang.String |
getText()
Get text of background element.
|
int |
getTextPosition()
Get text position of background element.
|
int |
getTextSize()
Get text size of background element.
|
int |
getTextStyle()
Get text style of background element.
|
void |
setData(java.lang.String text,
int textPosition,
int textSize,
int textStyle,
java.awt.Color foreground,
java.awt.Color background,
java.lang.String imageId)
Updates and repaints text properties
|
void |
setName(java.lang.String name)
set name of background element
|
public static final int TEXT_POSITION_TopLeft
public static final int TEXT_POSITION_TopMiddle
public static final int TEXT_POSITION_TopRight
public static final int TEXT_POSITION_MiddleLeft
public static final int TEXT_POSITION_Middle
public static final int TEXT_POSITION_MiddleRight
public static final int TEXT_POSITION_BottomLeft
public static final int TEXT_POSITION_BottomMiddle
public static final int TEXT_POSITION_BottomRight
public static final int TEXT_Style_Plain
public static final int TEXT_Style_Bold
public static final int TEXT_Style_Italic
public static final int TEXT_Size_Normal
public static final int TEXT_Size_Small
public static final int TEXT_Size_Big
public BackgroundElement(Model model, java.lang.String id, java.lang.String text, int textSize, int textStyle, double level, java.lang.String imageId)
id
- id of background elementtext
- text to show. When null, no text is shown.textSize
- for values look at TEXT_SIZE_...textStyle
- for values look at TEXT_STYLE_...level
- elements with low level are painted in front
of elements with high levelimageId
- image for background, maybe nullpublic BackgroundElement(Model model, java.lang.String id, java.lang.String text, int textPosition, int textSize, int textStyle, double level, java.lang.String imageId)
model
- used animation.model.Modelid
- id of background elementtext
- text to show. When null, no text is shown.textPosition
- for values look at TEXT_POSITION_...textSize
- for values look at TEXT_SIZE_...textStyle
- for values look at TEXT_STYLE_...level
- elements with low level are painted in front
of elements with high levelimageId
- image for background, maybe nullpublic java.lang.String getId()
getId
in interface ClassBasic
public void setName(java.lang.String name)
name
- public java.lang.String getName()
public double getLevel()
public java.lang.String getText()
public java.lang.String getImageId()
public int getTextPosition()
public int getTextSize()
public int getTextStyle()
public void setData(java.lang.String text, int textPosition, int textSize, int textStyle, java.awt.Color foreground, java.awt.Color background, java.lang.String imageId)
text
- textPosition
- textSize
- textStyle
- foreground
- background
- imageId
- public Grafic createGrafic(java.lang.String viewId, java.awt.Point topLeft, java.awt.Point bottomRight, java.awt.Color fg, java.awt.Color bg)
x0
- x coordinate of top left cornery0
- y coordinate of top left cornerx1
- x coordinate of bottom right cornery1
- y coordinate of bottom right cornerfg
- text colorbg
- background color. When null, the background is transparentpublic Grafic createGrafic(java.lang.String viewId, java.awt.Point middle, java.awt.Color fg, java.awt.Color bg, java.awt.Dimension size)
x
- x coordinate of the middle pointy
- y coordinate of the middle pointfg
- text colorbg
- background color. When null, the background is transparentwidth
- width of background element.height
- heigth of background element.public Grafic createGrafic(java.lang.String viewId, java.awt.Point middle, java.awt.Color fg, java.awt.Color bg)
viewId
- middle
- fg
- bg
-