public class Axis1D extends Object
GlimpseLayout
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
.Modifier and Type | Method and Description |
---|---|
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 |
lock()
Locks both the minimum and maximum value of this axis to their current values.
|
void |
lockAspectRatio(Axis1D orthogonalAxis,
double aspectRatio)
Locks the aspect ratio between this axis and a provided orthogonal
aspect to a fixed ratio.
|
void |
lockMax()
Locks the maximum value of this axis to its current max value.
|
void |
lockMax(double value)
Locks the maximum value of this axis to a fixed value.
|
void |
lockMin()
Locks the minimum value of this axis to its current min 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.
|
String |
toString() |
void |
unlock()
Unlocks the minimum an maximum values of this axis.
|
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) |
public static Logger logger
public Axis1D(Axis1D parent)
public Axis1D()
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 lock()
public void lockMin()
public void lockMax()
public void unlock()
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)
Copyright © 2016 Metron, Inc.. All rights reserved.