|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
org.norvelle.textcite.model.AbstractCitationContainerTreeNode
org.norvelle.textcite.model.Category
public class Category
Represents a subject category that can be associated with a citation. Stored in hierarchical form in the CategoryTree
Nested Class Summary | |
---|---|
static class |
Category.CategoryConverter
CategoryConverter is an inner class used for serializing Category objects via XStream. |
Field Summary |
---|
Fields inherited from class org.norvelle.textcite.model.AbstractCitationContainerTreeNode |
---|
citationIds, citations |
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
---|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
---|---|
protected |
Category()
A parameterless constructor, so that we can recreate a serialized Category from XML. |
|
Category(java.lang.String n)
This constructor is the same as the two-parameter one, simply supplying null as the parent Category, so that the new Category will be added to the root of the tree |
|
Category(java.lang.String n,
Category parent)
The constructor calls the DefaultMutableTreeNode constructor, passing the name of the Category as the UserObject (which will also be displayed as the label) |
Method Summary | |
---|---|
void |
destroy()
On destroying a Category, notify all associated Citations that they need to remove the Category from their CitationCategoryLists |
java.util.HashMap |
getCitations()
|
int |
getId()
|
java.lang.String |
getName()
|
void |
registerCitation(Citation citation)
Mark a Citation object as belong to this Category. |
void |
setName(java.lang.String n)
Change the label of the category. |
void |
unregisterCitation(Citation citation)
Dissasociate a given Citation from this Category. |
Methods inherited from class org.norvelle.textcite.model.AbstractCitationContainerTreeNode |
---|
restoreCitationReferences, saveCitationReferences |
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
---|
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Category(java.lang.String n, Category parent)
n
- The name/label of the Categoryparent
- The Category that is parent to the new Category in the CategoryTreepublic Category(java.lang.String n)
n
- The name of the new Categoryprotected Category()
Method Detail |
---|
public void registerCitation(Citation citation)
registerCitation
in class AbstractCitationContainerTreeNode
citation
- The Citation object to be addedpublic void unregisterCitation(Citation citation)
unregisterCitation
in class AbstractCitationContainerTreeNode
citation
- The Citation to be eliminated from the Category.public void destroy()
destroy
in interface ClipboardHostable
public java.lang.String getName()
public void setName(java.lang.String n)
n
- The new name for the Category.public int getId()
public java.util.HashMap getCitations()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |