Package wprover

Class JSegmentMovingFlash

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

    public class JSegmentMovingFlash
    extends JFlash
    implements java.awt.event.ActionListener
    JSegmentMovingFlash is a class that extends JFlash and implements ActionListener. It is used to create a moving flash effect on a segment defined by four points.
    • Constructor Detail

      • JSegmentMovingFlash

        public JSegmentMovingFlash​(javax.swing.JPanel p,
                                   CPoint p1,
                                   CPoint p2,
                                   CPoint p3,
                                   CPoint p4,
                                   int c1,
                                   int c2)
        Constructs a new JSegmentMovingFlash with the specified parameters.
        Parameters:
        p - the JPanel to associate with this JSegmentMovingFlash
        p1 - the first CPoint of the segment
        p2 - the second CPoint of the segment
        p3 - the third CPoint of the segment
        p4 - the fourth CPoint of the segment
        c1 - the first color index for the flashing effect
        c2 - the second color index for the flashing effect
    • Method Detail

      • draw

        public boolean draw​(java.awt.Graphics2D g2)
        Draws the moving flash effect 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 the action event for the timer, updating the animation state and repainting the panel.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Parameters:
        e - the action event