|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.odesys.chart.Grid
Grid is a helper class that draws a coordinate grid. It uses a rectangular coordinate system Oxy. Grid calculates and positions the axes so they use all the available area.
Field Summary | |
static int |
BOTTOM
Constant used to specify the bottom side of the Grid. |
static int |
LEFT
Constant used to specify the left side of the Grid. |
static int |
RIGHT
Constant used to specify the right side of the Grid. |
static int |
TOP
Constant used to specify the top side of the Grid. |
Constructor Summary | |
Grid(ChartView parent)
Creates a new Grid instance for the specified ChartView |
Method Summary | |
void |
addXConstraint(float pos,
int value,
float weight,
float z)
Adds an AxisConstraint to the X axis. |
void |
addYConstraint(float pos,
int value,
float weight,
float z)
Adds an AxisConstraint to the Y axis. |
Axis |
getAxisX()
Gets the X Axis |
int |
getAxisXPosition()
Gets the position of Axis X. |
float |
getAxisXZ()
Gets the depth of the X axis. |
Axis |
getAxisY()
Gets the Y Axis |
int |
getAxisYPosition()
Gets the position of Axis Y. |
float |
getAxisYZ()
Gets the depth of the Y axis. |
java.awt.Rectangle |
getGridRect()
Gets the front rectangle of this Grid |
int |
getLabelGap()
Gets the distance from the Axis line to its labels. |
java.awt.Point |
getLabelStep()
Gets the increment at which the labels are shown along the axes. |
float |
getValueFromX(int x)
Converts component to logical coordinates for Axis X The conversion is performed for Z = 0. |
float |
getValueFromY(int y)
Converts component to logical coordinates for Axis Y The conversion is performed for Z = 0. |
int |
getX(float x)
Converts logical to component coordinates for Axis X. |
int |
getY(float y)
Converts logical to component coordinates for Axis Y The conversion is performed for Z = 0. |
java.awt.Point |
getZVector()
Gets the Z vector of this grid. |
boolean |
isDrawHorzLines()
Checks whether the horizontal coordinate lines are drawn. |
boolean |
isDrawVertLines()
Checks whether the vertical coordinate lines are drawn. |
void |
paint(java.awt.Graphics g)
Draws this Grid in the specified Graphics context. |
void |
resizeToFit(java.awt.FontMetrics fm)
Resizes this Grid to fit the whole area of its parent ChartView. |
void |
setAxisXPosition(int pos)
Sets the position of Axis X. |
void |
setAxisYPosition(int pos)
Sets the position of Axis Y. |
void |
setDrawHorzLines(boolean draw)
Determines whether the horizontal coordinate lines should be drawn. |
void |
setDrawVertLines(boolean draw)
Determines whether the vertical coordinate lines should be drawn. |
void |
setGridRect(java.awt.Rectangle gridRect)
Sets the front rectangle of this Grid |
void |
setLabelGap(int gap)
Sets the distance from the Axis line to its labels. |
void |
setLabelStep(java.awt.Point labelStep)
Sets the increment at which the labels are shown along the axes. |
void |
setZVector(java.awt.Point zVector)
Sets the Z vector of this Grid. |
static void |
translate(java.awt.Polygon p,
int dx,
int dy)
Translates the points of the Polygon p by dx along the x axis and by dy along the y axis. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LEFT
public static final int RIGHT
public static final int TOP
public static final int BOTTOM
Constructor Detail |
public Grid(ChartView parent)
Method Detail |
public void setGridRect(java.awt.Rectangle gridRect)
public java.awt.Rectangle getGridRect()
public void setZVector(java.awt.Point zVector)
public java.awt.Point getZVector()
public void setLabelStep(java.awt.Point labelStep)
public java.awt.Point getLabelStep()
public Axis getAxisX()
public Axis getAxisY()
public int getX(float x)
public float getValueFromX(int x)
public int getY(float y)
public float getValueFromY(int y)
public float getAxisXZ()
public float getAxisYZ()
public void addXConstraint(float pos, int value, float weight, float z)
public void addYConstraint(float pos, int value, float weight, float z)
public void resizeToFit(java.awt.FontMetrics fm)
public void paint(java.awt.Graphics g)
public void setAxisXPosition(int pos)
pos
- The position of the Axis X (TOP or BOTTOM)public int getAxisXPosition()
public void setAxisYPosition(int pos)
pos
- The position of the Axis Y (LEFT or RIGHT)public int getAxisYPosition()
public void setDrawHorzLines(boolean draw)
public boolean isDrawHorzLines()
public void setDrawVertLines(boolean draw)
public boolean isDrawVertLines()
public void setLabelGap(int gap)
public int getLabelGap()
public static void translate(java.awt.Polygon p, int dx, int dy)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |