|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.tree.DefaultTreeModel org.keridwen.core.data.model.impl.DefaultDataModel
public class DefaultDataModel
Default implementation of Keridwen hierarchical data model.
Field Summary |
---|
Fields inherited from class javax.swing.tree.DefaultTreeModel |
---|
asksAllowsChildren, listenerList, root |
Constructor Summary | |
---|---|
DefaultDataModel()
Default constructor. |
|
DefaultDataModel(Node<?> root)
Creates a DataModel with the given root Node . |
Method Summary | |
---|---|
void |
addModificationStateListener(ModificationStateListener listenerToAdd)
Adds the given ModificationStateListener to the list of listeners. |
int |
addNode(Node<?> newChild,
Node<?> parent)
Adds the given child Node as the last child of the given parent Node . |
void |
addNodeReaderForPath(NodeReader<?> readerToAdd,
String nodePath)
Associates the given NodeReader to the provided node absolute path in the XML file. |
DataModelInformation |
getDataModelInformation()
Gets the DataModel metadata |
ModificationState |
getModificationState()
Gets the ModificationState of the DataModel . |
NodeReader<?> |
getNodeReader(String nodePath)
Gets the NodeReader associated with the given file format. |
Node<?> |
getRootNode()
Gets the DataModel root Node . |
void |
insertNodeInto(Node<?> newChild,
Node<?> parent,
int index)
Inserts the given child Node in the given parent Node , at the given index. |
void |
loadModel(URI rootURI)
Loads the DataModel from the given root Node URI . |
void |
removeModificationStateListener(ModificationStateListener listenerToRemove)
Removes the given ModificationStateListener from the list of listeners. |
void |
removeReaderForPath(String nodePath)
Removes the association between the given node path and its NodeReader . |
void |
saveModel()
Saves the whole model. |
void |
saveModelAs(URI rootURI)
Saves the DataModel , with the given URI as the root Node . |
void |
setModificationState(ModificationState newState)
Sets the ModificationState of the DataModel to the given new state. |
void |
setRootNode(Node<?> rootNode)
Sets the root Node of the DataModel . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.tree.TreeModel |
---|
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged |
Constructor Detail |
---|
public DefaultDataModel()
public DefaultDataModel(Node<?> root)
DataModel
with the given root Node
.
root
- the root Node
to setMethod Detail |
---|
public Node<?> getRootNode()
DataModel
DataModel
root Node
.
getRootNode
in interface DataModel
Node
of the DataModel
public void setRootNode(Node<?> rootNode)
DataModel
Node
of the DataModel
.
setRootNode
in interface DataModel
rootNode
- the root Node
to setpublic void insertNodeInto(Node<?> newChild, Node<?> parent, int index)
DataModel
Node
in the given parent Node
, at the given index.
insertNodeInto
in interface DataModel
newChild
- the child Node
to addparent
- the parent Node
in which to add the new Node
index
- the index of insertionpublic int addNode(Node<?> newChild, Node<?> parent)
DataModel
Node
as the last child of the given parent Node
.
addNode
in interface DataModel
newChild
- the Node
to addparent
- the Node
in which to add the new Node
Node
public void saveModel()
DataModel
saveModel
in interface DataModel
public void saveModelAs(URI rootURI)
DataModel
DataModel
, with the given URI
as the root Node
.
saveModelAs
in interface DataModel
rootURI
- the root Node
URI
public void loadModel(URI rootURI)
DataModel
DataModel
from the given root Node
URI
.
loadModel
in interface DataModel
rootURI
- the root Node
URI
public DataModelInformation getDataModelInformation()
DataModel
DataModel
metadata
getDataModelInformation
in interface DataModel
DataModelInformation
of the DataModel
public ModificationState getModificationState()
DataModel
ModificationState
of the DataModel
.
getModificationState
in interface DataModel
ModificationState
of the DataModel
public void setModificationState(ModificationState newState)
DataModel
ModificationState
of the DataModel
to the given new state.
setModificationState
in interface DataModel
newState
- the ModificationState
to set.public void addModificationStateListener(ModificationStateListener listenerToAdd)
DataModel
ModificationStateListener
to the list of listeners.
addModificationStateListener
in interface DataModel
listenerToAdd
- the ModificationStateListener
to addpublic void removeModificationStateListener(ModificationStateListener listenerToRemove)
DataModel
ModificationStateListener
from the list of listeners.
removeModificationStateListener
in interface DataModel
listenerToRemove
- the ModificationStateListener
to removepublic NodeReader<?> getNodeReader(String nodePath)
DataModel
NodeReader
associated with the given file format.
getNodeReader
in interface DataModel
nodePath
- the file format of the node currently read
NodeReader
for the given file formatpublic void addNodeReaderForPath(NodeReader<?> readerToAdd, String nodePath)
DataModel
NodeReader
to the provided node absolute path in the XML file.
addNodeReaderForPath
in interface DataModel
readerToAdd
- the NodeReader
to addnodePath
- the absolute path of the node in the XML filepublic void removeReaderForPath(String nodePath)
DataModel
NodeReader
.
removeReaderForPath
in interface DataModel
nodePath
- the absolute node path in the XML file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |