Package crackers.kobots.graphics.widgets
Class UpDownIndicator
-
- All Implemented Interfaces:
-
crackers.kobots.graphics.widgets.KobotsWidget
public final class UpDownIndicator<T extends Comparable<T>> implements KobotsWidget<T>
Draws up/down arrows indicating which way something is "moving". The display is divided into 4 sections:
label (drawn at the top)
top arrow
value label
bottom arrow The sizes of the arrows are based on some hacking up the available space into equals enough parts to make it look at least not entirely sucky.
Decreasing values will light up the "top" arrow and increasing values will have the opposite effect.
-
-
Constructor Summary
Constructors Constructor Description UpDownIndicator(Graphics2D graphics, Font labelFont, Integer maxWidth, Integer maxHeight, String label, Integer lineWidth, Integer x, Integer y)
-
Method Summary
Modifier and Type Method Description Rectangle
getBounds()
How much space this occupies. Graphics2D
getGraphics()
Font
getLabelFont()
final Integer
getMaxWidth()
String
getLabel()
Integer
getLineWidth()
Integer
getX()
Integer
getY()
<Error class: unknown class>
drawStatic()
Draw any "static" parts that don't get updated. Unit
updateValue(T currentValue)
Update the display to the current value. -
-
Method Detail
-
getGraphics
Graphics2D getGraphics()
-
getLabelFont
Font getLabelFont()
-
getMaxWidth
final Integer getMaxWidth()
-
getLineWidth
Integer getLineWidth()
-
drawStatic
<Error class: unknown class> drawStatic()
Draw any "static" parts that don't get updated.
-
updateValue
Unit updateValue(T currentValue)
Update the display to the current value. THIS IS NOT GUARANTEED TO BE THREAD-SAFE!!!
-
-
-
-