svn commit: r17682 - trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-12-19 03:44:27-0800
New Revision: 17682

Added:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActionAsynchronousCheckBox.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActionSynchCheckBox.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationEndNavigableCheckBox.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationEndOrderingCheckBox.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationEndTargetScopeCheckbox.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLBehavioralFeatureQueryCheckBox.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCheckBox.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassActiveCheckBox.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLDerivedCheckBox.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLFeatureOwnerScopeCheckBox.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizableElementAbstractCheckBox.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizableElementLeafCheckBox.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizableElementRootCheckBox.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTaggedValueCheckBox.java

Log:
Copy checkboxes local to this package

Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActionAsynchronousCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActionAsynchronousCheckBox.java?view=markup&pathrev=17682
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActionAsynchronousCheckBox.java	2009-12-19 03:44:27-0800
@@ -0,0 +1,104 @@
+// $Id: UMLActionAsynchronousCheckBox.java 11516 2006-11-25 04:30:15Z tfmorris $

+// Copyright (c) 1996-2006 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

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.core.propertypanels.ui;

+

+import java.awt.event.ActionEvent;

+

+import javax.swing.Action;

+

+import org.argouml.i18n.Translator;

+import org.argouml.model.Model;

+import org.argouml.ui.UndoableAction;

+

+/**

+ *

+ * @author MarkusK

+ *

+ */

+public class UMLActionAsynchronousCheckBox extends UMLCheckBox {

+

+    /**

+     * The class uid

+     */

+    private static final long serialVersionUID = 8275834601266204370L;

+

+    /**

+     * Constructor for UMLAssociationEndNavigableCheckBox.

+     */

+    public UMLActionAsynchronousCheckBox() {

+        super(Translator.localize("checkbox.asynchronous"),

+                new ActionSetActionAsynchronous(), "isAsynchronous");

+    }

+

+    /*

+     * @see org.argouml.uml.ui.UMLCheckBox#buildModel()

+     */

+    public void buildModel() {

+        if (getTarget() != null) {

+            setSelected(Model.getFacade().isAsynchronous(getTarget()));

+        }

+

+    }

+

+    /**

+     *

+     * @author MarkusK

+     *

+     */

+    private static class ActionSetActionAsynchronous extends UndoableAction {

+

+        /**

+         * Constructor for ActionSetElementOwnershipSpecification.

+         */

+        public ActionSetActionAsynchronous() {

+            super(Translator.localize("action.set"), null);

+            // Set the tooltip string:

+            putValue(Action.SHORT_DESCRIPTION, 

+                    Translator.localize("action.set"));

+        }

+

+        /*

+         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+         */

+        public void actionPerformed(ActionEvent e) {

+            super.actionPerformed(e);

+            if (e.getSource() instanceof UMLCheckBox) {

+                UMLCheckBox source = (UMLCheckBox) e.getSource();

+                Object target = source.getTarget();

+                if (Model.getFacade().isAAction(target)) {

+                    Object m = target;

+                    Model.getCommonBehaviorHelper().setAsynchronous(

+                            m,

+                            source.isSelected());

+                }

+            }

+        }

+

+        /**

+         * The UID.

+         */

+        private static final long serialVersionUID = 1683440096488846000L;

+    }

+}


Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActionSynchCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActionSynchCheckBox.java?view=markup&pathrev=17682
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActionSynchCheckBox.java	2009-12-19 03:44:27-0800
@@ -0,0 +1,98 @@
+// $Id: UMLActionSynchCheckBox.java 12558 2007-05-06 20:46:30Z tfmorris $

+// Copyright (c) 1996-2006 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

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.core.propertypanels.ui;

+

+import java.awt.event.ActionEvent;

+

+import javax.swing.Action;

+

+import org.argouml.i18n.Translator;

+import org.argouml.model.Model;

+import org.argouml.ui.UndoableAction;

+

+/**

+ * Set the isSynch attribute for a ObjectFlowState.

+ * 

+ * @author Tom Morris

+ */

+public class UMLActionSynchCheckBox extends UMLCheckBox {

+

+    /**

+     * The class uid

+     */

+    private static final long serialVersionUID = 8571271949666690415L;

+

+    /**

+     * Constructor for UMLAssociationEndNavigableCheckBox.

+     */

+    public UMLActionSynchCheckBox() {

+        super(Translator.localize("checkbox.synch-lc"),

+                new ActionSetSynch(), "isSynch");

+    }

+

+    /*

+     * @see org.argouml.uml.ui.UMLCheckBox#buildModel()

+     */

+    public void buildModel() {

+        if (getTarget() != null) {

+            setSelected(Model.getFacade().isSynch(getTarget()));

+        }

+    }

+    

+    /**

+     * Set the isSynch attribte of an ObjectFlowState.

+     * 

+     * @author Tom Morris

+     */

+    private static class ActionSetSynch extends UndoableAction {

+

+        /**

+         * Constructor for ActionSetElementOwnershipSpecification.

+         */

+        protected ActionSetSynch() {

+            super(Translator.localize("action.set"), null);

+            // Set the tooltip string:

+            putValue(Action.SHORT_DESCRIPTION, 

+                    Translator.localize("action.set"));

+        }

+

+        /*

+         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+         */

+        public void actionPerformed(ActionEvent e) {

+            super.actionPerformed(e);

+            if (e.getSource() instanceof UMLCheckBox) {

+                UMLCheckBox source = (UMLCheckBox) e.getSource();

+                Object target = source.getTarget();

+                if (Model.getFacade().isAObjectFlowState(target)) {

+                    Object m = target;

+                    Model.getActivityGraphsHelper().setSynch(

+                            m,

+                            source.isSelected());

+                }

+            }

+        }

+    }

+}


Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationEndNavigableCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationEndNavigableCheckBox.java?view=markup&pathrev=17682
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationEndNavigableCheckBox.java	2009-12-19 03:44:27-0800
@@ -0,0 +1,102 @@
+// $Id: UMLAssociationEndNavigableCheckBox.java 11516 2006-11-25 04:30:15Z tfmorris $

+// Copyright (c) 1996-2006 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

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.core.propertypanels.ui;

+

+import java.awt.event.ActionEvent;

+

+import javax.swing.Action;

+

+import org.argouml.i18n.Translator;

+import org.argouml.model.Model;

+import org.argouml.ui.UndoableAction;

+

+/**

+ *

+ * @author [email protected]

+ * @since Jan 4, 2003

+ */

+public class UMLAssociationEndNavigableCheckBox extends UMLCheckBox {

+

+    /**

+     * The class uid

+     */

+    private static final long serialVersionUID = 1722449792391086747L;

+

+    /**

+     * Constructor for UMLAssociationEndNavigableCheckBox.

+     */

+    public UMLAssociationEndNavigableCheckBox() {

+        super(Translator.localize("label.navigable"),

+                new ActionSetAssociationEndNavigable(), "isNavigable");

+    }

+

+    /*

+     * @see org.argouml.uml.ui.UMLCheckBox#buildModel()

+     */

+    public void buildModel() {

+        if (getTarget() != null) {

+            setSelected(Model.getFacade().isNavigable(getTarget()));

+        }

+

+    }

+    

+    /**

+     *

+     * @author [email protected]

+     * @since Jan 4, 2003

+     */

+    private static class ActionSetAssociationEndNavigable extends UndoableAction {

+

+        /**

+         * The class uid

+         */

+        private static final long serialVersionUID = -5432326422910085165L;

+

+        /**

+         * Constructor for ActionSetElementOwnershipSpecification.

+         */

+        protected ActionSetAssociationEndNavigable() {

+           super(Translator.localize("action.set"), null);

+           // Set the tooltip string:

+           putValue(Action.SHORT_DESCRIPTION, 

+                   Translator.localize("action.set"));

+       }

+

+       /*

+        * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+        */

+       public void actionPerformed(ActionEvent e) {

+           super.actionPerformed(e);

+           if (e.getSource() instanceof UMLCheckBox) {

+               UMLCheckBox source = (UMLCheckBox) e.getSource();

+               Object target = source.getTarget();

+               if (Model.getFacade().isAAssociationEnd(target)) {

+                   Object m = target;

+                   Model.getCoreHelper().setNavigable(m, source.isSelected());

+               }

+           }

+       }

+   }

+}


Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationEndOrderingCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationEndOrderingCheckBox.java?view=markup&pathrev=17682
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationEndOrderingCheckBox.java	2009-12-19 03:44:27-0800
@@ -0,0 +1,105 @@
+// $Id: UMLAssociationEndOrderingCheckBox.java 11516 2006-11-25 04:30:15Z tfmorris $

+// Copyright (c) 1996-2006 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

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.core.propertypanels.ui;

+

+import java.awt.event.ActionEvent;

+

+import javax.swing.Action;

+

+import org.argouml.i18n.Translator;

+import org.argouml.model.Model;

+import org.argouml.ui.UndoableAction;

+

+/**

+ *

+ * @author [email protected]

+ * @since Jan 4, 2003

+ */

+public class UMLAssociationEndOrderingCheckBox extends UMLCheckBox {

+

+    /**

+     * Constructor for UMLAssociationEndOrderingCheckBox.

+     */

+    public UMLAssociationEndOrderingCheckBox() {

+        super(Translator.localize("label.ordered"),

+                new ActionSetAssociationEndOrdering(), "ordering");

+    }

+

+    /*

+     * @see org.argouml.uml.ui.UMLCheckBox#buildModel()

+     */

+    public void buildModel() {

+        if (getTarget() != null) {

+            Object associationEnd = getTarget();

+            setSelected(

+                    Model.getOrderingKind().getOrdered().equals(

+                            Model.getFacade().getOrdering(associationEnd)));

+        }

+    }

+    

+    /**

+     *

+     * @author [email protected]

+     * @since Jan 4, 2003

+     */

+    private static class ActionSetAssociationEndOrdering extends UndoableAction {

+

+        /**

+         * The class uid

+         */

+        private static final long serialVersionUID = 4443969211918657168L;

+

+        /**

+         * Constructor for ActionSetElementOwnershipSpecification.

+         */

+        public ActionSetAssociationEndOrdering() {

+            super(Translator.localize("Set"), null);

+            // Set the tooltip string:

+            putValue(Action.SHORT_DESCRIPTION, 

+                    Translator.localize("Set"));

+        }

+

+        /*

+         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+         */

+        public void actionPerformed(ActionEvent e) {

+            super.actionPerformed(e);

+            if (e.getSource() instanceof UMLCheckBox) {

+                 UMLCheckBox source = (UMLCheckBox) e.getSource();

+                 Object target = source.getTarget();

+                 if (Model.getFacade().isAAssociationEnd(target)) {

+                    Object m = target;

+                    if (source.isSelected()) {

+                        Model.getCoreHelper().setOrdering(m,

+                                Model.getOrderingKind().getOrdered());

+                    } else {

+                        Model.getCoreHelper().setOrdering(m,

+                                Model.getOrderingKind().getUnordered());

+                    }

+                }

+            }

+        }

+    }

+}


Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationEndTargetScopeCheckbox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationEndTargetScopeCheckbox.java?view=markup&pathrev=17682
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationEndTargetScopeCheckbox.java	2009-12-19 03:44:27-0800
@@ -0,0 +1,100 @@
+// $Id: UMLAssociationEndTargetScopeCheckbox.java 15920 2008-10-14 18:03:33Z tfmorris $

+// 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

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.core.propertypanels.ui;

+

+import java.awt.event.ActionEvent;

+

+import javax.swing.Action;

+

+import org.argouml.i18n.Translator;

+import org.argouml.model.Model;

+import org.argouml.ui.UndoableAction;

+

+/**

+ *

+ * @author [email protected]

+ * @since Jan 4, 2003

+ */

+public class UMLAssociationEndTargetScopeCheckbox extends UMLCheckBox {

+

+    /**

+     * Constructor for UMLAssociationEndTargetScopeCheckbox.

+     */

+    public UMLAssociationEndTargetScopeCheckbox() {

+        // TODO: property name will need to be updated for UML 2.x

+        // Unfortunately we can specify two property names here

+        super(Translator.localize("label.static"),

+                new ActionSetAssociationEndTargetScope(), 

+                "targetScope");

+    }

+

+    /*

+     * @see org.argouml.uml.ui.UMLCheckBox#buildModel()

+     */

+    public void buildModel() {

+        if (getTarget() != null) {

+            Object associationEnd = getTarget();

+            setSelected(Model.getFacade().isStatic(associationEnd));

+        }

+    }

+    

+    /**

+     *

+     * @author [email protected]

+     * @since Jan 4, 2003

+     */

+    private static class ActionSetAssociationEndTargetScope extends UndoableAction {

+

+        /**

+         * 

+         */

+        private static final long serialVersionUID = 5012290492852358140L;

+

+        /**

+         * Constructor for ActionSetElementOwnershipSpecification.

+         */

+        protected ActionSetAssociationEndTargetScope() {

+            super(Translator.localize("Set"), null);

+            // Set the tooltip string:

+            putValue(Action.SHORT_DESCRIPTION, 

+                    Translator.localize("Set"));

+        }

+ 

+        /*

+         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+         */

+        public void actionPerformed(ActionEvent e) {

+            super.actionPerformed(e);

+            if (e.getSource() instanceof UMLCheckBox) {

+                UMLCheckBox source = (UMLCheckBox) e.getSource();

+                Object target = source.getTarget();

+                if (Model.getFacade().isAAssociationEnd(target)) {

+                    Object m = target;

+                    Model.getCoreHelper().setStatic(m, source.isSelected());

+                }

+            }

+        }

+    }

+}


Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLBehavioralFeatureQueryCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLBehavioralFeatureQueryCheckBox.java?view=markup&pathrev=17682
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLBehavioralFeatureQueryCheckBox.java	2009-12-19 03:44:27-0800
@@ -0,0 +1,96 @@
+// $Id: UMLBehavioralFeatureQueryCheckBox.java 11516 2006-11-25 04:30:15Z tfmorris $

