|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metsci.glimpse.axis.Axis1D
public class Axis1D
A one dimensional numeric axis. Has minimum and maximum bounds which represent its current extent. Constraints can also be set on the axis which constrain what values the minimum and maximum bounds can take on.
Axis1D can be part of a hierarchy of axes which all mirror changes in each other, making it easy to set up a series of linked plots. Axis1D also supports locking its aspect ratio with respect to another (usually orthogonal) axis in order to ensure that the ratio of the scales of the two axes remains consistent. Axis1D are associated with one of twoGlimpseLayout
implementations: GlimpseAxisLayout1D
and
GlimpseAxisLayout2D
. When a
GlimpsePainter
is added to a
GlimpseLayout
, it paints based on the
bounds provided by the Axis1D associated with the
GlimpseLayout
.
Field Summary | |
---|---|
static java.util.logging.Logger |
logger
|
Constructor Summary | |
---|---|
Axis1D()
|
|
Axis1D(Axis1D parent)
|
Method Summary | |
---|---|
void |
addAxisListener(AxisListener1D listener)
Adds a listener which will be notified whenever this axis changes. |
void |
applyConstraints()
Adjusts the min and max values of the axis to conform to the various axis constraints like absolute bounds and locked min/max. |
Axis1D |
clone()
|
double |
getAbsoluteMax()
|
double |
getAbsoluteMin()
|
Axis1D |
getLockedAspectAxis()
|
double |
getLockedAspectRatio()
|
double |
getLockMax()
|
double |
getLockMin()
|
double |
getMax()
|
double |
getMaxSpan()
|
double |
getMin()
|
double |
getMinSpan()
|
double |
getMouseValue()
|
double |
getPixelsPerValue()
|
double |
getSelectionCenter()
|
double |
getSelectionSize()
|
int |
getSizePixels()
|
UpdateMode |
getUpdateMode()
|
boolean |
isInitialized()
|
boolean |
isLockMax()
|
boolean |
isLockMin()
|
boolean |
isMaxSpanConstrained()
|
boolean |
isMinSpanConstrained()
|
boolean |
isSelectionLocked()
|
void |
lockAspectRatio(Axis1D orthogonalAxis,
double aspectRatio)
Locks the aspect ratio between this axis and a provided orthogonal aspect to a fixed ratio. |
void |
lockMax(double value)
Locks the maximum value of this axis to a fixed value. |
void |
lockMin(double value)
Locks the minimum value of this axis to a fixed value. |
void |
removeAxisListener(AxisListener1D listener)
Removes the provided listener from the list of listeners which are notified when this axis changes. |
double |
screenPixelToValue(double pixel)
|
void |
setAbsoluteMax(double max)
Sets the absolute maximum value of this axis. |
void |
setAbsoluteMin(double min)
Sets the absolute minimum value of this axis. |
void |
setConstrainMaxSpan(boolean constrain)
If true, the maximum difference set by setMaxSpan() is enforced. |
void |
setConstrainMinSpan(boolean constrain)
If true, the minimum difference set by setMinSpan() is enforced. |
void |
setInitialized()
Should be called once axisSizePixels has been properly set (usually once the underlying canvas associated with this Axis1D has been drawn). |
void |
setLinkChildren(boolean link)
|
void |
setMax(double value)
Sets the maximum value of this axis. |
void |
setMaxSpan(double diff)
Constrains the maximum difference between the axis max and min values. |
void |
setMin(double value)
Sets the minimum value of this axis. |
void |
setMinSpan(double diff)
Constrains the minimum difference between the axis max and min values. |
void |
setMouseValue(double value)
Sets the position of the mouse in axis value space. |
void |
setParent(Axis1D newParent)
Allows a group of axis which should mirror each other to be defined by placing them in a tree-hierarchy. |
void |
setParent(Axis1D newParent,
boolean duplicateChild)
|
void |
setSelectionCenter(double value)
Sets the center of the selected range of this axis. |
void |
setSelectionLock(boolean lock)
Locks the selected region of this axis so that it does not adjust. |
void |
setSelectionSize(double value)
Sets the size of the selected range of this axis. |
void |
setSizePixels(int newSize)
Sets the pixel size of this axis. |
void |
setSizePixels(int newSize,
boolean initialize)
Sets the pixel size of this axis. |
void |
setUpdateMode(UpdateMode mode)
Sets the UpdateMode of this axis. |
java.lang.String |
toString()
|
void |
unlockAspectRatio()
Removes the aspect ratio locking which was established through a call to lockAspectRatio( ). |
void |
unlockMax()
Unlocks the maximum value of this axis. |
void |
unlockMin()
Unlocks the minimum value of this axis. |
void |
updateLinkedAxes()
|
void |
updateLinkedAxes(Axis1D... ignore)
|
void |
validate()
Ensures that the axis min and max values do not violate any constraints and publishes this axis' values to all linked axes. |
int |
valueToScreenPixel(double value)
|
double |
valueToScreenPixelUnits(double value)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.util.logging.Logger logger
Constructor Detail |
---|
public Axis1D(Axis1D parent)
public Axis1D()
Method Detail |
---|
public Axis1D clone()
clone
in class java.lang.Object
public void validate()
public void setParent(Axis1D newParent)
newParent
- The new parent for this axis.public void setParent(Axis1D newParent, boolean duplicateChild)
public void setLinkChildren(boolean link)
public void addAxisListener(AxisListener1D listener)
listener
- public void removeAxisListener(AxisListener1D listener)
listener
- public void lockAspectRatio(Axis1D orthogonalAxis, double aspectRatio)
orthogonalAxis
- The axis to remain at a fixed aspect ratio with.aspectRatio
- The aspect ratio to maintain.public void setMinSpan(double diff)
diff
- public void setMaxSpan(double diff)
diff
- public void setConstrainMinSpan(boolean constrain)
constrain
- public void setConstrainMaxSpan(boolean constrain)
constrain
- public boolean isMinSpanConstrained()
public boolean isMaxSpanConstrained()
public void unlockAspectRatio()
public void lockMin(double value)
value
- public void lockMax(double value)
value
- public void unlockMin()
public void unlockMax()
public void setUpdateMode(UpdateMode mode)
mode
- UpdateMode
public void setMin(double value)
value
- public void setMax(double value)
value
- public void setAbsoluteMin(double min)
min
- public void setAbsoluteMax(double max)
max
- public void setSelectionSize(double value)
value
- public void setSelectionCenter(double value)
value
- public void setSelectionLock(boolean lock)
lock
- public void setMouseValue(double value)
value
- public void setSizePixels(int newSize)
newSize
- public void setSizePixels(int newSize, boolean initialize)
newSize
- public void setInitialized()
public double getMinSpan()
public double getMaxSpan()
public Axis1D getLockedAspectAxis()
public double getLockedAspectRatio()
public double getLockMin()
public double getLockMax()
public boolean isLockMin()
public boolean isLockMax()
public boolean isInitialized()
public UpdateMode getUpdateMode()
UpdateMode
public double getMin()
public double getMax()
public double getAbsoluteMin()
public double getAbsoluteMax()
public double getSelectionSize()
public double getSelectionCenter()
public boolean isSelectionLocked()
public int getSizePixels()
public double getMouseValue()
public double getPixelsPerValue()
public double screenPixelToValue(double pixel)
public int valueToScreenPixel(double value)
public double valueToScreenPixelUnits(double value)
public void applyConstraints()
public void updateLinkedAxes()
public void updateLinkedAxes(Axis1D... ignore)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |