Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorytanguy2011-12-14 10:03:18 +0000
committerytanguy2011-12-14 10:03:18 +0000
commit2790a6adf555857f141392e8e14c92c226e05a50 (patch)
tree7e358ee4bd073fb0543484af6b5da6dc291acb53 /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common
parentabe0d45355c09b4cdd2a6c684b221c747115860a (diff)
downloadorg.eclipse.papyrus-2790a6adf555857f141392e8e14c92c226e05a50.tar.gz
org.eclipse.papyrus-2790a6adf555857f141392e8e14c92c226e05a50.tar.xz
org.eclipse.papyrus-2790a6adf555857f141392e8e14c92c226e05a50.zip
366675: [SysML Internal Block Diagram] Invisible label may prevent other element selection
https://bugs.eclipse.org/bugs/show_bug.cgi?id=366675 366676: [SysML Block Definition Diagram] Invisible label may prevent other element selection https://bugs.eclipse.org/bugs/show_bug.cgi?id=366676
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeWrappingLabelFigure.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusWrappingLabel.java48
2 files changed, 50 insertions, 3 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeWrappingLabelFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeWrappingLabelFigure.java
index 29153f39c49..98e9f2d94b0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeWrappingLabelFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeWrappingLabelFigure.java
@@ -14,13 +14,12 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.figure.node;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
import org.eclipse.swt.graphics.Image;
/**
- * This a wrappingLebel that can display applied stereotypes
+ * This a WrappingLabel that can display applied stereotypes
*/
-public class AppliedStereotypeWrappingLabelFigure extends WrappingLabel implements IPapyrusUMLElementFigure {
+public class AppliedStereotypeWrappingLabelFigure extends PapyrusWrappingLabel implements IPapyrusUMLElementFigure {
public void setStereotypeDisplay(String stereotypes, Image image) {
setText(stereotypes);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusWrappingLabel.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusWrappingLabel.java
new file mode 100644
index 00000000000..1b22e4a12de
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusWrappingLabel.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ * Arthur Daussy - Bug 354622 - [ActivityDiagram] Object Flows selection prevent selecting other close elements.
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+/**
+ * This correct the bug where invisible label can be selected
+ *
+ * @author arthur daussy
+ *
+ */
+public class PapyrusWrappingLabel extends WrappingLabel {
+
+ /**
+ * Bug 354622 - [ActivityDiagram] Object Flows selection prevent selecting other close elements.
+ * On this bug bug come from that invisible label return true containsPoint(int, int) even if there invisible
+ *
+ * This is a temporary fix until the real issue described in Bug 363362
+ * (https://bugs.eclipse.org/bugs/show_bug.cgi?id=363362) is fixed by GMF.
+ *
+ * @see org.eclipse.draw2d.Figure#containsPoint(int, int)
+ *
+ * @param x
+ * @param y
+ * @return
+ */
+ @Override
+ public boolean containsPoint(int x, int y) {
+ if(isVisible()) {
+ return super.containsPoint(x, y);
+ }
+ return false;
+ }
+
+}

Back to the top