|
JClass 4.5.0 API Documentation |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--com.klg.jclass.swing.gauge.JCScale | +--com.klg.jclass.swing.gauge.JCCircularScale
JCCircularScale
provides a graduated scale.
Angular measurements follow this convention:
Zero degrees is at 3 o'clock, 90° at 12 o'clock,
180° at 9 o'clock and 270° at 6 o'clock.
JCTicks
are used to mark this scale so that readings may be taken.
See
the section on how angles are measured in the manual.
Inner classes inherited from class com.klg.jclass.swing.gauge.JCScale |
JCScale.Direction |
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Field Summary | |
protected double |
extent
Paints a scale background covering this ratio from the origin. |
protected JCCircularGauge |
gauge
The parent gauge. |
protected double |
minSize
The minimum diameter for the scale. |
protected boolean |
paintCompleteBackground
Paints the complete background defined by JCCircularGauge.GaugeType ,
not just area swept by the scale. |
protected double |
startAngle
The start angle in degrees. |
protected double |
stopAngle
The stop angle in degrees. |
Fields inherited from class com.klg.jclass.swing.gauge.JCScale |
direction,
max,
min,
ticks |
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 |
Constructor Summary | |
JCCircularScale(JCCircularGauge gauge)
Creates a scale given its parent gauge. |
|
JCCircularScale(JCCircularGauge gauge,
JCScale.Direction direction,
double min,
double max,
double startAngle,
double stopAngle,
Color foreground)
Creates a graduated scale. |
Method Summary | |
Component |
add(Component c)
Overrides add to pass in a radial constraint. |
Component |
add(Component c,
int index)
Overrides add to pass in a radial constraint. |
double |
getExtent()
Returns the background extent for this scale. |
JCCircularGauge |
getGauge()
Returns the gauge associated with this scale |
boolean |
getPaintCompleteBackground()
Paints the complete background defined by the GaugeType ,
not just area swept by scale. |
Dimension |
getPreferredSize()
This is called by our widget parent when it wants to know our preferrred size. |
double |
getRadius()
Returns the current radius of this scale. |
double |
getStartAngle()
Returns the start angle for this scale. |
double |
getStopAngle()
Returns the stop angle for this scale. |
void |
paintComponent(Graphics g)
Draws the background of this scale. |
double |
pick(Point p)
Given a screen position in pixels, returns the closest scale value. |
void |
redraw()
Call this instead of paint so that the repaintEnabled flag can be checked. |
void |
setExtent(double extent)
Sets the background extent for this scale. |
void |
setPaintCompleteBackground(boolean paintCompleteBackground)
If true, paints the complete background for this GaugeType ,
not just area between the scale's start and stop angles. |
void |
setStartAngle(double startAngle)
Sets the start angle for this scale. |
void |
setStopAngle(double stopAngle)
Sets the stop angle for this scale. |
Methods inherited from class com.klg.jclass.swing.gauge.JCScale |
addTick,
addTick,
getDirection,
getMax,
getMin,
getTicks,
inBounds,
removeTick,
setDirection,
setMax,
setMin |
Methods inherited from class java.awt.Container |
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected double startAngle
protected double stopAngle
protected JCCircularGauge gauge
protected double minSize
protected double extent
protected boolean paintCompleteBackground
JCCircularGauge.GaugeType
,
not just area swept by the scale. For instance,
a scale whose type is FULL_CIRCLE
and whose angular sweep is from
0° to 270° paints only that region.
If not just from 0° to 270°. The default is
false.
GaugeType
,
false means just the area spanning the scale's sweep angle.Constructor Detail |
public JCCircularScale(JCCircularGauge gauge)
gauge
- The JCCircularGauge
associated with this scale.public JCCircularScale(JCCircularGauge gauge, JCScale.Direction direction, double min, double max, double startAngle, double stopAngle, Color foreground)
gauge
- The JCCircularGauge
associated with this scale.direction
- A JCCircularScale.Direction
enum indicating
CLOCKWISE or COUNTERCLOCKWISE direction.min
- The minumum value this scale can havemax
- The maximum value this scale can havestartAngle
- The start angle in degreesstopAngle
- The stop angle in degreesforeground
- The color to of this scale's foregroundMethod Detail |
public Dimension getPreferredSize()
Dimension
(size) we'd like to be based on our
radiuspublic Component add(Component c)
c
- The component to be added.public Component add(Component c, int index)
c
- The component to be added.index
- The order this component has in the list. Components added
last are drawn first.public void paintComponent(Graphics g)
g
- the Graphics object onto which we will draw our backgroundpublic double pick(Point p)
p
- The point representing the x, y coordinates of the
clickpublic double getRadius()
public double getStartAngle()
public void setStartAngle(double startAngle)
startAngle
- The start angle for this scale degreespublic double getStopAngle()
public void setStopAngle(double stopAngle)
stopAngle
- The stop angle for this scale in degreespublic JCCircularGauge getGauge()
public double getExtent()
public void setExtent(double extent)
extent
- The extent of the circuar scale's foreground color. Used
when tick objects and labels need to appear "outside" the scale.public boolean getPaintCompleteBackground()
GaugeType
,
not just area swept by scale. For instance, you can have a
scale defined from 0° to 270° for a FULL_CIRCLE
, yet have the full
circle background painted, not just from 0° to 270°. The default is
false.public void setPaintCompleteBackground(boolean paintCompleteBackground)
GaugeType
,
not just area between the scale's start and stop angles. For instance, a
scale defined from 0° to 270° and having gauge type FULL_CIRCLE
has the full
circular background painted, not just the part from 0° to 270°. The default is
false.paintCompleteBackground
- True means paint all of the background
consistent with the gauge type.public void redraw()
|
Copyright© 1999-2000 KL Group Inc. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |