|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--com.klg.jclass.swing.gauge.JCAbstractTick | +--com.klg.jclass.swing.gauge.JCCircularTick
The class for tick marks that are drawn on a JCCircularScale
.
Nested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class com.klg.jclass.swing.gauge.JCAbstractTick |
automatic, drawLabels, drawTicks, fontColor, incrementValue, innerExtent, labelExtent, labelGenerator, outerExtent, precision, precisionUseDefault, reversed, scale, startValue, stopValue, tickColor, tickStyle, tickWidth |
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 java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
JCCircularTick(com.klg.jclass.swing.gauge.JCCircularScale scale)
Creates a JCCircularTick that spans its circular scale. |
|
JCCircularTick(com.klg.jclass.swing.gauge.JCCircularScale scale,
boolean automatic,
double startValue,
double stopValue,
double incrementValue,
boolean precisionUseDefault,
int precision,
double width,
boolean drawLabels,
boolean drawTicks,
double labelExtent,
double innerExtent,
double outerExtent,
Color tickColor,
com.klg.jclass.swing.gauge.JCTickStyle style,
Font font,
Color fontColor)
Creates a JCCircularTick by specifying its properties. |
Method Summary | |
void |
calcCircularTicks(Graphics g)
If automatic , this method is called to determine and
set the start/stop and increment values for laying out ticks. |
com.klg.jclass.swing.gauge.JCCircularScale |
getCircularScale()
Returns the circular scale associated with this tick object. |
Dimension |
getPreferredSize()
|
void |
paintComponent(Graphics g)
Main tick draw routine. |
void |
redraw(boolean redrawLabels)
Call this instead of paint so that the repaintEnabled flag can
be checked. |
void |
redrawLabels()
Layout and redraw labels. |
void |
reshape(int x,
int y,
int w,
int h)
Overridden to preserve the layout of labels on a resize. |
Methods inherited from class com.klg.jclass.swing.gauge.JCAbstractTick |
calcPrecision, calcTicks, getAutomatic, getDrawLabels, getDrawTicks, getFontColor, getIncrementValue, getInnerExtent, getLabelExtent, getLabelGenerator, getOuterExtent, getPrecision, getPrecisionUseDefault, getScale, getStartValue, getStopValue, getTickColor, getTickStyle, getTickWidth, isReversed, niceNum, paintChildren, redraw, setAutomatic, setDrawLabels, setDrawTicks, setFontColor, setIncrementValue, setInnerExtent, setLabelExtent, setLabelGenerator, setOuterExtent, setPrecision, setPrecisionUseDefault, setReversed, setStartValue, setStopValue, setTickColor, setTickStyle, setTickWidth |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JCCircularTick(com.klg.jclass.swing.gauge.JCCircularScale scale)
JCCircularTick
that spans its circular scale. Other
tick properties have default values.
scale
- the JCCircularScale
for which these ticks are
drawnpublic JCCircularTick(com.klg.jclass.swing.gauge.JCCircularScale scale, boolean automatic, double startValue, double stopValue, double incrementValue, boolean precisionUseDefault, int precision, double width, boolean drawLabels, boolean drawTicks, double labelExtent, double innerExtent, double outerExtent, Color tickColor, com.klg.jclass.swing.gauge.JCTickStyle style, Font font, Color fontColor)
JCCircularTick
by specifying its properties.
scale
- the JCCircularScale
for which these ticks are
drawnautomatic
- whether to automatically calculate the tick start, stop,
and increment values from the scale's min and max, or to use the
provided valuesstartValue
- the value on the scale where these ticks startstopValue
- the value on the scale where these ticks endincrementValue
- the tick intervalprecisionUseDefault
- if true
, gauge will determine an
appropriate precision automatically; if false
, "precision"
will be usedprecision
- The format of the tick label: positive values denote the
number of places after the decimal point (for example, 3 means multiples
of 0.001); negative values indicate the positive number of zeros to be
used before the decimal place (for example, -3 means numbering will be in
multiples of 1000). Overridden if precisionUseDefault
is
set to true
.width
- the width of the tick to be drawndrawLabels
- if true
, draw labels for each tick; if
false
, do not draw labelsdrawTicks
- if true
, draw ticks; if false
, do
not draw ticks (you may want only the labels)labelExtent
- a ratio of the radius at which the label will be drawn;
for example, 0.8 means draw labels 80% of the radius size away from the
centerinnerExtent
- the inner extent of each tick drawn as a ratio of the
radius size; for example, 0.8 means the tick will start at 80% of the
radius size away from the center and be drawn to outerExtent
outerExtent
- the outer extent of each tick drawn as a ratio of the
radius size; for example, 1.1 means start at inner extent and draw to a
location 110% the size of the radius away from the centertickColor
- the color the tick is drawn instyle
- The JCTickStyle
that defines the shape of the tick;
valid values are DIAMOND
, TRIANGLE
,
REVERSE_TRIANGLE
, RECTANGLE
,
LINE
, and CIRCLE
. You can also create your
own JCTickStyle
.font
- the font used to draw tick labelsfontColor
- the color of the font for tick labelsMethod Detail |
public com.klg.jclass.swing.gauge.JCCircularScale getCircularScale()
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public void reshape(int x, int y, int w, int h)
reshape
in class JComponent
x
- the new horizontal locationy
- the new vertical locationw
- the new widthh
- the new heightComponent.setBounds(int, int, int, int)
public void calcCircularTicks(Graphics g)
automatic
, this method is called to determine and
set the start/stop and increment values for laying out ticks.
The goal is to have as many ticks/labels as will fit without
the ticks or labels overlapping.
g
- the graphics used to get font metric informationpublic void redrawLabels()
redrawLabels
in class JCAbstractTick
public void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- The graphics object with which to drawpublic void redraw(boolean redrawLabels)
repaintEnabled
flag can
be checked. No repaint will occur if that flag is false
.
redraw
in class JCAbstractTick
redrawLabels
- true
means reposition and redraw the labels; otherwise,
just repaint the component
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |