private void updateModel(DefaultTableModel model, MindMapNode node) { ReminderHookBase hook = TimeManagementOrganizer.getHook(node); // show all nodes or only those with reminder: if (showAllNodes || hook != null) { Date date = null; if (hook != null) { date = new Date(hook.getRemindUserAt()); } model.addRow( new Object[] { date, new NodeHolder(node), new IconsHolder(node), node.getHistoryInformation().getCreatedAt(), node.getHistoryInformation().getLastModifiedAt(), new NotesHolder(node) }); } if ((!mViewFoldedNodes) && node.isFolded()) { // no recursion, if folded nodes should be hidden. return; } for (Iterator i = node.childrenUnfolded(); i.hasNext(); ) { MindMapNode child = (MindMapNode) i.next(); updateModel(model, child); } }
protected int getMaxDepth(MindMapNode node) { if (node.isFolded() || !node.hasChildren()) return depth(node); int k = 0; for (Iterator i = node.childrenUnfolded(); i.hasNext(); ) { int l = getMaxDepth((MindMapNode) i.next()); if (l > k) k = l; } return k; }
public int getMinDepth(MindMapNode node) { if (node.isFolded()) return depth(node); if (!node.hasChildren()) return Integer.MAX_VALUE; int k = Integer.MAX_VALUE; for (Iterator i = node.childrenUnfolded(); i.hasNext(); ) { int l = getMinDepth((MindMapNode) i.next()); if (l < k) k = l; } return k; }
protected void setFolded(MindMapNode node, boolean state) { if (node.hasChildren() && (node.isFolded() != state)) { getMindMapController().setFolded(node, state); } }