mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-09-09 23:54:32 +00:00
exposing the last mouse clicked mote, skins may use this to view additional information about the mote
This commit is contained in:
parent
e227b50151
commit
e6fd4def78
@ -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: Visualizer.java,v 1.17 2010/10/25 13:53:02 nifi Exp $
|
* $Id: Visualizer.java,v 1.18 2010/12/03 13:54:25 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.plugins;
|
package se.sics.cooja.plugins;
|
||||||
@ -145,6 +145,7 @@ public class Visualizer extends VisPlugin {
|
|||||||
private Point zoomingPixel = null; /* Zooming center pixel */
|
private Point zoomingPixel = null; /* Zooming center pixel */
|
||||||
private boolean moving = false;
|
private boolean moving = false;
|
||||||
private Mote movedMote = null;
|
private Mote movedMote = null;
|
||||||
|
public Mote clickedMote = null;
|
||||||
private long moveStartTime = -1;
|
private long moveStartTime = -1;
|
||||||
private boolean moveConfirm;
|
private boolean moveConfirm;
|
||||||
private Cursor moveCursor = new Cursor(Cursor.MOVE_CURSOR);
|
private Cursor moveCursor = new Cursor(Cursor.MOVE_CURSOR);
|
||||||
@ -672,6 +673,7 @@ public class Visualizer extends VisPlugin {
|
|||||||
private void handleMousePress(MouseEvent mouseEvent) {
|
private void handleMousePress(MouseEvent mouseEvent) {
|
||||||
int x = mouseEvent.getX();
|
int x = mouseEvent.getX();
|
||||||
int y = mouseEvent.getY();
|
int y = mouseEvent.getY();
|
||||||
|
clickedMote = null;
|
||||||
|
|
||||||
if (mouseEvent.isControlDown()) {
|
if (mouseEvent.isControlDown()) {
|
||||||
/* Zoom */
|
/* Zoom */
|
||||||
@ -693,6 +695,7 @@ public class Visualizer extends VisPlugin {
|
|||||||
|
|
||||||
if (motes != null && motes.length > 0) {
|
if (motes != null && motes.length > 0) {
|
||||||
/* One of the clicked motes should be moved */
|
/* One of the clicked motes should be moved */
|
||||||
|
clickedMote = motes[0];
|
||||||
beginMoveRequest(motes[0], !mouseEvent.isAltDown(), !mouseEvent.isAltDown());
|
beginMoveRequest(motes[0], !mouseEvent.isAltDown(), !mouseEvent.isAltDown());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -794,6 +797,7 @@ public class Visualizer extends VisPlugin {
|
|||||||
|
|
||||||
moving = false;
|
moving = false;
|
||||||
movedMote = null;
|
movedMote = null;
|
||||||
|
repaint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user