Author: mvw
Date: 2008-02-03 13:39:51-0800
New Revision: 14076

Modified:
   trunk/src_new/org/argouml/i18n/label.properties
   trunk/src_new/org/argouml/kernel/ProjectSettings.java
   trunk/src_new/org/argouml/notation/Notation.java
   
trunk/src_new/org/argouml/notation/providers/uml/AssociationNameNotationUml.java
   trunk/src_new/org/argouml/notation/ui/SettingsTabNotation.java
   trunk/src_new/org/argouml/persistence/ArgoParser.java
   trunk/src_new/org/argouml/persistence/ArgoTokenTable.java
   trunk/src_new/org/argouml/persistence/argo.tee
   trunk/src_new/org/argouml/uml/diagram/ui/FigAssociation.java

Log:
Fix for issue 4969. Patch supplied by Jan Bares.

Add the ability to hide/show all association names.

Modified: trunk/src_new/org/argouml/i18n/label.properties
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/i18n/label.properties?view=diff&rev=14076&p1=trunk/src_new/org/argouml/i18n/label.properties&p2=trunk/src_new/org/argouml/i18n/label.properties&r1=14075&r2=14076
==============================================================================
--- trunk/src_new/org/argouml/i18n/label.properties     (original)
+++ trunk/src_new/org/argouml/i18n/label.properties     2008-02-03 13:39:51-0800
@@ -342,6 +342,7 @@
 label.shortcut-custom = Custom
 label.shortcut-default = Default
 label.shortcut-none = None
+label.show-associationnames = Show association names
 label.show-bold-names = Show name of nodes in bold font
 label.show-initialvalue = Show initial value
 label.show-multiplicity = Show multiplicity

Modified: trunk/src_new/org/argouml/kernel/ProjectSettings.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/kernel/ProjectSettings.java?view=diff&rev=14076&p1=trunk/src_new/org/argouml/kernel/ProjectSettings.java&p2=trunk/src_new/org/argouml/kernel/ProjectSettings.java&r1=14075&r2=14076
==============================================================================
--- trunk/src_new/org/argouml/kernel/ProjectSettings.java       (original)
+++ trunk/src_new/org/argouml/kernel/ProjectSettings.java       2008-02-03 
13:39:51-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2006-2007 The Regents of the University of California. All
+// Copyright (c) 2006-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
@@ -43,9 +43,9 @@
 
 /**
  * A datastructure for settings for a Project. <p>
- * 
+ *
  * Most getters return a string, since they are used by "argo.tee".
- * This is also the reason all these attributes 
+ * This is also the reason all these attributes
  * are not part of a Map or something. <p>
  *
  * TODO: The header comment is curently not used - this function
@@ -60,6 +60,7 @@
     private String notationLanguage;
     private boolean showBoldNames;
     private boolean useGuillemots;
+    private boolean showAssociationNames;
     private boolean showVisibility;
     private boolean showMultiplicity;
     private boolean showInitialValue;
@@ -69,7 +70,7 @@
     private boolean showSingularMultiplicities;
     private int defaultShadowWidth;
     private int defaultStereotypeView;
-    
+
     /* Diagram appearance settings with project scope: */
     private String fontName;
     private int fontSize;
@@ -78,7 +79,7 @@
     private Font fontItalic;
     private Font fontBold;
     private Font fontBoldItalic;
-    
+
     /* Generation preferences: */
     private String headerComment =
         "Your copyright and other header comments";
