Verder gewerkt aan PanelDevice. Feedback moet algemeen worden voor Devices.
This commit is contained in:
22
java/src/pm/util/swing/CycleButton.java
Normal file
22
java/src/pm/util/swing/CycleButton.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package pm.util.swing;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
import pm.util.ArrayCycle;
|
||||
|
||||
public class CycleButton extends HoldButton {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
|
||||
protected ArrayCycle<ImageIcon> imageIconCycle;
|
||||
|
||||
public CycleButton(HoldButtonListener holdButtonListener, ArrayCycle<ImageIcon> imageIconCycle) {
|
||||
super(holdButtonListener);
|
||||
this.imageIconCycle = imageIconCycle;
|
||||
cycle();
|
||||
}
|
||||
|
||||
public void cycle() {
|
||||
setIcon(imageIconCycle.current());
|
||||
imageIconCycle.next();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user