/** * @return the tree node at the specified index */ public Node<E> getTreeNode(int visibleIndex) { return data.get(visibleIndex, VISIBLE_NODES).get(); }
/** * @return the node that precedes this one, or <code>null</code> if there * is no such node. */ private Node<E> previous() { Element<Node<E>> previous = element.previous(); return (previous == null) ? null : previous.get(); }
/** {@inheritDoc} */ @Override public T0 get(int index) { return tree.get(index /*[ COLORED_START ]*/, colors /*[ COLORED_END ]*/).get(); }
/** {@inheritDoc} */ @Override public List<E> get(int index) { return groupLists.get(index).get(); }
/** {@inheritDoc} */ @Override public T0 get(int index) { return tree.get(index , colors ).get(); }
/** * Get the value at the specified target index. * * @return the value, or {@link ListEvent#UNKNOWN_VALUE} if this index * holds a value that hasn't been buffered. In this case, the value * can be obtained from the source list. */ public E getTargetValue(int targetIndex) { return tree.get(targetIndex, TARGET_INDICES).get(); }
/** * @return <code>true</code> if the children of the node at the specified * index are visible. Nodes with no children may be expanded or not, * this is used to determine whether to show children should any be * added. */ public boolean isExpanded(int visibleIndex) { return data.get(visibleIndex, VISIBLE_NODES).get().expanded; }
/** {@inheritDoc} */ @Override public T0 get(int index) { return tree.get(index , colors ).get(); }
/** * @return <code>true</code> if the children of the node at the specified * index are visible. Nodes with no children may be expanded or not, * this is used to determine whether to show children should any be * added. */ public boolean isExpanded(int visibleIndex) { return data.get(visibleIndex, VISIBLE_NODES).get().expanded; }
/** * @return the node that precedes this one, or <code>null</code> if there * is no such node. */ private Node<E> previous() { Element<Node<E>> previous = element.previous(); return (previous == null) ? null : previous.get(); }
/** {@inheritDoc} */ @Override public T0 get(int index) { return tree.get(index ).get(); }
/** {@inheritDoc} */ @Override public T0 get(int index) { return tree.get(index ).get(); }
/** {@inheritDoc} */ @Override public List<E> get(int index) { return groupLists.get(index).get(); }
/** * Get the value at the specified target index. * * @return the value, or {@link ListEvent#UNKNOWN_VALUE} if this index * holds a value that hasn't been buffered. In this case, the value * can be obtained from the source list. */ public E getTargetValue(int targetIndex) { return tree.get(targetIndex, TARGET_INDICES).get(); }
/** {@inheritDoc} */ @Override protected int getSourceIndex(int mutationIndex) { Element sortedNode = sorted.get(mutationIndex); Element unsortedNode = (Element)sortedNode.get(); return unsorted.indexOfNode(unsortedNode, ALL_COLORS); }
/** * Get the child element for the specified child index. */ private ChildElement<E> getChildElement(int childIndex) { if(childIndex < 0) throw new IndexOutOfBoundsException("Invalid index: " + childIndex); if(childIndex >= size()) throw new IndexOutOfBoundsException("Index: " + childIndex + ", Size: " + size()); // get the child element int parentIndex = barcode.getBlackBeforeWhite(childIndex); return childElements.get(parentIndex).get(); }
/** {@inheritDoc} */ @Override public E get(int index) { Object type = insertedSeparators.get(index); if(type == SEPARATOR) return (E)separators.get(getSeparatorIndex(index)).get(); else if(type == SOURCE_ELEMENT) return source.get(getSourceIndex(index)); else throw new IllegalStateException(); }
/** {@inheritDoc} */ @Override public E get(int index) { Object type = insertedSeparators.get(index); if(type == SEPARATOR) return (E)separators.get(getSeparatorIndex(index)).get(); else if(type == SOURCE_ELEMENT) return source.get(getSourceIndex(index)); else throw new IllegalStateException(); }
/** {@inheritDoc} */ @Override public E get(int index) { Object type = insertedSeparators.get(index); if(type == SEPARATOR) return (E)separators.get(getSeparatorIndex(index)).get(); else if(type == SOURCE_ELEMENT) return source.get(getSourceIndex(index)); else throw new IllegalStateException(); }
/** * Control whether the child elements of the specified node are visible. * * @param expanded <code>true</code> to expand the node, <code>false</code> * to collapse it. */ public void setExpanded(int visibleIndex, boolean expanded) { Node<E> toExpand = data.get(visibleIndex, VISIBLE_NODES).get(); expansionModel.setExpanded(toExpand.getElement(), toExpand.path, expanded); setExpanded(toExpand, expanded); assert(isValid()); }