+// Copyright (c) 1996-2006 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

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.core.propertypanels.ui;

+

+import java.awt.event.ActionEvent;

+

+import javax.swing.Action;

+

+import org.argouml.i18n.Translator;

+import org.argouml.model.Model;

+import org.argouml.ui.UndoableAction;

+

+/**

+ */

+public class UMLBehavioralFeatureQueryCheckBox extends UMLCheckBox {

+

+    /**

+     * The class uid

+     */

+    private static final long serialVersionUID = 8834169933906356558L;

+

+    /**

+     * Constructor.

+     */

+    public UMLBehavioralFeatureQueryCheckBox() {

+        super(Translator.localize("checkbox.query-lc"),

+                new ActionSetBehavioralFeatureQuery(), "isQuery");

+    }

+

+    /*

+     * @see org.argouml.uml.ui.UMLCheckBox#buildModel()

+     */

+    public void buildModel() {

+        if (getTarget() != null) {

+            setSelected(Model.getFacade().isQuery(getTarget()));

+        }

+    }

+

+    /**

+     * @author mkl

+     */

+    private static class ActionSetBehavioralFeatureQuery extends UndoableAction {

+

+        /**

+         * The class uid

+         */

+        private static final long serialVersionUID = 1901565153156775274L;

+

+        /**

+         * Constructor.

+         */

+        protected ActionSetBehavioralFeatureQuery() {

+            super(Translator.localize("Set"), null);

+            // Set the tooltip string:

+            putValue(Action.SHORT_DESCRIPTION, 

+                    Translator.localize("Set"));

+        }

+

+        /*

+         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+         */

+        public void actionPerformed(ActionEvent e) {

+            super.actionPerformed(e);

+            if (e.getSource() instanceof UMLCheckBox) {

+                UMLCheckBox source = (UMLCheckBox) e.getSource();

+                Object target = source.getTarget();

+                if (Model.getFacade().isABehavioralFeature(target)) {

+                    Object m = target;

+                    Model.getCoreHelper().setQuery(m, source.isSelected());

+                }

+            }

+        }

+    }

+}


Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCheckBox.java?view=markup&pathrev=17682
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCheckBox.java	2009-12-19 03:44:27-0800
@@ -0,0 +1,106 @@
+// $Id: UMLCheckBox.java 13325 2007-08-14 02:47:31Z tfmorris $

+// Copyright (c) 2002-2007 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

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.core.propertypanels.ui;

+

+import java.beans.PropertyChangeEvent;

+import java.beans.PropertyChangeListener;

+

+import javax.swing.Action;

+import javax.swing.JCheckBox;

+

+import org.argouml.model.Model;

+import org.argouml.ui.LookAndFeelMgr;

+import org.argouml.ui.targetmanager.TargetEvent;

+import org.argouml.ui.targetmanager.TargetListener;

+import org.tigris.gef.presentation.Fig;

+

+/**

+ * The checkbox to be used to show boolean UML attributes in the GUI's. Mostly

+ * used on proppanels. Other GUI elements (like UMLLinkedList) divide the

+ * responsibility of showing an attribute and maintaining the state of the

+ * attribute between a GUI element and a model. This is not the case for the

+ * UMLCheckBox. Reason for this is that the model is just too simple to need

+ * extra classes for the model.

+ * 

+ * @since Oct 12, 2002

+ * @author [email protected]

+ */

+abstract class UMLCheckBox extends JCheckBox

