Package wprover
Class JLineFlash
- java.lang.Object
-
- wprover.JFlash
-
- wprover.JLineFlash
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.util.EventListener
public class JLineFlash extends JFlash implements java.awt.event.ActionListener
A class that represents a flashing line effect.
-
-
Constructor Summary
Constructors Constructor Description JLineFlash(javax.swing.JPanel p)Constructs a new JLineFlash with the specified JPanel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent e)Handles action events for the timer.intaddALine()Adds a new line to the list of lines to be flashed.voidaddAPoint(int index, CPoint p)Adds a point to a line at the specified index.booleandraw(java.awt.Graphics2D g2)Draws the flashing lines on the specified Graphics2D context.voidsetAlternate(boolean a)Sets the alternate flashing mode.voidsetInfinitLine(int n)Sets a line to be drawn infinitely.voidstop()Stops the flashing effect.-
Methods inherited from class wprover.JFlash
drawALine3, drawALine3Short, getColor, getRatioColor, getvisibleType, isfinished, isrRunning, isZero, recalculate, setColor, setDealy, setDrawDash, setDrawDashFb2, start, updateTimer
-
-
-
-
Method Detail
-
addALine
public int addALine()
Adds a new line to the list of lines to be flashed.- Returns:
- the index of the newly added line
-
setInfinitLine
public void setInfinitLine(int n)
Sets a line to be drawn infinitely.- Parameters:
n- the index of the line to set as infinite
-
addAPoint
public void addAPoint(int index, CPoint p)Adds a point to a line at the specified index.- Parameters:
index- the index of the line to add the point top- the point to add
-
setAlternate
public void setAlternate(boolean a)
Sets the alternate flashing mode.- Parameters:
a- true to enable alternate flashing mode, false otherwise
-
draw
public boolean draw(java.awt.Graphics2D g2)
Draws the flashing lines on the specified Graphics2D context.
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
Handles action events for the timer.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener- Parameters:
e- the action event
-
-