Class GaugeState
- java.lang.Object
-
- com.realtime.crossfire.jxclient.gui.gauge.GaugeState
-
public class GaugeState extends java.lang.ObjectThe state of a gauge.
-
-
Constructor Summary
Constructors Constructor Description GaugeState(@Nullable java.awt.Image fullImage, @Nullable java.awt.Image negativeImage, int dx, int dy)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddraw(@NotNull java.awt.Graphics g)Draws the gauge image into the given graphics context.@NotNull java.awt.DimensiongetPreferredSize()Returns the preferred size.voidsetDy(int dy)Sets the y-offset for drawing.booleansetValues(@NotNull Orientation orientation)Updates the values from aOrientationstate.
-
-
-
Constructor Detail
-
GaugeState
public GaugeState(@Nullable @Nullable java.awt.Image fullImage, @Nullable @Nullable java.awt.Image negativeImage, int dx, int dy)Creates a new instance.- Parameters:
fullImage- the image representing a full gaugenegativeImage- 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 Detail
-
setDy
public void setDy(int dy)
Sets the y-offset for drawing.- Parameters:
dy- the y-offset for drawing
-
setValues
public boolean setValues(@NotNull @NotNull Orientation orientation)Updates the values from aOrientationstate.- Parameters:
orientation- the state- Returns:
- whether the state has changed
-
draw
public void draw(@NotNull @NotNull java.awt.Graphics g)Draws the gauge image into the given graphics context.- Parameters:
g- the graphics context
-
getPreferredSize
@NotNull public @NotNull java.awt.Dimension getPreferredSize()
Returns the preferred size.- Returns:
- the preferred size
-
-