Class AbstractGraphCanvas

  • All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, Accessible
    Direct Known Subclasses:
    ParamGraphCanvas, ProcessGraphCanvas

    public abstract class AbstractGraphCanvas
    extends JPanel
    AbstractGraphCanvas is an abstract class offering scaling functionality and the structure of the underlying Axes and Plot classes. The functionality of the scaling is as following: the size of the canvas is determined by two sizes: the size itself and the preferredSize, which is used by the parental viewport to set its size. If the window is rescaled (e.g. by dragging the window) the preferred size does not change, which results in setting the size to the viewport size. If the y axis is zoomed, the baseHeight determines the new size and preferred size. This class is partially based on GraphCanvas.
    Version:
    $Revision: 1 $
    Author:
    Tim Sabsch (tim.sabsch@ovgu.de)
    See Also:
    Serialized Form
    • Field Detail

      • measureSelected

        protected int measureSelected
      • min_x_value

        protected double min_x_value
      • max_x_value

        protected double max_x_value
      • max_y_value

        protected double max_y_value
      • x_resolution

        protected double x_resolution
      • y_resolution

        protected double y_resolution
      • baseWidth

        protected double baseWidth
      • baseHeight

        protected double baseHeight
    • Constructor Detail

      • AbstractGraphCanvas

        public AbstractGraphCanvas​(AbstractGraphAxes ax,
                                   AbstractGraphPlot g)
        Initialises an AbstractGraphCanvas by constructing its AbstractGraphAxes, AbstractGraphPlot as well as setting initial sizes.
    • Method Detail

      • setStandardDeviationPainted

        public void setStandardDeviationPainted​(boolean b)
        Sets the value of the plotPlanel for isStandardDeviationPainted.
        Parameters:
        b - new setting for isStandardDeviationPainted in the plotPanel
      • scaleXResolution

        public void scaleXResolution​(double factor)
        Scales the resolution on the x-axis by the given factor and updates the canvas.
        Parameters:
        factor - factor the x_resolution will be scaled by
      • scaleYResolution

        public void scaleYResolution​(double factor)
        Scales the resolution on the y-axis by the given factor and updates the canvas. The y-resolution must not be lower than 1.
        Parameters:
        factor - factor the y_resolution will be scaled by
      • setMeasureSelected

        public void setMeasureSelected​(int selected)
        Sets the currently selected measure index.
        Parameters:
        selected - new selected measure
      • updateCanvas

        public void updateCanvas​(boolean force)
        Updates the canvas: if values have changed or it is forced, the canvas and preferred sizes are updated and the canvas is repainted. Size and preferred size are determined by the subclass extending AbstractGraphCanvas.
        Parameters:
        force - enforce repainting
      • setSize

        public abstract void setSize()
        Sets the canvas size.
      • setPreferredSize

        public abstract void setPreferredSize()
        Sets the preferred canvas size.
      • getMinXValue

        public abstract double getMinXValue()
        Returns the minimum value for the x-axis.
      • getMaxXValue

        public abstract double getMaxXValue()
        Returns the maximum value for the x-axis.