|
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.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.
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Field Summary | |
protected Color |
foreground
The scale's foreground color. |
protected JCCircularGauge |
gauge
The associated circlar gauge. |
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 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 |
Constructor Summary | |
JCCenter(JCCircularGauge gauge)
Creates a black disk at the center of the scale whose default radius is 10% of the scale's radius. |
|
JCCenter(JCCircularGauge gauge,
Color foreground,
double radius)
Creates a black disk at the center of the scale whose radius and foreground color are parameters. |
|
JCCenter(JCCircularGauge gauge,
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)
Draws an image as the center. |
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. |
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.awt.Container |
add,
add,
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 JCCircularGauge gauge
protected Image image
Image
may be used to mark the center of the gauge.protected Color foreground
protected boolean scaleImage
protected double radius
Constructor Detail |
public JCCenter(JCCircularGauge gauge)
gauge
- The parent circular gauge.public JCCenter(JCCircularGauge gauge, Color foreground, double radius)
gauge
- The parent circular gauge.foreground
- The Color of the foregroundradius
- The radius of the center disc as a fractional proportion of
the 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(JCCircularGauge gauge, Color foreground, Image image)
gauge
- The parent circular gauge.foreground
- The Color of the foregroundimage
- The image used as the centerMethod Detail |
public void paintComponent(Graphics g)
g
- public Dimension getPreferredSize()
Dimension
object indicating the preferred size of
the component.protected void drawImage(Graphics g)
g
- The Graphics on which to drawprotected void drawDisc(Graphics g)
g
- The graphics on which to drawpublic 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 radius.public 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 scale.public boolean getScaleImage()
public 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()
|
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 |