public abstract class BaseGauge extends VisualElementContainer
| Modifier and Type | Field and Description |
|---|---|
protected VisualElementContainer |
background
A
VisualElement containing all background elements. |
protected VisualElementContainer |
foreground
A
VisualElement containing all foreground elements. |
filling, outline, RelativeCoordinates, RelativeStroke| Modifier | Constructor and Description |
|---|---|
protected |
BaseGauge()
Initializes a new instance of the
BaseGauge class. |
| Modifier and Type | Method and Description |
|---|---|
void |
addBaseGaugeListener(BaseGaugeListener listener) |
ComponentController |
createController(RenderContext context)
Returns a
ComponentController used to interact with this component. |
void |
draw(RenderContext context)
Draws this component in specified
RenderContext. |
protected abstract java.awt.geom.Dimension2D |
getDefaultSize()
Gets the initial size of the gauge.
|
VisualElement |
getElementByName(java.lang.String name)
Returns the scale element with the specified name.
|
java.lang.String |
getFontName()
Gets the name of font used to draw text in this gauge.
|
java.lang.Double |
getFontSize()
Gets the size of font used to draw text in this gauge.
|
java.util.EnumSet<FontStyle> |
getFontStyle()
Gets the style of font used to draw text in this gauge.
|
Brush |
getPointerBackground()
Gets a
Brush used to draw the background of gauge pointers. |
Brush |
getPointerStroke()
Gets a
Brush used to stroke gauge pointers. |
java.lang.Double |
getPointerStrokeThickness()
Gets the thickness of the
Pen used to stroke the gauge pointers. |
Brush |
getScaleBackground()
Gets a
Brush used to draw the background of the gauge scales. |
Brush |
getScaleStroke()
Gets a
Brush used to stroke the gauge scales. |
java.lang.Double |
getScaleStrokeThickness()
Gets the thickness of the
Pen used to stroke the gauge scales. |
Brush |
getTickBackground()
Gets a
Brush used to draw the background of gauge ticks. |
Brush |
getTickStroke()
Gets a
Brush used to stroke gauge ticks. |
java.lang.Double |
getTickStrokeThickness()
Gets the thickness of the
Pen used to stroke gauge ticks. |
boolean |
hitTestObj(java.awt.geom.Point2D point)
Checks whether the specified point lies within the visual structure of a scale element.
|
void |
measure(double maxWidth,
double maxHeight,
RenderContext context)
Measures the desired size of this component.
|
protected void |
onInvalidated(java.util.EventObject e)
Raises the
invalidated event. |
protected void |
onPaintBackground(CustomPaintEvent e)
Raises the
paintBackground event. |
protected void |
onPaintForeground(CustomPaintEvent e)
Raises the
paintForeground event. |
protected void |
onPaintPointer(CustomPaintEvent e)
Raises the
paintPointer event. |
protected void |
onPaintScale(CustomPaintEvent e)
Raises the
paintScale event. |
protected void |
onPaintTick(CustomPaintEvent e)
Raises the
paintTick event. |
protected void |
onPrepaintBackground(PrepaintEvent e)
Raises the
prepaintBackground event. |
protected void |
onPrepaintForeground(PrepaintEvent e)
Raises the
prepaintForeground event. |
protected void |
onPrepaintPointer(PrepaintEvent e)
Raises the
prepaintPointer event. |
protected void |
onPrepaintScale(PrepaintEvent e)
Raises the
prepaintScale event. |
protected void |
onPrepaintTick(PrepaintEvent e)
Raises the
prepaintTick event. |
void |
processMouseDown(double x,
double y)
Invoked to handle a MouseDown event.
|
void |
processMouseMove(double x,
double y)
Invoked to handle a MouseMove event.
|
void |
processMouseUp(double x,
double y)
Invoked to handle a MouseUp event.
|
void |
removeBaseGaugeListener(BaseGaugeListener listener) |
void |
setFontName(java.lang.String value)
Sets the name of font used to draw text in this gauge.
|
void |
setFontSize(double value)
Sets the size of font used to draw text in this gauge.
|
void |
setFontStyle(java.util.EnumSet<FontStyle> value)
Sets the style of font used to draw text in this gauge.
|
void |
setPointerBackground(Brush value)
Sets a
Brush used to draw the background of gauge pointers. |
void |
setPointerStroke(Brush value)
Sets a
Brush used to stroke gauge pointers. |
void |
setPointerStrokeThickness(double value)
Sets the thickness of the
Pen used to stroke the gauge pointers. |
void |
setScaleBackground(Brush value)
Sets a
Brush used to draw the background of the gauge scales. |
void |
setScaleStroke(Brush value)
Sets a
Brush used to stroke the gauge scales. |
void |
setScaleStrokeThickness(double value)
Sets the thickness of the
Pen used to stroke the gauge scales. |
void |
setTickBackground(Brush value)
Sets a
Brush used to draw the background of gauge ticks. |
void |
setTickStroke(Brush value)
Sets a
Brush used to stroke gauge ticks. |
void |
setTickStrokeThickness(double value)
Sets the thickness of the
Pen used to stroke gauge ticks. |
arrangeaddVisualElementListener, getEffectiveFill, getFill, getMargin, getName, getStroke, hitTest, onPostpaint, onPrepaint, onQueryAmbientPropertyValue, removeVisualElementListener, setFill, setMargin, setName, setStroke, toStringadd, associateJComponent, dissociateJComponent, effectiveMeasuredHeight, effectiveMeasuredWidth, getActualHeight, getActualWidth, getDesiredHeight, getDesiredWidth, getGridColumn, getGridRow, getHeight, getHitTestVisibility, getHorizontalAlignment, getParent, getRectInParent, getToolTip, getVerticalAlignment, getVisibility, getWidth, getXInParent, getYInParent, invalidate, invalidate, invalidate, invalidateLayout, invalidateLayout, localToRoot, rootToLocal, setActualHeight, setActualWidth, setDesiredHeight, setDesiredWidth, setGridColumn, setGridRow, setHeight, setHitTestVisibility, setHorizontalAlignment, setParent, setToolTip, setVerticalAlignment, setVisibility, setWidth, setXInParent, setYInParent, visitprotected VisualElementContainer background
VisualElement containing all background elements.protected VisualElementContainer foreground
VisualElement containing all foreground elements.protected BaseGauge()
BaseGauge class.public ComponentController createController(RenderContext context)
ComponentComponentController used to interact with this component.createController in class Componentcontext - A RenderContext instance.ComponentController-derived class.public void measure(double maxWidth,
double maxHeight,
RenderContext context)
VisualElementmeasure in class VisualElementContainermaxWidth - The maximum width provided by parent component.maxHeight - The maximum height provided by parent component.context - A RenderContext instance.public void draw(RenderContext context)
RenderContext.draw in class VisualElementContainercontext - A RenderContext instance.public void processMouseDown(double x,
double y)
x - The x-coordinate of the mouse in client coordinates.y - The y-coordinate of the mouse in client coordinates.public void processMouseMove(double x,
double y)
x - The x-coordinate of the mouse in client coordinates.y - The y-coordinate of the mouse in client coordinates.public void processMouseUp(double x,
double y)
x - The x-coordinate of the mouse in client coordinates.y - The y-coordinate of the mouse in client coordinates.public VisualElement getElementByName(java.lang.String name)
This method performs deep search.
name - The name of the element to search for.VisualElement with the specified name.public void addBaseGaugeListener(BaseGaugeListener listener)
public void removeBaseGaugeListener(BaseGaugeListener listener)
protected void onPrepaintBackground(PrepaintEvent e)
prepaintBackground event.e - An object, containing the event data.protected void onPaintBackground(CustomPaintEvent e)
paintBackground event.e - An object, containing the event data.protected void onPrepaintForeground(PrepaintEvent e)
prepaintForeground event.e - An object, containing the event data.protected void onPaintForeground(CustomPaintEvent e)
paintForeground event.e - An object, containing the event data.protected void onPrepaintScale(PrepaintEvent e)
prepaintScale event.e - An object, containing the event data.protected void onPaintScale(CustomPaintEvent e)
paintScale event.e - An object, containing the event data.protected void onPrepaintPointer(PrepaintEvent e)
prepaintPointer event.e - An object, containing the event data.protected void onPaintPointer(CustomPaintEvent e)
paintPointer event.e - An object, containing the event data.protected void onPrepaintTick(PrepaintEvent e)
prepaintTick event.e - An object, containing the event data.protected void onPaintTick(CustomPaintEvent e)
paintTick event.e - An object, containing the event data.protected void onInvalidated(java.util.EventObject e)
invalidated event.onInvalidated in class VisualElemente - An object, containing the event data.public boolean hitTestObj(java.awt.geom.Point2D point)
hitTestObj in class VisualElementContainerprotected abstract java.awt.geom.Dimension2D getDefaultSize()
public Brush getScaleBackground()
Brush used to draw the background of the gauge scales.public void setScaleBackground(Brush value)
Brush used to draw the background of the gauge scales.public void setScaleStroke(Brush value)
Brush used to stroke the gauge scales.public java.lang.Double getScaleStrokeThickness()
Pen used to stroke the gauge scales.public void setScaleStrokeThickness(double value)
Pen used to stroke the gauge scales.public Brush getPointerBackground()
Brush used to draw the background of gauge pointers.public void setPointerBackground(Brush value)
Brush used to draw the background of gauge pointers.public void setPointerStroke(Brush value)
Brush used to stroke gauge pointers.public java.lang.Double getPointerStrokeThickness()
Pen used to stroke the gauge pointers.public void setPointerStrokeThickness(double value)
Pen used to stroke the gauge pointers.public Brush getTickBackground()
Brush used to draw the background of gauge ticks.public void setTickBackground(Brush value)
Brush used to draw the background of gauge ticks.public java.lang.Double getTickStrokeThickness()
Pen used to stroke gauge ticks.public void setTickStrokeThickness(double value)
Pen used to stroke gauge ticks.public java.lang.String getFontName()
public void setFontName(java.lang.String value)
public java.util.EnumSet<FontStyle> getFontStyle()
public void setFontStyle(java.util.EnumSet<FontStyle> value)
public java.lang.Double getFontSize()
public void setFontSize(double value)