org.jlab.groot.graphics
Class GraphicsAxis
- java.lang.Object
-
- org.jlab.groot.graphics.GraphicsAxis
-
public class GraphicsAxis extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classGraphicsAxis.GraphicsAxisTicks
-
Field Summary
Fields Modifier and Type Field and Description static intAXISTYPE_COLORstatic intAXISTYPE_HORIZONTALstatic intAXISTYPE_VERTICAL
-
Constructor Summary
Constructors Constructor and Description GraphicsAxis(int AXISTYPE)default
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddrawAxis(java.awt.Graphics2D g2d, int x, int y)voiddrawAxis(java.awt.Graphics2D g2d, int x, int y, int height)voiddrawAxisGrid(java.awt.Graphics2D g2d, int x, int y, int height)voiddrawAxisMirror(java.awt.Graphics2D g2d, int x, int y, int height)AxisAttributesgetAttributes()intgetAxisBounds(java.awt.Graphics2D g2d)intgetAxisDivisions()doublegetAxisPosition(double value)returns position along the axis, the dimension of the axis has to be set.java.util.List<java.lang.Double>getAxisTicks()Dimension1DgetDimension()booleangetGrid()FontPropertiesgetLabelFont()returns properties for the label fonts.intgetLabelFontSize()booleangetLog()doublegetMax()doublegetMin()Dimension1DgetRange()intgetSize(java.awt.Graphics2D g2d, boolean vertical)java.lang.StringgetTitle()FontPropertiesgetTitleFont()returns properties of the title fontintgetTitleFontSize()booleanisAutoScale()booleanisShowAxis()static voidmain(java.lang.String[] args)main program for testing the axisvoidsetAttributes(AxisAttributes attr)voidsetAutoScale(boolean b)voidsetAxisDivisions(int ndiv)voidsetAxisFont(java.lang.String fontname)voidsetAxisFontSize(int size)voidsetAxisType(int type)GraphicsAxissetDimension(int xmin, int xmax)sets the dimension for the axis for plotting.voidsetGrid(boolean isGrid)voidsetLog(boolean flag)GraphicsAxissetRange(double min, double max)Sets the range of the axis, it also updates the axis labels.voidsetShowAxis(boolean b)voidsetTitle(java.lang.String title)voidsetVertical(boolean flag)voidshow()prints string representation of the axis.java.lang.StringtoString()returns string representation of the axis.
-
-
-
Field Detail
-
AXISTYPE_COLOR
public static int AXISTYPE_COLOR
-
AXISTYPE_HORIZONTAL
public static int AXISTYPE_HORIZONTAL
-
AXISTYPE_VERTICAL
public static int AXISTYPE_VERTICAL
-
-
Method Detail
-
setDimension
public final GraphicsAxis setDimension(int xmin, int xmax)
sets the dimension for the axis for plotting.- Parameters:
xmin-xmax-- Returns:
-
setAxisType
public void setAxisType(int type)
-
getDimension
public Dimension1D getDimension()
-
setRange
public final GraphicsAxis setRange(double min, double max)
Sets the range of the axis, it also updates the axis labels.- Parameters:
min-max-- Returns:
-
setTitle
public void setTitle(java.lang.String title)
-
getLog
public boolean getLog()
-
setLog
public void setLog(boolean flag)
-
getRange
public Dimension1D getRange()
-
show
public void show()
prints string representation of the axis.
-
getAxisPosition
public double getAxisPosition(double value)
returns position along the axis, the dimension of the axis has to be set.- Parameters:
value-- Returns:
-
getTitleFont
public FontProperties getTitleFont()
returns properties of the title font- Returns:
-
getLabelFont
public FontProperties getLabelFont()
returns properties for the label fonts.- Returns:
-
setAxisFont
public void setAxisFont(java.lang.String fontname)
-
setAxisFontSize
public void setAxisFontSize(int size)
-
getSize
public int getSize(java.awt.Graphics2D g2d, boolean vertical)
-
getAxisDivisions
public int getAxisDivisions()
-
setVertical
public void setVertical(boolean flag)
-
setAxisDivisions
public void setAxisDivisions(int ndiv)
-
getAxisTicks
public java.util.List<java.lang.Double> getAxisTicks()
-
getAxisBounds
public int getAxisBounds(java.awt.Graphics2D g2d)
-
drawAxisGrid
public void drawAxisGrid(java.awt.Graphics2D g2d, int x, int y, int height)
-
drawAxisMirror
public void drawAxisMirror(java.awt.Graphics2D g2d, int x, int y, int height)
-
drawAxis
public void drawAxis(java.awt.Graphics2D g2d, int x, int y)
-
drawAxis
public void drawAxis(java.awt.Graphics2D g2d, int x, int y, int height)
-
toString
public java.lang.String toString()
returns string representation of the axis.- Overrides:
toStringin classjava.lang.Object- Returns:
-
main
public static void main(java.lang.String[] args)
main program for testing the axis- Parameters:
args-
-
isAutoScale
public boolean isAutoScale()
-
setAutoScale
public void setAutoScale(boolean b)
-
getAttributes
public AxisAttributes getAttributes()
-
setAttributes
public void setAttributes(AxisAttributes attr)
-
getGrid
public boolean getGrid()
-
setGrid
public void setGrid(boolean isGrid)
-
getTitle
public java.lang.String getTitle()
-
getTitleFontSize
public int getTitleFontSize()
-
getLabelFontSize
public int getLabelFontSize()
-
getMin
public double getMin()
-
getMax
public double getMax()
-
setShowAxis
public void setShowAxis(boolean b)
-
isShowAxis
public boolean isShowAxis()
-
-
DMelt 3.0 © DataMelt by jWork.ORG