|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjhplot.jadraw.JaObject
jhplot.jadraw.JaFillObject
jhplot.jadraw.JaAxes
public class JaAxes
Main class to build a pad with axes, ticks, labels.
Field Summary |
---|
Fields inherited from class jhplot.jadraw.JaObject |
---|
BB_MAX_X, BB_MAX_Y, BB_MIN_X, BB_MIN_Y, COPY, D_FORMAT, INIT_SIZE, LENGTH, MOVE, RESIZE, SELECT_BODY, SELECT_LL, SELECT_LR, SELECT_NONE, SELECT_P1, SELECT_P2, SELECT_P3, SELECT_UL, SELECT_UR |
Constructor Summary | |
---|---|
JaAxes(int padX,
int padY)
Constructor: sets the width, height, getRelw() and getRelh() to a default value of 25. |
Method Summary | |
---|---|
void |
addData(jplot.DataArray d,
int plotType)
Add data to this plot. |
void |
addData(H2D h2d,
int plotType)
Add h2d data set. |
java.lang.String |
axisExponent(int axis)
Get exponent for the axis |
void |
clear()
Clear. |
JaObject |
copy()
Returns an exact copy of this Label. |
void |
drawData(java.awt.Graphics2D g2)
Draw data points |
void |
drawHandles(java.awt.Graphics2D g2)
Draws the handles of this box object. |
boolean |
editPanel()
Brings up the edit panel that allows to change the parameters of this object. |
java.lang.String |
formatNumber(double num,
int n)
formats a double precision number such that it is correctly rounded for output. |
int |
getAxesArrow(int axis)
Is arrow to be shown |
int |
getContourBinX()
Get number of bins in X for contour plot |
int |
getContourBinY()
Get number of bins in Y for contour plot |
int |
getContourLevels()
Get the number of levels to show contour plot |
java.util.Vector<jplot.DataArray> |
getData()
Get the vector which keeps all the data |
int |
getExpForm()
Get exponential form |
int |
getGrabbedHandle(int clickX,
int clickY,
int editmode)
Determines where on this JaObject a mouse click has ocurred. |
java.awt.Color |
getGridColor()
Get grid color (gray is default) |
java.awt.Color |
getLabelColor()
Get label color |
void |
getLabelDimension(java.awt.FontMetrics fmX,
int axis)
Get the lastst lavel size |
java.awt.Font |
getLabelFont()
Get label font |
double |
getLabelRotation()
Get label rotation |
double |
getLabelSpace(int axis)
Get label space |
double |
getMarginBottom()
Get bottom margin |
double |
getMarginLeft()
Get left margin |
double |
getMarginRight()
Get right margin |
double |
getMarginTop()
Get top margin |
double |
getMax(int axis)
Get max value |
double |
getMin(int axis)
Get min value |
int |
getNumDigits(double num)
Return the number of digits required to display the given number. |
int |
getPad(int axis)
Get ID of the current pad |
int |
getPlotType()
|
java.util.Vector<jplot.PlotPoint> |
getPoints(jplot.DataArray da)
|
java.util.Vector<jplot.PlotPoint> |
getPointsNoCuts(jplot.DataArray da)
|
boolean |
getRotateTicks(int axis)
Set true if ticks should be rotated |
java.lang.String[] |
getStatistics()
Get strings representing the statistics of the object |
int |
getSubTicksNumber(int axis)
Get the number of sub-ticks |
double |
getSubTicksSize(int axis)
Get sub-tick size |
int |
getTicksNumber(int axis)
Get number of main ticks |
double |
getTicksSize(int axis)
Get subtick size |
java.lang.String[][] |
getTicLabel()
|
boolean |
isAutoRange(int axis)
Is the graph axis were done with the aoutorange option? |
boolean |
isContour()
Is contour plot shown? |
boolean |
isCopy(JaObject comp)
Returns true if all serializable variables of this JaObject and those of the specified one are equal. |
boolean |
isGridFront()
is grid should be shown in front of all drawn objects? |
boolean |
isLogScale(int axis)
|
boolean |
isShow(int axis)
Is a particular axis should be shown? |
boolean |
isShowGrid(int axis)
Is grid to be shown? |
boolean |
isShowKey()
is key should be shown? |
boolean |
isShowMirror(int axis)
Is axis mirror is shown? |
boolean |
isTicksLabels(int axis)
Is ticks should be drawn |
void |
jaxoDraw(java.awt.Graphics2D g2,
boolean drawToScreen)
The method that draws this Jaxo Axes. |
java.lang.String |
latexCommand(float scale,
java.awt.Dimension canvasDim)
The LaTeX command that is necessary to draw the given JaAxes using the axodraw.sty package. |
void |
parseContour()
Prepare a contour plot |
void |
parseH2D()
Prepare a contour plot to display H2D histograms |
void |
rescaleObject(int orx,
int ory,
float scale)
Rescales this JaAxes by the scale factor scale, keeping the point (orx, ory) fixed. |
void |
setAutoRange()
Set auto-range on all axes |
void |
setAutoRange(int axis,
boolean autoRange)
Set autorange for a particular axis |
void |
setAxesArrow(int axis,
int type)
Set arrow type |
void |
setContour(boolean isContour)
Set the contour style and parse the data. |
void |
setContourBar(boolean bar)
Show or not a bar with color levels |
void |
setContourBins(int binsX,
int binsY)
How many bins used to slice the data in X (and Y) |
void |
setContourGray(boolean gray)
Color style to show contour plot. |
void |
setContourLevels(int levels)
How many color levels should be shown (10 default) |
void |
setData(java.util.Vector<jplot.DataArray> data)
Set data in form of vector |
void |
setExpForm(int expForm)
Set exponential form. |
void |
setGridColor(java.awt.Color gridColor)
Set grid color |
void |
setGridFront(boolean isGridFront)
Set grid to be drown in fron of all graphic objects |
void |
setLabelColor(java.awt.Color labelColor)
Set the color for labels indicating the ticks |
void |
setLabelFont(java.awt.Font labelFont)
Set label fonts |
void |
setLabelRotation(double labelRotation)
Set rotation for labels |
void |
setLabelSpace(int axis,
double labelSpace)
Set a space between axis and labels for ticks |
void |
setLogScale(int axis,
boolean set)
Sets true or false to plot on a log scale. |
void |
setMax(int axis,
double value)
Set min values |
void |
setMin(int axis,
double value)
Set max value |
void |
setPad(int axis,
int pad)
Set pad ID |
void |
setRange(int axis,
double minValue,
double maxValue)
Set the ranges for the current pad |
void |
setRotateTicks(int axis,
boolean angle)
Set true if ticks should be rotated |
void |
setShow(int axis,
boolean show)
Set true if you want to show a particular axis |
void |
setShowGrid(int axis,
boolean showGrid)
Is grid to be shown? |
void |
setShowKey(boolean show)
Set true if keys are shown |
void |
setShowMirror(int axis,
boolean showMirror)
Set true if a mirror axis to be shown |
void |
setStatistics(java.lang.String[] s)
Set a strings representing the full statistics |
void |
setSubTicksNumber(int axis,
int maxSubTicks)
Set the number of sub-ticks |
void |
setSubTicksSize(int axis,
double subTicsSize)
Set the size of subtics in NDC |
void |
setTicksLabels(int axis,
boolean draw)
Set or not tick labels |
void |
setTicksNumber(int axis,
int maxTicks)
Set the number of main ticks. |
void |
setTicksSize(int axis,
double ticsSize)
Set the size of the ticks in NDC format. |
void |
setTicLabel(java.lang.String[][] ticLabel)
|
double |
toUserX(int Xpic)
Move to User coordinates |
double |
toUserY(int Ypic)
Move to User coordinates |
int |
toX(double x)
Convert the user coordinate X to the pixel coordinate |
int |
toY(double y)
Convert the user coordinate Y to the pixel coordinate |
Methods inherited from class jhplot.jadraw.JaFillObject |
---|
getFillColor, getStroke, latexWidth, setFillColor, setStroke |
Methods inherited from class jhplot.jadraw.JaObject |
---|
drawVisualAid, getBoundingBox, getColor, getGeneralPath, getHeight, getRelh, getRelHndc, getRelHuser, getRelSize, getRelw, getRelWndc, getRelWuser, getSize, getWidth, getX, getXndc, getXuser, getY, getYndc, getYuser, isMarked, isUser, moveBy, scalePoint, setAsMarked, setBoundingBox, setColor, setLocation, setLocation, setRelh, setRelw, setRelWAndH, setRelWH, setSize, setX, setY, updateCoor, updateNDC |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JaAxes(int padX, int padY)
Method Detail |
---|
public boolean isGridFront()
public void setGridFront(boolean isGridFront)
isGridFront
- true, if in frontpublic double getMarginLeft()
public double getMarginRight()
public double getMarginTop()
public double getMarginBottom()
public void setExpForm(int expForm)
expForm
- public int getExpForm()
public void setLabelSpace(int axis, double labelSpace)
axis
- axis (0: for X or 1: for Y)labelSpace
- space in NDC (0-1)public double getLabelSpace(int axis)
axis
- axis (0: for X or 1: for Y)
public void setGridColor(java.awt.Color gridColor)
gridColor
- color used to draw gridpublic void setSubTicksNumber(int axis, int maxSubTicks)
axis
- axis (0: for X or 1: for Y)maxSubTicks
- max number of subtickspublic void setTicksNumber(int axis, int maxTicks)
axis
- axis (0: for X or 1: for Y)maxTicks
- max number of ticspublic void setShowGrid(int axis, boolean showGrid)
axis
- axis (0: for X or 1: for Y)showGrid
- true if shown.public void setShow(int axis, boolean show)
axis
- axis (0: for X or 1: for Y) to be shownshow
- set true if the axis should be drawnpublic void setShowMirror(int axis, boolean showMirror)
axis
- axis (0: for X or 1: for Y)showMirror
- true if mirror axis will be shownpublic void setTicksSize(int axis, double ticsSize)
axis
- axis (0: for X or 1: for Y)ticsSize
- tick size in NDC formpublic void setSubTicksSize(int axis, double subTicsSize)
axis
- axis (0: for X or 1: for Y)subTicsSize
- subtick sizepublic void setLabelColor(java.awt.Color labelColor)
labelColor
- colorpublic java.awt.Color getLabelColor()
public void setLabelFont(java.awt.Font labelFont)
labelFont
- fontpublic java.awt.Font getLabelFont()
public void setLabelRotation(double labelRotation)
labelRotation
- public double getLabelRotation()
public void setPad(int axis, int pad)
axis
- axis axis (0: for X or 1: for Y)pad
- pad IDpublic int getPad(int axis)
axis
- axis (0: for X or 1: for Y)
public java.awt.Color getGridColor()
public boolean getRotateTicks(int axis)
axis
-
public void setRotateTicks(int axis, boolean angle)
axis
- axis (0: for X or 1: for Y)angle
- anglepublic int getSubTicksNumber(int axis)
axis
- axis (0: for X or 1: for Y)
public int getTicksNumber(int axis)
axis
- axis (0: for X or 1: for Y)
public double getSubTicksSize(int axis)
axis
- axis (0: for X or 1: for Y)
public double getTicksSize(int axis)
axis
- axis (0: for X or 1: for Y)
public int getAxesArrow(int axis)
axis
- axis (0: for X or 1: for Y)
public void setAxesArrow(int axis, int type)
axis
- axis (0: for X or 1: for Y)type
- of arrowpublic boolean isTicksLabels(int axis)
axis
- axis (0: for X or 1: for Y)
public void setTicksLabels(int axis, boolean draw)
axis
- axis (0: for X or 1: for Y)draw
- true if shownpublic boolean isShowKey()
public void setShowKey(boolean show)
show
- public boolean isShow(int axis)
axis
- axis (0: for X or 1: for Y)
public boolean isShowGrid(int axis)
axis
- axis (0: for X or 1: for Y)
public boolean isShowMirror(int axis)
axis
- axis (0: for X or 1: for Y)
public java.lang.String axisExponent(int axis)
axis
- axis (0: for X or 1: for Y)
public void setContour(boolean isContour)
isContour
- true if contour style is set.public boolean isContour()
public void setContourBar(boolean bar)
bar
- true if the bar is shownpublic int getContourBinX()
public int getContourBinY()
public int getContourLevels()
public void setStatistics(java.lang.String[] s)
s
- strings with statisticspublic java.lang.String[] getStatistics()
public void setContourLevels(int levels)
levels
- number of color levelspublic void setContourBins(int binsX, int binsY)
binsX
- number of bins in XbinsY
- number of bins in Ypublic void setContourGray(boolean gray)
gray
- set to true to show in black-whitepublic void setData(java.util.Vector<jplot.DataArray> data)
data
- input datapublic int toX(double x)
x
- user coordinate X for conversionpublic double toUserX(int Xpic)
Xpic
-
public int toY(double y)
y
- user coordinate Y for conversionpublic double toUserY(int Ypic)
Ypic
-
public void setTicLabel(java.lang.String[][] ticLabel)
public java.lang.String[][] getTicLabel()
public void setLogScale(int axis, boolean set)
axis
- defines to which axis this function applies (0 if X, 1 if Y).b
- toggle, true if the scaling is logarithmicpublic boolean isLogScale(int axis)
public void setAutoRange(int axis, boolean autoRange)
axis
- axis (0: for X and 1: for Y)autoRange
- true if autorangepublic void setAutoRange()
public boolean isAutoRange(int axis)
axis
- axis (0: for X and 1: for Y)
public void setRange(int axis, double minValue, double maxValue)
axis
- axis (0: for X and 1: for Y)minValue
- min valuemaxValue
- max valuepublic void setMax(int axis, double value)
axis
- axis (0: for X and 1: for Y)value
- min valuepublic void setMin(int axis, double value)
axis
- axis (0: for X and 1: for Y)value
- max valuepublic double getMax(int axis)
axis
- axis (0: for X and 1: for Y)
public double getMin(int axis)
axis
- axis (0: for X and 1: for Y)
public final JaObject copy()
copy
in class JaObject
public final boolean isCopy(JaObject comp)
isCopy
in class JaObject
comp
- A JaObject to compare with.
public final int getGrabbedHandle(int clickX, int clickY, int editmode)
getGrabbedHandle
in class JaObject
clickX
- The x position of the point where the mouse click ocurred.clickY
- The y position of the point where the mouse click ocurred.editmode
- The current edit mode as defined in JaxoMainPanel.
public final void drawHandles(java.awt.Graphics2D g2)
drawHandles
in class JaObject
g2
- The current graphics context.public void getLabelDimension(java.awt.FontMetrics fmX, int axis)
public java.util.Vector<jplot.DataArray> getData()
public int getNumDigits(double num)
public java.lang.String formatNumber(double num, int n)
num
- number to be formattedn
- number of digits (accuracy) after the decimal point.
public final void jaxoDraw(java.awt.Graphics2D g2, boolean drawToScreen)
jaxoDraw
in class JaObject
g2
- The graphics context where the JaAxes has to be drawn.drawToScreen
- A boolean variable that indicates whether the drawing is done
on the screen or somewhere else. This is used for
exporting/printing, where the object handles should not be
painted, even if they are visible on the screen.public final java.lang.String latexCommand(float scale, java.awt.Dimension canvasDim)
latexCommand
in class JaObject
scale
- A scale factor to translate Java coordinates to LaTeX
coordinates.canvasDim
- The current dimension of the canvas.
public final void rescaleObject(int orx, int ory, float scale)
rescaleObject
in class JaObject
orx
- The x - coordinate of the fixed pointory
- The y - coordinate of the fixed pointscale
- The scale parameterpublic void addData(jplot.DataArray d, int plotType)
d
- plotType
- current plottypepublic void addData(H2D h2d, int plotType)
h2d
- public void parseContour()
public void parseH2D()
public void clear()
public int getPlotType()
public void drawData(java.awt.Graphics2D g2)
public java.util.Vector<jplot.PlotPoint> getPoints(jplot.DataArray da)
public java.util.Vector<jplot.PlotPoint> getPointsNoCuts(jplot.DataArray da)
public final boolean editPanel()
editPanel
in class JaObject
|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |