Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ShapeDisplayCompartmentEditPart.java2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/FollowSVGSymbolEditPolicy.java225
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/ShapeDecorator.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/src/org/eclipse/papyrus/uml/diagram/symbols/provider/TypedElementShapeProvider.java2
6 files changed, 92 insertions, 145 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
index 0af5873c0fb..2e793117fb1 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
@@ -48,9 +48,9 @@ Require-Bundle: org.eclipse.emf.edit.ui;bundle-version="2.5.0",
org.eclipse.papyrus.uml.tools;bundle-version="0.10.1",
org.apache.batik.util;bundle-version="[1.6.0,1.7.0)",
org.apache.batik.svggen;bundle-version="[1.6.0,1.7.0)",
- org.w3c.dom.svg,
+ org.w3c.dom.svg;bundle-version="1.1.0",
org.apache.batik.dom.svg;bundle-version="[1.6.0,1.7.0)",
- org.apache.batik.dom;bundle-version="1.6.0",
+ org.apache.batik.dom;bundle-version="[1.6.0,1.7.0)",
org.apache.batik.xml;bundle-version="[1.6.0,1.7.0)"
Bundle-Vendor: %providerName
Bundle-Version: 0.10.1.qualifier
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ShapeDisplayCompartmentEditPart.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ShapeDisplayCompartmentEditPart.java
index 84769c96c65..8a31d568a5a 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ShapeDisplayCompartmentEditPart.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ShapeDisplayCompartmentEditPart.java
@@ -170,7 +170,7 @@ public class ShapeDisplayCompartmentEditPart extends ResizableCompartmentEditPar
if(shapesToDisplay != null && !shapesToDisplay.isEmpty()) {
for(RenderedImage image : shapesToDisplay) {
if(image != null) {
- IFigure imageFigure = new BorderedScalableImageFigure(image, false, false, true);
+ IFigure imageFigure = new BorderedScalableImageFigure(image, false, true, true);
imageFigure.setOpaque(false);
imageFigure.setVisible(true);
contentPane.add(imageFigure);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/FollowSVGSymbolEditPolicy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/FollowSVGSymbolEditPolicy.java
index bb187a958ea..4cdcc3e8d69 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/FollowSVGSymbolEditPolicy.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/FollowSVGSymbolEditPolicy.java
@@ -1,139 +1,86 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.common.editpolicies;
-
-import org.eclipse.core.databinding.observable.ChangeEvent;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.BooleanValueStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.papyrus.infra.gmfdiag.common.databinding.custom.CustomBooleanStyleObservableValue;
-
-/**
- * this edit policy has in charge to display follow the symbol associated to the node
- * associated figure has to be a {@link NodeNamedElementFigure}
- */
-public class FollowSVGSymbolEditPolicy extends GraphicalEditPolicy implements IChangeListener {
- /**
- * name of the style to get for follow the Symbol
- */
- public static final String FOLLOW_SVG_SYMBOL = "FollowSVGSymbol";
-
- /** key for this edit policy */
- public final static String FOLLOW_SVG_SYMBOL_EDITPOLICY = "followSVGSymbolEditPolicy";
-
- protected IObservableValue styleObservable;
-
-
-
- /**
- * Creates a new QualifiedNameDisplayEditPolicy
- */
- public FollowSVGSymbolEditPolicy() {
- super();
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void activate() {
- // retrieve the view and the element managed by the edit part
- View view = (View)getHost().getModel();
- if(view == null) {
- return;
- }
-
- styleObservable = new CustomBooleanStyleObservableValue(view, EMFHelper.resolveEditingDomain(view), FOLLOW_SVG_SYMBOL);
- styleObservable.addChangeListener(this);
-
- refreshFigure();
- }
-
-
- /**
- * refresh the qualified name
- */
- protected void refreshFigure() {
- if(getHost() instanceof GraphicalEditPart) {
- GraphicalEditPart editPart=(GraphicalEditPart)getHost();
- BooleanValueStyle followStyle=getFollowSymbolStyle(editPart.getNotationView());
- if(followStyle!=null && followStyle.isBooleanValue()==true){
- final IFigure fig=getHostFigure();
-
-
-
-
-
- System.err.println(fig);
-
-
- }
- }
- }
-
- /**
- *
- * @param currentView
- * @return the current Style that repersent the boder
- */
- protected BooleanValueStyle getFollowSymbolStyle(View currentView){
- return (BooleanValueStyle)currentView.getNamedStyle(NotationPackage.eINSTANCE.getBooleanValueStyle(),FOLLOW_SVG_SYMBOL);
-
- }
- /**
- *
- * {@inheritDoc}
- */
- public void deactivate() {
- // retrieve the view and the element managed by the edit part
- View view = (View)getHost().getModel();
- if(view == null) {
- return;
- }
- if(styleObservable != null) {
- styleObservable.removeChangeListener(this);
- styleObservable.dispose();
- styleObservable = null;
- }
-
- }
-
-
- /**
- * Gets the diagram event broker from the editing domain.
- *
- * @return the diagram event broker
- */
- protected DiagramEventBroker getDiagramEventBroker() {
- TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(theEditingDomain != null) {
- return DiagramEventBroker.getInstance(theEditingDomain);
- }
- return null;
- }
-
- public void handleChange(ChangeEvent event) {
- getHost().refresh();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.editpolicies;
+
+import org.eclipse.core.databinding.observable.ChangeEvent;
+import org.eclipse.core.databinding.observable.IChangeListener;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.databinding.custom.CustomBooleanStyleObservableValue;
+
+/**
+ * this edit policy has in charge to display follow the symbol associated to the node
+ * associated figure has to be a {@link NodeNamedElementFigure}
+ */
+public class FollowSVGSymbolEditPolicy extends GraphicalEditPolicy implements IChangeListener {
+
+ /**
+ * name of the style to get for follow the Symbol
+ */
+ public static final String FOLLOW_SVG_SYMBOL = "followSVGSymbol";
+
+ /** key for this edit policy */
+ public final static String FOLLOW_SVG_SYMBOL_EDITPOLICY = "followSVGSymbolEditPolicy";
+
+ protected IObservableValue styleObservable;
+
+ /**
+ * Creates a new QualifiedNameDisplayEditPolicy
+ */
+ public FollowSVGSymbolEditPolicy() {
+ super();
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public void activate() {
+ // retrieve the view and the element managed by the edit part
+ View view = (View)getHost().getModel();
+ if(view == null) {
+ return;
+ }
+
+ styleObservable = new CustomBooleanStyleObservableValue(view, EMFHelper.resolveEditingDomain(view), FOLLOW_SVG_SYMBOL);
+ styleObservable.addChangeListener(this);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public void deactivate() {
+ // retrieve the view and the element managed by the edit part
+ View view = (View)getHost().getModel();
+ if(view == null) {
+ return;
+ }
+ if(styleObservable != null) {
+ styleObservable.removeChangeListener(this);
+ styleObservable.dispose();
+ styleObservable = null;
+ }
+ }
+
+ @Override
+ public void handleChange(ChangeEvent event) {
+ getHost().refresh();
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/ShapeDecorator.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/ShapeDecorator.java
index ace3701747a..860946c90ff 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/ShapeDecorator.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/ShapeDecorator.java
@@ -163,7 +163,7 @@ public class ShapeDecorator extends AbstractDecorator implements NotificationLis
figure.setLayoutManager(new ShapeFlowLayout());
for(RenderedImage image : shapesToDisplay) {
- BorderedScalableImageFigure subFigure = new BorderedScalableImageFigure(image, false, false, true);
+ BorderedScalableImageFigure subFigure = new BorderedScalableImageFigure(image, false, true, true);
figure.add(subFigure);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/META-INF/MANIFEST.MF
index 246e03c661a..e50d4c789ec 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/META-INF/MANIFEST.MF
@@ -17,7 +17,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.uml.diagram.common;bundle-version="0.10.1",
org.eclipse.papyrus.uml.appearance;bundle-version="0.10.1",
org.eclipse.papyrus.infra.emf;bundle-version="0.10.1",
- org.w3c.dom.svg
+ org.w3c.dom.svg;bundle-version="1.1.0"
Export-Package: org.eclipse.papyrus.uml.diagram.symbols,
org.eclipse.papyrus.uml.diagram.symbols.provider
Bundle-Vendor: %Bundle-Vendor
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/src/org/eclipse/papyrus/uml/diagram/symbols/provider/TypedElementShapeProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/src/org/eclipse/papyrus/uml/diagram/symbols/provider/TypedElementShapeProvider.java
index ba54ee4b8be..761930945f5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/src/org/eclipse/papyrus/uml/diagram/symbols/provider/TypedElementShapeProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/src/org/eclipse/papyrus/uml/diagram/symbols/provider/TypedElementShapeProvider.java
@@ -59,7 +59,7 @@ public class TypedElementShapeProvider extends AbstractShapeProvider {
if(path != null && path.length() > 0) {
List<SVGDocument> documents = getSVGDocument(view);
- if(!documents.isEmpty()) {
+ if(documents != null && !documents.isEmpty()) {
List<RenderedImage> result = new LinkedList<RenderedImage>();
for(SVGDocument document : documents) {
if(document == null) {

Back to the top