- Timestamp:
- 09/10/13 21:11:41 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/gui/tree/TreeModel.java
r103 r105 14 14 import org.apache.logging.log4j.LogManager; 15 15 16 import com.framsticks.core.ListChange;17 import com.framsticks.core.Node;18 import com.framsticks.core.Path;19 import com.framsticks.core.SideNoteKey;20 import com.framsticks.core.TreeOperations;21 import com.framsticks.core.ValueChange;22 16 import com.framsticks.gui.Frame; 23 17 import com.framsticks.params.Access; … … 29 23 import com.framsticks.params.ValueParam; 30 24 import com.framsticks.params.types.EventParam; 31 import com.framsticks.util.FramsticksException; 25 import com.framsticks.structure.Node; 26 import com.framsticks.structure.Path; 27 import com.framsticks.structure.SideNoteKey; 28 import com.framsticks.structure.TreeOperations; 29 import com.framsticks.structure.messages.ListChange; 30 import com.framsticks.structure.messages.ValueChange; 32 31 import com.framsticks.util.Misc; 33 32 import com.framsticks.util.FramsticksUnsupportedOperationException; 34 import com.framsticks.util.dispatching.Future Handler;33 import com.framsticks.util.dispatching.Future; 35 34 import com.framsticks.util.lang.Casting; 36 35 37 import static com.framsticks. core.TreeOperations.*;36 import static com.framsticks.structure.TreeOperations.*; 38 37 39 38 public class TreeModel implements javax.swing.tree.TreeModel { … … 42 41 43 42 protected List<TreeModelListener> listeners = new LinkedList<>(); 44 45 43 46 44 protected final Frame frame; … … 208 206 } 209 207 210 public TreePath convertToTreePath(Path path , boolean forceComplete) {208 public TreePath convertToTreePath(Path path) { 211 209 assert frame.isActive(); 212 210 … … 271 269 return; 272 270 } 273 path.getTree().get(path, new Future Handler<Path>(frame) {271 path.getTree().get(path, new Future<Path>(frame) { 274 272 @Override 275 273 protected void result(Path result) { 276 final TreePath treePath = convertToTreePath(result , true);274 final TreePath treePath = convertToTreePath(result); 277 275 278 276 … … 358 356 359 357 log.debug("reacting to change {} in {}", listChange, listPath); 360 final TreePath treeListPath = convertToTreePath(listPath, true); 361 if (treeListPath == null) { 362 throw new FramsticksException().msg("path was not fully converted").arg("path", listPath); 363 } 358 final TreePath treeListPath = convertToTreePath(listPath); 364 359 365 360 if ((listChange.getAction().equals(ListChange.Action.Modify)) && (listChange.getPosition() == -1)) { … … 387 382 } 388 383 389 listPath.getTree().get(childPath, new Future Handler<Path>(frame) {384 listPath.getTree().get(childPath, new Future<Path>(frame) { 390 385 @Override 391 386 protected void result(Path result) { … … 394 389 } 395 390 assert frame.isActive(); 396 final TreePath treePath = Misc.throwIfNull(frame.getTreeModel().convertToTreePath(result , true));391 final TreePath treePath = Misc.throwIfNull(frame.getTreeModel().convertToTreePath(result)); 397 392 398 393 // treeModel.nodeStructureChanged(treePath); … … 420 415 case Modify: { 421 416 Path childPath = listPath.appendParam(access.prepareParamFor(id)).tryResolveIfNeeded(); 422 listPath.getTree().get(childPath, new Future Handler<Path>(frame) {417 listPath.getTree().get(childPath, new Future<Path>(frame) { 423 418 @Override 424 419 protected void result(Path result) {
Note: See TracChangeset
for help on using the changeset viewer.