1
0
Fork 0
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:
Vasiliy Bout 2010-02-25 10:07:16 +00:00
parent 1cddf78fa1
commit 282c132922
10 changed files with 254 additions and 76 deletions

View file

@ -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();