Class PlotParameters

java.lang.Object
cnuphys.splot.plot.PlotParameters

public class PlotParameters extends Object
  • Constructor Details

    • PlotParameters

      public PlotParameters(PlotCanvas canvas)
      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

      public String[] getExtraStrings()
      Get the extra strings for a second legend like display
      Returns:
      the extra strings
    • setExtraStrings

      public void setExtraStrings(String... extraStrings)
      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:
      true if the extra text border is drawn.
    • setExtraBorder

      public void setExtraBorder(boolean extraBorder)
      Set whether the extra text border is drawn
      Parameters:
      extraBorder - true if the extra text border is drawn.
    • isLegendBorder

      public boolean isLegendBorder()
      Check whether the legend border is drawn
      Returns:
      true if the legend border is drawn.
    • setLegendBorder

      public void setLegendBorder(boolean legBorder)
      Set whether the legend border is drawn
      Parameters:
      legBorder - true if the legend border is drawn.
    • setTextBackground

      public void setTextBackground(Color color)
      Set the legend fill color
      Parameters:
      color - the legendfill color
    • getTextBackground

      public Color getTextBackground()
      Get the legend fill color
      Returns:
      the legend fill color
    • setTextForeground

      public void setTextForeground(Color color)
      Set the legend text color
      Parameters:
      color - the legend text color
    • getTextForeground

      public Color getTextForeground()
      Get the legend text color
      Returns:
      the legend text color
    • getTextBorderColor

      public Color getTextBorderColor()
      Get the legend border color
      Returns:
      the legend border color
    • setTextBorderColor

      public void setTextBorderColor(Color color)
      Set the legend border color
      Parameters:
      color - the legend border color
    • setTextFont

      public void setTextFont(Font font)
      Set the legend font
      Parameters:
      font - the legend font
    • getTextFont

      public Font getTextFont()
      Get the legend font
      Returns:
      the legend font
    • setExtraBackground

      public void setExtraBackground(Color color)
      Set the extra text fill color
      Parameters:
      color - the extra text fill color
    • getExtraBackground

      public Color getExtraBackground()
      Get the extra text fill color
      Returns:
      the extra text fill color
    • setExtraForeground

      public void setExtraForeground(Color color)
      Set the extra text color
      Parameters:
      color - the extra text color
    • getExtraForeground

      public Color getExtraForeground()
      Get the extra text color
      Returns:
      the extra text color
    • getExtraBorderColor

      public Color getExtraBorderColor()
      Get the extra text border color
      Returns:
      the extra text border color
    • setExtraBorderColor

      public void setExtraBorderColor(Color color)
      Set the extra text border color
      Parameters:
      color - the extra text border color
    • setExtraFont

      public void setExtraFont(Font font)
      Set the extra text font
      Parameters:
      font - the new extra text font
    • getExtraFont

      public Font getExtraFont()
      Get the extra text font
      Returns:
      the extra text font
    • setTitleFont

      public void setTitleFont(Font font)
      Set the title font
      Parameters:
      font - the new title font
    • getTitleFont

      public Font getTitleFont()
      Get the title font
      Returns:
      the title font
    • setAxesFont

      public void setAxesFont(Font font)
      Set the axes font
      Parameters:
      font - the new axes font
    • getAxesFont

      public Font getAxesFont()
      Get the axes font
      Returns:
      the axes font
    • setStatusFont

      public void setStatusFont(Font font)
      Set the status font
      Parameters:
      font - the new status font
    • getStatusFont

      public 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:
      true if we should include x = 0
    • includeYZero

      public boolean includeYZero()
      Check whether to include y = 0
      Returns:
      true if we should include y = 0
    • addPlotLine

      public void addPlotLine(PlotLine line)
      Add a plot line to the plot
      Parameters:
      line - the line to add
    • removePlotLine

      public void removePlotLine(PlotLine line)
      Remove a plot line from the plot
      Parameters:
      line - the line to remove
    • getPlotLines

      public Vector<PlotLine> getPlotLines()
      Get all the plot lines
      Returns:
      all the plot lines
    • getPlotTitle

      public String getPlotTitle()
      Get the plot title
      Returns:
      the plot title
    • setPlotTitle

      public void setPlotTitle(String title)
      Set the plot title
      Parameters:
      title - the plot title
    • getXLabel

      public String getXLabel()
      Get the label for the x axis
      Returns:
      the label for the x axis
    • getYLabel

      public String getYLabel()
      Get the label for the y axis
      Returns:
      the label for the y axis
    • setXLabel

      public void setXLabel(String label)
      Set the x axis label
      Parameters:
      label - the plot x axis label
    • setYLabel

      public void setYLabel(String label)
      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 x
      xmax - the maximum x
    • setYRange

      public void setYRange(double ymin, double ymax)
      Manually set the y range
      Parameters:
      xmin - the minimum y
      xmax - 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

      public LimitsMethod getXLimitsMethod()
      Get the limit method for the x axis
      Returns:
      the limit method for the x axis
    • setXLimitsMethod

      public void setXLimitsMethod(LimitsMethod method)
      Set the limits method for the x axis
      Parameters:
      method - the method
    • getYLimitsMethod

      public LimitsMethod getYLimitsMethod()
      Get the limit method for the y axis
      Returns:
      the limit method for the y axis
    • setYLimitsMethod

      public void setYLimitsMethod(LimitsMethod method)
      Set the limits method for the y axis
      Parameters:
      method - the method