// gridColor = new JColorChooser();
// Set up the layout
/* LAYER OPTIONS */
JPanel layerOps = new VerticalStaticJPanel();
layerOps.setLayout(new GridBagLayout());
layerOps.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(LAYER_OPTIONS_TITLE),
BorderFactory.createEmptyBorder(0, 5, 5, 5)));
GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.EAST;
c.fill = GridBagConstraints.NONE;
c.gridy = 1;
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1;
c.gridy = 0;
c.weightx = 1;
layerOps.add(cbBinaryEncode, c);
c.gridy = 2;
c.insets = new Insets(0, 10, 0, 0);
layerOps.add(cbCompressLayerData, c);
/* GENERAL OPTIONS */
JPanel generalOps = new VerticalStaticJPanel();
generalOps.setLayout(new GridBagLayout());
generalOps.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
c = new GridBagConstraints();
c.anchor = GridBagConstraints.NORTH;
c.fill = GridBagConstraints.NONE;
generalOps.add(new JLabel(UNDO_DEPTH_LABEL), c);
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1;
c.weightx = 1;
generalOps.add(undoDepth, c);
c.gridy = 1;
c.gridx = 0;
generalOps.add(cbReportIOWarnings, c);
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)));
tilesetOps.add(cbEmbedImages, c);
c.gridy = 1;
c.insets = new Insets(0, 10, 0, 0);
tilesetOps.add(rbEmbedInTiles, c);
c.gridy = 2;
c.insets = new Insets(0, 10, 0, 0);
tilesetOps.add(rbEmbedInSet, c);
/* GRID OPTIONS */
JPanel gridOps = new VerticalStaticJPanel();
gridOps.setLayout(new GridBagLayout());
gridOps.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
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.weightx = 1;
c.gridx = 1;
c.fill = GridBagConstraints.HORIZONTAL;
gridOps.add(gridOpacitySlider, c);
c.gridwidth = 2;
c.gridy = 1;
c.gridx = 0;
gridOps.add(cbGridAA, c);
// c.gridy = 2; c.weightx = 0;
// gridOps.add(new JLabel("Color: "), c);
// c.gridx = 1;
// gridOps.add(gridColor, c);
JButton exportButton = new JButton(EXPORT_BUTTON);
exportButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
doExport();
}
});
JButton importButton = new JButton(IMPORT_BUTTON);
importButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
doImport();
}
});
JButton closeButton = new JButton(CLOSE_BUTTON);
closeButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
dispose();
}
});
/* BUTTONS PANEL */
JPanel buttons = new VerticalStaticJPanel();
buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
buttons.add(exportButton);
buttons.add(Box.createRigidArea(new Dimension(5, 5)));
buttons.add(importButton);
buttons.add(Box.createRigidArea(new Dimension(5, 5)));
buttons.add(Box.createGlue());
buttons.add(closeButton);
JPanel saving = new JPanel();
saving.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
saving.setLayout(new BoxLayout(saving, BoxLayout.Y_AXIS));
saving.add(generalSavingOps);