mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-08-09 17:25:00 +00:00
added click button menu shortcut fr all visualizers
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: Visualizer2D.java,v 1.5 2007/01/29 16:02:17 fros4943 Exp $
|
* $Id: Visualizer2D.java,v 1.6 2007/03/22 09:59:50 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.plugins;
|
package se.sics.cooja.plugins;
|
||||||
@@ -101,6 +101,18 @@ public abstract class Visualizer2D extends VisPlugin {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private class ButtonClickMoteMenuAction implements MoteMenuAction {
|
||||||
|
public boolean isEnabled(Mote mote) {
|
||||||
|
return mote.getInterfaces().getButton() != null && !mote.getInterfaces().getButton().isPressed();
|
||||||
|
}
|
||||||
|
public String getDescription(Mote mote) {
|
||||||
|
return "Click button on " + mote;
|
||||||
|
}
|
||||||
|
public void doAction(Mote mote) {
|
||||||
|
mote.getInterfaces().getButton().clickButton();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private Vector<MoteMenuAction> menuActions = new Vector<MoteMenuAction>();
|
private Vector<MoteMenuAction> menuActions = new Vector<MoteMenuAction>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -224,6 +236,9 @@ public abstract class Visualizer2D extends VisPlugin {
|
|||||||
|
|
||||||
// Add menu action for moving motes
|
// Add menu action for moving motes
|
||||||
addMoteMenuAction(new MoveMoteMenuAction());
|
addMoteMenuAction(new MoveMoteMenuAction());
|
||||||
|
|
||||||
|
// Add menu action for clicking mote button
|
||||||
|
addMoteMenuAction(new ButtonClickMoteMenuAction());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setSelected(true);
|
setSelected(true);
|
||||||
|
Reference in New Issue
Block a user