|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.infai.emo.matcher.editor.pages.DifferencePage
public class DifferencePage
This class describes the page of the ModelMatcherEditor
that contains the mapping and the difference-model.
It consists of two trees at the top of the page that are connected with a canvas and a tree that contains the diff-model at the bottom.
Composite
Field Summary | |
---|---|
private org.eclipse.swt.widgets.Composite |
comp
The Composite on which the GUI is placed. |
private org.eclipse.jface.viewers.TreeViewer |
differencesTreeV
The TreeViewer which contains the diff-model. |
private DiffModel |
diffModel
This model contains the differences of both input-models. |
private ModelMatcherEditor |
editor
The editor that contains this page. |
private org.eclipse.swt.widgets.Tree |
leftTree
The tree which contains the left model of the mapping. |
private org.eclipse.jface.viewers.TreeViewer |
leftTreeV
The TreeViewer which contains the tree for the left model of the mapping. |
private int |
leftTreeV_OldVBarSelection
The position of the vertical ScrollBar of the leftTreeV . |
private java.util.Vector<Line> |
lines
This Vector contains all currently drawn mapping-lines from the sash. |
private MapModel |
mapModel
The model that contains the mapping between both compared input-models. |
private org.eclipse.swt.widgets.Tree |
rightTree
The tree which contains the right model of the mapping. |
private org.eclipse.jface.viewers.TreeViewer |
rightTreeV
The TreeViewer which contains the tree for the right model of the mapping. |
private int |
rightTreeV_OldVBarSelection
The position of the vertical ScrollBar of the rightTreeV . |
private org.eclipse.swt.widgets.Sash |
sash
This is the sash that divides the mapping-part of this page. |
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
DifferencePage(org.eclipse.swt.widgets.Composite parent,
int style,
ModelMatcherEditor e)
The constructor for creating a new DifferencePage . |
Method Summary | |
---|---|
private void |
analyseGroup(Group group,
org.eclipse.swt.widgets.TreeItem groupItem)
Method analyzes a Group-element from the diff-model and builds its children in the tree. |
private org.eclipse.swt.widgets.TreeItem |
createDiffTreeItem(org.eclipse.swt.widgets.TreeItem parentItem,
DiffElement element)
This method creates a single element for the differencesTreeV . |
private java.lang.String |
createItemName(org.eclipse.emf.ecore.EObject item)
Create a name for the given object. |
private boolean |
diffContainsGroups(org.eclipse.emf.common.util.EList<DiffElement> diffElements)
Determines whether the diff-model contains any group-elements. |
private void |
drawLine(org.eclipse.emf.ecore.EObject leftElement,
org.eclipse.emf.ecore.EObject rightElement,
java.util.Vector<org.eclipse.swt.widgets.TreeItem> leftTreeItems,
java.util.Vector<org.eclipse.swt.widgets.TreeItem> rightTreeItems)
This method draws a line between two model-elements on the sash. |
private void |
drawLines(java.util.Vector<org.eclipse.swt.widgets.TreeItem> leftTreeItems,
java.util.Vector<org.eclipse.swt.widgets.TreeItem> rightTreeItems)
This method draws the lines between all mapped elements of the mapModel . |
private java.util.Vector<org.eclipse.swt.widgets.TreeItem> |
getAllTreeItems(org.eclipse.swt.widgets.TreeItem parent)
This method reads out all TreeItems of this tree. |
DiffModel |
getDiffModel()
|
MapModel |
getMappingModel()
|
void |
initLeftTree(Model model,
java.lang.String path)
This method initializes the left tree with the given model that resulted of the path given for this model. |
void |
initMappingAndDiff()
This method initializes the Mapping and the diff-model between the input-models. |
void |
initRightTree(Model model,
java.lang.String path)
This method initializes the right tree with the given model that resulted of the path given for this model. |
private void |
moveLines(int treeID,
int amount)
Method is called if one of the trees is scrolled vertically. |
private java.util.Vector<org.eclipse.swt.widgets.TreeItem> |
removeChildrenLines(org.eclipse.swt.widgets.TreeItem parent,
java.util.Vector<org.eclipse.swt.widgets.TreeItem> treeItems)
Method removes all mapping-lines that are of a lower-level than the parent-element. |
void |
removeLines()
Mehtod removes all lines from the sash. |
private void |
showDifferences(DiffModel diffModel)
This method fills the differencesTreeV with the calculated differences between both models. |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Control |
---|
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private ModelMatcherEditor editor
ModelMatcherEditor
private org.eclipse.swt.widgets.Composite comp
Composite
private org.eclipse.jface.viewers.TreeViewer leftTreeV
TreeViewer
,
leftTree
private org.eclipse.jface.viewers.TreeViewer rightTreeV
TreeViewer
,
rightTree
private org.eclipse.jface.viewers.TreeViewer differencesTreeV
TreeViewer
private org.eclipse.swt.widgets.Tree leftTree
Tree
private org.eclipse.swt.widgets.Tree rightTree
Tree
private org.eclipse.swt.widgets.Sash sash
leftTreeV
and rightTreeV
.
Sash
private java.util.Vector<Line> lines
Vector
,
Sash
,
Line
private int leftTreeV_OldVBarSelection
leftTreeV
.
private int rightTreeV_OldVBarSelection
rightTreeV
.
private MapModel mapModel
MapModel
private DiffModel diffModel
DiffModel
Constructor Detail |
---|
public DifferencePage(org.eclipse.swt.widgets.Composite parent, int style, ModelMatcherEditor e)
DifferencePage
.
parent
- the composite on which the page shall be placed.style
- the style for the page.e
- the editor which contains this pageComposite
,
SWT
,
ModelMatcherEditor
Method Detail |
---|
public MapModel getMappingModel()
public DiffModel getDiffModel()
public void initMappingAndDiff()
private java.util.Vector<org.eclipse.swt.widgets.TreeItem> removeChildrenLines(org.eclipse.swt.widgets.TreeItem parent, java.util.Vector<org.eclipse.swt.widgets.TreeItem> treeItems)
parent
- the treeItem whichs mapping-lines shall be removed from the sash.treeItems
- the Vector that contains the tree from which the children can be determined.
TreeItem
,
Vector
private void drawLine(org.eclipse.emf.ecore.EObject leftElement, org.eclipse.emf.ecore.EObject rightElement, java.util.Vector<org.eclipse.swt.widgets.TreeItem> leftTreeItems, java.util.Vector<org.eclipse.swt.widgets.TreeItem> rightTreeItems)
leftElement
- the element that is the left ending for the line.rightElement
- the element that is the right ending for the line.leftTreeItems
- the vector which contains all tree-items of the left model.rightTreeItems
- the vector which contains all tree-items of the right model.EObject
,
Vector
private void drawLines(java.util.Vector<org.eclipse.swt.widgets.TreeItem> leftTreeItems, java.util.Vector<org.eclipse.swt.widgets.TreeItem> rightTreeItems)
mapModel
.drawLine(EObject, EObject, Vector, Vector)
for each pair of elements.
leftTreeItems
- the vector which contains all tree-items of the left model.rightTreeItems
- the vector which contains all tree-items of the right model.Vector
private void moveLines(int treeID, int amount)
treeID
- the ID of the tree that was scrolled. This influences the ending of the lines which will be moved.amount
- the scroll-value for the tree.ModelMatcherTreeViewer.getTreeID()
private java.util.Vector<org.eclipse.swt.widgets.TreeItem> getAllTreeItems(org.eclipse.swt.widgets.TreeItem parent)
parent
- the TreeItem that shall be the entry-point for tree.TreeItem
,
Vector
public void initLeftTree(Model model, java.lang.String path)
model
- the model from which the tree will be built.path
- the path of the file out of which the model was read.Model
public void initRightTree(Model model, java.lang.String path)
model
- the model from which the tree will be built.path
- the path of the file out of which the model was read.Model
public void removeLines()
private void showDifferences(DiffModel diffModel)
differencesTreeV
with the calculated differences between both models.
diffModel
- the model that contains the differences.DiffModel
private void analyseGroup(Group group, org.eclipse.swt.widgets.TreeItem groupItem)
group
- the group that has to be calculated.groupItem
- the treeItem that represents the group in the differencesTreeV
.Group
,
TreeItem
private org.eclipse.swt.widgets.TreeItem createDiffTreeItem(org.eclipse.swt.widgets.TreeItem parentItem, DiffElement element)
differencesTreeV
.
parentItem
- the item which will be the parent for the created item in the tree-notation.element
- the element from the difference-model which contains all information about the change.
TreeItem
,
DiffElement
private java.lang.String createItemName(org.eclipse.emf.ecore.EObject item)
item
- the item to create the name for.
EClass
,
EStructuralFeature
,
EObject
private boolean diffContainsGroups(org.eclipse.emf.common.util.EList<DiffElement> diffElements)
diffElements
- a list that contains all diff-elements.
Group
,
EList
,
DiffElement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |