svn commit: r19860 - trunk/src: argouml-app/src/org/argouml/uml/diagram/state/ui argouml-core-diagrams-state2/src/org/argouml/state2/diagram
[email protected] Sat, 31 Dec 2011 03:27:14 -0800 (PST)
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: mvw
Date: 2011-12-31 03:27:14-0800
New Revision: 19860
Modified:
trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/SelectionState.java
trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigVertex.java
Log:
Make SelectionState suitable for UML2. Add toolbelt buttons to a state vertex on a UML2 state machine diagram.
Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/SelectionState.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/SelectionState.java?view=diff&pathrev=19860&r1=19859&r2=19860
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/SelectionState.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/SelectionState.java 2011-12-31 03:27:14-0800
@@ -1,6 +1,6 @@
/* $Id$
*****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2011 Contributors - see below
* 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
@@ -8,6 +8,7 @@
*
* Contributors:
* tfmorris
+ * Michiel van der Wulp
*****************************************************************************
*
* Some portions of this file was previously release using the BSD License:
@@ -84,14 +85,14 @@
}
/**
- * @param b true if the buton is enabled
+ * @param b true if the button is enabled
*/
public void setIncomingButtonEnabled(boolean b) {
showIncoming = b;
}
/**
- * @param b true if the buton is enabled
+ * @param b true if the button is enabled
*/
public void setOutgoingButtonEnabled(boolean b) {
showOutgoing = b;
@@ -129,7 +130,11 @@
@Override
protected Object getNewNodeType(int index) {
- return Model.getMetaTypes().getSimpleState();
+ if (Model.getFacade().getUmlVersion().startsWith("1")) {
+ return Model.getMetaTypes().getSimpleState();
+ } else {
+ return Model.getMetaTypes().getState();
+ }
}
@Override
Modified: trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigVertex.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigVertex.java?view=diff&pathrev=19860&r1=19859&r2=19860
==============================================================================
--- trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigVertex.java (original)
+++ trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigVertex.java 2011-12-31 03:27:14-0800
@@ -8,6 +8,7 @@
*
* Contributors:
* Bob Tarling
+ * Michiel van der Wulp
*****************************************************************************
*/
@@ -38,8 +39,10 @@
import org.argouml.ui.targetmanager.TargetManager;
import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.state.ui.SelectionState;
import org.argouml.uml.diagram.ui.FigNodeModelElement;
import org.tigris.gef.base.LayerPerspective;
+import org.tigris.gef.base.Selection;
import org.tigris.gef.di.DiagramElement;
import org.tigris.gef.presentation.Connector;
import org.tigris.gef.presentation.Fig;
@@ -69,7 +72,7 @@
/**
* Create a new instance of FigVertex
- * @param owner the vertex that own this dagram element
+ * @param owner the vertex that own this diagram element
* @param bounds the bounds of the diagram element
* @param settings the display settings for this diagram element
*/
@@ -494,4 +497,17 @@
}
}
+
+ /**
+ * Return a Selection for a Vertex.
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public Selection makeSelection() {
+ if (getOwner() != null) {
+ return new SelectionState(this);
+ }
+ return null;
+ }
}
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2903230
To unsubscribe from this discussion, e-mail: [[email protected]].