 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.gauge;
25 import java.awt.Dimension;
26 import java.awt.Graphics;
27 import java.awt.Image;
28 import org.jetbrains.annotations.NotNull;
29 import org.jetbrains.annotations.Nullable;
112 preferredSize =
new Dimension(preferredWidth, preferredHeight);
131 final int newFilledX = orientation.getX();
132 final int newFilledY = orientation.getY();
133 final int newFilledW = orientation.getW();
134 final int newFilledH = orientation.getH();
135 @Nullable
final Image newFilledPicture;
136 if (!orientation.isValid()) {
137 newFilledPicture =
null;
138 }
else if (orientation.isNegativeImage()) {
140 }
else if (orientation.isLowImage()) {
162 public void draw(@NotNull
final Graphics g) {
final Dimension preferredSize
The preferred size of this component.
final Image negativeImage
The image representing a more-than-empty gauge.
void draw(@NotNull final Graphics g)
Draws the gauge image into the given graphics context.
int filledH
The height of the "filled" area.
GaugeState(@Nullable final Image fullImage, @Nullable final Image lowImage, @Nullable final Image negativeImage, final int dx, final int dy)
Creates a new instance.
void setDy(final int dy)
Sets the y-offset for drawing.
int filledY
The y-coordinate of the "filled" area.
Interface for orientation images.
int filledX
The x-coordinate of the "filled" area.
Dimension getPreferredSize()
Returns the preferred size.
final int dx
The x-offset for drawing.
final Image fullImage
The image representing a full gauge.
Image filledPicture
The image for painting the "filled" area.
final Image lowImage
The image representing a low gauge (<30%).
int filledW
The width of the "filled" area.
boolean setValues(@NotNull final Orientation orientation)
Updates the values from a Orientation state.
int dy
The y-offset for drawing.