Author: mvw
Date: 2007-05-20 07:01:22-0700
New Revision: 12629
Modified:
trunk/src_new/org/argouml/moduleloader/SettingsTabModules.java
trunk/src_new/org/argouml/ui/SettingsTabEnvironment.java
Log:
Removed (cyclic) dependency from org.argouml.ui to org.argouml.moduleloader, by moving the field with the paths to the modules from one settings panel to another.
Modified: trunk/src_new/org/argouml/moduleloader/SettingsTabModules.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/moduleloader/SettingsTabModules.java?view=diff&rev=12629&p1=trunk/src_new/org/argouml/moduleloader/SettingsTabModules.java&p2=trunk/src_new/org/argouml/moduleloader/SettingsTabModules.java&r1=12628&r2=12629
==============================================================================
--- trunk/src_new/org/argouml/moduleloader/SettingsTabModules.java (original)
+++ trunk/src_new/org/argouml/moduleloader/SettingsTabModules.java 2007-05-20 07:01:22-0700
@@ -25,14 +25,19 @@
package org.argouml.moduleloader;
import java.awt.BorderLayout;
+import java.util.Iterator;
+import java.util.List;
+import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
+import javax.swing.JTextField;
import javax.swing.table.AbstractTableModel;
import org.argouml.i18n.Translator;
import org.argouml.ui.GUISettingsTabInterface;
+import org.tigris.swidgets.LabelledLayout;
/**
* Tab for the settings dialog that makes it possible to
@@ -49,6 +54,8 @@
* The table of modules.
*/
private JTable table;
+
+ private JTextField fieldAllExtDirs;
/**
* The names of the columns in the table.
@@ -163,6 +170,14 @@
*/
public void handleSettingsTabRefresh() {
table.setModel(new ModuleTableModel());
+
+ StringBuffer sb = new StringBuffer();
+ List locations = ModuleLoader2.getInstance().getExtensionLocations();
+ for (Iterator it = locations.iterator(); it.hasNext();) {
+ sb.append((String) it.next());
+ sb.append("\n");
+ }
+ fieldAllExtDirs.setText(sb.substring(0, sb.length() - 1).toString());
}
/*
@@ -203,6 +218,18 @@
table.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
table.setShowVerticalLines(true);
add(new JScrollPane(table), BorderLayout.CENTER);
+ int labelGap = 10;
+ int componentGap = 5;
+ JPanel top = new JPanel(new LabelledLayout(labelGap, componentGap));
+ JLabel label = new JLabel(
+ Translator.localize("label.extension-directories"));
+ JTextField j = new JTextField();
+ fieldAllExtDirs = j;
+ fieldAllExtDirs.setEnabled(false);
+ label.setLabelFor(fieldAllExtDirs);
+ top.add(label);
+ top.add(fieldAllExtDirs);
+ add(top, BorderLayout.NORTH);
}
return this;
Modified: trunk/src_new/org/argouml/ui/SettingsTabEnvironment.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/SettingsTabEnvironment.java?view=diff&rev=12629&p1=trunk/src_new/org/argouml/ui/SettingsTabEnvironment.java&p2=trunk/src_new/org/argouml/ui/SettingsTabEnvironment.java&r1=12628&r2=12629
==============================================================================
--- trunk/src_new/org/argouml/ui/SettingsTabEnvironment.java (original)
+++ trunk/src_new/org/argouml/ui/SettingsTabEnvironment.java 2007-05-20 07:01:22-0700
@@ -28,7 +28,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
-import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel;
@@ -40,7 +39,6 @@
import org.argouml.application.api.Argo;
import org.argouml.configuration.Configuration;
import org.argouml.i18n.Translator;
-import org.argouml.moduleloader.ModuleLoader2;
import org.argouml.uml.ui.SaveGraphicsManager;
import org.argouml.util.SuffixFilter;
import org.tigris.swidgets.LabelledLayout;
@@ -55,14 +53,13 @@
implements GUISettingsTabInterface {
private JTextField fieldArgoExtDir;
- private JTextField fieldAllExtDirs;
private JTextField fieldJavaHome;
private JTextField fieldUserHome;
private JTextField fieldUserDir;
private JTextField fieldStartupDir;
private JComboBox fieldGraphicsFormat;
private JComboBox fieldGraphicsResolution;
- private Collection theResolutions;
+ private Collection<GResolution> theResolutions;
/**
* The constructor.
@@ -84,7 +81,7 @@
label =
new JLabel(
Translator.localize("label.default.graphics-resolution"));
- theResolutions = new ArrayList();
+ theResolutions = new ArrayList<GResolution>();
theResolutions.add(new GResolution(1, "combobox.item.resolution-1"));
theResolutions.add(new GResolution(2, "combobox.item.resolution-2"));
theResolutions.add(new GResolution(4, "combobox.item.resolution-4"));
@@ -102,14 +99,6 @@
top.add(label);
top.add(fieldArgoExtDir);
- label = new JLabel(Translator.localize("label.extension-directories"));
- JTextField j = new JTextField();
- fieldAllExtDirs = j;
- fieldAllExtDirs.setEnabled(false);
- label.setLabelFor(fieldAllExtDirs);
- top.add(label);
- top.add(fieldAllExtDirs);
-
// This string is NOT to be translated! See issue 2381.
label = new JLabel("${java.home}");
JTextField j3 = new JTextField();
@@ -154,13 +143,6 @@
*/
public void handleSettingsTabRefresh() {
fieldArgoExtDir.setText(System.getProperty("argo.ext.dir"));
- StringBuffer sb = new StringBuffer();
- List locations = ModuleLoader2.getInstance().getExtensionLocations();
- for (Iterator it = locations.iterator(); it.hasNext();) {
- sb.append((String) it.next());
- sb.append("\n");
- }
- fieldAllExtDirs.setText(sb.substring(0, sb.length() - 1).toString());
fieldJavaHome.setText(System.getProperty("java.home"));
fieldUserHome.setText(System.getProperty("user.home"));
fieldUserDir.setText(Configuration.getString(Argo.KEY_STARTUP_DIR,
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.