public class ComparisonModel
extends java.lang.Object
Constructor and Description |
---|
ComparisonModel(java.io.File leftFile,
java.io.File rightFile,
ComparedElement comparedRoot)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addComparedElement(ComparedElement compElement)
Add a compared element which is in the comparison.
|
int |
countDifferences()
Count the number of differences.
|
ComparedElement |
getComparedElement()
Return the root compared element.
|
javax.swing.tree.DefaultMutableTreeNode |
getComparedTreeNode(boolean isLeft)
Return the root tree node associated with the left or right root node of the comparison.
|
char |
getComparisonState()
Return the comparison state.
|
int |
getCurrentDifference()
Return the current diffeence index.
|
java.util.List<ComparedElement> |
getDifferences()
Return the list of differences in the comparison result.
|
java.util.Map<XMLNodeKey,ComparedElement> |
getKeyToComparedElement()
Return the map of keys to elements.
|
ComparedElement |
getKeyToComparedElement(XMLNodeKey key)
Return the element corresponding to a key.
|
java.io.File |
getLeftFile()
Return the left file.
|
org.mdiutil.xml.tree.XMLNode |
getLeftRootNode()
Return the left root node of the comparison.
|
javax.swing.JTree |
getLeftTree()
Return the left tree.
|
javax.swing.tree.DefaultTreeModel |
getLeftTreeModel()
Return the tree model for the left tree
|
java.io.File |
getRightFile()
Return the right file.
|
org.mdiutil.xml.tree.XMLNode |
getRightRootNode()
Return the right root node of the comparison.
|
javax.swing.JTree |
getRightTree()
Return the right tree.
|
javax.swing.tree.DefaultTreeModel |
getRightTreeModel()
Return the tree model for the right tree
|
javax.swing.tree.DefaultTreeModel |
getTreeModel(boolean isLeftTree)
Return the tree model for the left or right tree.
|
boolean |
hasDifferences()
Return true if there are differences.
|
boolean |
hasNextDifference()
Return true if there is a next difference.
|
boolean |
hasPreviousDifference()
Return true if there is a previous difference.
|
void |
initCurrentDifference()
Initialize the current difference index.
|
ComparedElement |
nextDifference()
Return the next difference.
|
ComparedElement |
previousDifference()
Return the previous difference.
|
void |
setLeftTree(javax.swing.JTree leftTree)
Set the left tree.
|
void |
setLeftTreeModel(javax.swing.tree.DefaultTreeModel leftTreeModel)
Set the tree model for the left tree
|
void |
setRightTree(javax.swing.JTree rightTree)
Set the right tree.
|
void |
setRightTreeModel(javax.swing.tree.DefaultTreeModel rightTreeModel)
Set the tree model for the right tree
|
void |
setTree(javax.swing.JTree tree,
boolean isLeftTree)
Set the left or right tree.
|
void |
setTreeModel(javax.swing.tree.DefaultTreeModel treeModel,
boolean isLeftTree)
Set the tree model for the left or right tree.
|
public ComparisonModel(java.io.File leftFile, java.io.File rightFile, ComparedElement comparedRoot)
leftFile
- the left filerightFile
- the right filecomparedRoot
- the root element of the comparisonpublic java.io.File getLeftFile()
public java.io.File getRightFile()
public void setTreeModel(javax.swing.tree.DefaultTreeModel treeModel, boolean isLeftTree)
treeModel
- the tree modelisLeftTree
- true for the left treepublic void setLeftTreeModel(javax.swing.tree.DefaultTreeModel leftTreeModel)
leftTreeModel
- the tree modelpublic void setRightTreeModel(javax.swing.tree.DefaultTreeModel rightTreeModel)
rightTreeModel
- the tree modelpublic javax.swing.tree.DefaultTreeModel getTreeModel(boolean isLeftTree)
isLeftTree
- true for the left treepublic javax.swing.tree.DefaultTreeModel getLeftTreeModel()
public javax.swing.tree.DefaultTreeModel getRightTreeModel()
public void setTree(javax.swing.JTree tree, boolean isLeftTree)
tree
- the treeisLeftTree
- true for the left treepublic void setLeftTree(javax.swing.JTree leftTree)
leftTree
- the left treepublic javax.swing.JTree getLeftTree()
public void setRightTree(javax.swing.JTree rightTree)
rightTree
- the left rightpublic javax.swing.JTree getRightTree()
public org.mdiutil.xml.tree.XMLNode getLeftRootNode()
public org.mdiutil.xml.tree.XMLNode getRightRootNode()
public ComparedElement getComparedElement()
public javax.swing.tree.DefaultMutableTreeNode getComparedTreeNode(boolean isLeft)
isLeft
- true for the left nodepublic void addComparedElement(ComparedElement compElement)
compElement
- the elementpublic char getComparisonState()
NodeState.STATE_UNCHANGED
or NodeState.STATE_UPDATED
.public java.util.List<ComparedElement> getDifferences()
public void initCurrentDifference()
public int countDifferences()
public boolean hasDifferences()
public int getCurrentDifference()
public boolean hasPreviousDifference()
public ComparedElement previousDifference()
public boolean hasNextDifference()
public ComparedElement nextDifference()
public java.util.Map<XMLNodeKey,ComparedElement> getKeyToComparedElement()
public ComparedElement getKeyToComparedElement(XMLNodeKey key)
key
- the keyCopyright © 2024 HervĂ© Girod. All Rights Reserved. Documentation and source under the BSD licence