[tiled] r748 - trunk/src/tiled/mapeditor/dialogs

tiled-svn at biggeruniverse.com tiled-svn at biggeruniverse.com
Mon Jun 9 11:17:15 PDT 2008


Author: bjorn
Date: 2008-06-09 13:17:15 -0500 (Mon, 09 Jun 2008)
New Revision: 748

Modified:
   trunk/src/tiled/mapeditor/dialogs/ConfigurationDialog.java
Log:
Improved layout of saving options a bit

Modified: trunk/src/tiled/mapeditor/dialogs/ConfigurationDialog.java
===================================================================
--- trunk/src/tiled/mapeditor/dialogs/ConfigurationDialog.java	2008-06-09 18:07:39 UTC (rev 747)
+++ trunk/src/tiled/mapeditor/dialogs/ConfigurationDialog.java	2008-06-09 18:17:15 UTC (rev 748)
@@ -67,6 +67,7 @@
     private static final String EMBED_IN_TILES_CHECKBOX = Resources.getString("dialog.preferences.embed.in.tiles.checkbox");
     private static final String EMBED_IN_SET_CHECKBOX = Resources.getString("dialog.preferences.embed.in.set.checkbox");
     private static final String ANTIALIASING_CHECKBOX = Resources.getString("dialog.preferences.antialiasing.checkbox");
+    private static final String GENERAL_SAVING_OPTIONS_TITLE = Resources.getString("dialog.preferences.general.tab");
     private static final String LAYER_OPTIONS_TITLE = Resources.getString("dialog.preferences.layer.options.title");
     private static final String UNDO_DEPTH_LABEL = Resources.getString("dialog.preferences.undo.depth.label");
     private static final String TILESET_OPTIONS_TITLE = Resources.getString("dialog.preferences.tileset.options.title");
@@ -93,6 +94,7 @@
         super(parent, DIALOG_TITLE, true);
         init();
         pack();
+        setResizable(false);
         setLocationRelativeTo(parent);
     }
 
@@ -110,9 +112,9 @@
         ButtonGroup bg = new ButtonGroup();
         bg.add(rbEmbedInTiles);
         bg.add(rbEmbedInSet);
-        undoDepth = new IntegerSpinner();
+        undoDepth = new IntegerSpinner();
         cbGridAA = new JCheckBox(ANTIALIASING_CHECKBOX);
-        gridOpacitySlider = new JSlider(0, 255, 255);
+        gridOpacitySlider = new JSlider(0, 255, 255);
         //gridColor = new JColorChooser();
 
         // Set up the layout
@@ -150,16 +152,24 @@
         c.gridy = 2;
         c.gridx = 0;
         generalOps.add(cbAutoOpenLastFile, c);
-        
+
+        /* GENERAL SAVING OPTIONS */
+        JPanel generalSavingOps = new VerticalStaticJPanel();
+        generalSavingOps.setLayout(new GridBagLayout());
+        generalSavingOps.setBorder(BorderFactory.createCompoundBorder(
+                    BorderFactory.createTitledBorder(GENERAL_SAVING_OPTIONS_TITLE),
+                    BorderFactory.createEmptyBorder(0, 5, 5, 5)));
+        c = new GridBagConstraints();
+        c.fill = GridBagConstraints.HORIZONTAL;
+        c.gridx = 1; c.gridy = 0; c.weightx = 1;
+        generalSavingOps.add(cbUsefulComments, c);
+
         /* TILESET OPTIONS */
         JPanel tilesetOps = new VerticalStaticJPanel();
         tilesetOps.setLayout(new GridBagLayout());
         tilesetOps.setBorder(BorderFactory.createCompoundBorder(
                     BorderFactory.createTitledBorder(TILESET_OPTIONS_TITLE),
                     BorderFactory.createEmptyBorder(0, 5, 5, 5)));
-        c = new GridBagConstraints();
-        c.fill = GridBagConstraints.HORIZONTAL;
-        c.gridx = 1; c.gridy = 0; c.weightx = 1;
         tilesetOps.add(cbEmbedImages, c);
         c.gridy = 1; c.insets = new Insets(0, 10, 0, 0);
         tilesetOps.add(rbEmbedInTiles, c);
@@ -170,10 +180,10 @@
         JPanel gridOps = new VerticalStaticJPanel();
         gridOps.setLayout(new GridBagLayout());
         gridOps.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
-        c = new GridBagConstraints();
+        c = new GridBagConstraints();
         c.insets = new Insets(0, 0, 0, 5);
         gridOps.add(new JLabel(OPACITY_LABEL), c);
-        c.insets = new Insets(0, 0, 0, 0);
+        c.insets = new Insets(0, 0, 0, 0);
         c.weightx = 1; c.gridx = 1;
         c.fill = GridBagConstraints.HORIZONTAL;
         gridOps.add(gridOpacitySlider, c);
@@ -218,7 +228,7 @@
         JPanel saving = new JPanel();
         saving.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
         saving.setLayout(new BoxLayout(saving, BoxLayout.Y_AXIS));
-        saving.add(cbUsefulComments);
+        saving.add(generalSavingOps);
         saving.add(layerOps);
         saving.add(tilesetOps);
 
@@ -343,8 +353,8 @@
     }
 
     private void updateFromConfiguration() {
-        undoDepth.setValue(prefs.getInt("undoDepth", 30));
-        gridOpacitySlider.setValue(displayPrefs.getInt("gridOpacity", 255));
+        undoDepth.setValue(prefs.getInt("undoDepth", 30));
+        gridOpacitySlider.setValue(displayPrefs.getInt("gridOpacity", 255));
 
         boolean embedImages = savingPrefs.getBoolean("embedImages", true);
         if (embedImages) {




More information about the tiled-commit mailing list