public class JaAxes extends JaFillObject
Constructor and Description |
---|
JaAxes(int padX,
int padY)
Constructor: sets the width, height, getRelw() and getRelh() to a default
value of 25.
|
Modifier and Type | Method and Description |
---|---|
void |
addData(jplot.DataArray d,
int plotType)
Add data to this plot.
|
void |
addData(H2D h2d,
int plotType)
Add h2d data set.
|
String |
axisExponent(int axis)
Get exponent for the axis
|
void |
clear()
Clear.
|
JaObject |
copy()
Returns an exact copy of this Label.
|
void |
drawData(org.freehep.graphics2d.VectorGraphics g2)
Draw data points
|
void |
drawHandles(org.freehep.graphics2d.VectorGraphics g2)
Draws the handles of this box object.
|
void |
drawMargins(org.freehep.graphics2d.VectorGraphics g2) |
boolean |
editPanel()
Brings up the edit panel that allows to change the parameters of this
object.
|
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
|
Color |
getBackgroundColor()
Get background color (white is default)
|
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
|
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.
|
Color |
getGridColor()
Get grid color (gray is default)
|
Color |
getLabelColor()
Get label color
|
void |
getLabelDimension(FontMetrics fmX,
int axis)
Get the lastst lavel size
|
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() |
Vector<jplot.PlotPoint> |
getPoints(jplot.DataArray da) |
Vector<jplot.PlotPoint> |
getPointsNoCuts(jplot.DataArray da) |
boolean |
getRotateTicks(int axis)
Set true if ticks should be rotated
|
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
|
String[][] |
getTicLabel() |
boolean |
isAutoRange(int axis)
Is the graph axis were done with the aoutorange option?
|
boolean |
isContour()
Is contour plot shown?
|
boolean |
isContourBar()
is a bar showing levels should be 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(org.freehep.graphics2d.VectorGraphics g2,
boolean drawToScreen)
The method that draws this Jaxo Axes.
|
String |
latexCommand(float scale,
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 |
setBackgroundColor(Color bkgColor)
Set background color
|
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(Vector<jplot.DataArray> data)
Set data in form of vector
|
void |
setExpForm(int expForm)
Set exponential form.
|
void |
setGridColor(Color gridColor)
Set grid color
|
void |
setGridFront(boolean isGridFront)
Set grid to be drown in fron of all graphic objects
|
void |
setLabelColor(Color labelColor)
Set the color for labels indicating the ticks
|
void |
setLabelFont(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(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(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
|
getFillColor, getStroke, latexWidth, setFillColor, setStroke
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
public JaAxes(int padX, int padY)
public boolean isGridFront()
public void setGridFront(boolean isGridFront)
isGridFront
- true, if in frontpublic void setBackgroundColor(Color bkgColor)
color
- for backgroundpublic Color getBackgroundColor()
public 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(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(Color labelColor)
labelColor
- colorpublic Color getLabelColor()
public void setLabelFont(Font labelFont)
labelFont
- fontpublic 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 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 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 boolean isContourBar()
public int getContourBinX()
public int getContourBinY()
public int getContourLevels()
public void setStatistics(String[] s)
s
- strings with statisticspublic 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(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(String[][] ticLabel)
public 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()
public final boolean isCopy(JaObject comp)
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(org.freehep.graphics2d.VectorGraphics g2)
drawHandles
in class JaObject
g2
- The current graphics context.public void getLabelDimension(FontMetrics fmX, int axis)
public Vector<jplot.DataArray> getData()
public int getNumDigits(double num)
public String formatNumber(double num, int n)
num
- number to be formattedn
- number of digits (accuracy) after the decimal point.public final void jaxoDraw(org.freehep.graphics2d.VectorGraphics 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 String latexCommand(float scale, 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(org.freehep.graphics2d.VectorGraphics g2)
public Vector<jplot.PlotPoint> getPoints(jplot.DataArray da)
public Vector<jplot.PlotPoint> getPointsNoCuts(jplot.DataArray da)
public void drawMargins(org.freehep.graphics2d.VectorGraphics g2)
SCaVis 1.0 ©