+    implements PropertyChangeListener {

+

+    private Object checkBoxTarget;

+    private String propertySetName;

+

+    /**

+     * Constructor for UMLCheckBox.

+     * @param text the text of the check box

+     * @param a the action we're going to listen to

+     * @param name the property set name

+     */

+    public UMLCheckBox(String text, Action a, String name) {

+        super(text);

+        setFont(LookAndFeelMgr.getInstance().getStandardFont());

+        propertySetName = name;

+        addActionListener(a);

+

+        setActionCommand((String) a.getValue(Action.ACTION_COMMAND_KEY));

+    }

+

+    /*

+     * The property value has changed so rebuild our view.

+     * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)

+     */

+    public void propertyChange(PropertyChangeEvent evt) {

+        buildModel();

+    }

+

+    /**

+     * Return the target. 

+     *

+     * @return the target

+     */

+    public Object getTarget() {

+        return checkBoxTarget;

+    }

+

+    /**

+     * Sets the target. This method will not be used until the target does

+     * not come via the container.

+     * @param target The target to set

+     */

+    public void setTarget(Object target) {

+        checkBoxTarget = target;

+        Model.getPump().addModelEventListener(

+                this, checkBoxTarget, propertySetName);

+        buildModel();

+    }

+

+    /**

+     * Builds the model. That is: it sets the checkbox to true or

+     * false. The name of this method is chosen to be compliant with

+     * for example UMLModelElementListModel.

+     */

+    public abstract void buildModel();

+}


Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassActiveCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassActiveCheckBox.java?view=markup&pathrev=17682
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassActiveCheckBox.java	2009-12-19 03:44:27-0800
@@ -0,0 +1,90 @@
+// $Id: UMLClassActiveCheckBox.java 11516 2006-11-25 04:30:15Z tfmorris $

+// Copyright (c) 1996-2006 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

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.core.propertypanels.ui;

+

+import java.awt.event.ActionEvent;

+

+import javax.swing.Action;

+

+import org.argouml.i18n.Translator;

+import org.argouml.model.Model;

+import org.argouml.ui.UndoableAction;

+

+/**

+ *

+ * @author [email protected]

+ * @since Jan 27, 2003

+ */

+public class UMLClassActiveCheckBox extends UMLCheckBox {

+

+    /**

+     * Constructor for UMLGeneralizableElementRootCheckBox.

+     */

+    public UMLClassActiveCheckBox() {

+        super(Translator.localize("checkbox.active-lc"),

+                new ActionSetClassActive(), "isActive");

+    }

+

+    /*

+     * @see org.argouml.uml.ui.UMLCheckBox#buildModel()

+     */

+    public void buildModel() {

+        if (getTarget() != null) {

+            setSelected(Model.getFacade().isActive(getTarget()));

+        }

+    }

+

+    /**

+     * @stereotype singleton

+     * @author mkl

+     */

+    private static class ActionSetClassActive extends UndoableAction {

+

+        /**

+         * Constructor.

+         */

+        public ActionSetClassActive() {

+            super(Translator.localize("Set"), null);

+            // Set the tooltip string:

+            putValue(Action.SHORT_DESCRIPTION, 

+                    Translator.localize("Set"));

+        }

+

+        /*

+         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+         */

+        public void actionPerformed(ActionEvent e) {

+            super.actionPerformed(e);

+            if (e.getSource() instanceof UMLCheckBox) {

+                UMLCheckBox source = (UMLCheckBox) e.getSource();

+                Object target = source.getTarget();

+                if (Model.getFacade().isAClass(target)) {

+                    Object m = target;

+                    Model.getCoreHelper().setActive(m, source.isSelected());

+                }

+            }

+        }

+    }

+}


Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLDerivedCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLDerivedCheckBox.java?view=markup&pathrev=17682
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLDerivedCheckBox.java	2009-12-19 03:44:27-0800
@@ -0,0 +1,44 @@
+// $Id: UMLDerivedCheckBox.java 13702 2007-11-04 00:11:25Z tfmorris $

+// Copyright (c) 2003-2007 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

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.core.propertypanels.ui;

+

+import org.argouml.model.Facade;

+

+/**

+ * Class to represent a checkbox for the derived tagged value.

+ *

+ * @author tfmorris

+ */

+public class UMLDerivedCheckBox extends UMLTaggedValueCheckBox {

+    

+    /**

+     * The constructor.

+     *

+     */

+    public UMLDerivedCheckBox() {

+        // TODO: This is a tagged value name which will never trigger an event

+        super(Facade.DERIVED_TAG);

+    }

+}


Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLFeatureOwnerScopeCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLFeatureOwnerScopeCheckBox.java?view=markup&pathrev=17682
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLFeatureOwnerScopeCheckBox.java	2009-12-19 03:44:27-0800
@@ -0,0 +1,96 @@
+// $Id: UMLFeatureOwnerScopeCheckBox.java 17680 2009-12-19 10:19:28Z bobtarling $

+// Copyright (c) 1996-2006 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

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.core.propertypanels.ui;

+

+import java.awt.event.ActionEvent;

+

+import javax.swing.Action;

+

+import org.argouml.i18n.Translator;

+import org.argouml.model.Model;

+import org.argouml.ui.UndoableAction;

+

+/**

+ * @since Nov 6, 2002

+ * @author [email protected]

+ */

