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 booleanm_Flippedwhether 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 doubleadjustMaximum(double max)Adjusts the maximum to work with this model.doubleadjustMinimum(double min)Adjusts the minimum to work with this model.voidassign(AbstractAxisModel model)Obtains the necessary values from the given model and updates itself.booleancanHandle(double min, double max)Checks whether the data range can be handled by the model.protected StringdoValueToDisplay(double value)Returns the display string of the value for the tooltip, for instance.StringgetDisplayName()Returns the display name of this model.protected voidinitialize()Initializes the member variables.booleanisFlipped()Returns whether the axis is flipped.doubleposToValue(int pos)Returns the value for the given position on the axis.voidpushZoom(double min, double max)Adds the zoom to its internal list and updates the axis.voidsetFlipped(boolean value)Sets whether to flip the axis.intvalueToPos(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:
initializein classAbstractAxisModel
-
assign
public void assign(AbstractAxisModel model)
Obtains the necessary values from the given model and updates itself.- Overrides:
assignin 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:
canHandlein 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:
adjustMinimumin 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:
adjustMaximumin classAbstractAxisModel- Parameters:
max- the maximum to adjust- Returns:
- the updated value
-
getDisplayName
public String getDisplayName()
Returns the display name of this model.- Specified by:
getDisplayNamein classAbstractAxisModel- Returns:
- the display name
-
setFlipped
public void setFlipped(boolean value)
Sets whether to flip the axis.- Specified by:
setFlippedin interfaceFlippableAxisModel- Parameters:
value- if true the axis gets flipped
-
isFlipped
public boolean isFlipped()
Returns whether the axis is flipped.- Specified by:
isFlippedin 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:
doValueToDisplayin 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:
valueToPosin 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:
posToValuein 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:
pushZoomin classAbstractAxisModel- Parameters:
min- the minimum of the zoommax- the maximum of the zoom
-
-