Class GaugeState
java.lang.Object
com.realtime.crossfire.jxclient.gui.gauge.GaugeState
The state of a gauge.
-
Constructor Summary
ConstructorsConstructorDescriptionGaugeState(@Nullable Image fullImage, @Nullable Image lowImage, @Nullable Image negativeImage, int dx, int dy) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidDraws the gauge image into the given graphics context.@NotNull DimensionReturns the preferred size.voidsetDy(int dy) Sets the y-offset for drawing.booleansetValues(@NotNull Orientation orientation) Updates the values from aOrientationstate.
-
Constructor Details
-
GaugeState
public GaugeState(@Nullable @Nullable Image fullImage, @Nullable @Nullable Image lowImage, @Nullable @Nullable Image negativeImage, int dx, int dy) Creates a new instance.- Parameters:
fullImage- the image representing a full gaugelowImage- the image representing a low gaueg (<30%)negativeImage- the image representing a more-than-empty gauge; if set tonullthe gauge remains in empty statedx- the x-offset for drawingdy- the y-offset for drawing
-
-
Method Details
-
setDy
public void setDy(int dy) Sets the y-offset for drawing.- Parameters:
dy- the y-offset for drawing
-
setValues
Updates the values from aOrientationstate.- Parameters:
orientation- the state- Returns:
- whether the state has changed
-
draw
Draws the gauge image into the given graphics context.- Parameters:
g- the graphics context
-
getPreferredSize
Returns the preferred size.- Returns:
- the preferred size
-