Package wprover

Class JObjectFlash

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.util.EventListener

    public class JObjectFlash
    extends JFlash
    implements java.awt.event.ActionListener
    A class that represents a flashing effect for graphical objects.
    • Constructor Detail

      • JObjectFlash

        public JObjectFlash​(javax.swing.JPanel p)
        Constructs a new JObjectFlash with the specified JPanel.
        Parameters:
        p - the JPanel to associate with this JObjectFlash
    • Method Detail

      • draw

        public boolean draw​(java.awt.Graphics2D g2)
        Draws the flashing objects on the specified Graphics2D context.
        Specified by:
        draw in class JFlash
        Parameters:
        g2 - the Graphics2D context to draw on
        Returns:
        true if the drawing was successful, false otherwise
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
        Handles action events for the timer.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Parameters:
        e - the action event
      • setAt

        public void setAt​(javax.swing.JPanel p,
                          java.util.Vector list)
        Sets the panel and list of objects to be flashed.
        Parameters:
        p - the JPanel to associate with this JObjectFlash
        list - the list of objects to be flashed
      • addFlashObject

        public void addFlashObject​(CClass obj)
        Adds an object to the list of objects to be flashed.
        Parameters:
        obj - the object to add
      • start

        public void start()
        Starts the flashing effect.
        Overrides:
        start in class JFlash
      • stop

        public void stop()
        Stops the flashing effect.
        Overrides:
        stop in class JFlash