@@ -86,22 +87,28 @@
 
 
     /**
-     * Create a new set of project settings, 
+     * Create a new set of project settings,
      * based on the application defaults. <p>
-     * 
-     * The constructor is not public, since this 
+     *
+     * The constructor is not public, since this
      * class is only created from the Project..
      */
     ProjectSettings() {
         super();
-        
-        notationLanguage = 
+
+        notationLanguage =
             Notation.getConfiguredNotation().getConfigurationValue();
         NotationProviderFactory2.setCurrentLanguage(notationLanguage);
         showBoldNames = Configuration.getBoolean(
                 Notation.KEY_SHOW_BOLD_NAMES);
         useGuillemots = Configuration.getBoolean(
                 Notation.KEY_USE_GUILLEMOTS, false);
+        /*
+         * The next one defaults to TRUE, to stay compatible with older
+         * ArgoUML versions that did not have this setting:
+         */
+        showAssociationNames = Configuration.getBoolean(
+                Notation.KEY_SHOW_ASSOCIATION_NAMES, true);
         showVisibility = Configuration.getBoolean(
                 Notation.KEY_SHOW_VISIBILITY);
         showMultiplicity = Configuration.getBoolean(
@@ -119,12 +126,12 @@
                 Notation.KEY_SHOW_STEREOTYPES);
         /*
          * The next one defaults to TRUE, despite that this is
-         * NOT compatible with older ArgoUML versions 
-         * (before 0.24) that did 
+         * NOT compatible with older ArgoUML versions
+         * (before 0.24) that did
          * not have this setting - see issue 1395 for the rationale:
          */
         showSingularMultiplicities = Configuration.getBoolean(
-                Notation.KEY_SHOW_SINGULAR_MULTIPLICITIES, true); 
+                Notation.KEY_SHOW_SINGULAR_MULTIPLICITIES, true);
         defaultShadowWidth = Configuration.getInteger(
                 Notation.KEY_DEFAULT_SHADOW_WIDTH, 1);
         defaultStereotypeView = Configuration.getInteger(
@@ -156,6 +163,7 @@
         setNotationLanguage(getNotationLanguage());
         setShowBoldNames(getShowBoldNamesValue());
         setUseGuillemots(getUseGuillemotsValue());
+        setShowAssociationNames(getShowAssociationNamesValue());
         setShowVisibility(getShowVisibilityValue());
         setShowMultiplicity(getShowMultiplicityValue());
         setShowInitialValue(getShowInitialValueValue());
@@ -170,7 +178,7 @@
 
     /**
      * Used by "argo.tee".
-     * 
+     *
      * @return Returns the notation language.
      */
     public String getNotationLanguage() {
@@ -194,9 +202,9 @@
             /* This Notation is not available! */
             return false;
         }
-        
+
         final String oldLanguage = notationLanguage;
-        
+
         Memento memento = new Memento() {
             private final ConfigurationKey key = Notation.KEY_DEFAULT_NOTATION;
 
@@ -219,7 +227,7 @@
         ProjectManager.getManager().setSaveEnabled(true);
         return true;
     }
-    
+
     /**
      * @param nn the new notation language
      */
@@ -229,7 +237,7 @@
 
     /**
      * Used by "argo.tee".
-     * 
+     *
      * @return Returns "true" if we show bold names.
      */
     public String getShowBoldNames() {
@@ -278,7 +286,7 @@
 
     /**
      * Used by "argo.tee".
-     * 
+     *
      * @return Returns "true" if we show guillemots.
      */
     public String getUseGuillemots() {
@@ -342,7 +350,56 @@
 
     /**
      * Used by "argo.tee".
-     * 
+     *
+     * @return Returns "true" if we show association names.
+     */
+    public String getShowAssociationNames() {
+        return Boolean.toString(showAssociationNames);
+    }
+
+    /**
+     * @return Returns <code>true</code> if we show association names.
+     */
+    public boolean getShowAssociationNamesValue() {
+        return showAssociationNames;
+    }
+
+    /**
+     * @param showem <code>true</code> if association names are to be shown.
+     */
+    public void setShowAssociationNames(String showem) {
+        setShowAssociationNames(Boolean.valueOf(showem).booleanValue());
+    }
+
+    /**
+     * @param showem <code>true</code> if association names are to be shown.
+     */
+    public void setShowAssociationNames(final boolean showem) {
+        if (showAssociationNames == showem) return;
+
+        Memento memento = new Memento() {
+            private final ConfigurationKey key = 
Notation.KEY_SHOW_ASSOCIATION_NAMES;
+
+            public void redo() {
+                showAssociationNames = showem;
+                fireNotationEvent(key, !showem, showem);
+            }
+
+            public void undo() {
+                showAssociationNames = !showem;
+                fireNotationEvent(key, showem, !showem);
+            }
+        };
+        if (UndoManager.getInstance().isGenerateMementos()) {
+            UndoManager.getInstance().addMemento(memento);
+        }
+        memento.redo();
+        ProjectManager.getManager().setSaveEnabled(true);
+    }
+
+    /**
+     * Used by "argo.tee".
+     *
      * @return Returns "true" if we show visibilities.
      */
     public String getShowVisibility() {
@@ -391,7 +448,7 @@
 
     /**
      * Used by "argo.tee".
-     * 
+     *
      * @return Returns "true" if we show multiplicities.
      */
     public String getShowMultiplicity() {
@@ -440,7 +497,7 @@
 
     /**
      * Used by "argo.tee".
-     * 
+     *
      * @return Returns "true" if we show initial values.
      */
     public String getShowInitialValue() {
@@ -490,7 +547,7 @@
 
     /**
      * Used by "argo.tee".
-     * 
+     *
      * @return Returns "true" if we show properties.
      */
     public String getShowProperties() {
@@ -540,7 +597,7 @@
 
     /**
      * Used by "argo.tee".
-     * 
+     *
      * @return Returns "true" if we show types.
      */
     public String getShowTypes() {
@@ -590,7 +647,7 @@
 
     /**
      * Used by "argo.tee".
-     * 
+     *
      * @return Returns "true" if we show stereotypes.
      */
     public String getShowStereotypes() {
@@ -639,7 +696,7 @@
 
     /**
      * Used by "argo.tee".
-     * 
+     *
      * @return Returns "true" if we show "1" Multiplicities.
      */
     public String getShowSingularMultiplicities() {
@@ -689,7 +746,7 @@
 
     /**
      * Used by "argo.tee".
-     * 
+     *
      * @return Returns the shadow width.
      */
     public String getDefaultShadowWidth() {
@@ -738,37 +795,37 @@
     public void setDefaultShadowWidth(String width) {
         setDefaultShadowWidth(Integer.parseInt(width));
     }
-    
+
     /**
      * Used by "argo.tee".
-     * 
+     *
      * @return Returns the default stereotype view
      */
     public String getDefaultStereotypeView() {
         return Integer.valueOf(defaultStereotypeView).toString();
     }
-    
+
     /**
      * @return Returns the default stereotype view
      */
     public int getDefaultStereotypeViewValue() {
         return defaultStereotypeView;
     }
-    
-    
+
+
     /**
      * Used by "argo.tee".
-     * 
+     *
      * @return the output directory name
      */
-    public String getGenerationOutputDir() { 
-        return generationOutputDir; 
+    public String getGenerationOutputDir() {
+        return generationOutputDir;
     }
 
     /**
      * @param od the output directory name
      */
-    public void setGenerationOutputDir(String od) { 
+    public void setGenerationOutputDir(String od) {
         generationOutputDir = od;
         Configuration.setString(Argo.KEY_MOST_RECENT_EXPORT_DIRECTORY, od);
     }
@@ -792,7 +849,7 @@
         final int oldValue = defaultStereotypeView;
 
         Memento memento = new Memento() {
-            private final ConfigurationKey key = 
+            private final ConfigurationKey key =
                 ProfileConfiguration.KEY_DEFAULT_STEREOTYPE_VIEW;
 
             public void redo() {
@@ -827,7 +884,7 @@
      */
     private void fireNotationEvent(
             ConfigurationKey key, int oldValue, int newValue) {
-        fireNotationEvent(key, Integer.toString(oldValue), 
+        fireNotationEvent(key, Integer.toString(oldValue),
                 Integer.toString(newValue));
     }
 
@@ -840,7 +897,7 @@
      */
     private void fireNotationEvent(ConfigurationKey key, boolean oldValue,
             boolean newValue) {
-        fireNotationEvent(key, Boolean.toString(oldValue), 
+        fireNotationEvent(key, Boolean.toString(oldValue),
                 Boolean.toString(newValue));
     }
 
@@ -859,7 +916,7 @@
     }
 
     /**
-     * Convenience methods to fire diagram appearance 
+     * Convenience methods to fire diagram appearance
      * configuration change events.
      *
      * @param key the ConfigurationKey that is related to the change
@@ -874,7 +931,7 @@
 
 
     /**
-     * Convenience methods to fire diagram appearance 
+     * Convenience methods to fire diagram appearance
      * configuration change events.
      *
      * @param key the ConfigurationKey that is related to the change
@@ -890,9 +947,9 @@
 
     /**
      * Diagram font name. <p>
-     * 
+     *
      * Used by "argo.tee".
-     * 
+     *
      * @return diagram font name.
      */
     public String getFontName() {
@@ -914,9 +971,9 @@
 
     /**
      * Diagram font size. <p>
-     * 
+     *
      * Used by "argo.tee".
-     * 
+     *
      * @return diagram font size.
      */
     public int getFontSize() {
@@ -940,14 +997,14 @@
         fontPlain = new Font(fontName, Font.PLAIN, fontSize);
         fontItalic = new Font(fontName, Font.ITALIC, fontSize + 2);
         fontBold = new Font(fontName, Font.BOLD, fontSize + 2);
-        fontBoldItalic = new Font(fontName, 
+        fontBoldItalic = new Font(fontName,
                 Font.BOLD | Font.ITALIC, fontSize + 2);
     }
 
     /**
-     * Returns the Plain diagram font which corresponds 
+     * Returns the Plain diagram font which corresponds
      * to selected parameters.
-     * 
+     *
      * @return plain diagram font
      */
     public Font getFontPlain() {
@@ -955,9 +1012,9 @@
     }
 
     /**
-     * Returns the Italic diagram font which corresponds 
+     * Returns the Italic diagram font which corresponds
      * to selected parameters.
-     * 
+     *
      * @return italic diagram font
      */
     public Font getFontItalic() {
@@ -965,9 +1022,9 @@
     }
 
     /**
-     * Returns the Bold diagram font which corresponds 
+     * Returns the Bold diagram font which corresponds
      * to selected parameters.
-     * 
+     *
      * @return bold diagram font
      */
     public Font getFontBold() {
@@ -975,18 +1032,18 @@
     }
 
     /**
-     * Returns the Bold-Italic diagram font which corresponds 
+     * Returns the Bold-Italic diagram font which corresponds
      * to selected parameters.
-     * 
+     *
      * @return bold-italic diagram font
      */
     public Font getFontBoldItalic() {
         return fontBoldItalic;
     }
-    
+
     /**
      * Utility function to convert a font style integer into a Font.
-     * 
+     *
      * @param fontStyle the style; see the predefined constants in Font
      * @return the Font that corresponds to the style
      */

Modified: trunk/src_new/org/argouml/notation/Notation.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/notation/Notation.java?view=diff&rev=14076&p1=trunk/src_new/org/argouml/notation/Notation.java&p2=trunk/src_new/org/argouml/notation/Notation.java&r1=14075&r2=14076
==============================================================================
--- trunk/src_new/org/argouml/notation/Notation.java    (original)
+++ trunk/src_new/org/argouml/notation/Notation.java    2008-02-03 13:39:51-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// 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
@@ -103,6 +103,13 @@
         Configuration.makeKey("notation", "guillemots");
 
     /**
+     * Indicates if the user wants to see associaction names (public,
+     * private, protected or # + -).
+     */
+    public static final ConfigurationKey KEY_SHOW_ASSOCIATION_NAMES =
+        Configuration.makeKey("notation", "show", "associationnames");
+
+    /**
      * Indicates if the user wants to see visibility signs (public,
      * private, protected or # + -).
      */
@@ -158,6 +165,7 @@
         Configuration.addListener(KEY_SHOW_TYPES, this);
         Configuration.addListener(KEY_SHOW_MULTIPLICITY, this);
         Configuration.addListener(KEY_SHOW_PROPERTIES, this);
+        Configuration.addListener(KEY_SHOW_ASSOCIATION_NAMES, this);
         Configuration.addListener(KEY_SHOW_VISIBILITY, this);
         Configuration.addListener(KEY_SHOW_INITIAL_VALUE, this);
     }
@@ -234,7 +242,7 @@
 
     /**
      * Get list of available notations, of type NotationName.
-     * This returns an immutable list so that 
+     * This returns an immutable list so that
      * the implementation type isn't exposed in the API.
      *
      * @return list of available notations
@@ -242,13 +250,13 @@
     public static List<NotationName> getAvailableNotations() {
         return NotationNameImpl.getAvailableNotations();
     }
-    
+
     /**
      * Remove a complete Notation language.
-     * This is to be used by plugins that implement their own notation, 
+     * This is to be used by plugins that implement their own notation,
      * and that are removed. <p>
      * This function fails if the given notation does not exist.
-     * 
+     *
      * @param theNotation the given NotationName
      * @return true if the Notation indeed is removed
      */

Modified: 
trunk/src_new/org/argouml/notation/providers/uml/AssociationNameNotationUml.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/notation/providers/uml/AssociationNameNotationUml.java?view=diff&rev=14076&p1=trunk/src_new/org/argouml/notation/providers/uml/AssociationNameNotationUml.java&p2=trunk/src_new/org/argouml/notation/providers/uml/AssociationNameNotationUml.java&r1=14075&r2=14076
==============================================================================
--- 
trunk/src_new/org/argouml/notation/providers/uml/AssociationNameNotationUml.java
    (original)
+++ 
trunk/src_new/org/argouml/notation/providers/uml/AssociationNameNotationUml.java
    2008-02-03 13:39:51-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2006-2007 The Regents of the University of California. All
+// Copyright (c) 2006-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
@@ -44,15 +44,15 @@
  * ie a string on the format:<pre>
  *     [ &lt;&lt; stereotype &gt;&gt;] [+|-|#] [name]
  * </pre>
- * 
+ *
  * @author Michiel
  */
 public class AssociationNameNotationUml extends AssociationNameNotation {
 
     /**
      * The constructor.
-     * 
-     * @param association the association modelelement 
+     *
+     * @param association the association modelelement
      * that we represent in textual form.
      */
     public AssociationNameNotationUml(Object association) {
@@ -88,6 +88,12 @@
      * @see 
org.argouml.notation.providers.NotationProvider#toString(java.lang.Object, 
java.util.Map)
      */
     public String toString(Object modelElement, Map args) {
+        Project p = ProjectManager.getManager().getCurrentProject();
+        ProjectSettings ps = p.getProjectSettings();
+
+        if (!ps.getShowAssociationNamesValue())
+            return "";
+
         String name = Model.getFacade().getName(modelElement);
         StringBuffer sb = new StringBuffer("");
         if (isValue("fullyHandleStereotypes", args)) {
@@ -122,14 +128,14 @@
                 first = false;
             }
         }
-        Project project = 
+        Project project =
             ProjectManager.getManager().getCurrentProject();
         ProjectSettings ps = project.getProjectSettings();
         return first ? "" : ps.getLeftGuillemot()
             + sb.toString()
             + ps.getRightGuillemot();
     }
-    
+
     /**
      * @param modelElement the UML element to generate for
      * @param args arguments that influence the generation

Modified: trunk/src_new/org/argouml/notation/ui/SettingsTabNotation.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/notation/ui/SettingsTabNotation.java?view=diff&rev=14076&p1=trunk/src_new/org/argouml/notation/ui/SettingsTabNotation.java&p2=trunk/src_new/org/argouml/notation/ui/SettingsTabNotation.java&r1=14075&r2=14076
==============================================================================
--- trunk/src_new/org/argouml/notation/ui/SettingsTabNotation.java      
(original)
+++ trunk/src_new/org/argouml/notation/ui/SettingsTabNotation.java      
2008-02-03 13:39:51-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// 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
@@ -49,24 +49,25 @@
 
 /**
  * Settings tab panel for handling Notation settings. <p>
- * 
+ *
  * It supports different scopes: application and project.
- * The former is stored in the properties file in the user-directory, 
+ * The former is stored in the properties file in the user-directory,
  * the latter in the project file (.zargo,...). <p>
- * 
- * This class is written in a way that supports 
+ *
+ * This class is written in a way that supports
  * adding more scopes easily.
  *
  * @author Thierry Lach
  * @since  0.9.4
  */
-public class SettingsTabNotation     
+public class SettingsTabNotation
     extends JPanel
     implements GUISettingsTabInterface {
 
     private JComboBox notationLanguage;
     private JCheckBox showBoldNames;
     private JCheckBox useGuillemots;
+    private JCheckBox showAssociationNames;
     private JCheckBox showVisibility;
     private JCheckBox showMultiplicity;
     private JCheckBox showInitialValue;
@@ -75,12 +76,12 @@
     private JCheckBox showStereotypes;
     private JCheckBox showSingularMultiplicities;
     private ShadowComboBox defaultShadowWidth;
-    
+
     private int scope;
 
     /**
      * The constructor.
-     * We currently support 2 scopes, but this class is written 
+     * We currently support 2 scopes, but this class is written
      * in a way to easily extend that.
      *
      * @param settingsScope the scope of the settings
@@ -125,6 +126,9 @@
         // Jaap Branderhorst
         // from here made visibility etc. configurable
 
+        showAssociationNames = createCheckBox("label.show-associationnames");
+        top.add(showAssociationNames, constraints);
+
         showVisibility = createCheckBox("label.show-visibility");
         top.add(showVisibility, constraints);
 
@@ -142,8 +146,8 @@
 
         showStereotypes = createCheckBox("label.show-stereotypes");
         top.add(showStereotypes, constraints);
-        
-        showSingularMultiplicities = 
+
+        showSingularMultiplicities =
             createCheckBox("label.show-singular-multiplicities");
         top.add(showSingularMultiplicities, constraints);
 
@@ -171,6 +175,8 @@
             useGuillemots.setSelected(getBoolean(
                     Notation.KEY_USE_GUILLEMOTS));
             notationLanguage.setSelectedItem(Notation.getConfiguredNotation());
+            showAssociationNames.setSelected(Configuration.getBoolean(
+                    Notation.KEY_SHOW_ASSOCIATION_NAMES, true));
             showVisibility.setSelected(getBoolean(
                     Notation.KEY_SHOW_VISIBILITY));
             showInitialValue.setSelected(getBoolean(
@@ -189,8 +195,8 @@
                     Notation.KEY_SHOW_STEREOTYPES));
             /*
              * The next one defaults to TRUE, despite that this is
-             * NOT compatible with older ArgoUML versions 
-             * (before 0.24) that did 
+             * NOT compatible with older ArgoUML versions
+             * (before 0.24) that did
              * not have this setting - see issue 1395 for the rationale:
              */
             showSingularMultiplicities.setSelected(Configuration.getBoolean(
@@ -206,6 +212,7 @@
                     ps.getNotationLanguage()));
             showBoldNames.setSelected(ps.getShowBoldNamesValue());
             useGuillemots.setSelected(ps.getUseGuillemotsValue());
+            
showAssociationNames.setSelected(ps.getShowAssociationNamesValue());
             showVisibility.setSelected(ps.getShowVisibilityValue());
             showMultiplicity.setSelected(ps.getShowMultiplicityValue());
             showInitialValue.setSelected(ps.getShowInitialValueValue());
@@ -240,6 +247,8 @@
                     showBoldNames.isSelected());
             Configuration.setBoolean(Notation.KEY_USE_GUILLEMOTS,
                     useGuillemots.isSelected());
+            Configuration.setBoolean(Notation.KEY_SHOW_ASSOCIATION_NAMES,
+                    showAssociationNames.isSelected());
             Configuration.setBoolean(Notation.KEY_SHOW_VISIBILITY,
                     showVisibility.isSelected());
             Configuration.setBoolean(Notation.KEY_SHOW_MULTIPLICITY,
@@ -264,6 +273,7 @@
             if (nn != null) ps.setNotationLanguage(nn.getConfigurationValue());
             ps.setShowBoldNames(showBoldNames.isSelected());
             ps.setUseGuillemots(useGuillemots.isSelected());
+            ps.setShowAssociationNames(showAssociationNames.isSelected());
             ps.setShowVisibility(showVisibility.isSelected());
             ps.setShowMultiplicity(showMultiplicity.isSelected());
             ps.setShowInitialValue(showInitialValue.isSelected());
@@ -293,6 +303,8 @@
                     Notation.KEY_SHOW_BOLD_NAMES));
             useGuillemots.setSelected(getBoolean(
                     Notation.KEY_USE_GUILLEMOTS));
+            showAssociationNames.setSelected(Configuration.getBoolean(
+                    Notation.KEY_SHOW_ASSOCIATION_NAMES, true));
             showVisibility.setSelected(getBoolean(
                     Notation.KEY_SHOW_VISIBILITY));
             showMultiplicity.setSelected(getBoolean(

Modified: trunk/src_new/org/argouml/persistence/ArgoParser.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/persistence/ArgoParser.java?view=diff&rev=14076&p1=trunk/src_new/org/argouml/persistence/ArgoParser.java&p2=trunk/src_new/org/argouml/persistence/ArgoParser.java&r1=14075&r2=14076
==============================================================================
--- trunk/src_new/org/argouml/persistence/ArgoParser.java       (original)
+++ trunk/src_new/org/argouml/persistence/ArgoParser.java       2008-02-03 
13:39:51-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// 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
@@ -46,7 +46,7 @@
     private static final Logger LOG = Logger.getLogger(ArgoParser.class);
 
     private Project project;
-    
+
     private ProjectSettings ps;
 
     private ArgoTokenTable tokens = new ArgoTokenTable();
@@ -75,7 +75,7 @@
         }
 
         preRead(theProject);
-        
+
         try {
             parse(source);
         } catch (SAXException e) {
@@ -83,7 +83,7 @@
             throw e;
         }
     }
-    
+
     /**
      * @param theProject the project to populate
      * @param reader the reader
@@ -98,7 +98,7 @@
         }
 
         preRead(theProject);
-        
+
         try {
             parse(reader);
         } catch (SAXException e) {
@@ -122,7 +122,7 @@
         LOG.error(projectName);
         PersistenceManager.getInstance().setLastLoadMessage(e.toString());
     }
-    
+
     /**
      * Get the project to which the URI is to be parsed.
      * @return the project
@@ -235,6 +235,9 @@
         case ArgoTokenTable.TOKEN_GENERATION_OUTPUT_DIR:
             handleGenerationOutputDir(e);
             break;
+        case ArgoTokenTable.TOKEN_SHOWASSOCIATIONNAMES:
+            handleShowAssociationNames(e);
+            break;
         default:
             if (DBG) {
                 LOG.warn("WARNING: unknown end tag:" + e.getName());
@@ -340,17 +343,17 @@
         String historyfile = e.getAttribute("name").trim();
         project.setHistoryFile(historyfile);
     }
-    
+
     /**
      * @param e the element
      */
     protected void handleNotationLanguage(XMLElement e) {
         String language = e.getText().trim();
         boolean success = ps.setNotationLanguage(language);
-        /* TODO: Here we should e.g. show the user a message that 
-         * the loaded project was using a Notation that is not 
-         * currently available and a fall back on the default Notation 
-         * was done. Maybe this can be implemented in the 
+        /* TODO: Here we should e.g. show the user a message that
+         * the loaded project was using a Notation that is not
+         * currently available and a fall back on the default Notation
+         * was done. Maybe this can be implemented in the
          * PersistenceManager? */
     }
 
@@ -455,6 +458,14 @@
     }
 
     /**
+     * @param e the element
+     */
+    protected void handleShowAssociationNames(XMLElement e) {
+        String showAssociationNames = e.getText().trim();
+        ps.setShowAssociationNames(showAssociationNames);
+    }
+
+    /**
      * Get the number of diagram members read.
      * @return the number of diagram members read.
      */

Modified: trunk/src_new/org/argouml/persistence/ArgoTokenTable.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/persistence/ArgoTokenTable.java?view=diff&rev=14076&p1=trunk/src_new/org/argouml/persistence/ArgoTokenTable.java&p2=trunk/src_new/org/argouml/persistence/ArgoTokenTable.java&r1=14075&r2=14076
==============================================================================
--- trunk/src_new/org/argouml/persistence/ArgoTokenTable.java   (original)
+++ trunk/src_new/org/argouml/persistence/ArgoTokenTable.java   2008-02-03 
13:39:51-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// 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
@@ -25,9 +25,9 @@
 package org.argouml.persistence;
 
 
-/** 
+/**
  * These strings are saved in the final output in a zargo.
- * 
+ *
  * @author Jim Holt
  */
 
@@ -56,17 +56,19 @@
     private static final String STRING_NOTATIONLANGUAGE = "notationlanguage";
     private static final String STRING_SHOWBOLDNAMES = "showboldnames";
     private static final String STRING_USEGUILLEMOTS = "useguillemots";
+    private static final String STRING_SHOWASSOCIATIONNAMES
+        = "showassociationnames";
     private static final String STRING_SHOWVISIBILITY = "showvisibility";
     private static final String STRING_SHOWMULTIPLICITY = "showmultiplicity";
     private static final String STRING_SHOWINITIALVALUE = "showinitialvalue";
     private static final String STRING_SHOWPROPERTIES = "showproperties";
     private static final String STRING_SHOWTYPES = "showtypes";
     private static final String STRING_SHOWSTEREOTYPES = "showstereotypes";
-    private static final String STRING_DEFAULTSHADOWWIDTH 
+    private static final String STRING_DEFAULTSHADOWWIDTH
         = "defaultshadowwidth";
     private static final String STRING_FONTNAME = "fontname";
     private static final String STRING_FONTSIZE = "fontsize";
-    private static final String STRING_GENERATION_OUTPUT_DIR 
+    private static final String STRING_GENERATION_OUTPUT_DIR
         = "generationoutputdir";
 
     /** The token for argo. */
@@ -116,6 +118,8 @@
     public static final int    TOKEN_FONTSIZE           = 22;
     /** A token for Generation Settings. */
     public static final int    TOKEN_GENERATION_OUTPUT_DIR     = 23;
+    /** A token for Generation Settings. */
+    public static final int    TOKEN_SHOWASSOCIATIONNAMES     = 24;
 
     /** The token for undefined. */
     public static final int    TOKEN_UNDEFINED               = 99;
@@ -146,12 +150,14 @@
         addToken(STRING_SHOWPROPERTIES, Integer.valueOf(TOKEN_SHOWPROPERTIES));
         addToken(STRING_SHOWTYPES, Integer.valueOf(TOKEN_SHOWTYPES));
         addToken(STRING_SHOWSTEREOTYPES, 
Integer.valueOf(TOKEN_SHOWSTEREOTYPES));
-        addToken(STRING_DEFAULTSHADOWWIDTH, 
+        addToken(STRING_DEFAULTSHADOWWIDTH,
                 Integer.valueOf(TOKEN_DEFAULTSHADOWWIDTH));
         addToken(STRING_FONTNAME, Integer.valueOf(TOKEN_FONTNAME));
         addToken(STRING_FONTSIZE, Integer.valueOf(TOKEN_FONTSIZE));
-        addToken(STRING_GENERATION_OUTPUT_DIR, 
+        addToken(STRING_GENERATION_OUTPUT_DIR,
                 Integer.valueOf(TOKEN_GENERATION_OUTPUT_DIR));
+        addToken(STRING_SHOWASSOCIATIONNAMES,
+                Integer.valueOf(TOKEN_SHOWASSOCIATIONNAMES));
     }
 
 } /* end class ArgoTokenTable */

Modified: trunk/src_new/org/argouml/persistence/argo.tee
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/persistence/argo.tee?view=diff&rev=14076&p1=trunk/src_new/org/argouml/persistence/argo.tee&p2=trunk/src_new/org/argouml/persistence/argo.tee&r1=14075&r2=14076
==============================================================================
--- trunk/src_new/org/argouml/persistence/argo.tee      (original)
+++ trunk/src_new/org/argouml/persistence/argo.tee      2008-02-03 13:39:51-0800
@@ -12,7 +12,30 @@
 
 <!-- Original Author: [EMAIL PROTECTED] -->
 <!-- $Id$ -->
-
+<!--
+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.
+-->
 
 <TemplateSet>
 
@@ -33,6 +56,7 @@
     
<notationlanguage><ocl>self.projectSettings.notationLanguage</ocl></notationlanguage>
     
<showboldnames><ocl>self.projectSettings.showBoldNames</ocl></showboldnames>
     
<useguillemots><ocl>self.projectSettings.useGuillemots</ocl></useguillemots>
+    
<showassociationnames><ocl>self.projectSettings.showAssociationNames</ocl></showassociationnames>
     
<showvisibility><ocl>self.projectSettings.showVisibility</ocl></showvisibility>
     
<showmultiplicity><ocl>self.projectSettings.showMultiplicity</ocl></showmultiplicity>
     
<showinitialvalue><ocl>self.projectSettings.showInitialValue</ocl></showinitialvalue>
@@ -46,7 +70,7 @@
     
<defaultstereotypeview><ocl>self.projectSettings.defaultStereotypeView</ocl></defaultstereotypeview>
     
<generationoutputdir><ocl>self.projectSettings.generationOutputDir</ocl></generationoutputdir>
   </settings>
-  
+
   <searchpath href="<ocl>self.searchPathList</ocl>" />
 
   <ocl>self.members</ocl>

Modified: trunk/src_new/org/argouml/uml/diagram/ui/FigAssociation.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/FigAssociation.java?view=diff&rev=14076&p1=trunk/src_new/org/argouml/uml/diagram/ui/FigAssociation.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/FigAssociation.java&r1=14075&r2=14076
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/FigAssociation.java        
(original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/FigAssociation.java        
2008-02-03 13:39:51-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// 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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to