Class DefaultAxisModel
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.gui.visualization.core.axis.AbstractAxisModel
-
- adams.gui.visualization.core.axis.DefaultAxisModel
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,FlippableAxisModel
,Serializable
public class DefaultAxisModel extends AbstractAxisModel implements FlippableAxisModel
An axis model for displaying absolute values.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_Flipped
whether the axis is flipped.-
Fields inherited from class adams.gui.visualization.core.axis.AbstractAxisModel
m_ActualMaximum, m_ActualMaximumNoMargin, m_ActualMinimum, m_ActualMinimumNoMargin, m_CustomerFormatter, m_Formatter, m_ManualMarginBottom, m_ManualMarginTop, m_ManualMaximum, m_ManualMinimum, m_MarginBottom, m_MarginTop, m_Maximum, m_Minimum, m_NthValueToShow, m_Parent, m_PixelOffset, m_PixelOffsets, m_TickGenerator, m_Validated, m_ZoomHandler
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description DefaultAxisModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
adjustMaximum(double max)
Adjusts the maximum to work with this model.double
adjustMinimum(double min)
Adjusts the minimum to work with this model.void
assign(AbstractAxisModel model)
Obtains the necessary values from the given model and updates itself.boolean
canHandle(double min, double max)
Checks whether the data range can be handled by the model.protected String
doValueToDisplay(double value)
Returns the display string of the value for the tooltip, for instance.String
getDisplayName()
Returns the display name of this model.protected void
initialize()
Initializes the member variables.boolean
isFlipped()
Returns whether the axis is flipped.double
posToValue(int pos)
Returns the value for the given position on the axis.void
pushZoom(double min, double max)
Adds the zoom to its internal list and updates the axis.void
setFlipped(boolean value)
Sets whether to flip the axis.int
valueToPos(double value)
Returns the position on the axis for the given value.-
Methods inherited from class adams.gui.visualization.core.axis.AbstractAxisModel
canAssignFormatter, canZoom, clearZoom, getActualFormatter, getActualMaximum, getActualMaximumNoMargin, getActualMinimum, getActualMinimumNoMargin, getBottomMargin, getCustomFormatter, getDefaultFormatter, getDefaultNumberFormat, getManualBottomMargin, getManualMaximum, getManualMinimum, getManualTopMargin, getMaximum, getMinimum, getMinZoomDifference, getNthValueToShow, getNumberFormat, getParent, getPixelOffset, getTickGenerator, getTicks, getTopMargin, hasCustomFormatter, invalidate, isZoomed, popZoom, setBottomMargin, setCustomFormatter, setManualBottomMargin, setManualMaximum, setManualMinimum, setManualTopMargin, setMaximum, setMinimum, setNthValueToShow, setNumberFormat, setParent, setPixelOffset, setTickGenerator, setTopMargin, toString, update, validate, valueToDisplay
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the member variables.- Overrides:
initialize
in classAbstractAxisModel
-
assign
public void assign(AbstractAxisModel model)
Obtains the necessary values from the given model and updates itself.- Overrides:
assign
in classAbstractAxisModel
- Parameters:
model
- the model to get the parameters from
-
canHandle
public boolean canHandle(double min, double max)
Checks whether the data range can be handled by the model.- Specified by:
canHandle
in classAbstractAxisModel
- Parameters:
min
- the minimum valuemax
- the maximum value- Returns:
- always true
-
adjustMinimum
public double adjustMinimum(double min)
Adjusts the minimum to work with this model.- Specified by:
adjustMinimum
in classAbstractAxisModel
- Parameters:
min
- the minimum to adjust- Returns:
- the updated value
-
adjustMaximum
public double adjustMaximum(double max)
Adjusts the maximum to work with this model.- Specified by:
adjustMaximum
in classAbstractAxisModel
- Parameters:
max
- the maximum to adjust- Returns:
- the updated value
-
getDisplayName
public String getDisplayName()
Returns the display name of this model.- Specified by:
getDisplayName
in classAbstractAxisModel
- Returns:
- the display name
-
setFlipped
public void setFlipped(boolean value)
Sets whether to flip the axis.- Specified by:
setFlipped
in interfaceFlippableAxisModel
- Parameters:
value
- if true the axis gets flipped
-
isFlipped
public boolean isFlipped()
Returns whether the axis is flipped.- Specified by:
isFlipped
in interfaceFlippableAxisModel
- Returns:
- true if the axis is flipped
-
doValueToDisplay
protected String doValueToDisplay(double value)
Returns the display string of the value for the tooltip, for instance.- Specified by:
doValueToDisplay
in classAbstractAxisModel
- Parameters:
value
- the value to turn into string- Returns:
- the display string
-
valueToPos
public int valueToPos(double value)
Returns the position on the axis for the given value.- Specified by:
valueToPos
in classAbstractAxisModel
- Parameters:
value
- the value to get the position for- Returns:
- the corresponding position
-
posToValue
public double posToValue(int pos)
Returns the value for the given position on the axis.- Specified by:
posToValue
in classAbstractAxisModel
- Parameters:
pos
- the position to get the corresponding value for- Returns:
- the corresponding value
-
pushZoom
public void pushZoom(double min, double max)
Adds the zoom to its internal list and updates the axis.- Overrides:
pushZoom
in classAbstractAxisModel
- Parameters:
min
- the minimum of the zoommax
- the maximum of the zoom
-
-