|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.infai.emo.matcher.editor.ModelMatcherTreeViewer
public class ModelMatcherTreeViewer
This class includes a TreeViewer and a TableViewer.
The TreeViewer is used to display a model that was part of the comparison.
The TableViewer is used to display the properties of a selected item of the TreeViewer, e.g. name, id, ...
TreeViewer
,
TableViewer
,
ISelectionChangedListener
Field Summary | |
---|---|
private org.eclipse.swt.widgets.Composite |
comp
The composite on which the TreeViewer and the tableViewer are placed. |
private org.eclipse.swt.graphics.Color |
currentSelectionColor
This is the color for the highlight and is determined by the line-color of the selected line on the canvas. |
private ModelMatcherEditor |
editor
The editor which contains this "TreeViewer" as a component. |
private Matching |
match
This is the matching that contains the element-tuples and the matching-value for each tuple. |
private org.eclipse.swt.widgets.TreeItem |
root
This is the root-item of the tree (the very first TreeItem). |
private org.eclipse.swt.events.PaintListener |
selectionHighlight
This is the PaintListener for the current highlighted TreeItem. |
private org.eclipse.swt.widgets.Table |
table
The table that lies under the TableViewer and contains the entries. |
private org.eclipse.jface.viewers.TableViewer |
tableV
The TableViewer that displays the properties of a selected TreeItem. |
private org.eclipse.swt.widgets.Tree |
tree
The tree that lies under the TreeViewer and contains the entries. |
private byte |
treeID
The ID for this Tree. |
private Model |
treeModel
The model that contains all elements to be displayed in this tree. |
private org.eclipse.jface.viewers.TreeViewer |
treeV
the TreeViewer that displays the model. |
private int |
treeV_OldHBarSelection
The position of the horizontal ScrollBar of the TreeViewer. |
private int |
treeV_OldVBarSelection
The position of the vertical ScrollBar of the TreeViewer. |
private int |
yPosHighlight
This variable contains the y-coordinate of the selected item. |
Constructor Summary | |
---|---|
ModelMatcherTreeViewer(ModelMatcherEditor editor,
org.eclipse.swt.widgets.Composite parent,
int style,
byte treeID)
The constructor for initializing this component by setting the editor, the style and the treeID. |
Method Summary | |
---|---|
void |
createGUI()
Creates the graphical appearance of the treeViewer and the table. |
private java.lang.String |
createItemName(org.eclipse.emf.ecore.EObject item)
Create a name for the given object. |
void |
createTableItems(org.eclipse.emf.ecore.EObject object)
This method creates the tableItems for a given EObject. |
private void |
createTableItems(org.eclipse.swt.widgets.TreeItem treeItem)
This method creates the tableItems for a selected TreeItem. |
private void |
createTreeItem(org.eclipse.swt.widgets.TreeItem parent,
org.eclipse.emf.ecore.EObject element)
Creates a TreeItem from the given EObject . |
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. |
Matching |
getMatch()
|
int |
getTreeID()
|
Model |
getTreeModel()
|
org.eclipse.jface.viewers.TreeViewer |
getTreeViewer()
|
void |
highlightItem(int y,
org.eclipse.swt.graphics.Color color)
Method for highlighting a TreeItem if a matching-line is selected. |
void |
initInput(Model model,
java.lang.String path)
This method initializes the tree with the given model that resulted of the path given for this model. |
private void |
initTree(org.eclipse.emf.ecore.resource.Resource res,
java.lang.String filePath)
Method adds all the other TreeItems to the root-item. |
void |
removeHighlight()
Method removes the highlight of the currently highlighted TreeItem. |
void |
selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
This method is called if the selection on the Tree has changed. |
void |
setLayoutData(java.lang.Object layoutData)
Sets the CellEditor.LayoutData to the underlying Composite . |
void |
setMatch(Matching match)
|
private void |
visualizeMatchingOnItem(org.eclipse.swt.widgets.TreeItem selection,
double threshold)
This method is responsible for drawing the matching-lines between the TreeItem that was selected in this tree and all the matched TreeItems in the opposite tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private org.eclipse.jface.viewers.TreeViewer treeV
TreeViewer
private org.eclipse.jface.viewers.TableViewer tableV
TableViewer
private org.eclipse.swt.widgets.TreeItem root
TreeItem
private org.eclipse.swt.widgets.Table table
Table
private org.eclipse.swt.widgets.Tree tree
Tree
private org.eclipse.swt.widgets.Composite comp
Composite
private ModelMatcherEditor editor
ModelMatcherEditor
private Matching match
Matching
private Model treeModel
Model
private byte treeID
0
for the left tree.
1
for the right tree.
private int treeV_OldVBarSelection
private int treeV_OldHBarSelection
private org.eclipse.swt.events.PaintListener selectionHighlight
PaintListener
private int yPosHighlight
private org.eclipse.swt.graphics.Color currentSelectionColor
Color
Constructor Detail |
---|
public ModelMatcherTreeViewer(ModelMatcherEditor editor, org.eclipse.swt.widgets.Composite parent, int style, byte treeID)
editor
- the editor that contains this component as a treeViewer.parent
- the editors Container on which the GUI-components can be placed.style
- the style for the Composite that holds the components.treeI
- the treeID for that tree.ModelMatcherEditor
,
Composite
,
SWT
,
getTreeID()
Method Detail |
---|
public void createGUI()
public void initInput(Model model, java.lang.String path)
model
- the model of which the tree will be built.path
- the path of the file out of which the model was read.Model
private void initTree(org.eclipse.emf.ecore.resource.Resource res, java.lang.String filePath)
res
- the model-resource.filePath
- the file path of the model.root
,
Resource
private void createTreeItem(org.eclipse.swt.widgets.TreeItem parent, org.eclipse.emf.ecore.EObject element)
TreeItem
from the given EObject
.
parent
- the TreeItem to append all the read items as children.element
- the model-element of the TreeItem thats children shall be read.TreeItem
,
EObject
private java.lang.String createItemName(org.eclipse.emf.ecore.EObject item)
item
- the item to create the name for.
EClass
,
EStructuralFeature
,
EObject
private void createTableItems(org.eclipse.swt.widgets.TreeItem treeItem)
treeItem
- the selected TreeItem which's Data-Object is the EObject from which the TreeItem was built.EObject
,
table
,
TreeItem
,
Widget.getData()
public void createTableItems(org.eclipse.emf.ecore.EObject object)
object
- the EObject which contains the informations for the table.table
,
EObject
public void setLayoutData(java.lang.Object layoutData)
CellEditor.LayoutData
to the underlying Composite
.
layoutData
- the LayoutData for the Composite.public void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
Tree
has changed.
selectionChanged
in interface org.eclipse.jface.viewers.ISelectionChangedListener
event
- the event that contains the source of the change.SelectionChangedEvent
private void visualizeMatchingOnItem(org.eclipse.swt.widgets.TreeItem selection, double threshold)
selection
- the selected TreeItem.threshold
- the threshold for drawing the lines.TreeItem
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 Matching getMatch()
Matching
public void setMatch(Matching match)
match
- the matching between the models.Matching
public int getTreeID()
treeID
public org.eclipse.jface.viewers.TreeViewer getTreeViewer()
TreeViewer
,
Tree
public Model getTreeModel()
Model
,
treeModel
public void highlightItem(int y, org.eclipse.swt.graphics.Color color)
y
- the y-coordinate of the matching-line that was selected so that the corresponding TreeItem can be found.color
- the color of the line so that this color can also be used for the highlight.Color
public void removeHighlight()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |