Author: penyaskito
Date: 2008-07-08 08:36:12-0700
New Revision: 15207
Added:
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/EnumerationListModel.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Enumeration.xml (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/EnumerationLiteral.xml (contents, props changed)
Modified:
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java
Log:
Panels for Enumeration and EnumerationLiteral.
Modified: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java?view=diff&rev=15207&p1=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java&p2=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java&r1=15206&r2=15207
==============================================================================
--- branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java (original)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java 2008-07-08 08:36:12-0700
@@ -39,6 +39,7 @@
import org.apache.log4j.Logger;
import org.argouml.core.propertypanels.ui.ActionAddStereotypeBaseClass;
import org.argouml.core.propertypanels.ui.ActionDeleteStereotypeBaseClass;
+import org.argouml.core.propertypanels.ui.EnumerationListModel;
import org.argouml.core.propertypanels.ui.UMLClassifierPackageImportsListModel;
import org.argouml.core.propertypanels.ui.UMLDefaultValueExpressionModel;
import org.argouml.core.propertypanels.ui.UMLExpressionModel3;
@@ -79,6 +80,7 @@
import org.argouml.uml.ui.foundation.core.UMLClassifierAssociationEndListModel;
import org.argouml.uml.ui.foundation.core.UMLClassifierFeatureListModel;
import org.argouml.uml.ui.foundation.core.UMLClassifierParameterListModel;
+import org.argouml.uml.ui.foundation.core.UMLEnumerationLiteralsListModel;
import org.argouml.uml.ui.foundation.core.UMLFeatureOwnerListModel;
import org.argouml.uml.ui.foundation.core.UMLFeatureOwnerScopeCheckBox;
import org.argouml.uml.ui.foundation.core.UMLGeneralizableElementAbstractCheckBox;
@@ -242,11 +244,16 @@
model.setTarget(target);
pane = new UMLSingleRowSelector(model);
}
- if ("feature".equals(prop.getName())) {
+ else if ("feature".equals(prop.getName())) {
model = new UMLParameterBehavioralFeatListModel();
model.setTarget(target);
pane = new UMLSingleRowSelector(model);
}
+ else if ("enumeration".equals(prop.getName())) {
+ EnumerationListModel m = new EnumerationListModel();
+ m.setTarget(target);
+ pane = new UMLSingleRowSelector(m);
+ }
if (pane != null) {
JLabel label = new JLabel(prop.getName());
label.setLabelFor(pane);
@@ -368,7 +375,11 @@
list = new ScrollList( new UMLLinkedList(model,
true, true));
}
-
+ else if ("literals".equals(prop.getName())) {
+ model = new UMLEnumerationLiteralsListModel();
+ model.setTarget(target);
+ list = new ScrollList(model);
+ }
if (list != null) {
String name = prop.getName();
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/EnumerationListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/EnumerationListModel.java?view=auto&rev=15207
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/EnumerationListModel.java 2008-07-08 08:36:12-0700
@@ -0,0 +1,77 @@
+// $Id$
+// Copyright (c) 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 javax.swing.DefaultListModel;
+
+import org.argouml.model.Model;
+import org.argouml.ui.targetmanager.TargetEvent;
+import org.argouml.ui.targetmanager.TargetListener;
+import org.argouml.ui.targetmanager.TargetManager;
+
+/**
+ * The list model for the enumeration of a literal.
+ *
+ * @author [email protected]
+ */
+public class EnumerationListModel extends DefaultListModel implements TargetListener {
+
+ /**
+ * Constructor for EnumerationListModel.
+ */
+ public EnumerationListModel() {
+ super();
+ setTarget(TargetManager.getInstance().getModelTarget());
+ TargetManager.getInstance().addTargetListener(this);
+ }
+
+ /*
+ * @see TargetListener#targetAdded(TargetEvent)
+ */
+ public void targetAdded(TargetEvent e) {
+ setTarget(e.getNewTarget());
+ }
+
+ /*
+ * @see TargetListener#targetRemoved(TargetEvent)
+ */
+ public void targetRemoved(TargetEvent e) {
+ setTarget(e.getNewTarget());
+ }
+
+ /*
+ * @see TargetListener#targetSet(TargetEvent)
+ */
+ public void targetSet(TargetEvent e) {
+ setTarget(e.getNewTarget());
+ }
+
+ public void setTarget(Object t) {
+ removeAllElements();
+ if (Model.getFacade().isAEnumerationLiteral(t)) {
+ addElement(Model.getFacade().getEnumeration(t));
+ }
+ }
+}
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Enumeration.xml
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Enumeration.xml?view=auto&rev=15207
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Enumeration.xml 2008-07-08 08:36:12-0700
@@ -0,0 +1,20 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<panel>
+ <text name='name' />
+ <combo name='namespace' />
+ <optionbox name='visibility' />
+ <checkgroup name='modifiers'>
+ <checkbox name='abstract' />
+ <checkbox name='leaf' />
+ <checkbox name='root' />
+ <checkbox name='derived' />
+ </checkgroup>
+ <separator />
+ <list name="client_dependency" />
+ <list name="supplier_dependency" />
+ <list name="generalizations" />
+ <list name="specializations" />
+ <separator />
+ <list name="operations" />
+ <list name="literals" />
+</panel>
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/EnumerationLiteral.xml
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/EnumerationLiteral.xml?view=auto&rev=15207
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/EnumerationLiteral.xml 2008-07-08 08:36:12-0700
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<panel>
+ <text name='name' />
+ <singlerow name='enumeration' />
+</panel>
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.