Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2013-11-06 05:32:00 -0500
committerCamille Letavernier2013-11-06 05:32:00 -0500
commitc12316f0108066bb8bb98afe3c2e25320e356591 (patch)
tree965e9f2db1ebfd32b9a7636af05221051be44c38
parent557638c70e6e215bbd081aa49418c9e262367e33 (diff)
parent67c5c59897e6552e168da2379bc844600ca4969a (diff)
downloadorg.eclipse.papyrus-c12316f0108066bb8bb98afe3c2e25320e356591.tar.gz
org.eclipse.papyrus-c12316f0108066bb8bb98afe3c2e25320e356591.tar.xz
org.eclipse.papyrus-c12316f0108066bb8bb98afe3c2e25320e356591.zip
Merge branch 'master' of
ssh://cletavernie@git.eclipse.org/gitroot/papyrus/org.eclipse.papyrus.git
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/IResourceLoadStateListener.java24
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/NodeEditPart.java1
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/NamedElementEditPart.java320
3 files changed, 183 insertions, 162 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/IResourceLoadStateListener.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/IResourceLoadStateListener.java
new file mode 100644
index 00000000000..71774a10a3d
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/IResourceLoadStateListener.java
@@ -0,0 +1,24 @@
+/*****************************************************************************
+ * 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:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.core.resource;
+
+import org.eclipse.emf.ecore.resource.Resource;
+
+/**
+ * Interface that all listeners to the resource load/unload state should implement. The {@link ModelSet} notifies all these listeners
+ */
+public interface IResourceLoadStateListener {
+
+ void notifyLoadStateChanged(Resource resource, boolean newState);
+
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/NodeEditPart.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/NodeEditPart.java
index b6c93841b1f..17efad531d0 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/NodeEditPart.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/NodeEditPart.java
@@ -135,6 +135,7 @@ public abstract class NodeEditPart extends AbstractBorderedShapeEditPart impleme
refreshLineType();
refreshLineWidth();
refreshTransparency();
+ refreshSVGPath();
}
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/NamedElementEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/NamedElementEditPart.java
index b996fd81b34..3e3d4bfaa01 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/NamedElementEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/NamedElementEditPart.java
@@ -1,162 +1,158 @@
-/*****************************************************************************
- * Copyright (c) 2008 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.uml.diagram.common.editparts;
-
-import org.apache.batik.dom.svg.SVGOMDocument;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.diagram.ui.figures.BorderedNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-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.appearance.helper.AppearanceHelper;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.FollowSVGSymbolEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.NameDisplayEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.service.shape.ShapeService;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.uml2.uml.NamedElement;
-
-/**
- * this editpart manage the font and icon of the name label and qualified name
- * label.
- *
- */
-public abstract class NamedElementEditPart extends UMLNodeEditPart implements IUMLNamedElementEditPart {
-
-
-
- /**
- * {@inheritDoc}
- */
- public NamedElementEditPart(View view) {
- super(view);
- }
-
- public NamedElement getNamedElement() {
- return (NamedElement)getUMLElement();
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- // set the figure active when the feature of the of a class is true
- if(resolveSemanticElement() != null) {
- refreshIconNamedLabel();
- refreshFontColor();
- }
- }
-
- private void refreshIconNamedLabel() {
- getNodeNamedElementFigure().setNameLabelIcon(AppearanceHelper.showElementIcon((View)getModel()));
- }
-
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- if(getNodeNamedElementFigure() != null && resolveSemanticElement() != null) {
- refreshIconNamedLabel();
- refreshFontColor();
- refreshLabelDisplay();
- refreshSVGPath();
- }
- }
-
- @Override
- public void activate() {
- super.activate();
- }
-
-
- protected void refreshLabelDisplay() {
- View view = getNotationView();
- BooleanValueStyle displayNameStyle = (BooleanValueStyle)view.getNamedStyle(NotationPackage.eINSTANCE.getBooleanValueStyle(), NameDisplayEditPolicy.DISPLAY_NAME);
- if(displayNameStyle != null && !displayNameStyle.isBooleanValue()) {
- getNodeNamedElementFigure().removeNameLabel();
- getNodeNamedElementFigure().removeStereotypeLabel();
- getNodeNamedElementFigure().removeTaggedLabel();
- } else {
- getNodeNamedElementFigure().restoreNameLabel();
- getNodeNamedElementFigure().restoreStereotypeLabel();
- getNodeNamedElementFigure().restoreTaggedLabel();
- }
- }
-
-
-
- /**
- * A method to specify the labels to be update when the font is refreshed.
- * Subclasses should call super.refreshLabelsFont(font)
- *
- * @param font
- * the font to use
- */
- @Override
- protected void refreshLabelsFont(Font font) {
- super.refreshLabelsFont(font);
- // Apply the font to the Name Label
- getNodeNamedElementFigure().getNameLabel().setFont(font);
- // Apply the font to the Qualified Name
- if(getNodeNamedElementFigure().getQualifiedNameLabel() != null) {
- getNodeNamedElementFigure().getQualifiedNameLabel().setFont(font);
- }
- // Apply the font to the tagged Label
- if(getNodeNamedElementFigure().getTaggedLabel() != null) {
- getNodeNamedElementFigure().getTaggedLabel().setFont(font);
- }
- }
-
- private IPapyrusNodeNamedElementFigure getNodeNamedElementFigure() {
- return (IPapyrusNodeNamedElementFigure)getPrimaryShape();
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected void setFontColor(Color color) {
- super.setFontColor(color);
- // Qualified Name
- if(getNodeNamedElementFigure().getQualifiedNameLabel() != null) {
- getNodeNamedElementFigure().getQualifiedNameLabel().setForegroundColor(color);
- }
- // TaggedLabel
- if(getNodeNamedElementFigure().getTaggedLabel() != null) {
- getNodeNamedElementFigure().getTaggedLabel().setForegroundColor(color);
- }
- }
-
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(NameDisplayEditPolicy.NAME_DISPLAY_EDITPOLICY, new NameDisplayEditPolicy());
- installEditPolicy(FollowSVGSymbolEditPolicy.FOLLOW_SVG_SYMBOL_EDITPOLICY, new FollowSVGSymbolEditPolicy());
- }
-
- protected NodeFigure createNodeFigure() {
- return new BorderedNodeFigure(createMainFigureWithSVG());
- }
-
-
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 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.uml.diagram.common.editparts;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderedNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+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.appearance.helper.AppearanceHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.FollowSVGSymbolEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.NameDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * this editpart manage the font and icon of the name label and qualified name
+ * label.
+ *
+ */
+public abstract class NamedElementEditPart extends UMLNodeEditPart implements IUMLNamedElementEditPart {
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public NamedElementEditPart(View view) {
+ super(view);
+ }
+
+ public NamedElement getNamedElement() {
+ return (NamedElement)getUMLElement();
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ super.handleNotificationEvent(event);
+
+ // set the figure active when the feature of the of a class is true
+ if(resolveSemanticElement() != null) {
+ refreshIconNamedLabel();
+ refreshFontColor();
+ }
+ }
+
+ private void refreshIconNamedLabel() {
+ getNodeNamedElementFigure().setNameLabelIcon(AppearanceHelper.showElementIcon((View)getModel()));
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ if(getNodeNamedElementFigure() != null && resolveSemanticElement() != null) {
+ refreshIconNamedLabel();
+ refreshFontColor();
+ refreshLabelDisplay();
+ }
+ }
+
+ @Override
+ public void activate() {
+ super.activate();
+ }
+
+
+ protected void refreshLabelDisplay() {
+ View view = getNotationView();
+ BooleanValueStyle displayNameStyle = (BooleanValueStyle)view.getNamedStyle(NotationPackage.eINSTANCE.getBooleanValueStyle(), NameDisplayEditPolicy.DISPLAY_NAME);
+ if(displayNameStyle != null && !displayNameStyle.isBooleanValue()) {
+ getNodeNamedElementFigure().removeNameLabel();
+ getNodeNamedElementFigure().removeStereotypeLabel();
+ getNodeNamedElementFigure().removeTaggedLabel();
+ } else {
+ getNodeNamedElementFigure().restoreNameLabel();
+ getNodeNamedElementFigure().restoreStereotypeLabel();
+ getNodeNamedElementFigure().restoreTaggedLabel();
+ }
+ }
+
+
+
+ /**
+ * A method to specify the labels to be update when the font is refreshed.
+ * Subclasses should call super.refreshLabelsFont(font)
+ *
+ * @param font
+ * the font to use
+ */
+ @Override
+ protected void refreshLabelsFont(Font font) {
+ super.refreshLabelsFont(font);
+ // Apply the font to the Name Label
+ getNodeNamedElementFigure().getNameLabel().setFont(font);
+ // Apply the font to the Qualified Name
+ if(getNodeNamedElementFigure().getQualifiedNameLabel() != null) {
+ getNodeNamedElementFigure().getQualifiedNameLabel().setFont(font);
+ }
+ // Apply the font to the tagged Label
+ if(getNodeNamedElementFigure().getTaggedLabel() != null) {
+ getNodeNamedElementFigure().getTaggedLabel().setFont(font);
+ }
+ }
+
+ private IPapyrusNodeNamedElementFigure getNodeNamedElementFigure() {
+ return (IPapyrusNodeNamedElementFigure)getPrimaryShape();
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setFontColor(Color color) {
+ super.setFontColor(color);
+ // Qualified Name
+ if(getNodeNamedElementFigure().getQualifiedNameLabel() != null) {
+ getNodeNamedElementFigure().getQualifiedNameLabel().setForegroundColor(color);
+ }
+ // TaggedLabel
+ if(getNodeNamedElementFigure().getTaggedLabel() != null) {
+ getNodeNamedElementFigure().getTaggedLabel().setForegroundColor(color);
+ }
+ }
+
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(NameDisplayEditPolicy.NAME_DISPLAY_EDITPOLICY, new NameDisplayEditPolicy());
+ installEditPolicy(FollowSVGSymbolEditPolicy.FOLLOW_SVG_SYMBOL_EDITPOLICY, new FollowSVGSymbolEditPolicy());
+ }
+
+ @Override
+ protected NodeFigure createNodeFigure() {
+ return new BorderedNodeFigure(createMainFigureWithSVG());
+ }
+
+
+
+}

Back to the top