Class DataToolTab.DataToolPlotter

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, InteractiveMouseHandler, OSPRuntime.Disposable, Renderable
Enclosing class:
DataToolTab

protected class DataToolTab.DataToolPlotter extends PlottingPanel
A class to plot datasets, value crossbars, slope lines, areas, and axes.
See Also:
  • Constructor Details

    • DataToolPlotter

      protected DataToolPlotter(Dataset dataset)
      Constructor
      Parameters:
      dataset - the initial dataset to plot
  • Method Details

    • isZoomEvent

      public boolean isZoomEvent(MouseEvent e)
      Description copied from class: DrawingPanel
      Returns true if an event starts or ends a zoom operation. Used by OptionController. Method added by D Brown 04 Nov 2011.
      Overrides:
      isZoomEvent in class DrawingPanel
      Parameters:
      e - a mouse event
      Returns:
      true if a zoom event
    • getInteractive

      public Interactive getInteractive()
      Description copied from class: PlottingPanel
      Gets the interactive drawable that was accessed by the last mouse event. This methods overrides the default implemenation in order to check for draggable axes.
      Overrides:
      getInteractive in class PlottingPanel
      Returns:
      the interactive object
    • refreshDecimalSeparators

      protected void refreshDecimalSeparators()
      Description copied from class: DrawingPanel
      Refreshes the decimal separators.
      Overrides:
      refreshDecimalSeparators in class DrawingPanel
    • lockScale

      protected void lockScale(boolean lock)
      Locks the scale so it can be manipulated when shifting the origin.
      Parameters:
      lock - true to lock, false to unlock
    • scale

      protected void scale(ArrayList<Drawable> tempList)
      Description copied from class: DrawingPanel
      Sets axis scales if autoscale is true using the max and min values of the objects in the given list.
      Overrides:
      scale in class DrawingPanel
    • paintDrawableList

      protected void paintDrawableList(Graphics g, ArrayList<Drawable> tempList)
      Description copied from class: DrawingPanel
      Paints all the drawable objects in the panel.
      Overrides:
      paintDrawableList in class DrawingPanel
    • setAreaVisible

      protected void setAreaVisible(boolean visible)
      Sets the visibility of the area limits and dataset.
      Parameters:
      visible - true to show the area
    • refreshMeasurements

      protected void refreshMeasurements()
      Refreshes the coordinate, slope and area measurements.
    • refreshArea

      protected void refreshArea()
      Fills the areaDataset with points whose x values are between the limit lines.
    • findIndexNearestX

      protected int findIndexNearestX(double x, Dataset data)
      Returns the index of the data point nearest the specified x on the plot.
      Parameters:
      x - the x-value on the plot
      data - the dataset to search
      Returns:
      the index, or -1 if none found
    • createMessage

      protected String createMessage()
      Creates a message showing the current coordinates, slope and/or area.
    • format

      protected String format(double value, double range)
      Formats a number.
      Parameters:
      value - the number
      range - a min-max range of values
      Returns:
      the formatted string
    • setAxisLabels

      protected void setAxisLabels(String xAxis, String yAxis)
      Sets the plot axis and related labels.
      Parameters:
      xAxis - the x-axis label
      yAxis - the y-axis label
    • getMouseController

      protected MouseInputAdapter getMouseController()
      Gets the mouse controller.
      Returns:
      the current mouse controller