Changeset 85 for java/main/src/main/java/com/framsticks/gui/TreeNode.java
- Timestamp:
- 06/24/13 13:38:40 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/gui/TreeNode.java
r84 r85 1 1 package com.framsticks.gui; 2 2 3 import com.framsticks.communication.Connection; 3 4 import com.framsticks.communication.Subscription; 4 5 import com.framsticks.communication.util.LoggingStateCallback; 6 import com.framsticks.core.Instance; 5 7 import com.framsticks.core.ListChange; 6 8 import com.framsticks.core.Path; … … 18 20 import com.framsticks.util.StateFunctor; 19 21 import org.apache.log4j.Logger; 22 import com.framsticks.util.dispatching.RunAt; 20 23 21 24 import javax.swing.tree.DefaultMutableTreeNode; … … 40 43 final protected EndpointAtFrame endpoint; 41 44 42 final protected Map<EventParam, Subscription > userSubscriptions = new HashMap<EventParam, Subscription>();45 final protected Map<EventParam, Subscription<?>> userSubscriptions = new HashMap<>(); 43 46 protected Map<ValueControl, Object> localChanges = null; 44 47 protected String tooltip; … … 59 62 iconName = TreeCellRenderer.findIconName(name, path.getTextual()); 60 63 tooltip = "?"; 61 path.getInstance().invokeLater(new Run nable() {64 path.getInstance().invokeLater(new RunAt<Instance>() { 62 65 @Override 63 66 public void run() { … … 82 85 assert p.getInstance().isActive(); 83 86 if (Logging.log(log, "fetch", TreeNode.this, e)) { 84 frame.invokeLater(new Run nable() {87 frame.invokeLater(new RunAt<Frame>() { 85 88 @Override 86 89 public void run() { … … 92 95 } 93 96 updateChildren(p); 94 frame.invokeLater(new Run nable() {97 frame.invokeLater(new RunAt<Frame>() { 95 98 @Override 96 99 public void run() { … … 104 107 assert !frame.isActive(); 105 108 /** TODO those two actions could be merged into single closure */ 106 frame.invokeLater(new Run nable() {109 frame.invokeLater(new RunAt<Frame>() { 107 110 @Override 108 111 public void run() { … … 149 152 /**If some child were found, update in frame context.*/ 150 153 if (childrenPaths.size() > 0) { 151 frame.invokeLater(new Run nable() {154 frame.invokeLater(new RunAt<Frame>() { 152 155 @Override 153 156 public void run() { … … 186 189 final Path p = path; 187 190 188 p.getInstance().invokeLater(new Run nable() {191 p.getInstance().invokeLater(new RunAt<Instance>() { 189 192 @Override 190 193 public void run() { … … 246 249 final String name = (nameParam != null ? access.get(nameParam, String.class) : path.getTop().getParam().getId()); 247 250 248 frame.invokeLater(new Run nable() {251 frame.invokeLater(new RunAt<Frame>() { 249 252 @Override 250 253 public void run() { … … 303 306 assert p.isResolved(); 304 307 panel.setCurrentTreeNode(this); 305 p.getInstance().invokeLater(new Run nable() {308 p.getInstance().invokeLater(new RunAt<Instance>() { 306 309 @Override 307 310 public void run() { … … 309 312 panel.pullValuesFromLocalToUser(access); 310 313 311 frame.invokeLater(new Run nable() {314 frame.invokeLater(new RunAt<Frame>() { 312 315 @Override 313 316 public void run() { … … 341 344 final Path p = path; 342 345 log.debug("preparing panel: " + p); 343 p.getInstance().invokeLater(new Run nable() {346 p.getInstance().invokeLater(new RunAt<Instance>() { 344 347 @Override 345 348 public void run() { … … 347 350 final CompositeParam param = p.getTop().getParam(); 348 351 final FramsClass framsClass = p.getInstance().getInfoFromCache(param.getContainedTypeName()); 349 frame.invokeLater(new Run nable() {352 frame.invokeLater(new RunAt<Frame>() { 350 353 @Override 351 354 public void run() { … … 410 413 return; 411 414 } 412 userSubscriptions.get(eventParam).unsubscribe(new LoggingStateCallback (log, "unsubscribed " + eventParam));415 userSubscriptions.get(eventParam).unsubscribe(new LoggingStateCallback<Connection>(log, "unsubscribed " + eventParam)); 413 416 userSubscriptions.remove(eventParam); 414 417 } … … 500 503 final Map<ValueControl, Object> changes = localChanges; 501 504 localChanges = null; 502 endpoint.getEndpoint().invokeLater(new Run nable() {505 endpoint.getEndpoint().invokeLater(new RunAt<Instance>() { 503 506 @Override 504 507 public void run() { … … 514 517 } 515 518 log.debug("applied changes for: " + p); 516 frame.invokeLater(new Run nable() {519 frame.invokeLater(new RunAt<Frame>() { 517 520 @Override 518 521 public void run() { … … 526 529 }); 527 530 } 528 529 531 }
Note: See TracChangeset
for help on using the changeset viewer.