mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
Network tree classes have been added
git-svn-id: https://only.mawhrin.net/repos/FBReaderJ/trunk@1061 6a642e6f-84f6-412e-ac94-c4a38d5a04b0
This commit is contained in:
parent
1cddf78fa1
commit
282c132922
10 changed files with 254 additions and 76 deletions
|
@ -46,25 +46,6 @@ public abstract class LibraryTree extends FBTree {
|
|||
return new BookTree(this, book, showAuthors);
|
||||
}
|
||||
|
||||
private String myChildrenString;
|
||||
public String getSecondString() {
|
||||
if (myChildrenString == null) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
int count = 0;
|
||||
for (FBTree subtree : subTrees()) {
|
||||
if (count++ > 0) {
|
||||
builder.append(", ");
|
||||
}
|
||||
builder.append(subtree.getName());
|
||||
if (count == 5) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
myChildrenString = builder.toString();
|
||||
}
|
||||
return myChildrenString;
|
||||
}
|
||||
|
||||
public boolean removeBook(Book book) {
|
||||
final LinkedList<FBTree> toRemove = new LinkedList<FBTree>();
|
||||
for (FBTree tree : this) {
|
||||
|
@ -79,7 +60,7 @@ public abstract class LibraryTree extends FBTree {
|
|||
parent.removeSelf();
|
||||
}
|
||||
for (; parent != null; parent = parent.Parent) {
|
||||
((LibraryTree)parent).myChildrenString = null;
|
||||
((LibraryTree)parent).invalidateChildren();
|
||||
}
|
||||
}
|
||||
return !toRemove.isEmpty();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue