Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/gmfdiag')
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSModelElement.java15
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/PapyrusLabelEditPart.java20
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/PapyrusWrappingLabel.java2
3 files changed, 22 insertions, 15 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSModelElement.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSModelElement.java
index 3c91af3e1f9..df00838d2fb 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSModelElement.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSModelElement.java
@@ -8,7 +8,7 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- * Mickaël Adam (ALL4TEC) mickael.adam@all4tec.net - bug 429642
+ * Micka�l Adam (ALL4TEC) mickael.adam@all4tec.net - bug 429642
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.css.properties.modelelement;
@@ -70,7 +70,9 @@ public class CSSModelElement extends CustomStyleModelElement {
@Override
public IObservable doGetObservable(String propertyPath) {
if (CSSStyles.CSS_DIAGRAM_STYLESHEETS_KEY.equals(propertyPath)) {
- return new DiagramStyleSheetObservableList((View) source, domain, propertyPath);
+ if (source instanceof View){
+ return new DiagramStyleSheetObservableList((View) source, domain, propertyPath);
+ }
}
if (CSSStyles.CSS_MODEL_STYLESHEETS_KEY.equals(propertyPath)) {
// Get the resource
@@ -96,9 +98,12 @@ public class CSSModelElement extends CustomStyleModelElement {
Activator.log.error(e);
}
// Initialize the adapter of the engine to listen model styleSheet
- ExtendedCSSEngine engine = ((CSSNotationResource) notationResource).getModelEngine();
- if (engine instanceof ModelCSSEngine) {
- ((ModelCSSEngine) engine).initAdapter();
+ if (notationResource instanceof CSSNotationResource ){
+ ExtendedCSSEngine engine = ((CSSNotationResource) notationResource).getModelEngine();
+
+ if (engine instanceof ModelCSSEngine) {
+ ((ModelCSSEngine) engine).initAdapter();
+ }
}
}
return new ModelStyleSheetObservableList(notationResource, modelStyleSheetsSource.getStylesheets(), domain, modelStyleSheetsSource, StylesheetsPackage.Literals.MODEL_STYLE_SHEETS__STYLESHEETS);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/PapyrusLabelEditPart.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/PapyrusLabelEditPart.java
index bfb924e4a7b..208b2876c81 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/PapyrusLabelEditPart.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/PapyrusLabelEditPart.java
@@ -47,29 +47,29 @@ public abstract class PapyrusLabelEditPart extends LabelEditPart {
/**
* Default Margin when not present in CSS
*/
- static final int DEFAULT_MARGIN = 1;
+ static final int DEFAULT_MARGIN = 0;
/**
* CSS Integer property to define the horizontal Label Margin
*/
- static final String X_MARGIN_PROPERTY = "xMarginLabel";
+ static final String X_MARGIN_PROPERTY = "xMarginLabel"; //$NON-NLS$
/**
* CSS Integer property to define the vertical Label Margin
*/
- static final String Y_MARGIN_PROPERTY = "yMarginLabel";
+ static final String Y_MARGIN_PROPERTY = "yMarginLabel"; //$NON-NLS$
/** The Constant TEXT_ALIGNMENT. */
- private static final String TEXT_ALIGNMENT = "textAlignment";
+ private static final String TEXT_ALIGNMENT = "textAlignment"; //$NON-NLS$
/** The Constant LABEL_OFFSET_Y. */
- private static final String LABEL_OFFSET_Y = "labelOffsetY";
+ private static final String LABEL_OFFSET_Y = "labelOffsetY"; //$NON-NLS$
/** The Constant LABEL_OFFSET_X. */
- private static final String LABEL_OFFSET_X = "labelOffsetX";
+ private static final String LABEL_OFFSET_X = "labelOffsetX"; //$NON-NLS$
/** The Constant LABEL_CONSTRAINED. */
- private static final String LABEL_CONSTRAINED = "labelConstrained";
+ private static final String LABEL_CONSTRAINED = "labelConstrained"; //$NON-NLS$
/** The label locator. */
protected PapyrusLabelLocator labelLocator;
@@ -363,14 +363,14 @@ public abstract class PapyrusLabelEditPart extends LabelEditPart {
if (model instanceof View) {
- horizontalMargin = NotationUtils.getIntValue((View) model, X_MARGIN_PROPERTY, DEFAULT_MARGIN);
- verticalMargin = NotationUtils.getIntValue((View) model, Y_MARGIN_PROPERTY, DEFAULT_MARGIN);
+ horizontalMargin = NotationUtils.getIntValue((View) model, Y_MARGIN_PROPERTY, DEFAULT_MARGIN);
+ verticalMargin = NotationUtils.getIntValue((View) model, X_MARGIN_PROPERTY, DEFAULT_MARGIN);
}
figure = ((GraphicalEditPart) this).getFigure();
if (figure instanceof IPapyrusWrappingLabel) {
- ((IPapyrusWrappingLabel) figure).setMarginLabel(horizontalMargin, verticalMargin);
+ ((IPapyrusWrappingLabel) figure).setMarginLabel(verticalMargin,horizontalMargin);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/PapyrusWrappingLabel.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/PapyrusWrappingLabel.java
index 52b4b352ba3..d583195b9b2 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/PapyrusWrappingLabel.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/PapyrusWrappingLabel.java
@@ -59,6 +59,8 @@ public class PapyrusWrappingLabel extends WrappingLabel implements IPapyrusWrapp
MarginBorder mb = new MarginBorder(xMargin, yMargin, xMargin, yMargin);
this.setBorder(mb);
+ repaint();
+ revalidate();

Back to the top