|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.infai.emo.matcher.editor.ModelMatcherCanvas
public class ModelMatcherCanvas
This class includes the canvas and a TableViewer below the canvas.
The canvas is used to draw the matching-lines between the models while the table is intended to show matching details.
Therefore this Class offers various methods for drawing lines, removing and updating them.
There are also methods provided for selecting lines and filling the table with informations.
MouseListener| Field Summary | |
|---|---|
private LineCalculations |
calculator
This variable contains the calculator for the line visualization. |
private org.eclipse.swt.widgets.Canvas |
canvas
The canvas of the editor on which the matching is visualized. |
private org.eclipse.swt.widgets.Composite |
comp
The composite on which the canvas, the tableViewer, ... are placed. |
private ModelMatcherEditor |
editor
The editor which contains this "canvas" (this Class providing the Canvas and the Table) as a component. |
private org.eclipse.swt.graphics.Color |
lineColor
This Color determines the base color for the visualization. |
private java.util.Vector<Line> |
lines
This Vector buffers all the lines that are actually drawn on the canvas. |
private double |
stepSize
This value shows the custom size of the visualization-steps. |
private org.eclipse.swt.widgets.Table |
table
The table that provides detailed matching informations about the matching to the user. |
private org.eclipse.jface.viewers.TableViewer |
tableV
The tableViewer that contains the table below the canvas. |
private double |
threshold
This value shows the threshold for the drawing-operation. |
private org.eclipse.swt.events.PaintListener |
valuePL
The PaintListener for the matching-value that stands beside the currently selected line. |
| Constructor Summary | |
|---|---|
ModelMatcherCanvas(org.eclipse.swt.widgets.Composite parent,
ModelMatcherEditor editor,
int style)
Constructor initializes the canvas and the tableViewer on the given composite. |
|
| Method Summary | |
|---|---|
void |
createGUI()
Creates the graphical appearance of the canvas and the table. |
private void |
createTableItems(Line line)
This method fills the table located under the canvas with the matching-details of the given line. |
void |
drawLine(int yLeft,
int yRight,
Tuple tuple,
double value,
boolean leftToRight)
This method draws a matching-line on the canvas. |
org.eclipse.swt.widgets.Canvas |
getCanvas()
|
ModelMatcherEditor |
getEditor()
|
double |
getStepSize()
|
double |
getThreshold()
|
void |
loadConfigurationData()
Loads the stored configuration for the graphical representation of the matching from the eclipse-preference-store for this plug-in. |
void |
mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseDown(org.eclipse.swt.events.MouseEvent e)
Activated by a click on the canvas. |
void |
mouseUp(org.eclipse.swt.events.MouseEvent e)
|
void |
moveLines(int treeID,
int scrollValue)
This method moves the lines on the canvas in horizontal direction in the case that a tree has been scrolled. |
void |
preferencesChanged()
Method is called after the preferences for the plug-in have changed so that all lines can be redrawn using the new settings. |
private void |
removeLastSelection()
Removes the current selection of a line on the canvas if there is one. |
void |
removeLines()
Removes all Lines from the canvas so that the canvas is prepared for a new set of matching-lines. |
private void |
selectLine(Line line)
Selects the given line by drawing it fat and dashed. |
void |
setLayoutData(java.lang.Object layoutData)
Set the given LayoutData to the composite that lies under the canvas and the table. |
void |
updateLines()
Update the drawn lines in case of a change to the composite (like resizing it). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private org.eclipse.swt.widgets.Canvas canvas
comp,
Canvasprivate org.eclipse.jface.viewers.TableViewer tableV
comp,
TableViewerprivate org.eclipse.swt.widgets.Table table
tableV,
Tableprivate final org.eclipse.swt.widgets.Composite comp
Compositeprivate java.util.Vector<Line> lines
Vector,
Lineprivate double threshold
private double stepSize
private org.eclipse.swt.graphics.Color lineColor
Colorprivate ModelMatcherEditor editor
ModelMatcherEditorprivate org.eclipse.swt.events.PaintListener valuePL
PaintListener,
Lineprivate LineCalculations calculator
LineCalculations,
Line| Constructor Detail |
|---|
public ModelMatcherCanvas(org.eclipse.swt.widgets.Composite parent,
ModelMatcherEditor editor,
int style)
parent - the parent Composite for this part of the editor. On this composite a new one, containing the canvas and the table, will be created.editor - the editor which contains this canvas as a component.style - the SWT-style for the new composite.Composite,
editor,
SWT| Method Detail |
|---|
public void createGUI()
public void setLayoutData(java.lang.Object layoutData)
layoutData - the LayoutData for the composite.Control.setLayoutData(Object)
public void drawLine(int yLeft,
int yRight,
Tuple tuple,
double value,
boolean leftToRight)
yLeft - the y-coordinate of the left ending of the line.yRight - the y-coordinate of the right ending of the line.tuple - the tuple containing the matched Objects that represent the endings of the line.value - the matching-value that belongs to the tuple.lineColor,
Line,
Tuple
public void moveLines(int treeID,
int scrollValue)
treeID - the ID of the tree that was scrolled.scrollValue - the number of pixels the tree was scrolled.ModelMatcherTreeViewer.getTreeID()public void updateLines()
public void removeLines()
lines).
public org.eclipse.swt.widgets.Canvas getCanvas()
canvaspublic double getThreshold()
thresholdpublic double getStepSize()
stepSizepublic void mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
mouseDoubleClick in interface org.eclipse.swt.events.MouseListenerpublic void mouseUp(org.eclipse.swt.events.MouseEvent e)
mouseUp in interface org.eclipse.swt.events.MouseListenerpublic void mouseDown(org.eclipse.swt.events.MouseEvent e)
mouseDown in interface org.eclipse.swt.events.MouseListenerprivate void removeLastSelection()
valuePL is set to null.
private void selectLine(Line line)
valuePL cannot be null.
line - the line to be selected.Lineprivate void createTableItems(Line line)
line - the line of which the comparison-details shall be displayed.Linepublic ModelMatcherEditor getEditor()
editorpublic void loadConfigurationData()
public void preferencesChanged()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||