- c.gridx = 1;
- c.gridy = row++;
- c.gridwidth = 3;
- c.fill = GridBagConstraints.NONE;
- c.anchor = GridBagConstraints.WEST;
- pane.add(serial_debug, c);
+ pane.add(serial_debug, constraints(1,2));
+ row++;
+ }
+
+ static final Integer map_caches[] = { 9, 25, 100 };
+
+ public void add_map_cache() {
+ pane.add(new JLabel("Map Cache Size"), constraints(0, 1));
+
+ final JComboBox<Integer> map_cache = new JComboBox<Integer>(map_caches);
+
+ map_cache.setEditable(true);
+ map_cache.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ try {
+ int size = (Integer) (map_cache.getSelectedItem());
+
+ AltosUIPreferences.set_map_cache(size);
+ } catch (ClassCastException ce) {
+ map_cache.setSelectedItem(AltosUIPreferences.map_cache());
+ }
+ }
+ });
+
+ map_cache.setSelectedItem (AltosUIPreferences.map_cache());
+ pane.add(map_cache, constraints(1, 2, GridBagConstraints.BOTH));
+ row++;