Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2014-03-26 06:50:08 -0400
committerAnsgar Radermacher2014-03-26 06:51:08 -0400
commit4b792febd196f5ce69e9c256aa7bbc97937b0388 (patch)
tree5f9ed376f6d8b6091109cee224e09c9d73100180 /plugins/developer/org.eclipse.papyrus.gmf.figureview
parent23294784baa4b44b783a2f76855acb7b87e2de83 (diff)
downloadorg.eclipse.papyrus-4b792febd196f5ce69e9c256aa7bbc97937b0388.tar.gz
org.eclipse.papyrus-4b792febd196f5ce69e9c256aa7bbc97937b0388.tar.xz
org.eclipse.papyrus-4b792febd196f5ce69e9c256aa7bbc97937b0388.zip
Bug 431011 - [Class Diagram] Model element has no borders on linux
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.gmf.figureview')
-rw-r--r--plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureHierarchyView.java11
-rw-r--r--plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureLabelProvider.java27
2 files changed, 29 insertions, 9 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureHierarchyView.java b/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureHierarchyView.java
index fec6cb57121..755feb0c2e8 100644
--- a/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureHierarchyView.java
+++ b/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureHierarchyView.java
@@ -113,17 +113,20 @@ public class FigureHierarchyView extends ViewPart {
viewer.getTree().setLinesVisible(true);
TreeColumn tcName = new TreeColumn(viewer.getTree(), SWT.LEFT);
- tcName.setText("Figure");
+ tcName.setText("Figure"); //$NON-NLS-1$
tcName.setWidth(300);
TreeColumn tcFigBounds = new TreeColumn(viewer.getTree(), SWT.LEFT);
- tcFigBounds.setText("Figure bounds");
+ tcFigBounds.setText("Figure bounds"); //$NON-NLS-1$
tcFigBounds.setWidth(250);
TreeColumn tcLayoutManager = new TreeColumn(viewer.getTree(), SWT.LEFT);
- tcLayoutManager.setText("Layout manager");
+ tcLayoutManager.setText("Layout manager"); //$NON-NLS-1$
tcLayoutManager.setWidth(150);
TreeColumn tcBorder = new TreeColumn(viewer.getTree(), SWT.LEFT);
- tcBorder.setText("Border");
+ tcBorder.setText("Border (width)"); //$NON-NLS-1$
tcBorder.setWidth(150);
+ TreeColumn tcLineWidth = new TreeColumn(viewer.getTree(), SWT.LEFT);
+ tcLineWidth.setText("Line width"); //$NON-NLS-1$
+ tcLineWidth.setWidth(100);
}
@Override
diff --git a/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureLabelProvider.java b/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureLabelProvider.java
index 82b875b34d1..4f3a7784769 100644
--- a/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureLabelProvider.java
+++ b/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureLabelProvider.java
@@ -15,6 +15,9 @@
package org.eclipse.papyrus.gmf.figureview.view;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.LineBorder;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITableColorProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
@@ -52,7 +55,7 @@ public class FigureLabelProvider implements ITableLabelProvider, ITableColorProv
switch(columnIndex) {
case 0:
String name = figure.getClass().getName();
- int index = name.lastIndexOf(".");
+ int index = name.lastIndexOf("."); //$NON-NLS-1$
if(index == -1) {
return name;
}
@@ -66,18 +69,32 @@ public class FigureLabelProvider implements ITableLabelProvider, ITableColorProv
return figure.getLayoutManager().getClass().getSimpleName();
}
else {
- return "no layout manager";
+ return "none"; //$NON-NLS-1$
}
case 3:
if(figure.getBorder() != null) {
- return figure.getBorder().getClass().getSimpleName();
+ String borderInfo = figure.getBorder().getClass().getSimpleName();
+ if (figure.getBorder() instanceof LineBorder) {
+ borderInfo += String.format(" (%d)", ((LineBorder) figure.getBorder()).getWidth()); //$NON-NLS-1$
+ }
+ return borderInfo;
}
else {
- return "no border";
+ return "no border"; //$NON-NLS-1$
+ }
+ case 4:
+ if (figure instanceof Shape) {
+ return String.format("%d", ((Shape) figure).getLineWidth()); //$NON-NLS-1$
+ }
+ else if (figure instanceof NodeFigure) {
+ return String.format("%d", ((NodeFigure) figure).getLineWidth()); //$NON-NLS-1$
+ }
+ else {
+ return "not avail"; //$NON-NLS-1$
}
}
}
- return "cannot display element: " + element;
+ return "cannot display element: " + element; //$NON-NLS-1$
}
public Image getColumnImage(Object element, int columnIndex) {

Back to the top