Buttons: Added missing @Override annotations
This commit is contained in:
parent
0a63922fa2
commit
b28c593776
|
@ -60,6 +60,7 @@ public class ESBButton extends Button {
|
||||||
mote.esbNode.setButton(true);
|
mote.esbNode.setButton(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isPressed() {
|
public boolean isPressed() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,7 @@ public class SkyButton extends Button {
|
||||||
skyMote.skyNode.setButton(false);
|
skyMote.skyNode.setButton(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isPressed() {
|
public boolean isPressed() {
|
||||||
/* Not implemented */
|
/* Not implemented */
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -111,6 +111,7 @@ public class ContikiButton extends Button implements ContikiMoteInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isPressed() {
|
public boolean isPressed() {
|
||||||
return moteMem.getByteValueOf("simButtonIsDown") == 1;
|
return moteMem.getByteValueOf("simButtonIsDown") == 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,11 +58,13 @@ public abstract class Button extends MoteInterface {
|
||||||
sim = mote.getSimulation();
|
sim = mote.getSimulation();
|
||||||
|
|
||||||
pressButtonEvent = new MoteTimeEvent(mote, 0) {
|
pressButtonEvent = new MoteTimeEvent(mote, 0) {
|
||||||
|
@Override
|
||||||
public void execute(long t) {
|
public void execute(long t) {
|
||||||
doPressButton();
|
doPressButton();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
releaseButtonEvent = new MoteTimeEvent(mote, 0) {
|
releaseButtonEvent = new MoteTimeEvent(mote, 0) {
|
||||||
|
@Override
|
||||||
public void execute(long t) {
|
public void execute(long t) {
|
||||||
doReleaseButton();
|
doReleaseButton();
|
||||||
}
|
}
|
||||||
|
@ -75,6 +77,7 @@ public abstract class Button extends MoteInterface {
|
||||||
*/
|
*/
|
||||||
public void clickButton() {
|
public void clickButton() {
|
||||||
sim.invokeSimulationThread(new Runnable() {
|
sim.invokeSimulationThread(new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
sim.scheduleEvent(pressButtonEvent, sim.getSimulationTime());
|
sim.scheduleEvent(pressButtonEvent, sim.getSimulationTime());
|
||||||
sim.scheduleEvent(releaseButtonEvent, sim.getSimulationTime() + Simulation.MILLISECOND);
|
sim.scheduleEvent(releaseButtonEvent, sim.getSimulationTime() + Simulation.MILLISECOND);
|
||||||
|
@ -87,6 +90,7 @@ public abstract class Button extends MoteInterface {
|
||||||
*/
|
*/
|
||||||
public void pressButton() {
|
public void pressButton() {
|
||||||
sim.invokeSimulationThread(new Runnable() {
|
sim.invokeSimulationThread(new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
sim.scheduleEvent(pressButtonEvent, sim.getSimulationTime());
|
sim.scheduleEvent(pressButtonEvent, sim.getSimulationTime());
|
||||||
}
|
}
|
||||||
|
@ -103,6 +107,7 @@ public abstract class Button extends MoteInterface {
|
||||||
*/
|
*/
|
||||||
public void releaseButton() {
|
public void releaseButton() {
|
||||||
sim.invokeSimulationThread(new Runnable() {
|
sim.invokeSimulationThread(new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
sim.scheduleEvent(releaseButtonEvent, sim.getSimulationTime());
|
sim.scheduleEvent(releaseButtonEvent, sim.getSimulationTime());
|
||||||
}
|
}
|
||||||
|
@ -119,6 +124,7 @@ public abstract class Button extends MoteInterface {
|
||||||
*/
|
*/
|
||||||
public abstract boolean isPressed();
|
public abstract boolean isPressed();
|
||||||
|
|
||||||
|
@Override
|
||||||
public JPanel getInterfaceVisualizer() {
|
public JPanel getInterfaceVisualizer() {
|
||||||
JPanel panel = new JPanel();
|
JPanel panel = new JPanel();
|
||||||
final JButton clickButton = new JButton("Click button");
|
final JButton clickButton = new JButton("Click button");
|
||||||
|
@ -126,6 +132,7 @@ public abstract class Button extends MoteInterface {
|
||||||
panel.add(clickButton);
|
panel.add(clickButton);
|
||||||
|
|
||||||
clickButton.addActionListener(new ActionListener() {
|
clickButton.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
clickButton();
|
clickButton();
|
||||||
}
|
}
|
||||||
|
@ -134,6 +141,7 @@ public abstract class Button extends MoteInterface {
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void releaseInterfaceVisualizer(JPanel panel) {
|
public void releaseInterfaceVisualizer(JPanel panel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue