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 RectanglegetBounds()How much space this occupies. Graphics2DgetGraphics()FontgetLabelFont()final IntegergetMaxWidth()StringgetLabel()IntegergetLineWidth()IntegergetX()IntegergetY()<Error class: unknown class>drawStatic()Draw any "static" parts that don't get updated. UnitupdateValue(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!!!
-
-
-
-