Package cnuphys.splot.plot
Class PlotParameters
java.lang.Object
cnuphys.splot.plot.PlotParameters
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPlotLine(PlotLine line) Add a plot line to the plotbooleanCheck whether we should draw extra textGet the axes fontGet the extra text fill colorGet the extra text border colorGet the extra text fontGet the extra text colorString[]Get the extra strings for a second legend like displayintGet the legend line lengthdoubleGet the maximum value for a manual X rangedoubleGet the minimum value for a manual X rangedoubleGet the maximum value for a manual Y rangedoubleGet the minimum value for a manual Y rangeintThe exponent where we switch to scientific notation on the x axisintThe exponent where we switch to scientific notation on the y axisintThe number of decimals for tick values on x axisintThe number of decimals for tick values on y axisGet all the plot linesGet the plot titleGet the status fontGet the legend fill colorGet the legend border colorGet the legend fontGet the legend text colorGet the title fontGet the label for the x axisGet the limit method for the x axisGet the label for the y axisGet the limit method for the y axisbooleanCheck whether we should draw a gradientbooleanCheck whether to include x = 0booleanCheck whether to include y = 0booleanCheck whether the extra text border is drawnbooleanCheck whether the legend border is drawnbooleanCheck whether we should draw a legendvoidmustIncludeXZero(boolean incZero) Force the plot to include x = 0voidmustIncludeYZero(boolean incZero) Force the plot to include y = 0voidremovePlotLine(PlotLine line) Remove a plot line from the plotvoidsetAxesFont(Font font) Set the axes fontvoidsetExtraBackground(Color color) Set the extra text fill colorvoidsetExtraBorder(boolean extraBorder) Set whether the extra text border is drawnvoidsetExtraBorderColor(Color color) Set the extra text border colorvoidsetExtraDrawing(boolean draw) Set whether we should draw the extra textvoidsetExtraFont(Font font) Set the extra text fontvoidsetExtraForeground(Color color) Set the extra text colorvoidsetExtraStrings(String... extraStrings) Set the extra strings for a second legend like displayvoidsetGradientDrawing(boolean draw) Set whether we should draw a gradientvoidsetLegendBorder(boolean legBorder) Set whether the legend border is drawnvoidsetLegendDrawing(boolean draw) Set whether we should draw a legendvoidsetLegendLineLength(int legLineLen) Set the legend line lengthvoidsetMinExponentX(int minExponentX) Set the exponent where we switch to scientific notation on the x axisvoidsetMinExponentY(int minExponentY) Set the exponent where we switch to scientific notation on the y axisvoidsetNumDecimalX(int numDecimalX) Set the number of decimals for tick values on x axisvoidsetNumDecimalY(int numDecimalY) Set the number of decimals for tick values on y axisvoidsetPlotTitle(String title) Set the plot titlevoidsetStatusFont(Font font) Set the status fontvoidsetTextBackground(Color color) Set the legend fill colorvoidsetTextBorderColor(Color color) Set the legend border colorvoidsetTextFont(Font font) Set the legend fontvoidsetTextForeground(Color color) Set the legend text colorvoidsetTitleFont(Font font) Set the title fontvoidSet the x axis labelvoidsetXLimitsMethod(LimitsMethod method) Set the limits method for the x axisvoidsetXRange(double xmin, double xmax) Manually set the x rangevoidSet the y axis labelvoidsetYLimitsMethod(LimitsMethod method) Set the limits method for the y axisvoidsetYRange(double ymin, double ymax) Manually set the y range
-
Constructor Details
-
PlotParameters
Create plot parameters for a canvas- Parameters:
canvas- the canvas
-
-
Method Details
-
mustIncludeXZero
public void mustIncludeXZero(boolean incZero) Force the plot to include x = 0- Parameters:
incZero- the flag
-
mustIncludeYZero
public void mustIncludeYZero(boolean incZero) Force the plot to include y = 0- Parameters:
incZero- the flag
-
getExtraStrings
Get the extra strings for a second legend like display- Returns:
- the extra strings
-
setExtraStrings
Set the extra strings for a second legend like display- Parameters:
extraStrings- the new extra strings array
-
isExtraBorder
public boolean isExtraBorder()Check whether the extra text border is drawn- Returns:
trueif the extra text border is drawn.
-
setExtraBorder
public void setExtraBorder(boolean extraBorder) Set whether the extra text border is drawn- Parameters:
extraBorder-trueif the extra text border is drawn.
-
isLegendBorder
public boolean isLegendBorder()Check whether the legend border is drawn- Returns:
trueif the legend border is drawn.
-
setLegendBorder
public void setLegendBorder(boolean legBorder) Set whether the legend border is drawn- Parameters:
legBorder-trueif the legend border is drawn.
-
setTextBackground
Set the legend fill color- Parameters:
color- the legendfill color
-
getTextBackground
Get the legend fill color- Returns:
- the legend fill color
-
setTextForeground
Set the legend text color- Parameters:
color- the legend text color
-
getTextForeground
Get the legend text color- Returns:
- the legend text color
-
getTextBorderColor
Get the legend border color- Returns:
- the legend border color
-
setTextBorderColor
Set the legend border color- Parameters:
color- the legend border color
-
setTextFont
Set the legend font- Parameters:
font- the legend font
-
getTextFont
Get the legend font- Returns:
- the legend font
-
setExtraBackground
Set the extra text fill color- Parameters:
color- the extra text fill color
-
getExtraBackground
Get the extra text fill color- Returns:
- the extra text fill color
-
setExtraForeground
Set the extra text color- Parameters:
color- the extra text color
-
getExtraForeground
Get the extra text color- Returns:
- the extra text color
-
getExtraBorderColor
Get the extra text border color- Returns:
- the extra text border color
-
setExtraBorderColor
Set the extra text border color- Parameters:
color- the extra text border color
-
setExtraFont
Set the extra text font- Parameters:
font- the new extra text font
-
getExtraFont
Get the extra text font- Returns:
- the extra text font
-
setTitleFont
Set the title font- Parameters:
font- the new title font
-
getTitleFont
Get the title font- Returns:
- the title font
-
setAxesFont
Set the axes font- Parameters:
font- the new axes font
-
getAxesFont
Get the axes font- Returns:
- the axes font
-
setStatusFont
Set the status font- Parameters:
font- the new status font
-
getStatusFont
Get the status font- Returns:
- the status font
-
setLegendLineLength
public void setLegendLineLength(int legLineLen) Set the legend line length- Parameters:
legLineLen- the line length in pixels
-
getLegendLineLength
public int getLegendLineLength()Get the legend line length- Returns:
- legLineLen the line length in pixels
-
includeXZero
public boolean includeXZero()Check whether to include x = 0- Returns:
trueif we should include x = 0
-
includeYZero
public boolean includeYZero()Check whether to include y = 0- Returns:
trueif we should include y = 0
-
addPlotLine
Add a plot line to the plot- Parameters:
line- the line to add
-
removePlotLine
Remove a plot line from the plot- Parameters:
line- the line to remove
-
getPlotLines
Get all the plot lines- Returns:
- all the plot lines
-
getPlotTitle
Get the plot title- Returns:
- the plot title
-
setPlotTitle
Set the plot title- Parameters:
title- the plot title
-
getXLabel
Get the label for the x axis- Returns:
- the label for the x axis
-
getYLabel
Get the label for the y axis- Returns:
- the label for the y axis
-
setXLabel
Set the x axis label- Parameters:
label- the plot x axis label
-
setYLabel
Set the y axis label- Parameters:
label- the plot y axis label
-
extraDrawing
public boolean extraDrawing()Check whether we should draw extra text- Returns:
- whether we should draw the extra text
-
setExtraDrawing
public void setExtraDrawing(boolean draw) Set whether we should draw the extra text- Parameters:
draw- the new drawing flag
-
isLegendDrawn
public boolean isLegendDrawn()Check whether we should draw a legend- Returns:
- whether we should draw a legend
-
setLegendDrawing
public void setLegendDrawing(boolean draw) Set whether we should draw a legend- Parameters:
draw- the new drawing flag
-
gradientDrawing
public boolean gradientDrawing()Check whether we should draw a gradient- Returns:
- whether we should draw a legend
-
setGradientDrawing
public void setGradientDrawing(boolean draw) Set whether we should draw a gradient- Parameters:
draw- the new drawing flag
-
getNumDecimalX
public int getNumDecimalX()The number of decimals for tick values on x axis- Returns:
- the numDecimalX
-
setNumDecimalX
public void setNumDecimalX(int numDecimalX) Set the number of decimals for tick values on x axis- Parameters:
numDecimalX- the numDecimalX to set
-
getMinExponentX
public int getMinExponentX()The exponent where we switch to scientific notation on the x axis- Returns:
- the minExponentX
-
setMinExponentX
public void setMinExponentX(int minExponentX) Set the exponent where we switch to scientific notation on the x axis- Parameters:
minExponentX- the minExponentX to set
-
getNumDecimalY
public int getNumDecimalY()The number of decimals for tick values on y axis- Returns:
- the numDecimalY
-
setNumDecimalY
public void setNumDecimalY(int numDecimalY) Set the number of decimals for tick values on y axis- Parameters:
numDecimalY- the numDecimalY to set
-
getMinExponentY
public int getMinExponentY()The exponent where we switch to scientific notation on the y axis- Returns:
- the minExponentY
-
setMinExponentY
public void setMinExponentY(int minExponentY) Set the exponent where we switch to scientific notation on the y axis- Parameters:
minExponentY- the minExponentY to set
-
setXRange
public void setXRange(double xmin, double xmax) Manually set the x range- Parameters:
xmin- the minimum xxmax- the maximum x
-
setYRange
public void setYRange(double ymin, double ymax) Manually set the y range- Parameters:
xmin- the minimum yxmax- the maximum y
-
getManualXMin
public double getManualXMin()Get the minimum value for a manual X range- Returns:
- the value for a manual X range
-
getManualXMax
public double getManualXMax()Get the maximum value for a manual X range- Returns:
- the value for a manual X range
-
getManualYMin
public double getManualYMin()Get the minimum value for a manual Y range- Returns:
- the value for a manual Y range
-
getManualYMax
public double getManualYMax()Get the maximum value for a manual Y range- Returns:
- the value for a manual Y range
-
getXLimitsMethod
Get the limit method for the x axis- Returns:
- the limit method for the x axis
-
setXLimitsMethod
Set the limits method for the x axis- Parameters:
method- the method
-
getYLimitsMethod
Get the limit method for the y axis- Returns:
- the limit method for the y axis
-
setYLimitsMethod
Set the limits method for the y axis- Parameters:
method- the method
-