+public class UMLFeatureOwnerScopeCheckBox extends UMLCheckBox {

+

+    /**

+     * The class uid

+     */

+    private static final long serialVersionUID = 8345750891363969965L;

+

+    /**

+     * Constructor for UMLFeatureOwnerScopeCheckBox.

+     */

+    public UMLFeatureOwnerScopeCheckBox() {

+        super(Translator.localize("checkbox.static-lc"),

+                new ActionSetFeatureOwnerScope(), "ownerScope");

+    }

+

+    /*

+     * @see org.argouml.uml.ui.UMLCheckBox#buildModel()

+     */

+    public void buildModel() {

+        setSelected(Model.getFacade().isStatic(getTarget()));

+    }

+

+    /**

+     * @since Nov 6, 2002

+     * @author [email protected]

+     */

+    private static class ActionSetFeatureOwnerScope extends UndoableAction {

+

+        /**

+         * The class uid

+         */

+        private static final long serialVersionUID = 3143839397101551684L;

+

+        /**

+         * Constructor for ActionSetElementOwnershipSpecification.

+         */

+        public ActionSetFeatureOwnerScope() {

+            super(Translator.localize("Set"), null);

+            // Set the tooltip string:

+            putValue(Action.SHORT_DESCRIPTION, 

+                    Translator.localize("Set"));

+        }

+

+        /*

+         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+         */

+        public void actionPerformed(ActionEvent e) {

+            super.actionPerformed(e);

+            if (e.getSource() instanceof UMLCheckBox) {

+                UMLCheckBox source = (UMLCheckBox) e.getSource();

+                Object target = source.getTarget();

+                if (Model.getFacade().isAFeature(target)) {

+                    Model.getCoreHelper().setStatic(target, source.isSelected());

+                }

+            }

+        }

+    }

+}


Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizableElementAbstractCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizableElementAbstractCheckBox.java?view=markup&pathrev=17682
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizableElementAbstractCheckBox.java	2009-12-19 03:44:27-0800
@@ -0,0 +1,107 @@
+// $Id: UMLGeneralizableElementAbstractCheckBox.java 13720 2007-11-04 19:13:50Z tfmorris $

+// Copyright (c) 1996-2006 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

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.core.propertypanels.ui;

+

+import java.awt.event.ActionEvent;

+

+import javax.swing.Action;

+

+import org.argouml.i18n.Translator;

+import org.argouml.model.Model;

+import org.argouml.ui.UndoableAction;

+

+/**

+ *

+ * @author [email protected]

+ * @since Jan 27, 2003

+ */

+public class UMLGeneralizableElementAbstractCheckBox extends UMLCheckBox {

+

+    /**

+     * The class uid

+     */

+    private static final long serialVersionUID = -7758415118444406220L;

+

+    /**

+     * Constructor for UMLGeneralizableElementRootCheckBox.

+     */

+    public UMLGeneralizableElementAbstractCheckBox() {

+        super(Translator.localize("checkbox.abstract-lc"),

+                new ActionSetGeneralizableElementAbstract(),

+                "isAbstract");

+    }

+

+    /*

+     * @see org.argouml.uml.ui.UMLCheckBox#buildModel()

+     */

+    public void buildModel() {

+        Object target = getTarget();

+        if (target != null && Model.getFacade().isAUMLElement(target)) {

+            setSelected(Model.getFacade().isAbstract(target));

+        } else {

+            setSelected(false);

+        }

+    }

+

+    /**

+     *

+     * @author [email protected]

+     * @since Jan 27, 2003

+     */

+    private static class ActionSetGeneralizableElementAbstract extends UndoableAction {

+

+        /**

+         * The class uid

+         */

+        private static final long serialVersionUID = -5554614626166434623L;

+

+        /**

+         * Constructor

+         */

+        public ActionSetGeneralizableElementAbstract() {

+            super(Translator.localize("Set"), null);

+            // Set the tooltip string:

+            putValue(Action.SHORT_DESCRIPTION, 

+                    Translator.localize("Set"));

+        }

+

+        /*

+         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+         */

+        public void actionPerformed(ActionEvent e) {

+            super.actionPerformed(e);

+            if (e.getSource() instanceof UMLCheckBox) {

+                UMLCheckBox source = (UMLCheckBox) e.getSource();

+                Object target = source.getTarget();

+                if (Model.getFacade().isAGeneralizableElement(target)

+                        || Model.getFacade().isAOperation(target)

+                        || Model.getFacade().isAReception(target)) {

+                    Model.getCoreHelper().setAbstract(target, source.isSelected());

+                }

+            }

+        }

+    }

+

+}


Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizableElementLeafCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizableElementLeafCheckBox.java?view=markup&pathrev=17682
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizableElementLeafCheckBox.java	2009-12-19 03:44:27-0800
@@ -0,0 +1,95 @@
+// $Id: UMLGeneralizableElementLeafCheckBox.java 13720 2007-11-04 19:13:50Z tfmorris $

+// Copyright (c) 1996-2007 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

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.core.propertypanels.ui;

+

+import java.awt.event.ActionEvent;

+

+import javax.swing.Action;

+

+import org.argouml.i18n.Translator;

+import org.argouml.model.Model;

+import org.argouml.ui.UndoableAction;

+

+/**

+ *

+ * @author [email protected]

+ * @since Jan 27, 2003

+ */

+public class UMLGeneralizableElementLeafCheckBox extends UMLCheckBox {

+

+    /**

+     * Constructor for UMLGeneralizableElementLeafCheckBox.

+     */

+    public UMLGeneralizableElementLeafCheckBox() {

+        super(Translator.localize("checkbox.leaf-lc"),

+                new ActionSetGeneralizableElementLeaf(), "isLeaf");

+    }

+

+    /*

+     * @see org.argouml.uml.ui.UMLCheckBox#buildModel()

+     */

+    public void buildModel() {

+        Object target = getTarget();

+        if (target != null && Model.getFacade().isAUMLElement(target)) {

+            setSelected(Model.getFacade().isLeaf(target));

+        } else {

+            setSelected(false);

+        }

+    }

+

+    /**

+     *

+     * @author [email protected]

+     * @since Jan 27, 2003

+     */

+    private static class ActionSetGeneralizableElementLeaf extends UndoableAction {

+

+       /**

+        * Constructor for ActionSetElementOwnershipSpecification.

+        */

+       public ActionSetGeneralizableElementLeaf() {

+           super(Translator.localize("Set"), null);

+           // Set the tooltip string:

+           putValue(Action.SHORT_DESCRIPTION, 

+                   Translator.localize("Set"));

+       }

+

+       /*

+        * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+        */

+       public void actionPerformed(ActionEvent e) {

+           super.actionPerformed(e);

+           if (e.getSource() instanceof UMLCheckBox) {

+               UMLCheckBox source = (UMLCheckBox) e.getSource();

+               Object target = source.getTarget();

+               if (Model.getFacade().isAGeneralizableElement(target)

+                       || Model.getFacade().isAOperation(target)

+                       || Model.getFacade().isAReception(target)) {

+                   Model.getCoreHelper().setLeaf(target, source.isSelected());

+               }

+           }

+       }

+   }

+}


Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizableElementRootCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizableElementRootCheckBox.java?view=markup&pathrev=17682
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizableElementRootCheckBox.java	2009-12-19 03:44:27-0800
@@ -0,0 +1,100 @@
+// $Id: UMLGeneralizableElementRootCheckBox.java 13720 2007-11-04 19:13:50Z tfmorris $

+// Copyright (c) 1996-2006 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

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.core.propertypanels.ui;

+

+import java.awt.event.ActionEvent;

+

+import javax.swing.Action;

+

+import org.argouml.i18n.Translator;

+import org.argouml.model.Model;

+import org.argouml.ui.UndoableAction;

+

+/**

+ *

+ * @author [email protected]

+ * @since Jan 27, 2003

+ */

+public class UMLGeneralizableElementRootCheckBox extends UMLCheckBox {

+

+    /**

+     * The class uid

+     */

+    private static final long serialVersionUID = 4266232738248839958L;

+

+    /**

+     * Constructor for UMLGeneralizableElementRootCheckBox.

+     */

+    public UMLGeneralizableElementRootCheckBox() {

+        super(Translator.localize("checkbox.root-lc"),

+                new ActionSetGeneralizableElementRoot(), "isRoot");

+    }

+

+    /*

+     * @see org.argouml.uml.ui.UMLCheckBox#buildModel()

+     */

+    public void buildModel() {

+        Object target = getTarget();

+        if (target != null && Model.getFacade().isAUMLElement(target)) {

+            setSelected(Model.getFacade().isRoot(target));

+        } else {

+            setSelected(false);

+        }

+    }

+

+    /**

+     *

+     * @author [email protected]

+     * @since Jan 27, 2003

+     */

+    private static class ActionSetGeneralizableElementRoot extends UndoableAction {

+

+       /**

+        * Constructor for ActionSetElementOwnershipSpecification.

+        */

+       public ActionSetGeneralizableElementRoot() {

+           super(Translator.localize("Set"), null);

+           // Set the tooltip string:

+           putValue(Action.SHORT_DESCRIPTION, 

+                   Translator.localize("Set"));

+       }

+

+       /*

+        * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+        */

+       public void actionPerformed(ActionEvent e) {

+           super.actionPerformed(e);

+           if (e.getSource() instanceof UMLCheckBox) {

+               UMLCheckBox source = (UMLCheckBox) e.getSource();

+               Object target = source.getTarget();

+               if (Model.getFacade().isAGeneralizableElement(target)

+                       || Model.getFacade().isAOperation(target)

+                       || Model.getFacade().isAReception(target)) {

+                   Model.getCoreHelper().setRoot(target, source.isSelected());

+               }

+           }

+       }

+   }

+}


Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTaggedValueCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTaggedValueCheckBox.java?view=markup&pathrev=17682
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTaggedValueCheckBox.java	2009-12-19 03:44:27-0800
@@ -0,0 +1,139 @@
+// $Id: UMLTaggedValueCheckBox.java 12518 2007-05-04 07:11:31Z tfmorris $

+// Copyright (c) 2007 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

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.core.propertypanels.ui;

+

+import java.awt.event.ActionEvent;

+

+import javax.swing.Action;

+

+import org.argouml.i18n.Translator;

+import org.argouml.model.Model;

+import org.argouml.ui.UndoableAction;

+

+/**

+ * Checkbox who's state is tied to a boolean tagged value of a specific

+ * name on the current target ModelElement.  Currently the value is constrained

+ * to be a string with the value "true" or "false".

+ * 

+ * @author tfmorris

+ */

+public class UMLTaggedValueCheckBox extends UMLCheckBox {

+

+    private String tagName;

+    

+    public UMLTaggedValueCheckBox(String name) {

+        super(Translator.localize("checkbox." + name + "-lc"), 

+                new ActionBooleanTaggedValue(name), 

+                name);

+        tagName = name;

+    }

+

+    /**

+     * Set the checkbox according to the tagged values of the target.

+     * 

+     * @see org.argouml.uml.ui.UMLCheckBox#buildModel()

+     */

+    public void buildModel() {

+        Object tv = Model.getFacade().getTaggedValue(getTarget(), tagName);

+        if (tv != null) {

+            String tag = Model.getFacade().getValueOfTag(tv);

+            if ("true".equals(tag)) {

+                setSelected(true);

+                return;

+            }

+        }

+        setSelected(false);

+    }

+

+    /**

+     * An action which can be used to create arbitrary tagged values which hold

+     * boolean data. It is designed (and implicitly) relies on a UMLCheckBox.

+     *

+     * @see UMLCheckBox

+     * @author mkl

+     */

+    private static class ActionBooleanTaggedValue extends UndoableAction {

+

+        /**

+         * The class uid

+         */

+        private static final long serialVersionUID = 4195056245309443576L;

+        

+        private String tagName;

+

+        /**

+         * The constructor takes the name of the tagged value as a string, which

+         * will hold boolean data.

+         *

+         * @param theTagName

+         *            the name of the taggedvalue containing boolean values.

+         */

+        public ActionBooleanTaggedValue(String theTagName) {

+            super(Translator.localize("Set"), null);

+            // Set the tooltip string:

+            putValue(Action.SHORT_DESCRIPTION, 

+                    Translator.localize("Set"));

+            tagName = theTagName;

+        }

+

+        /**

+         * set the taggedvalue according to the condition of the checkbox. The

+         * taggedvalue will be created if not existing.

+         *

+         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+         */

+        @Override

+        public void actionPerformed(ActionEvent e) {

+            super.actionPerformed(e);

+            if (!(e.getSource() instanceof UMLCheckBox)) {

+                return;

+            }

+

+            UMLCheckBox source = (UMLCheckBox) e.getSource();

+            Object obj = source.getTarget();

+

+            if (!Model.getFacade().isAModelElement(obj)) {

+                return;

+            }

+

+            boolean newState = source.isSelected();

+

+            Object taggedValue = Model.getFacade().getTaggedValue(obj, tagName);

+            if (taggedValue == null) {

+                taggedValue =

+                        Model.getExtensionMechanismsFactory().buildTaggedValue(

+                                tagName, "");

+                // TODO: Rework to use UML 1.4 TagDefinitions - tfm

+                Model.getExtensionMechanismsHelper().addTaggedValue(

+                        obj, taggedValue);

+            }

+            if (newState) {

+                Model.getCommonBehaviorHelper().setValue(taggedValue, "true");

+            } else {

+                Model.getCommonBehaviorHelper().setValue(taggedValue, "false");

+            }

+        }

+    }

+}
\ No newline at end of file


------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2431700

To unsubscribe from this discussion, e-mail: [[email protected]].
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.