Class PaintablePanel

    • Field Detail

      • m_Paintlets

        protected HashSet<Paintlet> m_Paintlets
        additional paintlets to execute.
    • Constructor Detail

      • PaintablePanel

        public PaintablePanel()
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class BasePanel
      • addPaintlet

        public void addPaintlet​(Paintlet p)
        Adds the paintlet to the internal list.
        Specified by:
        addPaintlet in interface PaintletManager
        Parameters:
        p - the paintlet to add.
      • removePaintlet

        public void removePaintlet​(Paintlet p)
        Removes this paintlet from its internal list.
        Specified by:
        removePaintlet in interface PaintletManager
        Parameters:
        p - the paintlet to remove
      • canHandleFixedLabels

        public boolean canHandleFixedLabels()
        Returns whether the panel can handle fixed lables for its axes.

        Default implementation returns false.
        Returns:
        true if panel can handle it
      • getPlot

        public abstract PlotPanel getPlot()
        Returns the plot panel of the panel, null if no panel present.
        Returns:
        the plot panel
      • check

        protected void check()
        Performs some setup checks.
      • prepareUpdate

        protected abstract void prepareUpdate()
        Prepares the update, i.e., calculations etc.
      • performUpdate

        protected void performUpdate()
        Performs the actual update.
      • postUpdate

        protected void postUpdate()
        Hook method, called after the update was performed.

        Default implementation does nothing.
      • update

        public void update()
        Updates the display.
      • canPaint

        protected abstract boolean canPaint​(Graphics g)
        Returns true if the paintlets can be executed.
        Parameters:
        g - the graphics context
        Returns:
        true if painting can go ahead
      • paint

        protected void paint​(Graphics g,
                             PaintEvent.PaintMoment moment)
        Executes all paintlets of the specified paint moment.
        Parameters:
        g - the graphics context
        moment - the paint moment
      • printAll

        public void printAll​(Graphics g)
        Invoke this method to print the component. This method invokes print on the component.
        Overrides:
        printAll in class JComponent
        Parameters:
        g - the Graphics context in which to paint