Clear node positions when clearing node data

This commit is contained in:
nifi 2010-11-12 00:12:55 +00:00
parent 3426eae031
commit 02965e25f6
2 changed files with 25 additions and 6 deletions

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: CollectServer.java,v 1.1 2010/11/03 14:53:05 adamdunkels Exp $
* $Id: CollectServer.java,v 1.2 2010/11/12 00:12:55 nifi Exp $
*
* -----------------------------------------------------------------
*
@ -34,8 +34,8 @@
*
* Authors : Joakim Eriksson, Niclas Finne
* Created : 3 jul 2008
* Updated : $Date: 2010/11/03 14:53:05 $
* $Revision: 1.1 $
* Updated : $Date: 2010/11/12 00:12:55 $
* $Revision: 1.2 $
*/
package se.sics.contiki.collect;
@ -810,6 +810,10 @@ public class CollectServer implements SerialConnectionListener {
window.setVisible(false);
}
public void setUseSensorDataLog(boolean useSensorLog) {
this.isSensorLogUsed = useSensorLog;
}
public void setExitOnRequest(boolean doExit) {
this.doExitOnRequest = doExit;
if (exitItem != null) {
@ -888,6 +892,10 @@ public class CollectServer implements SerialConnectionListener {
return configTable.getProperty(property, config.getProperty(property, defaultValue));
}
public void removeConfig(String property) {
configTable.remove(property);
}
public int getDefaultMaxItemCount() {
return defaultMaxItemCount;
}
@ -1231,6 +1239,13 @@ public class CollectServer implements SerialConnectionListener {
v.clearNodeData();
}
}
// Remove any saved node positions
for(String key: configTable.keySet().toArray(new String[0])) {
String property = key.toString();
if (!property.startsWith("collect")) {
configTable.remove(property);
}
}
}
private void clearSensorDataLog() {

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: MapPanel.java,v 1.1 2010/11/03 14:53:05 adamdunkels Exp $
* $Id: MapPanel.java,v 1.2 2010/11/12 00:12:56 nifi Exp $
*
* -----------------------------------------------------------------
*
@ -34,8 +34,8 @@
*
* Authors : Joakim Eriksson, Niclas Finne
* Created : 3 jul 2008
* Updated : $Date: 2010/11/03 14:53:05 $
* $Revision: 1.1 $
* Updated : $Date: 2010/11/12 00:12:56 $
* $Revision: 1.2 $
*/
package se.sics.contiki.collect.gui;
@ -563,7 +563,11 @@ public class MapPanel extends JPanel implements Configurable, Visualizer, Action
} else if (!isMap && source == lockedItem) {
if (popupNode != null) {
boolean wasFixed = popupNode.hasFixedLocation;
popupNode.hasFixedLocation = lockedItem.isSelected();
if (wasFixed && !popupNode.hasFixedLocation) {
server.removeConfig("collect.map." + popupNode.node.getID());
}
repaint();
}