|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.simBio.core.Component org.simBio.core.Parameter org.simBio.core.Composite org.simBio.core.Analyzer org.simBio.sim.analyzer.VisualizeAnalyzer org.simBio.sim.analyzer.graph.Axis
public abstract class Axis
Coordinate axis base class
Field Summary | |
---|---|
protected int |
extendMode
Action mode |
protected int |
extendModeDefault
Default action mode |
protected double |
extendRateDefault
When the calculation exceeds the range of the display, scroll or expand the range (standard value) |
double |
gridStep
|
protected boolean |
isPlotLabel
whether to display the label or not |
protected java.awt.Color |
labelColor
axis label colour |
protected java.awt.Font |
labelFont
axis label font |
protected boolean |
labelInitialized
for label display |
protected double |
labelLength
maximum length of the label string |
double |
labelStep
label display interval |
double |
length
origin location & Length (0.01mm) |
protected static Log |
log
|
double |
max
|
double |
min
|
protected int |
MODE_AUTOSCALE
Action mode: autoscale mode |
protected int |
MODE_AUTOSCROLL
Action mode: autoscroll mode |
protected int |
MODE_FIXED
Action mode: fixed mode |
protected double |
nextLabelPos
next display position of the label string |
double |
origin
origin location & Length (0.01mm) |
protected java.lang.String |
patternString
Label format string |
protected java.awt.Color |
titleColor
title colour |
protected java.awt.Font |
titleFont
title font |
Fields inherited from class org.simBio.core.Parameter |
---|
value |
Constructor Summary | |
---|---|
Axis()
|
Method Summary | |
---|---|
protected void |
analyze(double t)
Do nothing |
void |
doRepaint()
Performs a repaint. |
protected abstract void |
drowDesc(java.awt.Graphics graphics,
IPlot plot,
java.lang.String str)
Draws the axis label in graphics. |
protected abstract void |
drowGrid(java.awt.Graphics graphics,
IPlot plot,
double value)
Draws a grid in graphics with a value at the specified position. |
protected abstract void |
drowLabel(java.awt.Graphics graphics,
IPlot plot,
double value,
java.lang.String str)
Draws the numerical value of the value parameter in graphics at the specified position. |
java.lang.String |
format(double val)
Format numeric value, and return String. Please refer to prepare() for more information about the format. |
abstract java.lang.String |
getFormatString(double min,
double max)
Get default format string. |
int |
getFreeSpaceBottom(java.awt.Graphics graphics)
Gets the space at the bottom of the screen for displaying the scale. Please override as necessary with a subclass. |
int |
getFreeSpaceLeft(java.awt.Graphics graphics)
Gets the space on the left of the screen for displaying the scale. Please override as necessary with a concrete class. |
int |
getFreeSpaceRight(java.awt.Graphics graphics)
Gets the space on the right of the screen for displaying the scale. Please override as necessary with a concrete class. |
int |
getFreeSpaceTop(java.awt.Graphics graphics)
Gets the space at the top of the screen for displaying the scale. Please override as necessary with a subclass. |
protected abstract double |
getLabelLength(java.awt.Graphics graphics,
java.lang.String str)
Gets the length of the axis direction, when the numerical value is displayed. This result is used to control the display space of the label. |
protected abstract double |
getPos(double data,
IPlot plot)
Gets the coordinate axis from Plot. |
protected static double |
Log10(double x)
Calculates a base 10 logarithm |
void |
plotAxis(java.awt.Graphics2D graphics2d,
IPlot plot)
Draw the axis grid/label. Sets the interval appropriately, if gridStep is not yet set or below 0. |
protected void |
prepare()
Set whether to display the plot label or not and set the pattern of the label number format. The display range formats up to single figures if it's below 0.1-10 decimal places ,if it's 10-1000,the integer region,apart from that,every 3 decimal places. To set a specific number value format, please define the pattern in xml, in the axis, with <component name="pattern" initial_value="#.#"/> etc. Please refer to DecimalFormat in the Javadoc for more information about the format. |
void |
prepareRepaint()
When a region of a graph changes, this method is called before doRepaint(). |
protected void |
setLinks()
Set link to the Viewer to get scale factor later. |
Methods inherited from class org.simBio.sim.analyzer.VisualizeAnalyzer |
---|
getColorParameter, getDouble, getFontParameter, getNodeHierarchically, getNodeRecursive, repaint, resetBuffer |
Methods inherited from class org.simBio.core.Composite |
---|
accept, getLink, getNode, getNodesIterator, getNodesSize |
Methods inherited from class org.simBio.core.Parameter |
---|
addValue, getValue, getValueString, setInitializer, setValue, setValueString, setValueToField |
Methods inherited from class org.simBio.core.Component |
---|
addDydt, end, getIndent, getIndentedShortName, getName, getName, getParent, getRoot, getShortName, getUnits, isNamed, isPrefixed, logIndented, quit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.simBio.core.Node |
---|
addDydt, addValue, getValue, setValue |
Field Detail |
---|
protected static Log log
protected final int MODE_FIXED
protected final int MODE_AUTOSCROLL
protected final int MODE_AUTOSCALE
protected int extendModeDefault
protected int extendMode
protected double extendRateDefault
public double origin
public double length
public double gridStep
public double min
public double max
protected java.awt.Font labelFont
protected java.awt.Color labelColor
protected java.awt.Font titleFont
protected java.awt.Color titleColor
public double labelStep
protected boolean isPlotLabel
protected java.lang.String patternString
protected double labelLength
protected double nextLabelPos
protected boolean labelInitialized
Constructor Detail |
---|
public Axis()
Method Detail |
---|
protected void setLinks()
setLinks
in class Component
Component.setLinks()
protected void prepare()
prepare
in class Parameter
Component.prepare()
,
DecimalFormat
protected void analyze(double t)
analyze
in class VisualizeAnalyzer
t
- timeAnalyzer.analyze(double)
public void prepareRepaint()
prepareRepaint
in class VisualizeAnalyzer
VisualizeAnalyzer.prepareRepaint()
public void doRepaint()
doRepaint
in class VisualizeAnalyzer
VisualizeAnalyzer.doRepaint()
protected abstract double getPos(double data, IPlot plot)
data
- calculation value plot
- object that handles drawing
protected static double Log10(double x)
x
- original value
public java.lang.String format(double val)
val
- displayed value
public abstract java.lang.String getFormatString(double min, double max)
min
- minimum scale valuemax
- maximum scale value
public int getFreeSpaceTop(java.awt.Graphics graphics)
graphics
- Graphics of the drawing target
public int getFreeSpaceBottom(java.awt.Graphics graphics)
graphics
- Graphics of the drawing target
public int getFreeSpaceLeft(java.awt.Graphics graphics)
graphics
- Graphics of the drawing target
public int getFreeSpaceRight(java.awt.Graphics graphics)
graphics
- Graphics of the drawing object
public void plotAxis(java.awt.Graphics2D graphics2d, IPlot plot)
graphics2d
- Graphics drawing object plot
- drawing handling object protected abstract double getLabelLength(java.awt.Graphics graphics, java.lang.String str)
graphics
- Graphics drawing object str
- display valueprotected abstract void drowGrid(java.awt.Graphics graphics, IPlot plot, double value)
graphics
- Graphics drawing object plot
- drawing operation object value
- calculation value protected abstract void drowLabel(java.awt.Graphics graphics, IPlot plot, double value, java.lang.String str)
graphics
- Graphics drawing object plot
- drawing operation object value
- calculation value str
- display value protected abstract void drowDesc(java.awt.Graphics graphics, IPlot plot, java.lang.String str)
graphics
- Graphics drawing object plot
- drawing operation object str
- display value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |