|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.aplu.jgamegrid.GGProgressBar
public class GGProgressBar
Class that implements a progress bar indicator. It consists of a rectangular frame with a filled color stick inside that indicates the current value. The value may be displayed as text centered in the middle of the frame. The bar may be horizonal (stick advances from left to right) or vertical (stick advances from bottom to top). The bar graphics is a dynamically generated GGBitmap used to create an Actor instance that is added to the game grid.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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 shownMethod Detail |
---|
public 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.)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |