tileWidth = new IntegerSpinner(defaultTileWidth, 1);
tileHeight = new IntegerSpinner(defaultTileHeight, 1);
// Map size fields
JPanel mapSize = new VerticalStaticJPanel();
mapSize.setLayout(new GridBagLayout());
mapSize.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder(MAPSIZE_TITLE),
BorderFactory.createEmptyBorder(0, 5, 5, 5)));
GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.EAST;
c.fill = GridBagConstraints.NONE;
c.insets = new Insets(5, 0, 0, 5);
mapSize.add(new JLabel(WIDTH_LABEL), c);
c.gridy = 1;
mapSize.add(new JLabel(HEIGHT_LABEL), c);
c.insets = new Insets(5, 0, 0, 0);
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1; c.gridy = 0; c.weightx = 1;
mapSize.add(mapWidth, c);
c.gridy = 1;
mapSize.add(mapHeight, c);
// Tile size fields
JPanel tileSize = new VerticalStaticJPanel();
tileSize.setLayout(new GridBagLayout());
tileSize.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder(TILESIZE_TITLE),
BorderFactory.createEmptyBorder(0, 5, 5, 5)));
c.gridx = 0; c.gridy = 0; c.weightx = 0;
c.fill = GridBagConstraints.NONE;
c.insets = new Insets(5, 0, 0, 5);
tileSize.add(new JLabel(WIDTH_LABEL), c);
c.gridy = 1;
tileSize.add(new JLabel(HEIGHT_LABEL), c);
c.insets = new Insets(5, 0, 0, 0);
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1; c.gridy = 0; c.weightx = 1;
tileSize.add(tileWidth, c);
c.gridy = 1;
tileSize.add(tileHeight, c);
// OK and Cancel buttons
JButton okButton = new JButton(OK_BUTTON);
JButton cancelButton = new JButton(CANCEL_BUTTON);
okButton.addActionListener(this);
cancelButton.addActionListener(this);
JPanel buttons = new VerticalStaticJPanel();
buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
buttons.add(Box.createGlue());
buttons.add(okButton);
buttons.add(Box.createRigidArea(new Dimension(5, 0)));
buttons.add(cancelButton);
// Map type and name inputs
mapTypeChooser = new JComboBox();
mapTypeChooser.addItem(ORTHOGONAL_MAPTYPE);
mapTypeChooser.addItem(ISOMETRIC_MAPTYPE);
mapTypeChooser.addItem(HEXAGONAL_MAPTYPE);
// TODO: Enable views when implemented decently
//mapTypeChooser.addItem(SHIFTED_MAPTYPE);
JPanel miscPropPanel = new VerticalStaticJPanel();
miscPropPanel.setLayout(new GridBagLayout());
miscPropPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
c.gridx = 0; c.gridy = 0; c.weightx = 0;
c.fill = GridBagConstraints.NONE;
c.insets = new Insets(5, 0, 0, 5);
miscPropPanel.add(new JLabel(MAPTYPE_LABEL), c);
c.insets = new Insets(5, 0, 0, 0);
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1; c.gridy = 0; c.weightx = 1;
miscPropPanel.add(mapTypeChooser, c);
// Putting two size panels next to eachother
JPanel sizePanels = new JPanel();
sizePanels.setLayout(new BoxLayout(sizePanels, BoxLayout.X_AXIS));