|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimtools.shapes.AbstractShape
simtools.shapes.AxisShape
public class AxisShape
Nested Class Summary | |
---|---|
static class |
AxisShape.AxePropertiesNames
|
Nested classes/interfaces inherited from class simtools.shapes.AbstractShape |
---|
AbstractShape.AbstractShapePropertiesNames |
Field Summary | |
---|---|
protected java.awt.Color |
_color
|
protected static int |
_defaultTickLength
|
protected static int |
_defaultTickSpace
|
protected java.awt.Font |
_font
|
protected java.text.Format |
_format
|
protected double[] |
_gridDoubleValues
The double values, that contains the value of the ticks. |
protected double |
_gridOffset
|
protected int[] |
_gridPos
|
protected java.awt.Stroke |
_gridStroke
|
protected LabelShape[] |
_gridValues
The labelShape Array, that contains the tick. |
protected int |
_gridZeroIndex
|
protected boolean |
_isVertical
|
protected LabelShape |
_label
|
protected int |
_labelLineHeight
|
protected int |
_lineHeight
|
protected int |
_lineWidth
|
protected double |
_max
axis maximum value |
protected double |
_min
axis minimum value |
protected int |
_nbrLabelLines
|
protected double |
_step
axis grid step value |
protected boolean |
_valuesFirst
|
protected boolean |
_withDashedGrid
|
protected boolean |
_withGridlines
|
protected boolean |
_withValues
|
protected static java.awt.Color |
gridColor
|
static boolean |
preferredDashedGrid
the type of the line in the grid false : simple lines for the grid true : dashed lines for the grid |
static boolean |
preferredShowGrid
Indicate the presence of grids for the initialization |
Fields inherited from class simtools.shapes.AbstractShape |
---|
_h, _ox, _oy, _propertyNames, _w, _x, _y, ANTI_ALIASING, currentDialogBox, FONT_NAMES, listeners, REFRESH_PERIOD |
Constructor Summary | |
---|---|
AxisShape(boolean isVertical,
boolean valuesFirst,
int ox,
int oy,
int width,
int height)
|
Method Summary | |
---|---|
protected AbstractShape |
cloneShape()
Performs a copy of the shape This method has to be overriden to deal with concrete shapes |
protected void |
computeBounds()
|
protected double |
computeLogCeil(double upper)
Returns the smallest (closest to negative infinity) double value that is not less than the argument, is equal to a mathematical integer and satisfying the condition that log base 10 of the value is an integer (i.e., the value returned will be a power of 10: 1, 10, 100, 1000, etc.). |
protected double |
computeLogFloor(double lower)
Returns the largest (closest to positive infinity) double value that is not greater than the argument, is equal to a mathematical integer and satisfying the condition that log base 10 of the value is an integer (i.e., the value returned will be a power of 10: 1, 10, 100, 1000, etc.). |
protected double |
computeStep(double min,
double max)
Computes the "best" step to go from min to max Average number of graduations is set to 10 Algo from simgo/util/geom/WaveAxis.java |
void |
draw(java.awt.Graphics2D g2)
Draws it |
int |
getLineHeight()
|
int |
getLineWidth()
|
double |
getMax()
Gets the axis parameters |
double |
getMin()
Gets the axis parameters |
static java.lang.String |
getPrefix(java.lang.String id)
Properties managment |
double |
getScale()
Gets the axis scale factor |
double |
getStep()
Gets the axis parameters |
boolean |
isLog()
|
boolean |
isVertical()
|
boolean |
isWithDashedGrid()
|
boolean |
isWithGridlines()
|
boolean |
isWithValues()
|
void |
resize(int dx,
int dy)
Resizes the shape |
void |
set(double min,
double max)
Sets axis values. |
void |
set(double min,
double max,
double step)
Sets axis values |
void |
setAnchor(int ox,
int oy)
Sets shape anchor |
void |
setColor(java.awt.Color c)
|
void |
setFont(java.awt.Font f)
|
void |
setFormat(java.text.Format f)
|
void |
setLabel(java.lang.String s)
|
void |
setLog(boolean _log)
Method setLog Summary: This method set the axis logarithmic mode indicator. |
void |
setWithDashedGrid(boolean t)
|
void |
setWithGridlines(boolean t)
|
void |
setWithValues(boolean t)
|
void |
translate(int dx,
int dy)
Translates the shape |
Methods inherited from class simtools.shapes.AbstractShape |
---|
addListener, contains, contains, contains, contains, getAnchor, getBounds, getBounds2D, getInnerProperties, getMax, getMaxTranslated, getMin, getPathIterator, getPathIterator, getPropertyNames, getPropertyValue, intersects, intersects, notifyChange, notifyChange, refresh, removeListener, setAnchor, setProperties, setPropertyValue, wipeOff |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean preferredDashedGrid
public static boolean preferredShowGrid
protected static java.awt.Color gridColor
protected static int _defaultTickLength
protected static int _defaultTickSpace
protected boolean _isVertical
protected boolean _valuesFirst
protected boolean _withGridlines
protected boolean _withValues
protected java.awt.Font _font
protected java.text.Format _format
protected java.awt.Color _color
protected LabelShape _label
protected boolean _withDashedGrid
protected transient java.awt.Stroke _gridStroke
protected double _min
protected double _max
protected double _step
protected LabelShape[] _gridValues
protected double[] _gridDoubleValues
protected int[] _gridPos
protected int _gridZeroIndex
protected double _gridOffset
protected int _lineWidth
protected int _lineHeight
protected int _nbrLabelLines
protected int _labelLineHeight
Constructor Detail |
---|
public AxisShape(boolean isVertical, boolean valuesFirst, int ox, int oy, int width, int height)
ox
- the anchor x positionoy
- the anchor y positionlength
- the axis length excluding the space
to display label and gridlines valuesMethod Detail |
---|
protected AbstractShape cloneShape()
AbstractShape
cloneShape
in class AbstractShape
public void setWithGridlines(boolean t)
public boolean isWithGridlines()
public void setWithDashedGrid(boolean t)
public boolean isWithDashedGrid()
public void setWithValues(boolean t)
public boolean isWithValues()
public void setLabel(java.lang.String s)
public void setFont(java.awt.Font f)
public void setFormat(java.text.Format f)
public void setColor(java.awt.Color c)
public void resize(int dx, int dy)
resize
in interface Resizable
dx
- value on x axisdy
- value on y axispublic void setAnchor(int ox, int oy)
setAnchor
in class AbstractShape
p
- the originpublic void translate(int dx, int dy)
translate
in class AbstractShape
public void set(double min, double max)
min
- the axis minimum valuemax
- the axis maximum valuepublic void set(double min, double max, double step)
min
- the axis minimum valuemax
- the axis maximum valuestep
- the step for gridlinesstepOffset
- the offset between min value and fisrt steppublic double getMin()
public double getMax()
public double getStep()
public double getScale()
public void draw(java.awt.Graphics2D g2)
draw
in class AbstractShape
g2
- the current graphicsprotected void computeBounds()
protected double computeStep(double min, double max)
public int getLineHeight()
public int getLineWidth()
public void setLog(boolean _log)
logpx
- True to put axis in logarithmic mode, or false otherwise.public boolean isLog()
protected double computeLogFloor(double lower)
lower
- a double value below which a floor will be calcualted.
protected double computeLogCeil(double upper)
upper
- a double value above which a ceiling will be calcualted.
public static java.lang.String getPrefix(java.lang.String id)
public boolean isVertical()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |