|
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.JCCenter
A center object is used to mark the position of the center of a circular
scale in a JCCircularScale
widget. It can be a disk or an image.
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 | |
protected Color |
foreground
The scale's foreground color. |
protected Image |
image
An Image may be used to mark the center of the gauge. |
protected double |
radius
The size of the disk, expressed as a ratio based on the radius of the associated scale. |
protected com.klg.jclass.swing.gauge.JCCircularScale |
scale
The associated circular scale. |
protected boolean |
scaleImage
Boolean that determines whether the image should be scaled when the gauge is resized. |
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 | |
JCCenter(com.klg.jclass.swing.gauge.JCCircularScale scale)
Creates a black disk at the center of the scale whose default radius is 10% of the scale's radius. |
|
JCCenter(com.klg.jclass.swing.gauge.JCCircularScale scale,
Color foreground,
double radius)
Creates a black disk at the center of the scale whose radius and foreground color are parameters. |
|
JCCenter(com.klg.jclass.swing.gauge.JCCircularScale scale,
Color foreground,
Image image)
Creates a center using the provided image with no scaling. |
Method Summary | |
protected void |
drawDisc(Graphics g)
Draws a disk at the center of the scale. |
protected void |
drawImage(Graphics g,
Image image,
Rectangle bounds)
|
protected Shape |
getCenterShape()
|
Image |
getImage()
Gets the Image to be used to mark the center of the circular
scale. |
Dimension |
getPreferredSize()
Overridden so that the center can scale itself proportionately with the scale. |
double |
getRadius()
Gets the radius of the center. |
com.klg.jclass.swing.gauge.JCCircularScale |
getScale()
Returns the scale associated with this center. |
boolean |
getScaleImage()
Scales the image in relation to the radius. |
void |
paintComponent(Graphics g)
This routine actually draws the center object on the screen. |
void |
redraw()
Call this instead of paint so that the repaintEnabled flag can
be checked. |
void |
setImage(Image image)
Sets the Image to be used to mark the center of the circular
scale. |
void |
setRadius(double radius)
Sets the radius of the disk. |
void |
setScaleImage(boolean scaleImage)
Determines whether to scale the image according to the radius. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected com.klg.jclass.swing.gauge.JCCircularScale scale
protected Image image
Image
may be used to mark the center of the gauge.
protected Color foreground
protected boolean scaleImage
true
.
protected double radius
Constructor Detail |
public JCCenter(com.klg.jclass.swing.gauge.JCCircularScale scale)
scale
- the associated circular scalepublic JCCenter(com.klg.jclass.swing.gauge.JCCircularScale scale, Color foreground, double radius)
scale
- the associated circular scaleforeground
- the Color of the foregroundradius
- The radius of the center disc as a fractional proportion of
the associated scale's radius, from 0.0-1.0. For example, 0.5 means
the center will have a radius half the size of the scale's radius.public JCCenter(com.klg.jclass.swing.gauge.JCCircularScale scale, Color foreground, Image image)
scale
- the associated circular scaleforeground
- the Color of the foregroundimage
- the image used as the centerMethod Detail |
public void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- public Dimension getPreferredSize()
getPreferredSize
in class JComponent
Dimension
object indicating the preferred size of
the componentprotected void drawImage(Graphics g, Image image, Rectangle bounds)
protected void drawDisc(Graphics g)
g
- the graphics on which to drawpublic com.klg.jclass.swing.gauge.JCCircularScale getScale()
JCCenter
componentpublic void setRadius(double radius)
radius
parameter is a decimal
fraction of the scale's radius.
radius
- the radius of the center as a proportion of the circular
scale's radiuspublic double getRadius()
public Image getImage()
Image
to be used to mark the center of the circular
scale.
public void setImage(Image image)
Image
to be used to mark the center of the circular
scale.
image
- the Image
to be used to mark the center of the
circular scalepublic boolean getScaleImage()
true
if the image is to be scaled to the size of the
bounding box with length and width equal to "radius"; otherwise, center
the image based on its length and widthpublic void setScaleImage(boolean scaleImage)
scaleImage
- true
if the image is to be scaled to the size
of the bounding box with length and width equal to "radius"; otherwise,
center the image based on its length and widthpublic void redraw()
repaintEnabled
flag can
be checked. No repaint will occur if that flag is false
.
protected Shape getCenterShape()
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |