Author: mvw
Date: 2008-08-10 09:21:02-0700
New Revision: 15537
Modified:
trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionClass.java
trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionComment.java
trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionGeneralizableElement.java
trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionInterface.java
trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionStereotype.java
trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/SelectionActor.java
trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/SelectionUseCase.java
Log:
Fix for most cases of issue 5301: Disable toolbelt buttons that modify read-only elements.
Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionClass.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionClass.java?view=diff&rev=15537&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionClass.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionClass.java&r1=15536&r2=15537
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionClass.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionClass.java 2008-08-10 09:21:02-0700
@@ -104,6 +104,11 @@
workingIcons[LEFT - BASE] = compos;
workingIcons[RIGHT - BASE] = compos;
}
+ // Readonly class: no generalization, no association to self
+ if (Model.getModelManagementHelper().isReadOnly(
+ getContent().getOwner())) {
+ return new Icon[] { null, inherit, null, null, null };
+ }
return workingIcons;
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionComment.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionComment.java?view=diff&rev=15537&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionComment.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionComment.java&r1=15536&r2=15537
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionComment.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionComment.java 2008-08-10 09:21:02-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 2005-2007 The Regents of the University of California. All
+// Copyright (c) 2005-2008 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
@@ -71,6 +71,10 @@
@Override
protected Icon[] getIcons() {
+ if (Model.getModelManagementHelper().isReadOnly(
+ getContent().getOwner())) {
+ return null;
+ }
return icons;
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionGeneralizableElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionGeneralizableElement.java?view=diff&rev=15537&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionGeneralizableElement.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionGeneralizableElement.java&r1=15536&r2=15537
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionGeneralizableElement.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionGeneralizableElement.java 2008-08-10 09:21:02-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
@@ -86,9 +86,12 @@
// No generalizations in Deployment Diagrams
if (gm instanceof DeploymentDiagramGraphModel) {
return null;
- } else {
- return icons;
}
+ if (Model.getModelManagementHelper().isReadOnly(
+ getContent().getOwner())) {
+ return new Icon[] { null, inherit, null, null, null };
+ }
+ return icons;
}
@Override
Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionInterface.java?view=diff&rev=15537&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionInterface.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionInterface.java&r1=15536&r2=15537
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionInterface.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionInterface.java 2008-08-10 09:21:02-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
@@ -104,6 +104,10 @@
@Override
protected Icon[] getIcons() {
+ if (Model.getModelManagementHelper().isReadOnly(
+ getContent().getOwner())) {
+ return new Icon[] { null, realiz, null, null, null };
+ }
return icons;
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionStereotype.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionStereotype.java?view=diff&rev=15537&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionStereotype.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionStereotype.java&r1=15536&r2=15537
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionStereotype.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionStereotype.java 2008-08-10 09:21:02-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 2006-2007 The Regents of the University of California. All
+// Copyright (c) 2006-2008 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
@@ -132,6 +132,10 @@
instanceof DeploymentDiagramGraphModel) {
return null;
}
+ if (Model.getModelManagementHelper().isReadOnly(
+ getContent().getOwner())) {
+ return new Icon[] { null, dependIcon, null, null, null };
+ }
return icons;
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/SelectionActor.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/SelectionActor.java?view=diff&rev=15537&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/SelectionActor.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/SelectionActor.java&r1=15536&r2=15537
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/SelectionActor.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/SelectionActor.java 2008-08-10 09:21:02-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
@@ -82,6 +82,10 @@
@Override
protected Icon[] getIcons() {
+ if (Model.getModelManagementHelper().isReadOnly(
+ getContent().getOwner())) {
+ return new Icon[] { null, generalizationIcon, null, null, null };
+ }
return icons;
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/SelectionUseCase.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/SelectionUseCase.java?view=diff&rev=15537&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/SelectionUseCase.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/SelectionUseCase.java&r1=15536&r2=15537
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/SelectionUseCase.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/SelectionUseCase.java 2008-08-10 09:21:02-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
@@ -79,6 +79,10 @@
@Override
protected Icon[] getIcons() {
+ if (Model.getModelManagementHelper().isReadOnly(
+ getContent().getOwner())) {
+ return new Icon[] { null, inherit, null, null, null };
+ }
return icons;
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.