Author: tfmorris Date: 2008-11-08 00:13:25-0800 New Revision: 15982 Modified: trunk/src/argouml-app/src/org/argouml/kernel/Project.java trunk/src/argouml-app/src/org/argouml/kernel/ProjectSettings.java trunk/src/argouml-app/src/org/argouml/persistence/ArgoParser.java trunk/src/argouml-app/src/org/argouml/persistence/ArgoTokenTable.java trunk/src/argouml-app/src/org/argouml/persistence/argo.tee trunk/src/argouml-app/src/org/argouml/uml/generator/ui/ClassGenerationDialog.java
Log: Issue 5373: Remove user code gen directory from project file http://argouml.tigris.org/issues/show_bug.cgi?id=5373 Modified: trunk/src/argouml-app/src/org/argouml/kernel/Project.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/kernel/Project.java?view=diff&rev=15982&p1=trunk/src/argouml-app/src/org/argouml/kernel/Project.java&p2=trunk/src/argouml-app/src/org/argouml/kernel/Project.java&r1=15981&r2=15982 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/kernel/Project.java (original) +++ trunk/src/argouml-app/src/org/argouml/kernel/Project.java 2008-11-08 00:13:25-0800 @@ -131,6 +131,7 @@ * @return the search path * @deprecated by tfmorris for 0.25.4. Use [EMAIL PROTECTED] #getSearchPathList()}. */ + // TODO: Unused? @Deprecated public Vector<String> getSearchPath(); @@ -139,17 +140,20 @@ * * @return the search path */ + // TODO: Unused? public List<String> getSearchPathList(); /** * @param searchPathElement the element to be added to the searchpath */ + // TODO: Unused? public void addSearchPath(String searchPathElement); /** * Sets the searchpath. * @param theSearchpath The searchpath to set */ + // TODO: Unused? public void setSearchPath(final List<String> theSearchpath); /** @@ -592,6 +596,7 @@ * @return Vector * @deprecated for 0.25.4 by tfmorris. Use [EMAIL PROTECTED] #getSearchPathList()}. */ + // TODO: Unused? @Deprecated public Vector<String> getSearchpath(); @@ -612,6 +617,7 @@ * @param theSearchpath The searchpath to set * @deprecated for 0.25.4 by tfmorris. Use [EMAIL PROTECTED] #setSearchPath(List)}. */ + // TODO: Unused? @Deprecated public void setSearchpath(final Vector<String> theSearchpath); Modified: trunk/src/argouml-app/src/org/argouml/kernel/ProjectSettings.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/kernel/ProjectSettings.java?view=diff&rev=15982&p1=trunk/src/argouml-app/src/org/argouml/kernel/ProjectSettings.java&p2=trunk/src/argouml-app/src/org/argouml/kernel/ProjectSettings.java&r1=15981&r2=15982 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/kernel/ProjectSettings.java (original) +++ trunk/src/argouml-app/src/org/argouml/kernel/ProjectSettings.java 2008-11-08 00:13:25-0800 @@ -27,7 +27,6 @@ import java.awt.Font; import java.beans.PropertyChangeEvent; -import org.argouml.application.api.Argo; import org.argouml.application.events.ArgoDiagramAppearanceEvent; import org.argouml.application.events.ArgoEventPump; import org.argouml.application.events.ArgoEventTypes; @@ -84,7 +83,6 @@ /* Generation preferences: */ private String headerComment = "Your copyright and other header comments"; - private String generationOutputDir; /** @@ -150,14 +148,6 @@ /* And initialise some fonts: */ initFonts(); - /* Generation preferences: */ - if (System.getProperty("file.separator").equals("/")) { - generationOutputDir = "/tmp"; - } else { - generationOutputDir = System.getProperty("java.io.tmpdir"); - } - generationOutputDir = Configuration.getString( - Argo.KEY_MOST_RECENT_EXPORT_DIRECTORY, generationOutputDir); } /** @@ -271,7 +261,9 @@ * @return true if the notation is set - false if it does not exist */ public boolean setNotationLanguage(final String newLanguage) { - if (notationLanguage.equals(newLanguage)) return true; + if (notationLanguage.equals(newLanguage)) { + return true; + } if (Notation.findNotation(newLanguage) == null) { /* This Notation is not available! */ return false; @@ -336,7 +328,9 @@ * @param showem <code>true</code> if names are to be shown in bold font. */ public void setShowBoldNames(final boolean showem) { - if (showBoldNames == showem) return; + if (showBoldNames == showem) { + return; + } Memento memento = new Memento() { private final ConfigurationKey key = Notation.KEY_SHOW_BOLD_NAMES; @@ -387,7 +381,9 @@ */ public void setUseGuillemots(final boolean showem) { - if (useGuillemots == showem) return; + if (useGuillemots == showem) { + return; + } Memento memento = new Memento() { private final ConfigurationKey key = Notation.KEY_USE_GUILLEMOTS; @@ -450,7 +446,9 @@ * @param showem <code>true</code> if association names are to be shown. */ public void setShowAssociationNames(final boolean showem) { - if (showAssociationNames == showem) return; + if (showAssociationNames == showem) { + return; + } Memento memento = new Memento() { private final ConfigurationKey key = @@ -500,7 +498,9 @@ * @param showem <code>true</code> if visibilities are to be shown. */ public void setShowVisibility(final boolean showem) { - if (showVisibility == showem) return; + if (showVisibility == showem) { + return; + } Memento memento = new Memento() { private final ConfigurationKey key = Notation.KEY_SHOW_VISIBILITY; @@ -549,7 +549,9 @@ * @param showem <code>true</code> if the multiplicity is to be shown. */ public void setShowMultiplicity(final boolean showem) { - if (showMultiplicity == showem) return; + if (showMultiplicity == showem) { + return; + } Memento memento = new Memento() { private final ConfigurationKey key = Notation.KEY_SHOW_MULTIPLICITY; @@ -598,7 +600,9 @@ * @param showem <code>true</code> if initial values are to be shown. */ public void setShowInitialValue(final boolean showem) { - if (showInitialValue == showem) return; + if (showInitialValue == showem) { + return; + } Memento memento = new Memento() { private final ConfigurationKey key = @@ -648,7 +652,9 @@ * @param showem <code>true</code> if properties are to be shown. */ public void setShowProperties(final boolean showem) { - if (showProperties == showem) return; + if (showProperties == showem) { + return; + } Memento memento = new Memento() { private final ConfigurationKey key = @@ -698,7 +704,9 @@ * @param showem <code>true</code> if types are to be shown. */ public void setShowTypes(final boolean showem) { - if (showTypes == showem) return; + if (showTypes == showem) { + return; + } Memento memento = new Memento() { private final ConfigurationKey key = Notation.KEY_SHOW_TYPES; @@ -748,7 +756,9 @@ * @param showem <code>true</code> if stereotypes are to be shown. */ public void setShowStereotypes(final boolean showem) { - if (showStereotypes == showem) return; + if (showStereotypes == showem) { + return; + } Memento memento = new Memento() { private final ConfigurationKey key = Notation.KEY_SHOW_STEREOTYPES; @@ -797,7 +807,9 @@ * @param showem <code>true</code> if "1" Multiplicities are to be shown. */ public void setShowSingularMultiplicities(final boolean showem) { - if (showSingularMultiplicities == showem) return; + if (showSingularMultiplicities == showem) { + return; + } Memento memento = new Memento() { private final ConfigurationKey key = @@ -853,7 +865,9 @@ */ public void setHideBidirectionalArrows(final boolean hideem) { - if (hideBidirectionalArrows == hideem) return; + if (hideBidirectionalArrows == hideem) { + return; + } Memento memento = new Memento() { private final ConfigurationKey key = @@ -896,7 +910,9 @@ * @param newWidth The Shadow Width. */ public void setDefaultShadowWidth(final int newWidth) { - if (defaultShadowWidth == newWidth) return; + if (defaultShadowWidth == newWidth) { + return; + } final int oldValue = defaultShadowWidth; @@ -946,20 +962,25 @@ /** - * Used by "argo.tee". - * + * No longer used by "argo.tee". All uses deprecated. + * * @return the output directory name + * @deprecated for 0.27.2 by tfmorris. This is a user setting, not a project + * setting. */ + @Deprecated public String getGenerationOutputDir() { - return generationOutputDir; + return ""; } /** * @param od the output directory name + * @deprecated for 0.27.2 by tfmorris. This is a user setting, not a project + * setting. Any uses will be ignored. */ - public void setGenerationOutputDir(String od) { - generationOutputDir = od; - Configuration.setString(Argo.KEY_MOST_RECENT_EXPORT_DIRECTORY, od); + @Deprecated + public void setGenerationOutputDir(@SuppressWarnings("unused") String od) { + // ignored } /** Modified: trunk/src/argouml-app/src/org/argouml/persistence/ArgoParser.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/persistence/ArgoParser.java?view=diff&rev=15982&p1=trunk/src/argouml-app/src/org/argouml/persistence/ArgoParser.java&p2=trunk/src/argouml-app/src/org/argouml/persistence/ArgoParser.java&r1=15981&r2=15982 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/persistence/ArgoParser.java (original) +++ trunk/src/argouml-app/src/org/argouml/persistence/ArgoParser.java 2008-11-08 00:13:25-0800 @@ -24,7 +24,6 @@ package org.argouml.persistence; -import java.io.File; import java.io.Reader; import java.util.ArrayList; import java.util.List; @@ -233,7 +232,7 @@ handleFontSize(e); break; case ArgoTokenTable.TOKEN_GENERATION_OUTPUT_DIR: - handleGenerationOutputDir(e); + // ignored - it shouldn't have been in the project in the 1st place break; case ArgoTokenTable.TOKEN_SHOWASSOCIATIONNAMES: handleShowAssociationNames(e); @@ -460,17 +459,6 @@ /** * @param e the element */ - protected void handleGenerationOutputDir(XMLElement e) { - String dsw = e.getText().trim(); - File f = new File(dsw); - if (f.exists() && f.isDirectory()) { - ps.setGenerationOutputDir(dsw); - } - } - - /** - * @param e the element - */ protected void handleShowAssociationNames(XMLElement e) { String showAssociationNames = e.getText().trim(); ps.setShowAssociationNames(showAssociationNames); Modified: trunk/src/argouml-app/src/org/argouml/persistence/ArgoTokenTable.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/persistence/ArgoTokenTable.java?view=diff&rev=15982&p1=trunk/src/argouml-app/src/org/argouml/persistence/ArgoTokenTable.java&p2=trunk/src/argouml-app/src/org/argouml/persistence/ArgoTokenTable.java&r1=15981&r2=15982 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/persistence/ArgoTokenTable.java (original) +++ trunk/src/argouml-app/src/org/argouml/persistence/ArgoTokenTable.java 2008-11-08 00:13:25-0800 @@ -73,6 +73,9 @@ = "defaultshadowwidth"; private static final String STRING_FONTNAME = "fontname"; private static final String STRING_FONTSIZE = "fontsize"; + // The following is deprecated, but can never be removed to preserve + // backward compatibility with old project files + @Deprecated private static final String STRING_GENERATION_OUTPUT_DIR = "generationoutputdir"; private static final String STRING_ACTIVE_DIAGRAM = "activediagram"; @@ -123,6 +126,7 @@ /** A token for Font Settings. */ public static final int TOKEN_FONTSIZE = 22; /** A token for Generation Settings. */ + @Deprecated public static final int TOKEN_GENERATION_OUTPUT_DIR = 23; /** A token for Generation Settings. */ public static final int TOKEN_SHOWASSOCIATIONNAMES = 24; @@ -177,4 +181,4 @@ Integer.valueOf(TOKEN_ACTIVE_DIAGRAM)); } -} /* end class ArgoTokenTable */ +} Modified: trunk/src/argouml-app/src/org/argouml/persistence/argo.tee Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/persistence/argo.tee?view=diff&rev=15982&p1=trunk/src/argouml-app/src/org/argouml/persistence/argo.tee&p2=trunk/src/argouml-app/src/org/argouml/persistence/argo.tee&r1=15981&r2=15982 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/persistence/argo.tee (original) +++ trunk/src/argouml-app/src/org/argouml/persistence/argo.tee 2008-11-08 00:13:25-0800 @@ -69,7 +69,6 @@ <fontname><ocl>self.projectSettings.fontName</ocl></fontname> <fontsize><ocl>self.projectSettings.fontSize</ocl></fontsize> <defaultstereotypeview><ocl>self.projectSettings.defaultStereotypeView</ocl></defaultstereotypeview> - <generationoutputdir><ocl>self.projectSettings.generationOutputDir</ocl></generationoutputdir> <activediagram><ocl>self.activeDiagram.name</ocl></activediagram> </settings> Modified: trunk/src/argouml-app/src/org/argouml/uml/generator/ui/ClassGenerationDialog.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/generator/ui/ClassGenerationDialog.java?view=diff&rev=15982&p1=trunk/src/argouml-app/src/org/argouml/uml/generator/ui/ClassGenerationDialog.java&p2=trunk/src/argouml-app/src/org/argouml/uml/generator/ui/ClassGenerationDialog.java&r1=15981&r2=15982 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/uml/generator/ui/ClassGenerationDialog.java (original) +++ trunk/src/argouml-app/src/org/argouml/uml/generator/ui/ClassGenerationDialog.java 2008-11-08 00:13:25-0800 @@ -55,8 +55,6 @@ import org.apache.log4j.Logger; import org.argouml.i18n.Translator; -import org.argouml.kernel.Project; -import org.argouml.kernel.ProjectManager; import org.argouml.model.Model; import org.argouml.notation.Notation; import org.argouml.uml.generator.CodeGenerator; @@ -216,9 +214,8 @@ setContent(contentPanel); - Project p = ProjectManager.getManager().getCurrentProject(); - outputDirectoryComboBox.getModel().setSelectedItem( - p.getProjectSettings().getGenerationOutputDir()); + // TODO: Get saved default directory +// outputDirectoryComboBox.getModel().setSelectedItem(savedDir); } /* @@ -268,8 +265,9 @@ String classpath = System.getProperty("java.class.path"); Collection<String> entries = new TreeSet<String>(); - Project p = ProjectManager.getManager().getCurrentProject(); - entries.add(p.getProjectSettings().getGenerationOutputDir()); + // TODO: What does the output directory have to do with the class path? +// Project p = ProjectManager.getManager().getCurrentProject(); +// entries.add(p.getProjectSettings().getGenerationOutputDir()); final String pathSep = System.getProperty("path.separator"); StringTokenizer allEntries = new StringTokenizer(classpath, pathSep); @@ -295,8 +293,9 @@ String path = ((String) outputDirectoryComboBox.getModel() .getSelectedItem()).trim(); - Project p = ProjectManager.getManager().getCurrentProject(); - p.getProjectSettings().setGenerationOutputDir(path); + // TODO: Get default output directory from user settings +// Project p = ProjectManager.getManager().getCurrentProject(); +// p.getProjectSettings().setGenerationOutputDir(path); List<String>[] fileNames = new List[languages.size()]; for (int i = 0; i < languages.size(); i++) { fileNames[i] = new ArrayList<String>(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
