Package samer.tools

Class Plotter

  • java.lang.Object
    • samer.core.util.heavy.VCanvas
      • samer.tools.Plotter
  • Direct Known Subclasses:
    FunctionPlotter, ScatterPlot, VectorPlotter


    public class Plotter
    extends samer.core.util.heavy.VCanvas

    A Plotter object is a Canvas with its own Graphics (ie a GCanvas) which has two LinearMaps to map a portion of 2d space to the window. It can optionally draw the X and Y axes.

    The inner class Pen provides access to drawing functions in the real-valued coordinate space.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      class  Plotter.Pen
      This class provides a state based plotting environment (slightly inspired by Postscripts crazy reverse polish).
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int BOTH 
      static int NEITHER
      for passing to setAxes(int)
      static int XAXIS 
      IMap xmap 
      static int YAXIS 
      IMap ymap 
    • Constructor Summary

      Constructors 
      Constructor and Description
      Plotter()
      Default constructor makes Plotter with both axes drawn, in grey.
    • Constructor Detail

      • Plotter

        public Plotter()
        Default constructor makes Plotter with both axes drawn, in grey. LinearMaps take their default setup.
        See Also:
        samer.core.util.LinearMap
    • Method Detail

      • exposeMaps

        public void exposeMaps()
      • sized

        protected void sized()
      • getPreferredSize

        public java.awt.Dimension getPreferredSize()
      • setAxes

        public void setAxes(int f)
        use one of NONE, XAXIS, YAXIS or BOTH
      • setAxesColor

        public void setAxesColor(java.awt.Color c)
      • drawAxes

        public void drawAxes(java.awt.Graphics g)
        not really for public use
      • clear

        public void clear(java.awt.Graphics g)
      • paint

        public void paint(java.awt.Graphics g)
      • getPen

        public Plotter.Pen getPen()
        return a new Pen for this Plotter
      • getPen

        public Plotter.Pen getPen(java.awt.Graphics g)