Class AbstractPaintlet

    • Field Detail

      • m_Panel

        protected transient PaintablePanel m_Panel
        the panel this paintlet is for.
      • m_Enabled

        protected boolean m_Enabled
        whether the paintlet is enabled.
      • m_RepaintOnChange

        protected boolean m_RepaintOnChange
        whether the paintlet reacts with repaints to changes of its members.
      • m_Initializing

        protected boolean m_Initializing
        whether the paintlet is currently being initialized and should ignore repaint requests.
    • Constructor Detail

      • AbstractPaintlet

        public AbstractPaintlet()
    • Method Detail

      • isInitializing

        protected boolean isInitializing()
        Whether the paintlet is currently being initialized.
        Returns:
        true if the paintlet is currently being initialized
      • setPanel

        public void setPanel​(PaintablePanel value)
        Sets the panel to use, null to disable painting.
        Specified by:
        setPanel in interface Paintlet
        Parameters:
        value - the panel to paint on
      • setPanel

        public void setPanel​(PaintablePanel value,
                             boolean register)
        Sets the panel to use, null to disable painting.
        Specified by:
        setPanel in interface Paintlet
        Parameters:
        value - the panel to paint on
        register - whether to register the paintlet
      • getPanel

        public PaintablePanel getPanel()
        Returns the panel currently in use.
        Specified by:
        getPanel in interface Paintlet
        Returns:
        the panel in use
      • hasPanel

        public boolean hasPanel()
        Returns whether a panel has been set.
        Specified by:
        hasPanel in interface Paintlet
        Returns:
        true if a panel is currently set
      • getPlot

        public PlotPanel getPlot()
        Returns the plot panel of the panel, null if no panel present.
        Specified by:
        getPlot in interface Paintlet
        Returns:
        the plot panel
      • setEnabled

        public void setEnabled​(boolean value)
        Sets whether the paintlet is enabled or not. Setting it to true automatically initiates a repaint. Is not affected by m_RepaintOnChange.
        Specified by:
        setEnabled in interface Paintlet
        Parameters:
        value - if true then the paintlet is enabled
        See Also:
        m_RepaintOnChange
      • isEnabled

        public boolean isEnabled()
        Returns whether the paintlet is currently enabled.
        Specified by:
        isEnabled in interface Paintlet
        Returns:
        true if the paintlet is enabled.
      • setRepaintOnChange

        public void setRepaintOnChange​(boolean value)
        Sets whether the paintlet reacts with repaints to changes of its members.
        Specified by:
        setRepaintOnChange in interface Paintlet
        Parameters:
        value - if true then the paintlet repaints whenever members get changed
      • getRepaintOnChange

        public boolean getRepaintOnChange()
        Returns whether the paintlet reacts with repaints to changes of its members.
        Specified by:
        getRepaintOnChange in interface Paintlet
        Returns:
        true if paintlet repaints whenever members get changed
      • paint

        public void paint​(Graphics g)
        The paint routine of the paintlet.
        Specified by:
        paint in interface Paintlet
        Parameters:
        g - the graphics context to use for painting
        See Also:
        isEnabled()
      • updatePanel

        protected void updatePanel()
        Calls the update() method of the associated panel.
      • memberChanged

        public void memberChanged​(boolean updatePanel)
        Executes a repaints only if the changes to members are not ignored.
        Parameters:
        updatePanel - whether to call the update() method of the associated panel
        See Also:
        getRepaintOnChange(), isInitializing(), repaint()
      • repaint

        public void repaint()
        Repaints if possible (and enabled!).
        See Also:
        m_Panel, isEnabled()
      • shallowCopy

        public Paintlet shallowCopy​(boolean expand)
        Returns a shallow copy of itself, i.e., based on the commandline options.
        Specified by:
        shallowCopy in interface ShallowCopySupporter<Paintlet>
        Parameters:
        expand - whether to expand variables to their current values
        Returns:
        the shallow copy
      • getPaintlets

        public static String[] getPaintlets()
        Returns a list with classnames of paintlets.
        Returns:
        the filter classnames
      • forName

        public static Paintlet forName​(String classname,
                                       String[] options)
        Instantiates the paintlet with the given options.
        Parameters:
        classname - the classname of the paintlet to instantiate
        options - the options for the paintlet
        Returns:
        the instantiated paintlet or null if an error occurred
      • forCommandLine

        public static Paintlet forCommandLine​(String cmdline)
        Instantiates the paintlet from the given commandline (i.e., classname and optional options).
        Parameters:
        cmdline - the classname (and optional options) of the paintlet to instantiate
        Returns:
        the instantiated paintlet or null if an error occurred