|
||||||||||
| 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.JSlider
jview.JRationalSlider
public class JRationalSlider
A slider that converts its integer value with a rational function.
x = a+b/x_int^nWhere the two constants are defined through the minimum and maximum values supplied on construct. For zero power, i.e. n = 0, the rational in x is replaced with the logarithm of x_int. (xs-xe)=b(1/xmin^n-1/xmax^n)->b
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JSlider |
|---|
JSlider.AccessibleJSlider |
| 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 | |
|---|---|
private double |
fractional
The fractional constant. |
static int |
MAXINTX
Default end value for the slider. |
static int |
MININTX
Default starting int value for the slider. |
private int |
power
The power of the fractional, zero for logarithmic. |
private double |
xoff
The offset constant. |
| Fields inherited from class javax.swing.JSlider |
|---|
changeEvent, changeListener, majorTickSpacing, minorTickSpacing, orientation, sliderModel, snapToTicks |
| 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 javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JRationalSlider(int orientation,
double xstart,
double xend,
int n,
double now)
Constrcuts a new rational slider with the given minimum/maximum and current value. |
|
JRationalSlider(int orientation,
int xmin,
int xmax,
double xstart,
double xend,
int n,
double now)
Constrcuts a new rational slider with the given minimum/maximum and current value. |
|
| Method Summary | |
|---|---|
private double |
getFractionalPosition(int xn)
Converts the integer value of the underlying slider to the rational value serverd by this slider. |
double |
getFractionalValue()
Converts the current integer value of the slider to the rational double value. |
private int |
getIntegerPosition(double value)
Converts a fractional value by the rational function this slider was constructed with to the integer position of the underlying slider. |
void |
setFractionalValue(double now)
Sets the position of the underlying slider to the value defined by the fractional value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MININTX
public static final int MAXINTX
private double xoff
private double fractional
private int power
| Constructor Detail |
|---|
public JRationalSlider(int orientation,
double xstart,
double xend,
int n,
double now)
public JRationalSlider(int orientation,
int xmin,
int xmax,
double xstart,
double xend,
int n,
double now)
| Method Detail |
|---|
public double getFractionalValue()
public void setFractionalValue(double now)
private int getIntegerPosition(double value)
private double getFractionalPosition(int xn)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||