svn commit: r15398 - trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2008-07-28 17:18:13-0700
New Revision: 15398

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java

Log:
New isReadOnly method - not yet implemented - how do we do this with new Model interface?

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&rev=15398&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java&r1=15397&r2=15398
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java	2008-07-28 17:18:13-0700
@@ -965,7 +965,9 @@
             }
         } else if (pName.equals("editing")
                 && Boolean.TRUE.equals(pve.getNewValue())) {
-            textEditStarted((FigText) src);
+            if (!isReadOnly()) {
+                textEditStarted((FigText) src);
+            }
         } else {
             super.propertyChange(pve);
         }
@@ -1020,6 +1022,15 @@
             SwingUtilities.invokeLater(doWorkRunnable);
         }
     }
+    
+    /**
+     * Return true if the model element that this Fig represents is read only
+     * @return The model element is read only.
+     */
+    private boolean isReadOnly() {
+        // TODO: Yet to implement
+        return false;
+    }
 
     /**
      * Called by propertyChanged when it detects that a stereotype
@@ -1147,10 +1158,9 @@
         }
         if (me.getClickCount() >= 2
                 && !(me.isPopupTrigger()
-                        || me.getModifiers() == InputEvent.BUTTON3_MASK)) {
-            if (getOwner() == null) {
-                return;
-            }
+                        || me.getModifiers() == InputEvent.BUTTON3_MASK)
+                && getOwner() != null
+                && !isReadOnly()) {
             Rectangle r = new Rectangle(me.getX() - 2, me.getY() - 2, 4, 4);
             Fig f = hitFig(r);
             if (f instanceof MouseListener && f.isVisible()) {
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.