public class GGProgressBar
extends java.lang.Object
Constructor and Description |
---|
GGProgressBar(GameGrid gg,
Location loc,
int width,
int height)
Creates a horizontal progress bar with default properties.
|
GGProgressBar(GameGrid gg,
Location loc,
int width,
int height,
boolean isHorizontal)
Creates a horizontal or vertical progress bar with default properties.
|
Modifier and Type | Method and Description |
---|---|
void |
remove(boolean doRefresh)
Removes the progress bar from the game grid.
|
void |
setBgColor(java.awt.Color color)
Sets the background color of the frame.
|
void |
setFont(java.awt.Font font)
Sets the font for the value/unit text.
|
void |
setFrameColor(java.awt.Color color)
Sets the border color of the frame.
|
void |
setMax(double max)
Sets the maximum value of the indicator.
|
void |
setMin(double min)
Sets the minimum value of the indicator.
|
void |
setPattern(java.lang.String pattern)
Sets the DecimalFormat pattern used to display the value.
|
void |
setStripColor(java.awt.Color color)
Sets the color of the indicator strip (filled rectangle).
|
void |
setTextColor(java.awt.Color color)
Sets the color of the text centered in the middle of the bar.
|
void |
setUnit(java.lang.String unit)
Sets the text displayed as unit.
|
void |
setValue(double value)
Sets the current value of the progress bar.
|
void |
setValue(double value,
boolean doRefresh)
Sets the current value of the progress bar.
|
public GGProgressBar(GameGrid gg, Location loc, int width, int height)
gg
- the GameGrid reference where the bar is shownloc
- the location of the bar's centerwidth
- the width (length) of the barheight
- the height of the barpublic GGProgressBar(GameGrid gg, Location loc, int width, int height, boolean isHorizontal)
gg
- the GameGrid reference where the bar is shownloc
- the location of the bar's centerwidth
- the width (length) of the barheight
- the height of the barisHorizontal
- if true, a horizontal bar is shown;
otherwise a vertical bar is shownpublic void setBgColor(java.awt.Color color)
color
- the background colorpublic void setFrameColor(java.awt.Color color)
color
- the color of the frame borderpublic void setStripColor(java.awt.Color color)
color
- the color of the strippublic void setTextColor(java.awt.Color color)
color
- the text colorpublic void setMin(double min)
min
- the value for a strip length = 0.public void setMax(double max)
max
- the value for a the full length strip.public void setUnit(java.lang.String unit)
unit
- the unit stringpublic void setFont(java.awt.Font font)
font
- the font for the value/unit textpublic void setPattern(java.lang.String pattern)
pattern
- the format pattern used to create the decimal format for the
value textpublic void remove(boolean doRefresh)
doRefresh
- if true, the game grid is refreshedpublic void setValue(double value)
value
- the new valuepublic void setValue(double value, boolean doRefresh)
value
- the new valuedoRefresh
- if true, the game grid is refreshed; otherwise it must be refreshed
by another call (e.g. GamgeGrid.addActor(), GameGrid.refresh(), tetc.)