Author: penyaskito
Date: 2008-07-08 05:19:01-0700
New Revision: 15202
Added:
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLDefaultValueExpressionModel.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Parameter.xml (contents, props changed)
Modified:
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java
Log:
A panel for Parameters.
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=15202&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=15201&r2=15202
==============================================================================
--- 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 05:19:01-0700
@@ -37,6 +37,7 @@
import org.apache.log4j.Logger;
import org.argouml.core.propertypanels.ui.UMLClassifierPackageImportsListModel;
+import org.argouml.core.propertypanels.ui.UMLDefaultValueExpressionModel;
import org.argouml.core.propertypanels.ui.UMLExpressionModel3;
import org.argouml.core.propertypanels.ui.UMLExpressionPanel;
import org.argouml.core.propertypanels.ui.UMLInitialValueExpressionModel;
@@ -89,6 +90,8 @@
import org.argouml.uml.ui.foundation.core.UMLOperationMethodsListModel;
import org.argouml.uml.ui.foundation.core.UMLOperationRaisedSignalsListModel;
import org.argouml.uml.ui.foundation.core.UMLOperationSpecificationDocument;
+import org.argouml.uml.ui.foundation.core.UMLParameterBehavioralFeatListModel;
+import org.argouml.uml.ui.foundation.core.UMLParameterDirectionKindRadioButtonPanel;
import org.argouml.uml.ui.foundation.core.UMLStructuralFeatureChangeabilityRadioButtonPanel;
import org.argouml.uml.ui.foundation.core.UMLStructuralFeatureTypeComboBoxModel;
import org.tigris.swidgets.GridLayout2;
@@ -190,6 +193,13 @@
p = new UMLExpressionPanel(model, prop.getName());
control = p;
}
+ if ("default_value".equals(prop.getName())) {
+ UMLExpressionModel3 model = new UMLDefaultValueExpressionModel();
+ // model.setTarget(target);
+
+ p = new UMLExpressionPanel(model, prop.getName());
+ control = p;
+ }
else if ("specification".equals(prop.getName())) {
UMLPlainTextDocument document =
new UMLOperationSpecificationDocument();
@@ -227,6 +237,11 @@
model.setTarget(target);
pane = new UMLSingleRowSelector(model);
}
+ if ("feature".equals(prop.getName())) {
+ model = new UMLParameterBehavioralFeatListModel();
+ model.setTarget(target);
+ pane = new UMLSingleRowSelector(model);
+ }
if (pane != null) {
JLabel label = new JLabel(prop.getName());
label.setLabelFor(pane);
@@ -370,6 +385,13 @@
control = cPanel;
}
+ else if ("direction_kind".equals(prop.getName())) {
+ UMLRadioButtonPanel cPanel =
+ new UMLParameterDirectionKindRadioButtonPanel(
+ Translator.localize("label.parameter.kind"), true);
+ cPanel.setTarget(target);
+ control = cPanel;
+ }
if (control != null) {
panel.add(control);
}
@@ -454,6 +476,8 @@
model.setTarget(target);
final JComboBox combo = new UMLComboBox2(
model,
+ // TODO: The action is different for
+ // attributes and parameters. Issue #5222
ActionSetStructuralFeatureType.getInstance());
comp = combo;
}
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLDefaultValueExpressionModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLDefaultValueExpressionModel.java?view=auto&rev=15202
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLDefaultValueExpressionModel.java 2008-07-08 05:19:01-0700
@@ -0,0 +1,103 @@
+// $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 org.argouml.model.Model;
+import org.argouml.ui.targetmanager.TargetEvent;
+import org.argouml.ui.targetmanager.TargetManager;
+
+/**
+ *
+ * @author penyaskito
+ */
+public class UMLDefaultValueExpressionModel extends UMLExpressionModel3 {
+
+ /**
+ * The constructor.
+ *
+ * @param propertyName the name of the property
+ */
+ public UMLDefaultValueExpressionModel() {
+ super("default value");
+ }
+
+ /**
+ * The constructor.
+ *
+ * @param propertyName the name of the property
+ */
+ public UMLDefaultValueExpressionModel(String propertyName) {
+ super(propertyName);
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLExpressionModel2#getExpression()
+ */
+ public Object getExpression() {
+ Object target = TargetManager.getInstance().getTarget();
+ if (target == null) {
+ return null;
+ }
+ return Model.getFacade().getDefaultValue(target);
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLExpressionModel2#setExpression(java.lang.Object)
+ */
+ public void setExpression(Object expression) {
+ Object target = TargetManager.getInstance().getTarget();
+
+ if (target != null) {
+ Model.getCoreHelper().setDefaultValue(target, expression);
+ }
+ else {
+ // TODO: Log error
+ }
+
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLExpressionModel2#newExpression()
+ */
+ public Object newExpression() {
+ return Model.getDataTypesFactory().createExpression("", "");
+ }
+
+ public void targetAdded(TargetEvent e) {
+ // TODO: Auto-generated method stub
+
+ }
+
+ public void targetRemoved(TargetEvent e) {
+ // TODO: Auto-generated method stub
+
+ }
+
+ public void targetSet(TargetEvent e) {
+ // TODO: Auto-generated method stub
+
+ }
+
+}
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Parameter.xml
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Parameter.xml?view=auto&rev=15202
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Parameter.xml 2008-07-08 05:19:01-0700
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<panel>
+ <text name='name' />
+ <singlerow name='feature' />
+ <separator />
+ <combo name='type' />
+ <textarea name='default_value' />
+ <optionbox name='direction_kind' />
+</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.