|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
de.mospace.swing.VariableRangeSlider
public class VariableRangeSlider
A JSlider whose range and central value can be modified by the user.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
MAX_LOG_RANGE
A constant holding the maximum value allowed for logrange in setLogRange(int). |
static double |
MAX_VALUE
A constant holding the largest positive finite value the slider can assume. |
static int |
MIN_LOG_RANGE
A constant holding the minimum value allowed for logrange in setLogRange(int). |
static double |
MIN_VALUE
A constant holding the smallest positive nonzero value the slider can assume. |
static DecimalFormat |
NUMBER_FORMAT
The NumberFormat used to output the slider value. |
protected JSpinner |
range
The JSpinner used to set the power of ten that corresponds to half the slider length. |
protected JSlider |
slider
The internal JSlider of the VariableRangeSlider. |
protected JFormattedTextField |
value
The JTextField used to set and print the value of the slider. |
| 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 | |
|---|---|
VariableRangeSlider()
Constructs a new slider with central value 0, range -10 to 10 and gridsize 201. |
|
VariableRangeSlider(double value,
int logrange)
Constructs a new slider with the given central value, and range ±10logrange and gridsize 101. |
|
| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener l)
Adds a ChangeListener to the slider. |
protected void |
fireStateChanged()
Notifies all registered ChangeListeners. |
String |
getFormattedValue()
Gets the current value of the slider as a formatted String. |
int |
getGridsize()
Gets the number of steps used for the slider. |
int |
getLogRange()
Gets the power of ten that corresponds to half the slider length. |
Dimension |
getMinimumSize()
Overrides method in superclass java.awt.Component. |
Dimension |
getPreferredSize()
Overrides method in superclass java.awt.Component. |
double |
getValue()
Gets the current value of the slider. |
Dimension |
minimumSize()
Deprecated. |
Dimension |
preferredSize()
Deprecated. |
void |
removeChangeListener(ChangeListener l)
Removes a ChangeListener from the slider. |
void |
setGridsize(int i)
Sets the number of steps used for the slider. |
void |
setLogRange(int lr)
Sets the power of ten that corresponds to half the slider length. |
void |
setValue(double d)
Sets the value of the slider to d and makes it resume a central position. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_LOG_RANGE
setLogRange(int).
public static final int MIN_LOG_RANGE
setLogRange(int).
public static final double MAX_VALUE
public static final double MIN_VALUE
public static final DecimalFormat NUMBER_FORMAT
protected JSlider slider
protected JFormattedTextField value
protected JSpinner range
| Constructor Detail |
|---|
public VariableRangeSlider()
public VariableRangeSlider(double value,
int logrange)
| Method Detail |
|---|
public void setValue(double d)
d - a legal double value
IllegalArgumentException - when d is out of rangeMAX_VALUE,
MIN_VALUEpublic double getValue()
public String getFormattedValue()
NUMBER_FORMATpublic void setGridsize(int i)
i - will automatically be converted to an odd integer >= 3.public int getGridsize()
public void setLogRange(int lr)
lr - log10 of the desired rangepublic int getLogRange()
public void addChangeListener(ChangeListener l)
ChangeListener to the slider.
l - the listener to be addedpublic void removeChangeListener(ChangeListener l)
l - the listener to be removedprotected void fireStateChanged()
public Dimension getPreferredSize()
java.awt.Component.
getPreferredSize in class JComponentpublic Dimension getMinimumSize()
java.awt.Component.
getMinimumSize in class JComponentpublic Dimension preferredSize()
java.awt.Component.
preferredSize in class ContainergetPreferredSize()public Dimension minimumSize()
java.awt.Component.
minimumSize in class ContainergetMinimumSize()
|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||