public class GaugeState
extends java.lang.Object
Constructor and Description |
---|
GaugeState(@Nullable java.awt.Image fullImage,
@Nullable java.awt.Image lowImage,
@Nullable java.awt.Image negativeImage,
int dx,
int dy)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(@NotNull java.awt.Graphics g)
Draws the gauge image into the given graphics context.
|
@NotNull java.awt.Dimension |
getPreferredSize()
Returns the preferred size.
|
void |
setDy(int dy)
Sets the y-offset for drawing.
|
boolean |
setValues(@NotNull Orientation orientation)
Updates the values from a
Orientation state. |
public GaugeState(@Nullable @Nullable java.awt.Image fullImage, @Nullable @Nullable java.awt.Image lowImage, @Nullable @Nullable java.awt.Image negativeImage, int dx, int dy)
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 to null
the gauge remains in empty statedx
- the x-offset for drawingdy
- the y-offset for drawingpublic void setDy(int dy)
dy
- the y-offset for drawingpublic boolean setValues(@NotNull @NotNull Orientation orientation)
Orientation
state.orientation
- the statepublic void draw(@NotNull @NotNull java.awt.Graphics g)
g
- the graphics context@NotNull public @NotNull java.awt.Dimension getPreferredSize()