|
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.JCGauge | +--com.klg.jclass.swing.gauge.JCLinearGauge
JCLinearGauge
.
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 Vector |
labels
The list of labels for this gauge. |
Fields inherited from class com.klg.jclass.swing.gauge.JCGauge |
draggedNeedle, footer, footerLayoutHints, gaugeArea, gaugeAreaLayoutHints, header, headerLayoutHints, image, indicators, legend, legendLayoutHints, needles, pickListeners, repaintEnabled, scale, scaleImage, snapToValue |
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 | |
JCLinearGauge()
No-argument constructor for JCLinearGauge . |
|
JCLinearGauge(boolean createScale)
Constructs a JCLinearGauge with no default objects except
possibly a linear scale. |
Method Summary | |
void |
addLabel(JComponent label,
com.klg.jclass.swing.gauge.LinearConstraint constraint)
Adds a label to the gauge. |
void |
addLabel(JComponent label,
com.klg.jclass.swing.gauge.LinearConstraint constraint,
int index)
Adds a label to the gauge. |
protected void |
drawImage(Graphics g,
Image image,
Rectangle bounds,
Color color)
Draws an image as the gauge background. |
com.klg.jclass.swing.gauge.JCLinearNeedle |
getClosestNeedle(com.klg.jclass.swing.gauge.JCGaugePickEvent pe,
JCAbstractNeedle.InteractionType interactionType)
Returns the closest needle to the clicked/dragged point. |
Graphics |
getGraphics()
Overrides parent getGraphics() . |
com.klg.jclass.swing.gauge.JCLinearScale |
getLinearScale()
Returns the linear gauge's linear scale (appropriately cast). |
void |
mouseClicked(MouseEvent event)
Sends pick events to listeners and moves the closest needle with a CLICK interaction enabled to the value indicated
by the mouse click. |
void |
mouseDragged(MouseEvent event)
Drags the closest needle. |
void |
paintComponent(Graphics g)
Paints the gauge. |
void |
redraw()
Call this instead of paint so that the repaintEnabled flag can
be checked. |
void |
removeLabel(JComponent label)
Removes a label. |
void |
serverPaint(Graphics igc)
Internal use only. |
Image |
serverSnapshot()
Internal use only. |
void |
setGraphics(Graphics g)
Provides a way for the circular gauge to draw to a custom Graphics object. |
void |
setScale(com.klg.jclass.swing.gauge.JCLinearScale scale)
Adds a linear scale to the linear gauge. |
void |
setScale(com.klg.jclass.swing.gauge.JCLinearScale scale,
boolean addToGaugeArea)
Adds a linear scale to the linear gauge. |
protected int |
valueToPosition(double value)
A convenience method that returns the position corresponding to a linear scale value. |
Methods inherited from class com.klg.jclass.swing.gauge.JCGauge |
addIndicator, addIndicator, addNeedle, addNeedle, addPickListener, addRange, addRange, addTick, addTick, getAbout, getComponentArea, getDrawingAreaHeight, getDrawingAreaWidth, getFooter, getGaugeArea, getHeader, getImage, getIndicators, getLayoutHints, getLegend, getNeedles, getRanges, getRepaintEnabled, getScale, getScaleImage, getSnapToValue, getTicks, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, pick, removeIndicator, removeNeedle, removePickListener, removeRange, removeTick, sendPickEvent, setAbout, setFooter, setGaugeArea, setHeader, setImage, setIndicatorScales, setLegend, setNeedleScales, setRepaintEnabled, setScaleImage, setSnapToValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.klg.jclass.util.legend.LegendComponentLayoutUser |
getPreferredSize |
Field Detail |
protected Vector labels
JCLabelGenerator
Constructor Detail |
public JCLinearGauge()
JCLinearGauge
.
Creates a default scale, needle, and tick marks.
setScale(JCLinearScale)
,
JCGauge.addIndicator(JCAbstractIndicator)
,
JCGauge.addNeedle(JCAbstractNeedle)
,
JCAbstractScale.addRange(JCRange)
,
JCGauge.addTick(JCTick)
,
JCGauge.getScale()
,
JCGauge.removeIndicator(JCAbstractIndicator)
,
JCGauge.removeNeedle(JCAbstractNeedle)
,
JCAbstractScale.removeRange(JCRange)
,
JCGauge.removeTick(JCTick)
public JCLinearGauge(boolean createScale)
JCLinearGauge
with no default objects except
possibly a linear scale.
Use the following methods to add needles, indicators, ticks, and ranges.
createScale
- JCGauge.addIndicator(JCAbstractIndicator)
,
JCGauge.addNeedle(JCAbstractNeedle)
,
JCAbstractScale.addRange(JCRange)
,
JCGauge.addTick(JCTick)
,
JCGauge.getScale()
,
JCGauge.removeIndicator(JCAbstractIndicator)
,
JCGauge.removeNeedle(JCAbstractNeedle)
,
JCAbstractScale.removeRange(JCRange)
,
JCGauge.removeTick(JCTick)
Method Detail |
public void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- The Graphics
with which to paintpublic com.klg.jclass.swing.gauge.JCLinearScale getLinearScale()
public void setScale(com.klg.jclass.swing.gauge.JCLinearScale scale, boolean addToGaugeArea)
scale
- the linear scale to be addedaddToGaugeArea
- Add the scale to the JCGaugeArea
parent?public void setScale(com.klg.jclass.swing.gauge.JCLinearScale scale)
scale
- the linear scale to be addedpublic void addLabel(JComponent label, com.klg.jclass.swing.gauge.LinearConstraint constraint)
label
- the JComponent
to be added as a labelconstraint
- the LinearConstraint
specifying where to
place the labelpublic void addLabel(JComponent label, com.klg.jclass.swing.gauge.LinearConstraint constraint, int index)
label
- the JComponent
to be added as a labelconstraint
- the LinearConstraint
specifying where to
place the labelindex
- the z-order indexpublic void removeLabel(JComponent label)
label
- the JComponent
to be removedpublic void mouseClicked(MouseEvent event)
CLICK
interaction enabled to the value indicated
by the mouse click.
mouseClicked
in interface MouseListener
mouseClicked
in class JCGauge
event
- a MouseEvent
public void mouseDragged(MouseEvent event)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class JCGauge
event
- a MouseEvent
public com.klg.jclass.swing.gauge.JCLinearNeedle getClosestNeedle(com.klg.jclass.swing.gauge.JCGaugePickEvent pe, JCAbstractNeedle.InteractionType interactionType)
CLICK
/DRAG
/CLICK_DRAG
,
or if there are none of these, the closest needle of type NONE
.
pe
- the pick event with the click inforamationinteractionType
- the needle must be of this
JCAbstractNeedle.InteractionType
protected int valueToPosition(double value)
value
- a circular scale value.
protected void drawImage(Graphics g, Image image, Rectangle bounds, Color color)
bounds
- color
- image
- g
- the Graphics on which to drawpublic void redraw()
repaintEnabled
flag can
be checked. No repaint will occur if that flag is false
.
redraw
in class JCGauge
public Graphics getGraphics()
getGraphics()
. If another Graphics object has
been set to be the current one, will return that. Otherwise, call the
superclass' getGraphics()
method.
getGraphics
in interface com.klg.jclass.util.ServerRenderable
getGraphics
in class JComponent
public void setGraphics(Graphics g)
setGraphics
in interface com.klg.jclass.util.ServerRenderable
g
- Graphics object to use for drawingpublic Image serverSnapshot()
serverSnapshot
in interface com.klg.jclass.util.ServerRenderable
public void serverPaint(Graphics igc)
serverPaint
in interface com.klg.jclass.util.ServerRenderable
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |