Basis gelegd voor PanelDevice, todo:

- knop icons cachen om echte togglers mogelijk te maken
- rij if...elseif equals statements met een ButtonList loop korter maken?
- sliders afhandelen
- feedback terugsturen
- naamgeving aanpassen
This commit is contained in:
2011-03-01 09:58:00 +00:00
parent eae4f80c24
commit 1bb7cb7797
21 changed files with 314 additions and 4 deletions

View File

@@ -0,0 +1,33 @@
package pm.device.panel;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JButton;
public class HoldButton extends JButton implements MouseListener {
protected static final long serialVersionUID = 1L;
protected HoldButtonListener holdButtonListener;
public HoldButton(HoldButtonListener holdButtonListener) {
this.holdButtonListener = holdButtonListener;
addMouseListener(this);
}
public void mousePressed(MouseEvent event) {
if (event.getButton() == MouseEvent.BUTTON1) {
holdButtonListener.buttonPressed(this);
}
}
public void mouseReleased(MouseEvent event) {
if (event.getButton() == MouseEvent.BUTTON1) {
holdButtonListener.buttonReleased(this);
}
}
public void mouseClicked(MouseEvent event) {}
public void mouseEntered(MouseEvent event) {}
public void mouseExited(MouseEvent event) {}
}