[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui/treeview GenericTreeView.java, 1.152, 1.
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2010-11-26 14:20:42
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26399/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** GenericTreeView.java 31 Aug 2010 13:48:06 -0000 1.152 --- GenericTreeView.java 26 Nov 2010 14:20:34 -0000 1.153 *************** *** 664,673 **** --- 664,688 ---- private class TargetMonitorNode extends EntityNode { + private TargetMonitor monitor; public TargetMonitorNode(TargetMonitor monitor) { super(monitor); + this.monitor = monitor; for (SensorMonitor current : monitor.getMonitors()) { add(new SensorMonitorNode(current)); } } + + + public void update(Object object) { + removeAllChildren(); + for (SensorMonitor current : monitor.getMonitors()) { + add(new SensorMonitorNode(current)); + } + model.nodeStructureChanged(this); + } + + public ImageIcon icon() { + return genericgroupicon; + } } *************** *** 677,680 **** --- 692,699 ---- add(new SensorHistoryNode(monitor.getSensorHistory())); } + + public ImageIcon icon() { + return genericgroupicon; + } } *************** *** 684,687 **** --- 703,709 ---- add(new DataSetNode(sensorHistory.getData())); } + public ImageIcon icon() { + return genericgroupicon; + } } *************** *** 693,696 **** --- 715,722 ---- } } + + public ImageIcon icon() { + return genericgroupicon; + } } *************** *** 699,702 **** --- 725,732 ---- super(item); } + + public ImageIcon icon() { + return vertexicon; + } } *************** *** 719,736 **** */ protected void makeInstanceContent(Instance space) { ! Set surfaces = space.getEnvelope(); ! add(new SurfaceContainer("Envelope", surfaces, false)); ! CoordinateSystem cs = space.getAnchor(); ! if (cs != null) { ! add(new ConstructorNode(cs)); ! } ! Object obj = space.getParameters().get("target"); ! if (obj instanceof String) { ! Target target = TargetManager.instance().getTarget((String) obj); ! TargetMonitor monitor = MonitorManager.instance().get(target); add(new TargetMonitorNode(monitor)); } } /** * Update the node with the given object --- 749,769 ---- */ protected void makeInstanceContent(Instance space) { ! TargetMonitor monitor = getTarget(space); ! if (monitor != null) { add(new TargetMonitorNode(monitor)); } } + private TargetMonitor getTarget(Instance instance) { + if (instance.getParameters() != null) { + Object obj = instance.getParameters().get("moteid"); + if (obj instanceof String) { + Target target = TargetManager.instance().getTarget((String) obj); + return MonitorManager.instance().get(target); + } + } + return null; + } + /** * Update the node with the given object *************** *** 740,748 **** if (o instanceof Instance) { Instance instance = (Instance) o; ! removeAllChildren(); ! makeInstanceContent(instance); ! model.nodeStructureChanged(this); ! userObject = instance; ! model.nodeChanged(this); } } --- 773,783 ---- if (o instanceof Instance) { Instance instance = (Instance) o; ! TargetMonitor monitor = getTarget(instance); ! if (monitor != null) { ! if (this.getChildCount() > 0) { ! TargetMonitorNode node = (TargetMonitorNode) getChildAt(0); ! node.update(monitor); ! } ! } } } *************** *** 1640,1643 **** --- 1675,1679 ---- */ public void update(Object object) { + System.out.println("updated: " + object); updated = object; changed(); |