|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJSci.swing.JPointer
public class JPointer
A pointer for the JRoundDial or JArcDial
| Field Summary | |
|---|---|
protected javax.swing.event.EventListenerList |
listenerList
The list of ChangeListeners for this model. |
static int |
POINTER_SIMPLE_QUADRANGLE
|
static int |
POINTER_SIMPLE_STOP
|
static int |
POINTER_SIMPLE_TRIANGLE
|
static int |
SLIDER_SIMPLE_QUADRANGLE
|
static int |
SLIDER_SIMPLE_STOP
|
static int |
SLIDER_SIMPLE_TRIANGLE
|
| Constructor Summary | |
|---|---|
JPointer(int t)
|
|
| Method Summary | |
|---|---|
void |
addChangeListener(javax.swing.event.ChangeListener l)
Adds a ChangeListener to the model's listener list. |
boolean |
contains(java.awt.Point p)
check if a point is inside the pointer image |
protected void |
fireStateChanged()
Run each ChangeListeners stateChanged() method. |
javax.swing.event.ChangeListener[] |
getChangeListeners()
Returns an array of all the ChangeListeners added
to this JPointer with addChangeListener(). |
java.util.EventListener[] |
getListeners(java.lang.Class listenerType)
Return an array of all the listeners of the given type that were added to this model. |
double |
getValue()
get the value of the pointer |
protected void |
paintOnDial(java.awt.Graphics2D g,
double radius,
double one,
double zero,
double x0,
double y0)
draw the pointer on the dial. |
protected void |
paintOnSlider(java.awt.Graphics2D g,
double start,
double end,
double width,
double heigth)
draw the slider on the dial. |
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Removes a ChangeListener from the model's listener list. |
void |
setAdjusting(boolean b)
If you are adjusting the value, the changes should not be fired (dispatched) to the listeners. |
void |
setColor(java.awt.Color col)
set the color of the pointer |
void |
setEnabled(boolean b)
enable or disable the motion by the mouse |
void |
setValue(double v)
set the value of the pointer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected javax.swing.event.EventListenerList listenerList
public static final int POINTER_SIMPLE_TRIANGLE
public static final int POINTER_SIMPLE_QUADRANGLE
public static final int POINTER_SIMPLE_STOP
public static final int SLIDER_SIMPLE_TRIANGLE
public static final int SLIDER_SIMPLE_QUADRANGLE
public static final int SLIDER_SIMPLE_STOP
| Constructor Detail |
|---|
public JPointer(int t)
t - the type of the pointer| Method Detail |
|---|
public double getValue()
public void setValue(double v)
v - the valuepublic void setEnabled(boolean b)
b - should the mouse move the pointer?public void setAdjusting(boolean b)
b - are the following movements adjustments?public void setColor(java.awt.Color col)
col - the desired colorpublic boolean contains(java.awt.Point p)
p - the point
protected void paintOnDial(java.awt.Graphics2D g,
double radius,
double one,
double zero,
double x0,
double y0)
g - the graphics on which to drawradius - the radius of the dialone - the value of one turnzero - the angle (clockwise, starting from the top) at which the zero should
be placedx0 - horizontal coordinate of the center of the dialy0 - vertical coordinate of the center of the dial
protected void paintOnSlider(java.awt.Graphics2D g,
double start,
double end,
double width,
double heigth)
g - the graphics on which to drawstart - the value on the bottom of the JSliderPlusend - the value on the top of the JSliderPluswidth - the width of the componentheigth - the heigth of the componentpublic void addChangeListener(javax.swing.event.ChangeListener l)
l - the ChangeListener to addremoveChangeListener(javax.swing.event.ChangeListener)public void removeChangeListener(javax.swing.event.ChangeListener l)
l - the ChangeListener to removeaddChangeListener(javax.swing.event.ChangeListener)public javax.swing.event.ChangeListener[] getChangeListeners()
ChangeListeners added
to this JPointer with addChangeListener().
ChangeListeners added or an empty
array if no listeners have been addedprotected void fireStateChanged()
setValue(double),
EventListenerListpublic java.util.EventListener[] getListeners(java.lang.Class listenerType)
myJPointer.getListeners(ChangeListener.class);
listenerType - the type of listeners to return, e.g. ChangeListener.class
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||