|
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.JCAbstractScale | +--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.
Nested Class Summary |
Nested classes inherited from class com.klg.jclass.swing.gauge.JCAbstractScale |
JCAbstractScale.Direction |
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 | |
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.JCAbstractScale |
direction, gauge, image, max, min, ranges, scaleImage, ticks, zoomFactor |
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 | |
JCCircularScale(com.klg.jclass.swing.gauge.JCCircularGauge gauge)
Creates a scale given its parent gauge. |
|
JCCircularScale(com.klg.jclass.swing.gauge.JCCircularGauge gauge,
JCAbstractScale.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. |
protected void |
drawImage(Graphics g,
Image image,
Rectangle bounds)
|
com.klg.jclass.swing.gauge.JCCircularGauge |
getCircularGauge()
Returns the circular gauge associated with this scale. |
protected Shape |
getCircularScaleShape(com.klg.jclass.swing.gauge.JCCircularScale cscale)
|
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. |
protected Insets |
getScaleInsets()
Since the scale and the gaugeArea share the same real estate,
their insets may overlap (note that the scale's border will be drawn
overtop of the gaugeArea 's border). |
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 |
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.JCAbstractScale |
addRange, addRange, addTick, addTick, getDirection, getExtent, getGauge, getImage, getMax, getMin, getRanges, getScaleImage, getTicks, getZoomFactor, inBounds, removeRange, removeTick, setDirection, setExtent, setImage, setMax, setMin, setScaleImage, setZoomFactor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.klg.jclass.swing.gauge.JCScale |
setBorder |
Field Detail |
protected double startAngle
protected double stopAngle
protected double minSize
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.
The default is false
.
True
means paint the entire area specified in GaugeType
,
false
means just the area spanning the scale's sweep angle.
Constructor Detail |
public JCCircularScale(com.klg.jclass.swing.gauge.JCCircularGauge gauge)
gauge
- the JCCircularGauge
associated with this scale.public JCCircularScale(com.klg.jclass.swing.gauge.JCCircularGauge gauge, JCAbstractScale.Direction direction, double min, double max, double startAngle, double stopAngle, Color foreground)
gauge
- the JCCircularGauge
associated with this scale.direction
- a JCAbstractScale.Direction
enum indicating
FORWARD
or BACKWARD
directionmin
- 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 of this scale's foregroundMethod Detail |
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
Dimension
(size) we'd like to be based on our
radiuspublic Component add(Component c)
add
in class Container
c
- the component to be added
public Component add(Component c, int index)
add
in class Container
c
- the component to be addedindex
- the order this component has in the list; components added
last are drawn first
public void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- the Graphics
object onto which we will draw our
backgroundpublic double pick(Point p)
pick
in interface JCScale
pick
in class JCAbstractScale
p
- the point representing the X, Y coordinates of the
click
protected Insets getScaleInsets()
gaugeArea
share the same real estate,
their insets may overlap (note that the scale's border will be drawn
overtop of the gaugeArea
's border). Thus we need to return an
Insets
object which is the union of both.
public double getRadius()
zoomFactor
so the actual size may be smaller than the
gauge area.
public double getStartAngle()
public void setStartAngle(double startAngle)
startAngle
- the start angle for this scale, in degreespublic double getStopAngle()
public void setStopAngle(double stopAngle)
stopAngle
- the stop angle for this scale, in degreespublic com.klg.jclass.swing.gauge.JCCircularGauge getCircularGauge()
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
.
true
means paint all the background; false
means just the area spanned by scale's sweep anglepublic void setPaintCompleteBackground(boolean paintCompleteBackground)
true
, paints the complete background for this
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 typepublic void redraw()
repaintEnabled
flag can
be checked. No repaint will occur if that flag is false
.
redraw
in class JCAbstractScale
protected Shape getCircularScaleShape(com.klg.jclass.swing.gauge.JCCircularScale cscale)
protected void drawImage(Graphics g, Image image, Rectangle bounds)
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |