|
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.JCLinearTick
The class for tick marks that are drawn on a JCLinearScale
.
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 | |
JCLinearTick(com.klg.jclass.swing.gauge.JCLinearScale scale)
Creates a JCLinearTick that spans its linear scale. |
|
JCLinearTick(com.klg.jclass.swing.gauge.JCLinearScale scale,
boolean automatic,
double startValue,
double stopValue,
double incrementValue,
boolean precisionUseDefault,
int precision,
double width,
boolean drawLabels,
boolean visible,
double labelExtent,
double innerExtent,
double outerExtent,
Color foreground,
com.klg.jclass.swing.gauge.JCTickStyle style,
Font font,
Color fontColor)
Creates a linear tick object. |
Method Summary | |
void |
calcLinearTicks(Graphics g)
If automatic , this method is called to determine and
set the start/stop and increment values for laying out ticks. |
protected com.klg.jclass.swing.gauge.JCLinearScale |
getLinearScale()
Returns the linear scale associated with this tick object. |
Dimension |
getPreferredSize()
This is called by our widget parent when it wants to know our preferred size. |
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 JCLinearTick(com.klg.jclass.swing.gauge.JCLinearScale scale)
JCLinearTick
that spans its linear scale. Other
tick properties have default values.
scale
- the JCLinearScale
for which these ticks are
drawnpublic JCLinearTick(com.klg.jclass.swing.gauge.JCLinearScale scale, boolean automatic, double startValue, double stopValue, double incrementValue, boolean precisionUseDefault, int precision, double width, boolean drawLabels, boolean visible, double labelExtent, double innerExtent, double outerExtent, Color foreground, com.klg.jclass.swing.gauge.JCTickStyle style, Font font, Color fontColor)
scale
- the associated linear scaleautomatic
- whether to automatically calculate the tick start, stop,
and increment values from the scale's min and max, or to use the
provided valuesstartValue
- where the tick marks are to beginstopValue
- where the tick marks are to endincrementValue
- the tick intervalprecisionUseDefault
- sets whether tick labels use a default
precision, or use precision
precision
- 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
- each tick's width in pixelsdrawLabels
- whether to draw labels or notvisible
- Are the ticks visible?labelExtent
- each label's extent expressed as a ratio of its distance
from the top or left of the scale to the width or height of the scaleinnerExtent
- the tick's inner_extent
, expressed as a ratio
of its distance from the top or left to the width or height of the scaleouterExtent
- the tick's outer_extent
, expressed as a ratio
of its distance from the top or left to the width or height of the scaleforeground
- the tick's colorstyle
- the type of tick; valid values are DIAMOND
,
TRIANGLE
, REVERSE_TRIANGLE
,
RECTANGLE
, LINE
, and CIRCLE
.font
- the font used to draw tick labelsfontColor
- the color of the font for tick labelsMethod Detail |
protected com.klg.jclass.swing.gauge.JCLinearScale getLinearScale()
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
Dimension
(size) we'd like to be based on our
associated linear scalepublic 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 calcLinearTicks(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 information.public void redrawLabels()
redrawLabels
in class JCAbstractTick
public void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- public 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 |