Updated network graph to remember fixed node locations when clearing sensor/node data.

This commit is contained in:
nifi 2010-11-12 17:52:02 +00:00
parent 2b1f62afea
commit 3e61990312
2 changed files with 13 additions and 12 deletions

View File

@ -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: CollectServer.java,v 1.3 2010/11/12 17:03:43 nifi Exp $ * $Id: CollectServer.java,v 1.4 2010/11/12 17:52:02 nifi Exp $
* *
* ----------------------------------------------------------------- * -----------------------------------------------------------------
* *
@ -34,8 +34,8 @@
* *
* Authors : Joakim Eriksson, Niclas Finne * Authors : Joakim Eriksson, Niclas Finne
* Created : 3 jul 2008 * Created : 3 jul 2008
* Updated : $Date: 2010/11/12 17:03:43 $ * Updated : $Date: 2010/11/12 17:52:02 $
* $Revision: 1.3 $ * $Revision: 1.4 $
*/ */
package se.sics.contiki.collect; package se.sics.contiki.collect;
@ -892,6 +892,10 @@ public class CollectServer implements SerialConnectionListener {
return configTable.getProperty(property, config.getProperty(property, defaultValue)); return configTable.getProperty(property, config.getProperty(property, defaultValue));
} }
public void setConfig(String property, String value) {
configTable.setProperty(property, value);
}
public void removeConfig(String property) { public void removeConfig(String property) {
configTable.remove(property); configTable.remove(property);
} }

View File

@ -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: MapPanel.java,v 1.2 2010/11/12 00:12:56 nifi Exp $ * $Id: MapPanel.java,v 1.3 2010/11/12 17:52:02 nifi Exp $
* *
* ----------------------------------------------------------------- * -----------------------------------------------------------------
* *
@ -34,8 +34,8 @@
* *
* Authors : Joakim Eriksson, Niclas Finne * Authors : Joakim Eriksson, Niclas Finne
* Created : 3 jul 2008 * Created : 3 jul 2008
* Updated : $Date: 2010/11/12 00:12:56 $ * Updated : $Date: 2010/11/12 17:52:02 $
* $Revision: 1.2 $ * $Revision: 1.3 $
*/ */
package se.sics.contiki.collect.gui; package se.sics.contiki.collect.gui;
@ -567,6 +567,9 @@ public class MapPanel extends JPanel implements Configurable, Visualizer, Action
popupNode.hasFixedLocation = lockedItem.isSelected(); popupNode.hasFixedLocation = lockedItem.isSelected();
if (wasFixed && !popupNode.hasFixedLocation) { if (wasFixed && !popupNode.hasFixedLocation) {
server.removeConfig("collect.map." + popupNode.node.getID()); server.removeConfig("collect.map." + popupNode.node.getID());
} else if (!wasFixed && popupNode.hasFixedLocation) {
server.setConfig("collect.map." + popupNode.node.getID(),
"" + popupNode.x + ',' + popupNode.y);
} }
repaint(); repaint();
} }
@ -838,12 +841,6 @@ public class MapPanel extends JPanel implements Configurable, Visualizer, Action
for (MapNode n : getNodeList()) { for (MapNode n : getNodeList()) {
config.put(n.node.getID(), "" + n.x + ',' + n.y); config.put(n.node.getID(), "" + n.x + ',' + n.y);
} }
} else {
for (MapNode n : getNodeList()) {
if (n.hasFixedLocation) {
config.put("collect.map." + n.node.getID(), "" + n.x + ',' + n.y);
}
}
} }
} }