svn commit: r15185 - branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: penyaskito
Date: 2008-07-06 11:08:09-0700
New Revision: 15185

Modified:
   branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLExpressionPanel.java
   branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java

Log:
Work on Expression fields.

Modified: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLExpressionPanel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLExpressionPanel.java?view=diff&rev=15185&p1=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLExpressionPanel.java&p2=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLExpressionPanel.java&r1=15184&r2=15185
==============================================================================
--- branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLExpressionPanel.java	(original)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLExpressionPanel.java	2008-07-06 11:08:09-0700
@@ -37,7 +37,9 @@
  */
 public class UMLExpressionPanel extends JPanel {
 
-    private UMLExpressionModel3 model;
+    private final UMLExpressionModel3 model;
+    private final UMLExpressionLanguageField languageField;
+    private final UMLExpressionBodyField bodyField;
     
     public UMLExpressionPanel(UMLExpressionModel3 model, String title) {
         
@@ -46,11 +48,13 @@
         this.setBorder(border);        
         
         this.model = model;
+        this.languageField = new UMLExpressionLanguageField(model,
+                false);
+        this.bodyField = new UMLExpressionBodyField(
+                model, true);
         
-        add(new UMLExpressionLanguageField(model,
-                false));        
-        add(new JScrollPane(new UMLExpressionBodyField(
-                model, true)));
+        add(languageField);        
+        add(new JScrollPane(bodyField));
     }
     
 }

Modified: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java?view=diff&rev=15185&p1=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java&p2=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java&r1=15184&r2=15185
==============================================================================
--- branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java	(original)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java	2008-07-06 11:08:09-0700
@@ -27,17 +27,21 @@
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 
+import org.argouml.model.Model;
 import org.argouml.ui.targetmanager.TargetEvent;
 import org.argouml.ui.targetmanager.TargetListener;
 import org.argouml.uml.ui.UMLExpressionModel2;
 
 /**
- *
+ * @author jrobbins
+ * @author jaap.branderhorst
  * @author penyaskito
  */
 public class UMLInitialValueExpressionModel 
     extends UMLExpressionModel3 {
 
+    
+    
     public UMLInitialValueExpressionModel() {
         super("initial value");
     }
@@ -51,9 +55,12 @@
      * @see org.argouml.uml.ui.UMLExpressionModel2#getExpression()
      */
     @Override
-    public Object getExpression() {
-        // TODO: Auto-generated method stub
-        return null;
+    public Object getExpression() {        
+        Object target = null; //TODO getTarget();
+        if (target == null) {
+            return null;
+        }
+        return Model.getFacade().getInitialValue(target);
     }
 
     /**
@@ -62,8 +69,7 @@
      */
     @Override
     public Object newExpression() {
-        // TODO: Auto-generated method stub
-        return null;
+        return Model.getDataTypesFactory().createExpression("", "");
     }
 
     /**
@@ -71,9 +77,9 @@
      * @see org.argouml.uml.ui.UMLExpressionModel2#setExpression(java.lang.Object)
      */
     @Override
-    public void setExpression(Object expr) {
-        // TODO: Auto-generated method stub
-
+    public void setExpression(Object expression) {
+        Object target = null; // TODO  getTarget();
+        Model.getCoreHelper().setInitialValue(target, expression);
     }
 
     public void targetAdded(TargetEvent e) {
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.