Class FunctionGraphsPopupAdaptor

java.lang.Object
xal.extension.widgets.plot.FunctionGraphsPopupAdaptor
All Implemented Interfaces:
ChartPopupAdaptor

public class FunctionGraphsPopupAdaptor extends Object implements ChartPopupAdaptor
FunctionGraphsPopupAdaptor implements the ChartPopupAdaptor on behalf of the FunctionGraphsPanel class.
Author:
tap
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance of FunctionGraphsAdaptor
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the chart component.
    double
    Get the maximum value of x that is visible.
    double
    Get the maximum value of y that is visible.
    double
    Get the minimum value of x that is visible.
    double
    Get the minimum value of y that is visible.
    int
    Get the number of major ticks on the x-axis.
    int
    Get the number of minor ticks per major step on the x-axis.
    int
    Get the number of minor ticks on the y-axis.
    int
    Get the number of minor ticks per major step on the y-axis.
    boolean
    Get the state of x-axis auto-scaling
    boolean
    Get the visibility state of the x-axis grid.
    boolean
    Get the state of y-axis auto-scaling
    boolean
    Get the visibility state of the y-axis grid.
    protected void
    Scale the x-axis once so all points fit on the chart along the x axis then keep the x-axis scale fixed.
    void
    Scale the x and y axes once so all points fit on the chart then keep the axes' scales fixed.
    protected void
    Scale the y-axis once so all points fit on the chart along the y axis then keep the y-axis scale fixed.
    void
    setMaxXLimit(double upperLimit)
    Set the maximum value of x that is visible.
    void
    setMaxYLimit(double upperLimit)
    Set the maximum value of y that is visible.
    void
    setMinXLimit(double lowerLimit)
    Set the minimum value of x that is visible.
    void
    setMinYLimit(double lowerLimit)
    Set the minimum value of y that is visible.
    void
    setXAutoScale(boolean autoScale)
    Set the auto-scale state of the x-axis
    void
    setXGridVisible(boolean visibility)
    Set the visibility of the x-axis grid.
    void
    setXNumMajorTicks(int count)
    Set the number of major ticks on the x-axis.
    void
    setXNumMinorTicks(int count)
    Set the number of minor ticks on the x-axis.
    void
    setYAutoScale(boolean autoScale)
    Set the auto-scale state of the y-axis
    void
    setYGridVisible(boolean visibility)
    Set the visibility of the y-axis grid.
    void
    setYNumMajorTicks(int count)
    Set the number of major ticks on the y-axis.
    void
    setYNumMinorTicks(int count)
    Set the number of minor ticks on the y-axis.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • FunctionGraphsPopupAdaptor

      public FunctionGraphsPopupAdaptor(FunctionGraphsJPanel newChart)
      Creates a new instance of FunctionGraphsAdaptor
  • Method Details

    • getChartComponent

      public Component getChartComponent()
      Get the chart component.
      Specified by:
      getChartComponent in interface ChartPopupAdaptor
      Returns:
      The chart as a component.
    • getMinXLimit

      public double getMinXLimit()
      Get the minimum value of x that is visible.
      Specified by:
      getMinXLimit in interface ChartPopupAdaptor
      Returns:
      the minimum value of x that is visible
    • setMinXLimit

      public void setMinXLimit(double lowerLimit)
      Set the minimum value of x that is visible.
      Specified by:
      setMinXLimit in interface ChartPopupAdaptor
      Parameters:
      lowerLimit - the minimum value of x that is visible
    • getMaxXLimit

      public double getMaxXLimit()
      Get the maximum value of x that is visible.
      Specified by:
      getMaxXLimit in interface ChartPopupAdaptor
      Returns:
      the maximum value of x that is visible
    • setMaxXLimit

      public void setMaxXLimit(double upperLimit)
      Set the maximum value of x that is visible.
      Specified by:
      setMaxXLimit in interface ChartPopupAdaptor
      Parameters:
      upperLimit - the maximum value of x that is visible
    • getMinYLimit

      public double getMinYLimit()
      Get the minimum value of y that is visible.
      Specified by:
      getMinYLimit in interface ChartPopupAdaptor
      Returns:
      the minimum value of y that is visible
    • setMinYLimit

      public void setMinYLimit(double lowerLimit)
      Set the minimum value of y that is visible.
      Specified by:
      setMinYLimit in interface ChartPopupAdaptor
      Parameters:
      lowerLimit - the minimum value of y that is visible
    • getMaxYLimit

      public double getMaxYLimit()
      Get the maximum value of y that is visible.
      Specified by:
      getMaxYLimit in interface ChartPopupAdaptor
      Returns:
      the maximum value of y that is visible
    • setMaxYLimit

      public void setMaxYLimit(double upperLimit)
      Set the maximum value of y that is visible.
      Specified by:
      setMaxYLimit in interface ChartPopupAdaptor
      Parameters:
      upperLimit - the maximum value of y that is visible
    • scaleXandY

      public void scaleXandY()
      Scale the x and y axes once so all points fit on the chart then keep the axes' scales fixed.
      Specified by:
      scaleXandY in interface ChartPopupAdaptor
    • scaleX

      protected void scaleX()
      Scale the x-axis once so all points fit on the chart along the x axis then keep the x-axis scale fixed. Method intended for internal use.
    • scaleY

      protected void scaleY()
      Scale the y-axis once so all points fit on the chart along the y axis then keep the y-axis scale fixed. Method intended for internal use.
    • isXAutoScale

      public boolean isXAutoScale()
      Get the state of x-axis auto-scaling
      Specified by:
      isXAutoScale in interface ChartPopupAdaptor
      Returns:
      true if the x-axis has auto-scaling enabled; false if not
    • setXAutoScale

      public void setXAutoScale(boolean autoScale)
      Set the auto-scale state of the x-axis
      Specified by:
      setXAutoScale in interface ChartPopupAdaptor
      Parameters:
      autoScale - true to enable x-axis auto-scaling; false to disable auto-scaling
    • isYAutoScale

      public boolean isYAutoScale()
      Get the state of y-axis auto-scaling
      Specified by:
      isYAutoScale in interface ChartPopupAdaptor
      Returns:
      true if the y-axis has auto-scaling enabled; false if not
    • setYAutoScale

      public void setYAutoScale(boolean autoScale)
      Set the auto-scale state of the y-axis
      Specified by:
      setYAutoScale in interface ChartPopupAdaptor
      Parameters:
      autoScale - true to enable y-axis auto-scaling; false to disable auto-scaling
    • getXNumMinorTicks

      public int getXNumMinorTicks()
      Get the number of minor ticks per major step on the x-axis.
      Specified by:
      getXNumMinorTicks in interface ChartPopupAdaptor
      Returns:
      the number of minor ticks
    • setXNumMinorTicks

      public void setXNumMinorTicks(int count)
      Set the number of minor ticks on the x-axis.
      Specified by:
      setXNumMinorTicks in interface ChartPopupAdaptor
      Parameters:
      count - number of minor ticks
    • getXNumMajorTicks

      public int getXNumMajorTicks()
      Get the number of major ticks on the x-axis.
      Specified by:
      getXNumMajorTicks in interface ChartPopupAdaptor
      Returns:
      the spacing per minor tick
    • setXNumMajorTicks

      public void setXNumMajorTicks(int count)
      Set the number of major ticks on the x-axis.
      Specified by:
      setXNumMajorTicks in interface ChartPopupAdaptor
      Parameters:
      count - number of major ticks
    • getYNumMinorTicks

      public int getYNumMinorTicks()
      Get the number of minor ticks per major step on the y-axis.
      Specified by:
      getYNumMinorTicks in interface ChartPopupAdaptor
      Returns:
      the number of minor ticks
    • setYNumMinorTicks

      public void setYNumMinorTicks(int count)
      Set the number of minor ticks on the y-axis.
      Specified by:
      setYNumMinorTicks in interface ChartPopupAdaptor
      Parameters:
      count - the number of minor ticks
    • getYNumMajorTicks

      public int getYNumMajorTicks()
      Get the number of minor ticks on the y-axis.
      Specified by:
      getYNumMajorTicks in interface ChartPopupAdaptor
      Returns:
      the number of major ticks
    • setYNumMajorTicks

      public void setYNumMajorTicks(int count)
      Set the number of major ticks on the y-axis.
      Specified by:
      setYNumMajorTicks in interface ChartPopupAdaptor
      Parameters:
      count - the number of major ticks
    • isXGridVisible

      public boolean isXGridVisible()
      Get the visibility state of the x-axis grid.
      Specified by:
      isXGridVisible in interface ChartPopupAdaptor
      Returns:
      true if the grid is visible
    • setXGridVisible

      public void setXGridVisible(boolean visibility)
      Set the visibility of the x-axis grid.
      Specified by:
      setXGridVisible in interface ChartPopupAdaptor
      Parameters:
      visibility - true to enable the grid; false to disable the grid
    • isYGridVisible

      public boolean isYGridVisible()
      Get the visibility state of the y-axis grid.
      Specified by:
      isYGridVisible in interface ChartPopupAdaptor
      Returns:
      true if the grid is visible
    • setYGridVisible

      public void setYGridVisible(boolean visibility)
      Set the visibility of the y-axis grid.
      Specified by:
      setYGridVisible in interface ChartPopupAdaptor
      Parameters:
      visibility - true to enable the grid; false to disable the grid