Package wprover

Class JArrowFlash

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

    public class JArrowFlash
    extends JFlash
    implements java.awt.event.ActionListener
    JArrowFlash is a class that extends JFlash and implements ActionListener. It is used to create a flashing arrow effect on a JPanel.
    • Constructor Detail

      • JArrowFlash

        public JArrowFlash​(javax.swing.JPanel panel,
                           CPoint p1,
                           CPoint p2,
                           int type)
        Constructs a new JArrowFlash with the specified JPanel, points, and type.
        Parameters:
        panel - the JPanel to associate with this JArrowFlash
        p1 - the starting point of the arrow
        p2 - the ending point of the arrow
        type - the type of the arrow (0 for PI/6, 1 for PI*5/6)
    • Method Detail

      • draw

        public boolean draw​(java.awt.Graphics2D g2)
        Draws the flashing arrow 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