|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
org.tbee.swing.gauge.GaugeDirection
public abstract class GaugeDirection
Contains the generic code for a needle gauge. The value per default is percentage [0,100]. You can set the labels separately from the value, for example the labels could depict temperature, but the value still is percentage.
| Nested Class Summary | |
|---|---|
protected static class |
GaugeDirection.LabelPoint
|
protected static class |
GaugeDirection.Point2d
|
| Nested classes/interfaces inherited from class javax.swing.JLabel |
|---|
JLabel.AccessibleJLabel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected static FontRenderContext |
cLabelFontRenderContext
|
static String |
SOURCECODE_VERSION
Standard variable for determining version of a class file. |
| Fields inherited from class javax.swing.JLabel |
|---|
labelFor |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
GaugeDirection()
|
|
| Method Summary | |
|---|---|
protected void |
clearImage(BufferedImage image)
|
protected abstract BufferedImage |
drawCompleteGauge()
This generates the complete gauge |
protected void |
drawLabels(BufferedImage image,
GaugeDirection.Point2d center,
int distance,
Font font,
Color color)
|
protected void |
drawNeedle(BufferedImage image,
BufferedImage needle,
GaugeDirection.Point2d center,
Point offset,
double angle)
|
protected abstract BufferedImage |
drawNeedleOnly()
This only regenerates the needle part. |
protected void |
drawTicks(BufferedImage image,
GaugeDirection.Point2d center,
int tickDistance,
int tickLength,
int numberOfTicks,
int highlightTicks)
|
protected void |
drawTitle(BufferedImage image,
Font font,
Color color)
|
double |
getAngle()
|
boolean |
getAnimate()
|
String |
getLabel(int degrees)
|
protected Set |
getLabelAngles()
|
protected int |
getMinimalStepDelay()
|
abstract Dimension |
getPreferredSize()
|
protected double |
getStepSize()
|
String |
getTitle()
|
protected abstract GaugeDirection.LabelPoint |
getTitleLabelPoint()
|
protected double |
getVisualAngle()
|
boolean |
isAnimating()
return if the button currently is animating |
void |
paint(Graphics g)
|
void |
setAngle(double radials)
The angle in radials |
void |
setAngle(int degrees)
The angle in degrees |
void |
setAngleNotAnimated(double radials)
|
void |
setAngleNotAnimated(int degrees)
The angle in degrees |
void |
setAnimate(boolean v)
animate |
void |
setLabel(double radials,
String label)
|
void |
setLabel(int degrees,
String label)
set one of the tick labels at a certain degree |
void |
setTitle(String label)
A short text on the cover |
protected void |
setVisualAngle(double radials)
The angle of the needle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String SOURCECODE_VERSION
protected static final FontRenderContext cLabelFontRenderContext
| Constructor Detail |
|---|
public GaugeDirection()
| Method Detail |
|---|
public void setAnimate(boolean v)
public boolean getAnimate()
public void setTitle(String label)
public String getTitle()
public void setLabel(int degrees,
String label)
public String getLabel(int degrees)
public void setLabel(double radials,
String label)
protected Set getLabelAngles()
public void setAngle(double radials)
public double getAngle()
public void setAngleNotAnimated(double radials)
public void setAngle(int degrees)
public void setAngleNotAnimated(int degrees)
protected void setVisualAngle(double radials)
protected double getVisualAngle()
protected abstract GaugeDirection.LabelPoint getTitleLabelPoint()
protected double getStepSize()
protected int getMinimalStepDelay()
public abstract Dimension getPreferredSize()
getPreferredSize in class JComponentprotected abstract BufferedImage drawCompleteGauge()
protected abstract BufferedImage drawNeedleOnly()
public void paint(Graphics g)
paint in class JComponentpublic boolean isAnimating()
protected void drawTicks(BufferedImage image,
GaugeDirection.Point2d center,
int tickDistance,
int tickLength,
int numberOfTicks,
int highlightTicks)
protected void drawLabels(BufferedImage image,
GaugeDirection.Point2d center,
int distance,
Font font,
Color color)
protected void drawTitle(BufferedImage image,
Font font,
Color color)
protected void drawNeedle(BufferedImage image,
BufferedImage needle,
GaugeDirection.Point2d center,
Point offset,
double angle)
protected void clearImage(BufferedImage image)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||