fix: Adjustments of UI for smaller resolutions

This commit is contained in:
lantzelot-swe 2021-02-10 12:13:10 +01:00
parent 8485c64419
commit 631dd23af7
14 changed files with 457 additions and 484 deletions

View File

@ -32,8 +32,8 @@ public class PCUGameManager
SwingUtilities.invokeLater(() -> {
MainWindow mainWindow = MainWindow.getInstance();
mainWindow.setSize(1500, 960);
mainWindow.setMinimumSize(new Dimension(1400, 960));
mainWindow.setSize(1366, 740);
mainWindow.setMinimumSize(new Dimension(1366, 700));
mainWindow.setVisible(true);
mainWindow.setLocationRelativeTo(null);
mainWindow.initialize();

View File

@ -66,7 +66,7 @@ public class DescriptionPanel extends JPanel
if (descriptionTextArea == null) {
descriptionTextArea = new JTextArea();
descriptionTextArea.setBorder(null);
descriptionTextArea.setFont(new JLabel().getFont());
descriptionTextArea.setFont(new JLabel().getFont().deriveFont(11.0f));
descriptionTextArea.setWrapStyleWord(true);
descriptionTextArea.setLineWrap(true);

View File

@ -28,6 +28,9 @@ import se.lantz.gui.scraper.ScraperDialog;
import se.lantz.gui.scraper.ScraperProgressDialog;
import se.lantz.gui.scraper.ScraperWorker;
import se.lantz.gui.scraper.ScreenshotsSelectionDialog;
import se.lantz.gui.translation.TranslationDialog;
import se.lantz.gui.translation.TranslationProgressDialog;
import se.lantz.gui.translation.TranslationWorker;
import se.lantz.manager.ScraperManager;
import se.lantz.model.MainViewModel;
import se.lantz.model.data.GameListData;
@ -40,7 +43,7 @@ public class GameDetailsBackgroundPanel extends JPanel
private static final Logger logger = LoggerFactory.getLogger(GameDetailsBackgroundPanel.class);
private final MainViewModel model;
private JPanel settingsPanel;
private InfoPanel infoPanel;
private InfoBackgroundPanel infoPanel;
private CombinedJoystickPanel joystickPanel;
private SystemPanel systemPanel;
private JPanel buttonPanel;
@ -52,6 +55,7 @@ public class GameDetailsBackgroundPanel extends JPanel
private JPanel detailsPanel;
private CardLayout cardLayout;
private JButton scrapeButton;
private JButton translateButton;
private Timer cursorTimer;
private ActionListener defaultCursorAction = e -> {
MainWindow.getInstance().setWaitCursor(false);
@ -78,7 +82,7 @@ public class GameDetailsBackgroundPanel extends JPanel
{
this.model = model;
this.scraperManager = new ScraperManager(model);
this.setMinimumSize(new Dimension(1275, 800));
this.setMinimumSize(new Dimension(1170, 750));
cardLayout = new CardLayout();
setLayout(cardLayout);
add(getEmptyPanel(), EMPTY);
@ -92,7 +96,7 @@ public class GameDetailsBackgroundPanel extends JPanel
void focusTitleField()
{
getInfoPanel().focusTitleField();
getInfoBackgroundPanel().focusTitleField();
}
void updateSelectedGame(GameListData data)
@ -116,7 +120,7 @@ public class GameDetailsBackgroundPanel extends JPanel
detailsPanel = new JPanel();
detailsPanel.setLayout(new BorderLayout(0, 0));
detailsPanel.add(getSettingsPanel(), BorderLayout.CENTER);
detailsPanel.add(getInfoPanel(), BorderLayout.NORTH);
detailsPanel.add(getInfoBackgroundPanel(), BorderLayout.NORTH);
detailsPanel.add(getButtonPanel(), BorderLayout.SOUTH);
}
return detailsPanel;
@ -159,11 +163,11 @@ public class GameDetailsBackgroundPanel extends JPanel
return settingsPanel;
}
protected InfoPanel getInfoPanel()
protected InfoBackgroundPanel getInfoBackgroundPanel()
{
if (infoPanel == null)
{
infoPanel = new InfoPanel(model.getInfoModel());
infoPanel = new InfoBackgroundPanel(model.getInfoModel());
}
return infoPanel;
}
@ -202,11 +206,17 @@ public class GameDetailsBackgroundPanel extends JPanel
gbc_scrapeButton.gridx = 0;
gbc_scrapeButton.gridy = 0;
buttonPanel.add(getScrapeButton(), gbc_scrapeButton);
GridBagConstraints gbc_btnNewButton = new GridBagConstraints();
gbc_btnNewButton.insets = new Insets(5, 10, 5, 5);
gbc_btnNewButton.gridx = 1;
gbc_btnNewButton.gridy = 0;
buttonPanel.add(getBtnNewButton(), gbc_btnNewButton);
GridBagConstraints gbc_translateButton = new GridBagConstraints();
gbc_translateButton.insets = new Insets(5, 10, 5, 5);
gbc_translateButton.gridx = 1;
gbc_translateButton.gridy = 0;
buttonPanel.add(getTranslateButton(), gbc_translateButton);
GridBagConstraints gbc_viceButton = new GridBagConstraints();
gbc_viceButton.anchor = GridBagConstraints.WEST;
gbc_viceButton.insets = new Insets(5, 10, 5, 5);
gbc_viceButton.gridx = 2;
gbc_viceButton.gridy = 0;
buttonPanel.add(getViceButton(), gbc_viceButton);
GridBagConstraints gbc_saveButton = new GridBagConstraints();
gbc_saveButton.weighty = 1.0;
gbc_saveButton.anchor = GridBagConstraints.SOUTHEAST;
@ -248,7 +258,7 @@ public class GameDetailsBackgroundPanel extends JPanel
{
if (model.saveData())
{
getInfoPanel().getScreensPanel().resetWhenSaved();
getInfoBackgroundPanel().getScreensPanel().resetWhenSaved();
}
}
});
@ -348,7 +358,7 @@ public class GameDetailsBackgroundPanel extends JPanel
}
}
private JButton getBtnNewButton()
private JButton getViceButton()
{
if (btnNewButton == null)
{
@ -363,4 +373,29 @@ public class GameDetailsBackgroundPanel extends JPanel
}
return btnNewButton;
}
private JButton getTranslateButton()
{
if (translateButton == null)
{
translateButton = new JButton("Translate...");
translateButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
TranslationDialog dialog = new TranslationDialog(model.getInfoModel());
dialog.pack();
dialog.setLocationRelativeTo(MainWindow.getInstance());
if (dialog.showDialog())
{
TranslationProgressDialog progressDialog = new TranslationProgressDialog(MainWindow.getInstance());
progressDialog.pack();
progressDialog.setLocationRelativeTo(MainWindow.getInstance());
TranslationWorker worker = new TranslationWorker(model.getInfoModel(), progressDialog, dialog.getSelectedFromLanguage(), dialog.getSelectedToLanguages());
worker.execute();
progressDialog.setVisible(true);
}
}
});
}
return translateButton;
}
}

View File

@ -0,0 +1,52 @@
package se.lantz.gui;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import se.lantz.model.InfoModel;
public class InfoBackgroundPanel extends JPanel
{
private InfoModel model;
private ScreenshotsPanel screensPanel;
private InfoPanel infoPanel2;
public InfoBackgroundPanel(InfoModel model)
{
this.model = model;
BorderLayout borderLayout = new BorderLayout();
this.setLayout(borderLayout);
add(getInfoPanel2(), BorderLayout.WEST);
add(getScreensPanel(), BorderLayout.CENTER);
}
private InfoPanel getInfoPanel2()
{
if (infoPanel2 == null)
{
infoPanel2 = new InfoPanel(model);
}
return infoPanel2;
}
public ScreenshotsPanel getScreensPanel()
{
if (screensPanel == null)
{
screensPanel = new ScreenshotsPanel(this.model);
}
return screensPanel;
}
void focusTitleField()
{
getInfoPanel2().focusTitleField();
}
public void selectEnDescriptionTab()
{
getInfoPanel2().selectEnDescriptionTab();
}
}

View File

@ -10,9 +10,7 @@ import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.beans.Beans;
import java.util.Calendar;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSpinner;
@ -22,429 +20,327 @@ import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;
import javax.swing.SwingUtilities;
import se.lantz.gui.translation.TranslationDialog;
import se.lantz.gui.translation.TranslationProgressDialog;
import se.lantz.gui.translation.TranslationWorker;
import se.lantz.model.InfoModel;
import se.lantz.util.DescriptionTranslater;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class InfoPanel extends JPanel
{
private InfoModel model;
private JLabel titleLabel;
private JTextField titleField;
private JLabel authorLabel;
private JTextField authorField;
private JLabel composerLabel;
private JTextField composerField;
private JLabel yearLabel;
private JSpinner yearField;
private JLabel genreLabel;
private JButton translateButton;
private GenreComboBox genreComboBox;
private ScreenshotsPanel screensPanel;
private JTabbedPane descriptionTabbedPane;
private DescriptionPanel descriptionPanel;
private DescriptionPanel descriptionDePanel;
private DescriptionPanel descriptionFrPanel;
private DescriptionPanel descriptionEsPanel;
private DescriptionPanel descriptionItPanel;
private JTextField titleField;
private JTextField authorField;
private JTextField composerField;
JTabbedPane descriptionTabbedPane;
private DescriptionPanel descriptionPanel;
private DescriptionPanel descriptionDePanel;
private DescriptionPanel descriptionFrPanel;
private DescriptionPanel descriptionEsPanel;
private DescriptionPanel descriptionItPanel;
private InfoModel model;
JSpinner yearField;
GenreComboBox genreComboBox;
public InfoPanel(InfoModel model)
{
this.model = model;
this.setPreferredSize(new Dimension(729, 330));
GridBagLayout gbl_this = new GridBagLayout();
this.setLayout(gbl_this);
GridBagConstraints gbc_titleLabel = new GridBagConstraints();
gbc_titleLabel.anchor = GridBagConstraints.WEST;
gbc_titleLabel.insets = new Insets(10, 10, 0, 5);
gbc_titleLabel.gridx = 0;
gbc_titleLabel.gridy = 0;
this.add(getTitleLabel(), gbc_titleLabel);
GridBagConstraints gbc_titleField = new GridBagConstraints();
gbc_titleField.insets = new Insets(0, 10, 5, 5);
gbc_titleField.fill = GridBagConstraints.HORIZONTAL;
gbc_titleField.gridx = 0;
gbc_titleField.gridy = 1;
this.add(getTitleField(), gbc_titleField);
GridBagConstraints gbc_yearField = new GridBagConstraints();
gbc_yearField.insets = new Insets(0, 0, 5, 5);
gbc_yearField.fill = GridBagConstraints.HORIZONTAL;
gbc_yearField.gridx = 1;
gbc_yearField.gridy = 1;
this.add(getYearField(), gbc_yearField);
GridBagConstraints gbc_authorLabel = new GridBagConstraints();
gbc_authorLabel.insets = new Insets(0, 10, 0, 5);
gbc_authorLabel.anchor = GridBagConstraints.WEST;
gbc_authorLabel.gridx = 0;
gbc_authorLabel.gridy = 2;
this.add(getAuthorLabel(), gbc_authorLabel);
GridBagConstraints gbc_genreLabel = new GridBagConstraints();
gbc_genreLabel.anchor = GridBagConstraints.WEST;
gbc_genreLabel.insets = new Insets(0, 0, 0, 5);
gbc_genreLabel.gridx = 1;
gbc_genreLabel.gridy = 2;
this.add(getGenreLabel(), gbc_genreLabel);
GridBagConstraints gbc_authorField = new GridBagConstraints();
gbc_authorField.fill = GridBagConstraints.HORIZONTAL;
gbc_authorField.anchor = GridBagConstraints.WEST;
gbc_authorField.insets = new Insets(0, 10, 5, 100);
gbc_authorField.gridx = 0;
gbc_authorField.gridy = 3;
this.add(getAuthorField(), gbc_authorField);
GridBagConstraints gbc_composerLabel = new GridBagConstraints();
gbc_composerLabel.anchor = GridBagConstraints.WEST;
gbc_composerLabel.insets = new Insets(0, 10, 0, 5);
gbc_composerLabel.gridx = 0;
gbc_composerLabel.gridy = 4;
this.add(getComposerLabel(), gbc_composerLabel);
GridBagConstraints gbc_composerField = new GridBagConstraints();
gbc_composerField.fill = GridBagConstraints.HORIZONTAL;
gbc_composerField.anchor = GridBagConstraints.WEST;
gbc_composerField.insets = new Insets(0, 10, 5, 100);
gbc_composerField.gridx = 0;
gbc_composerField.gridy = 5;
this.add(getComposerField(), gbc_composerField);
GridBagConstraints gbc_yearLabel = new GridBagConstraints();
gbc_yearLabel.anchor = GridBagConstraints.WEST;
gbc_yearLabel.insets = new Insets(10, 0, 0, 5);
gbc_yearLabel.gridx = 1;
gbc_yearLabel.gridy = 0;
this.add(getYearLabel(), gbc_yearLabel);
GridBagConstraints gbc_genreComboBox = new GridBagConstraints();
gbc_genreComboBox.insets = new Insets(0, 0, 5, 5);
gbc_genreComboBox.fill = GridBagConstraints.HORIZONTAL;
gbc_genreComboBox.gridx = 1;
gbc_genreComboBox.gridy = 3;
this.add(getGenreComboBox(), gbc_genreComboBox);
GridBagConstraints gbc_descriptionTabbedPane = new GridBagConstraints();
gbc_descriptionTabbedPane.fill = GridBagConstraints.BOTH;
gbc_descriptionTabbedPane.insets = new Insets(0, 10, 5, 5);
gbc_descriptionTabbedPane.gridx = 0;
gbc_descriptionTabbedPane.gridy = 6;
gbc_descriptionTabbedPane.gridheight = 3;
add(getDescriptionTabbedPane(), gbc_descriptionTabbedPane);
GridBagConstraints gbc_screensPanel = new GridBagConstraints();
gbc_screensPanel.fill = GridBagConstraints.BOTH;
gbc_screensPanel.weighty = 1.0;
gbc_screensPanel.anchor = GridBagConstraints.NORTH;
gbc_screensPanel.weightx = 1.0;
gbc_screensPanel.insets = new Insets(0, 10, 0, 0);
gbc_screensPanel.gridheight = 9;
gbc_screensPanel.gridx = 2;
gbc_screensPanel.gridy = 0;
add(getScreensPanel(), gbc_screensPanel);
GridBagConstraints gbc_translateButton = new GridBagConstraints();
gbc_translateButton.fill = GridBagConstraints.HORIZONTAL;
gbc_translateButton.insets = new Insets(20, 0, 5, 5);
gbc_translateButton.gridx = 1;
gbc_translateButton.gridy = 6;
add(getTranslateButton(), gbc_translateButton);
public InfoPanel(InfoModel model)
{
this.model = model;
this.setPreferredSize(new Dimension(330,275));
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWeights = new double[]
{ 1.0, 0.0 };
gridBagLayout.columnWidths = new int[]
{ 0, 0 };
setLayout(gridBagLayout);
if (!Beans.isDesignTime())
{
model.addPropertyChangeListener(e -> modelChanged());
}
}
JLabel titleLabel = new JLabel("Game title");
GridBagConstraints gbc_titleLabel = new GridBagConstraints();
gbc_titleLabel.anchor = GridBagConstraints.WEST;
gbc_titleLabel.gridwidth = 2;
gbc_titleLabel.insets = new Insets(5, 5, 0, 0);
gbc_titleLabel.gridx = 0;
gbc_titleLabel.gridy = 0;
add(titleLabel, gbc_titleLabel);
private void modelChanged()
{
// Read from model
if (!getTitleField().hasFocus())
{
getTitleField().setText(model.getTitle());
}
if (!getDescriptionPanel().getDescriptionTextArea().hasFocus())
{
getDescriptionPanel().getDescriptionTextArea().setText(model.getDescription());
}
if (!getDescriptionDePanel().getDescriptionTextArea().hasFocus())
{
getDescriptionDePanel().getDescriptionTextArea().setText(model.getDescriptionDe());
}
if (!getDescriptionFrPanel().getDescriptionTextArea().hasFocus())
{
getDescriptionFrPanel().getDescriptionTextArea().setText(model.getDescriptionFr());
}
if (!getDescriptionEsPanel().getDescriptionTextArea().hasFocus())
{
getDescriptionEsPanel().getDescriptionTextArea().setText(model.getDescriptionEs());
}
if (!getDescriptionItPanel().getDescriptionTextArea().hasFocus())
{
getDescriptionItPanel().getDescriptionTextArea().setText(model.getDescriptionIt());
}
if (!getYearField().hasFocus())
{
getYearField().setValue(model.getYear());
}
if (!getGenreComboBox().hasFocus())
{
getGenreComboBox().setSelectedGenre(model.getGenre());
}
if (!getAuthorField().hasFocus())
{
getAuthorField().setText(model.getAuthor());
}
if (!getComposerField().hasFocus())
{
getComposerField().setText(model.getComposer());
}
}
GridBagConstraints gbc_titleField = new GridBagConstraints();
gbc_titleField.gridwidth = 2;
gbc_titleField.insets = new Insets(0, 5, 5, 0);
gbc_titleField.fill = GridBagConstraints.HORIZONTAL;
gbc_titleField.gridx = 0;
gbc_titleField.gridy = 1;
add(getTitleField(), gbc_titleField);
private JLabel getTitleLabel()
{
if (titleLabel == null)
{
titleLabel = new JLabel("Game title");
}
return titleLabel;
}
JLabel authorLabel = new JLabel("Author");
GridBagConstraints gbc_authorLabel = new GridBagConstraints();
gbc_authorLabel.anchor = GridBagConstraints.WEST;
gbc_authorLabel.insets = new Insets(0, 5, 0, 0);
gbc_authorLabel.gridx = 0;
gbc_authorLabel.gridy = 2;
add(authorLabel, gbc_authorLabel);
private JTextField getTitleField()
{
if (titleField == null)
{
titleField = new JTextField();
titleField.addKeyListener(new KeyAdapter()
{
@Override
public void keyReleased(KeyEvent e)
{
JTextField textField = (JTextField) e.getSource();
model.setTitle(textField.getText());
}
});
}
return titleField;
}
GridBagConstraints gbc_authorField = new GridBagConstraints();
gbc_authorField.insets = new Insets(0, 5, 5, 5);
gbc_authorField.fill = GridBagConstraints.HORIZONTAL;
gbc_authorField.gridx = 0;
gbc_authorField.gridy = 3;
add(getAuthorField(), gbc_authorField);
private JLabel getAuthorLabel()
{
if (authorLabel == null)
{
authorLabel = new JLabel("Author");
authorLabel.setPreferredSize(new Dimension(145, 14));
}
return authorLabel;
}
JLabel composerLabel = new JLabel("Composer");
GridBagConstraints gbc_composerLabel = new GridBagConstraints();
gbc_composerLabel.anchor = GridBagConstraints.WEST;
gbc_composerLabel.insets = new Insets(0, 5, 0, 0);
gbc_composerLabel.gridx = 0;
gbc_composerLabel.gridy = 4;
add(composerLabel, gbc_composerLabel);
private JTextField getAuthorField()
{
if (authorField == null)
{
authorField = new JTextField();
authorField.setPreferredSize(new Dimension(300, 20));
authorField.setColumns(10);
authorField.addKeyListener(new KeyAdapter()
{
@Override
public void keyReleased(KeyEvent e)
{
JTextField textField = (JTextField) e.getSource();
model.setAuthor(textField.getText());
}
});
}
return authorField;
}
GridBagConstraints gbc_composerField = new GridBagConstraints();
gbc_composerField.insets = new Insets(0, 5, 5, 5);
gbc_composerField.fill = GridBagConstraints.HORIZONTAL;
gbc_composerField.gridx = 0;
gbc_composerField.gridy = 5;
add(getComposerField(), gbc_composerField);
private JLabel getComposerLabel()
{
if (composerLabel == null)
{
composerLabel = new JLabel("Composer");
composerLabel.setPreferredSize(new Dimension(140, 14));
}
return composerLabel;
}
JLabel yearLabel = new JLabel("Year");
GridBagConstraints gbc_yearLabel = new GridBagConstraints();
gbc_yearLabel.anchor = GridBagConstraints.WEST;
gbc_yearLabel.gridx = 1;
gbc_yearLabel.gridy = 4;
add(yearLabel, gbc_yearLabel);
private JTextField getComposerField()
{
if (composerField == null)
{
composerField = new JTextField();
composerField.setPreferredSize(new Dimension(200, 20));
composerField.setColumns(10);
composerField.addKeyListener(new KeyAdapter()
{
@Override
public void keyReleased(KeyEvent e)
{
JTextField textField = (JTextField) e.getSource();
model.setComposer(textField.getText());
}
});
}
return composerField;
}
GridBagConstraints gbc_yearField = new GridBagConstraints();
gbc_yearField.anchor = GridBagConstraints.WEST;
gbc_yearField.insets = new Insets(0, 0, 5, 0);
gbc_yearField.gridx = 1;
gbc_yearField.gridy = 5;
add(getYearField(), gbc_yearField);
private JLabel getYearLabel()
{
if (yearLabel == null)
{
yearLabel = new JLabel("Year");
}
return yearLabel;
}
JLabel genreLabel = new JLabel("Genre");
GridBagConstraints gbc_genreLabel = new GridBagConstraints();
gbc_genreLabel.anchor = GridBagConstraints.WEST;
gbc_genreLabel.gridx = 1;
gbc_genreLabel.gridy = 2;
add(genreLabel, gbc_genreLabel);
private JSpinner getYearField()
{
if (yearField == null)
{
SpinnerModel spinnerModel = new SpinnerNumberModel(1986, //initial value
1978, //min
Calendar.getInstance().get(Calendar.YEAR), //max, no need to add more than current year
1);
yearField = new JSpinner(spinnerModel);
JSpinner.NumberEditor numberEditor = new JSpinner.NumberEditor(yearField, "####");
yearField.setEditor(numberEditor);
//Select all when gaining focus
numberEditor.getTextField().addFocusListener(new FocusAdapter()
{
@Override
public void focusGained(final FocusEvent e)
{
SwingUtilities.invokeLater(() -> {
JTextField tf = (JTextField) e.getSource();
tf.selectAll();
});
}
});
GridBagConstraints gbc_genreCombobox = new GridBagConstraints();
gbc_genreCombobox.anchor = GridBagConstraints.WEST;
gbc_genreCombobox.insets = new Insets(0, 0, 5, 0);
gbc_genreCombobox.fill = GridBagConstraints.HORIZONTAL;
gbc_genreCombobox.gridx = 1;
gbc_genreCombobox.gridy = 3;
add(getGenreComboBox(), gbc_genreCombobox);
yearField.addChangeListener(e -> {
JSpinner textField = (JSpinner) e.getSource();
model.setYear(Integer.parseInt(textField.getValue().toString()));
descriptionTabbedPane = new JTabbedPane(JTabbedPane.TOP);
descriptionTabbedPane.addTab("Description: en", null, getDescriptionPanel(), null);
descriptionTabbedPane.addTab("de", null, getDescriptionDePanel(), null);
descriptionTabbedPane.addTab("fr", null, getDescriptionFrPanel(), null);
descriptionTabbedPane.addTab("es", null, getDescriptionEsPanel(), null);
descriptionTabbedPane.addTab("it", null, getDescriptionItPanel(), null);
GridBagConstraints gbc_descriptionTabbedPane = new GridBagConstraints();
gbc_descriptionTabbedPane.insets = new Insets(0, 5, 0, 0);
gbc_descriptionTabbedPane.gridwidth = 2;
gbc_descriptionTabbedPane.weighty = 1.0;
gbc_descriptionTabbedPane.fill = GridBagConstraints.BOTH;
gbc_descriptionTabbedPane.gridx = 0;
gbc_descriptionTabbedPane.gridy = 6;
add(descriptionTabbedPane, gbc_descriptionTabbedPane);
});
}
return yearField;
}
if (!Beans.isDesignTime())
{
model.addPropertyChangeListener(e -> modelChanged());
}
}
private JLabel getGenreLabel()
{
if (genreLabel == null)
{
genreLabel = new JLabel("Genre");
}
return genreLabel;
}
private void modelChanged()
{
// Read from model
if (!getTitleField().hasFocus())
{
getTitleField().setText(model.getTitle());
}
if (!getDescriptionPanel().getDescriptionTextArea().hasFocus())
{
getDescriptionPanel().getDescriptionTextArea().setText(model.getDescription());
}
if (!getDescriptionDePanel().getDescriptionTextArea().hasFocus())
{
getDescriptionDePanel().getDescriptionTextArea().setText(model.getDescriptionDe());
}
if (!getDescriptionFrPanel().getDescriptionTextArea().hasFocus())
{
getDescriptionFrPanel().getDescriptionTextArea().setText(model.getDescriptionFr());
}
if (!getDescriptionEsPanel().getDescriptionTextArea().hasFocus())
{
getDescriptionEsPanel().getDescriptionTextArea().setText(model.getDescriptionEs());
}
if (!getDescriptionItPanel().getDescriptionTextArea().hasFocus())
{
getDescriptionItPanel().getDescriptionTextArea().setText(model.getDescriptionIt());
}
if (!getYearField().hasFocus())
{
getYearField().setValue(model.getYear());
}
if (!getGenreComboBox().hasFocus())
{
getGenreComboBox().setSelectedGenre(model.getGenre());
}
if (!getAuthorField().hasFocus())
{
getAuthorField().setText(model.getAuthor());
}
if (!getComposerField().hasFocus())
{
getComposerField().setText(model.getComposer());
}
}
private GenreComboBox getGenreComboBox()
{
if (genreComboBox == null)
{
genreComboBox = new GenreComboBox();
genreComboBox.addActionListener(e -> model.setGenre(genreComboBox.getSelectedGenre()));
}
return genreComboBox;
}
private JTextField getTitleField()
{
if (titleField == null)
{
titleField = new JTextField();
titleField.addKeyListener(new KeyAdapter()
{
@Override
public void keyReleased(KeyEvent e)
{
JTextField textField = (JTextField) e.getSource();
model.setTitle(textField.getText());
}
});
}
return titleField;
}
public ScreenshotsPanel getScreensPanel()
{
if (screensPanel == null)
{
screensPanel = new ScreenshotsPanel(this.model);
}
return screensPanel;
}
private JSpinner getYearField()
{
if (yearField == null)
{
SpinnerModel spinnerModel = new SpinnerNumberModel(1986, // initial value
1978, // min
Calendar.getInstance().get(Calendar.YEAR), // max, no need to add more than current year
1);
yearField = new JSpinner(spinnerModel);
JSpinner.NumberEditor numberEditor = new JSpinner.NumberEditor(yearField, "####");
yearField.setEditor(numberEditor);
// Select all when gaining focus
numberEditor.getTextField().addFocusListener(new FocusAdapter()
{
@Override
public void focusGained(final FocusEvent e)
{
SwingUtilities.invokeLater(() ->
{
JTextField tf = (JTextField) e.getSource();
tf.selectAll();
});
}
});
void focusTitleField()
{
getTitleField().requestFocus();
}
yearField.addChangeListener(e ->
{
JSpinner textField = (JSpinner) e.getSource();
model.setYear(Integer.parseInt(textField.getValue().toString()));
private JTabbedPane getDescriptionTabbedPane()
{
if (descriptionTabbedPane == null)
{
descriptionTabbedPane = new JTabbedPane(JTabbedPane.TOP);
descriptionTabbedPane.setPreferredSize(new Dimension(290, 150));
descriptionTabbedPane.addTab("Description: en", null, getDescriptionPanel(), null);
descriptionTabbedPane.addTab("de", null, getDescriptionDePanel(), null);
descriptionTabbedPane.addTab("fr", null, getDescriptionFrPanel(), null);
descriptionTabbedPane.addTab("es", null, getDescriptionEsPanel(), null);
descriptionTabbedPane.addTab("it", null, getDescriptionItPanel(), null);
}
return descriptionTabbedPane;
}
});
}
return yearField;
}
private DescriptionPanel getDescriptionPanel()
{
if (descriptionPanel == null)
{
descriptionPanel = new DescriptionPanel(model, DescriptionPanel.Language.en);
}
return descriptionPanel;
}
private GenreComboBox getGenreComboBox()
{
if (genreComboBox == null)
{
genreComboBox = new GenreComboBox();
genreComboBox.addActionListener(e -> model.setGenre(genreComboBox.getSelectedGenre()));
}
return genreComboBox;
}
private DescriptionPanel getDescriptionDePanel()
{
if (descriptionDePanel == null)
{
descriptionDePanel = new DescriptionPanel(model, DescriptionPanel.Language.de);
}
return descriptionDePanel;
}
private JTextField getAuthorField()
{
if (authorField == null)
{
authorField = new JTextField();
authorField.addKeyListener(new KeyAdapter()
{
@Override
public void keyReleased(KeyEvent e)
{
JTextField textField = (JTextField) e.getSource();
model.setAuthor(textField.getText());
}
});
}
return authorField;
}
private DescriptionPanel getDescriptionFrPanel()
{
if (descriptionFrPanel == null)
{
descriptionFrPanel = new DescriptionPanel(model, DescriptionPanel.Language.fr);
}
return descriptionFrPanel;
}
private JTextField getComposerField()
{
if (composerField == null)
{
composerField = new JTextField();
composerField.addKeyListener(new KeyAdapter()
{
@Override
public void keyReleased(KeyEvent e)
{
JTextField textField = (JTextField) e.getSource();
model.setComposer(textField.getText());
}
});
}
return composerField;
}
private DescriptionPanel getDescriptionEsPanel()
{
if (descriptionEsPanel == null)
{
descriptionEsPanel = new DescriptionPanel(model, DescriptionPanel.Language.es);
}
return descriptionEsPanel;
}
private DescriptionPanel getDescriptionPanel()
{
if (descriptionPanel == null)
{
descriptionPanel = new DescriptionPanel(model, DescriptionPanel.Language.en);
}
return descriptionPanel;
}
private DescriptionPanel getDescriptionItPanel()
{
if (descriptionItPanel == null)
{
descriptionItPanel = new DescriptionPanel(model, DescriptionPanel.Language.it);
}
return descriptionItPanel;
}
private JButton getTranslateButton()
{
if (translateButton == null)
{
translateButton = new JButton("Translate...");
translateButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
TranslationDialog dialog = new TranslationDialog(model);
dialog.pack();
dialog.setLocationRelativeTo(translateButton);
if (dialog.showDialog())
{
TranslationProgressDialog progressDialog = new TranslationProgressDialog(MainWindow.getInstance());
progressDialog.pack();
progressDialog.setLocationRelativeTo(MainWindow.getInstance());
TranslationWorker worker = new TranslationWorker(model, progressDialog, dialog.getSelectedFromLanguage(), dialog.getSelectedToLanguages());
worker.execute();
progressDialog.setVisible(true);
}
}
});
}
return translateButton;
}
public void selectEnDescriptionTab()
{
getDescriptionTabbedPane().setSelectedIndex(0);
}
private DescriptionPanel getDescriptionDePanel()
{
if (descriptionDePanel == null)
{
descriptionDePanel = new DescriptionPanel(model, DescriptionPanel.Language.de);
}
return descriptionDePanel;
}
private DescriptionPanel getDescriptionFrPanel()
{
if (descriptionFrPanel == null)
{
descriptionFrPanel = new DescriptionPanel(model, DescriptionPanel.Language.fr);
}
return descriptionFrPanel;
}
private DescriptionPanel getDescriptionEsPanel()
{
if (descriptionEsPanel == null)
{
descriptionEsPanel = new DescriptionPanel(model, DescriptionPanel.Language.es);
}
return descriptionEsPanel;
}
private DescriptionPanel getDescriptionItPanel()
{
if (descriptionItPanel == null)
{
descriptionItPanel = new DescriptionPanel(model, DescriptionPanel.Language.it);
}
return descriptionItPanel;
}
public void selectEnDescriptionTab()
{
descriptionTabbedPane.setSelectedIndex(0);
}
void focusTitleField()
{
getTitleField().requestFocus();
}
}

View File

@ -49,13 +49,6 @@ public class JoystickBottomPanel extends JPanel
gbc_cComboBox.gridx = 2;
gbc_cComboBox.gridy = 0;
add(getCComboBox(), gbc_cComboBox);
GridBagConstraints gbc_menuLabel = new GridBagConstraints();
gbc_menuLabel.weighty = 1.0;
gbc_menuLabel.anchor = GridBagConstraints.NORTH;
gbc_menuLabel.insets = new Insets(3, 15, 0, 5);
gbc_menuLabel.gridx = 3;
gbc_menuLabel.gridy = 0;
add(getMenuLabel(), gbc_menuLabel);
if (!Beans.isDesignTime())
{
model.addPropertyChangeListener((e) -> modelChanged());
@ -116,13 +109,4 @@ public class JoystickBottomPanel extends JPanel
}
return cComboBox;
}
private JLabel getMenuLabel()
{
if (menuLabel == null)
{
menuLabel = new JLabel("Menu");
}
return menuLabel;
}
}

View File

@ -41,8 +41,8 @@ public class JoystickPanel extends JPanel
{
this.portnumber = portnumber;
this.model = model;
this.setPreferredSize(new Dimension(460, 510));
this.setMinimumSize(new Dimension(460, 510));
this.setPreferredSize(new Dimension(390, 510));
this.setMinimumSize(new Dimension(390, 510));
setBorder(new TitledBorder(null, "Port " + portnumber, TitledBorder.LEADING, TitledBorder.TOP, null, null));
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWeights = new double[] { 0.0, 1.0, 0.0 };
@ -65,7 +65,7 @@ public class JoystickPanel extends JPanel
add(getJoystickStickPanel(), gbc_joystickStickPanel);
GridBagConstraints gbc_leftFireComboBox = new GridBagConstraints();
gbc_leftFireComboBox.anchor = GridBagConstraints.WEST;
gbc_leftFireComboBox.insets = new Insets(90, 10, 5, 5);
gbc_leftFireComboBox.insets = new Insets(45, 5, 5, 5);
gbc_leftFireComboBox.gridx = 0;
gbc_leftFireComboBox.gridy = 2;
add(getLeftFireComboBox(), gbc_leftFireComboBox);
@ -79,19 +79,19 @@ public class JoystickPanel extends JPanel
add(getImageLabel(), gbc_imageLabel);
GridBagConstraints gbc_rightFireComboBox = new GridBagConstraints();
gbc_rightFireComboBox.anchor = GridBagConstraints.EAST;
gbc_rightFireComboBox.insets = new Insets(90, 0, 5, 10);
gbc_rightFireComboBox.insets = new Insets(45, 0, 5, 5);
gbc_rightFireComboBox.gridx = 2;
gbc_rightFireComboBox.gridy = 2;
add(getRightFireComboBox(), gbc_rightFireComboBox);
GridBagConstraints gbc_tlComboBox = new GridBagConstraints();
gbc_tlComboBox.anchor = GridBagConstraints.WEST;
gbc_tlComboBox.insets = new Insets(30, 10, 5, 5);
gbc_tlComboBox.insets = new Insets(30, 5, 5, 5);
gbc_tlComboBox.gridx = 0;
gbc_tlComboBox.gridy = 3;
add(getTlComboBox(), gbc_tlComboBox);
GridBagConstraints gbc_trComboBox = new GridBagConstraints();
gbc_trComboBox.anchor = GridBagConstraints.EAST;
gbc_trComboBox.insets = new Insets(30, 0, 5, 10);
gbc_trComboBox.insets = new Insets(30, 0, 5, 5);
gbc_trComboBox.gridx = 2;
gbc_trComboBox.gridy = 3;
add(getTrComboBox(), gbc_trComboBox);
@ -103,8 +103,9 @@ public class JoystickPanel extends JPanel
gbc_joystickBottomPanel.gridy = 5;
add(getJoystickBottomPanel(), gbc_joystickBottomPanel);
GridBagConstraints gbc_configPanel = new GridBagConstraints();
gbc_configPanel.anchor = GridBagConstraints.NORTH;
gbc_configPanel.weighty = 1.0;
gbc_configPanel.fill = GridBagConstraints.HORIZONTAL;
gbc_configPanel.insets = new Insets(0, 0, 0, 5);
gbc_configPanel.gridx = 0;
gbc_configPanel.gridwidth = 3;
gbc_configPanel.gridy = 6;
@ -172,7 +173,7 @@ public class JoystickPanel extends JPanel
{
imageLabel = new JLabel();
imageLabel.setHorizontalAlignment(SwingConstants.CENTER);
ImageIcon joyImage = new ImageIcon(getClass().getResource("/se/lantz/joystick2.png"));
ImageIcon joyImage = new ImageIcon(getClass().getResource("/se/lantz/joystick4.png"));
imageLabel.setIcon(joyImage);
}
return imageLabel;
@ -286,12 +287,12 @@ public class JoystickPanel extends JPanel
configPanel.setLayout(gbl_configPanel);
GridBagConstraints gbc_configLabel = new GridBagConstraints();
gbc_configLabel.anchor = GridBagConstraints.WEST;
gbc_configLabel.insets = new Insets(0, 10, 0, 5);
gbc_configLabel.insets = new Insets(0, 5, 0, 5);
gbc_configLabel.gridx = 0;
gbc_configLabel.gridy = 0;
configPanel.add(getConfigLabel(), gbc_configLabel);
GridBagConstraints gbc_configTextField = new GridBagConstraints();
gbc_configTextField.insets = new Insets(0, 0, 0, 20);
gbc_configTextField.insets = new Insets(0, 0, 0, 5);
gbc_configTextField.fill = GridBagConstraints.HORIZONTAL;
gbc_configTextField.weightx = 1.0;
gbc_configTextField.anchor = GridBagConstraints.NORTHWEST;

View File

@ -27,19 +27,19 @@ public class JoystickStickPanel extends JPanel
GridBagLayout gridBagLayout = new GridBagLayout();
setLayout(gridBagLayout);
GridBagConstraints gbc_upComboBox = new GridBagConstraints();
gbc_upComboBox.insets = new Insets(0, 10, 5, 10);
gbc_upComboBox.insets = new Insets(0, 10, 0, 10);
gbc_upComboBox.fill = GridBagConstraints.HORIZONTAL;
gbc_upComboBox.gridx = 1;
gbc_upComboBox.gridy = 0;
add(getUpComboBox(), gbc_upComboBox);
GridBagConstraints gbc_leftComboBox = new GridBagConstraints();
gbc_leftComboBox.insets = new Insets(0, 5, 5, 0);
gbc_leftComboBox.insets = new Insets(0, 5, 0, 0);
gbc_leftComboBox.fill = GridBagConstraints.HORIZONTAL;
gbc_leftComboBox.gridx = 0;
gbc_leftComboBox.gridy = 1;
add(getLeftComboBox(), gbc_leftComboBox);
GridBagConstraints gbc_rightComboBox = new GridBagConstraints();
gbc_rightComboBox.insets = new Insets(0, 0, 5, 5);
gbc_rightComboBox.insets = new Insets(0, 0, 0, 5);
gbc_rightComboBox.fill = GridBagConstraints.HORIZONTAL;
gbc_rightComboBox.gridx = 2;
gbc_rightComboBox.gridy = 1;

View File

@ -1,5 +1,6 @@
package se.lantz.gui;
import java.beans.Beans;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
@ -25,7 +26,10 @@ public class KeySelectionComboBox extends JComboBox<String>
{
super();
this.model = model;
setupItemsAndCodes();
if (!Beans.isDesignTime())
{
setupItemsAndCodes();
}
}
private void setupItemsAndCodes()

View File

@ -177,6 +177,6 @@ public class MainPanel extends JPanel
public void selectEnDescriptionTab()
{
getGameDetailsBackgroundPanel().getInfoPanel().selectEnDescriptionTab();
getGameDetailsBackgroundPanel().getInfoBackgroundPanel().selectEnDescriptionTab();
}
}

View File

@ -85,12 +85,12 @@ public class ScreenshotsPanel extends JPanel
setLayout(gridBagLayout);
GridBagConstraints gbc_coverPanel = new GridBagConstraints();
gbc_coverPanel.fill = GridBagConstraints.BOTH;
gbc_coverPanel.insets = new Insets(10, 0, 5, 5);
gbc_coverPanel.insets = new Insets(5, 0, 0, 0);
gbc_coverPanel.gridx = 1;
gbc_coverPanel.gridy = 0;
add(getCoverPanel(), gbc_coverPanel);
GridBagConstraints gbc_screenshotPanel = new GridBagConstraints();
gbc_screenshotPanel.insets = new Insets(10, 0, 5, 5);
gbc_screenshotPanel.insets = new Insets(5, 0, 0, 5);
gbc_screenshotPanel.anchor = GridBagConstraints.WEST;
gbc_screenshotPanel.fill = GridBagConstraints.VERTICAL;
gbc_screenshotPanel.gridx = 2;
@ -388,7 +388,7 @@ public class ScreenshotsPanel extends JPanel
gbc_screen1ImageLabel.weightx = 0.5;
gbc_screen1ImageLabel.weighty = 1.0;
gbc_screen1ImageLabel.anchor = GridBagConstraints.WEST;
gbc_screen1ImageLabel.insets = new Insets(0, 5, 5, 5);
gbc_screen1ImageLabel.insets = new Insets(0, 5, 0, 0);
gbc_screen1ImageLabel.gridx = 0;
gbc_screen1ImageLabel.gridy = 0;
screenshotPanel.add(getScreen1ImageLabel(), gbc_screen1ImageLabel);
@ -404,7 +404,7 @@ public class ScreenshotsPanel extends JPanel
gbc_screen2ImageLabel.weighty = 1.0;
gbc_screen2ImageLabel.anchor = GridBagConstraints.WEST;
gbc_screen2ImageLabel.weightx = 0.5;
gbc_screen2ImageLabel.insets = new Insets(0, 5, 5, 0);
gbc_screen2ImageLabel.insets = new Insets(0, 5, 0, 0);
gbc_screen2ImageLabel.gridx = 3;
gbc_screen2ImageLabel.gridy = 0;
screenshotPanel.add(getScreen2ImageLabel(), gbc_screen2ImageLabel);
@ -415,7 +415,7 @@ public class ScreenshotsPanel extends JPanel
screenshotPanel.add(getResolution1Label(), gbc_resolution1Label);
GridBagConstraints gbc_crop1Button = new GridBagConstraints();
gbc_crop1Button.anchor = GridBagConstraints.NORTHEAST;
gbc_crop1Button.insets = new Insets(0, 0, 3, 5);
gbc_crop1Button.insets = new Insets(0, 0, 3, 0);
gbc_crop1Button.gridx = 2;
gbc_crop1Button.gridy = 1;
screenshotPanel.add(getEdit1Button(), gbc_crop1Button);
@ -517,14 +517,14 @@ public class ScreenshotsPanel extends JPanel
GridBagConstraints gbc_gameLabel = new GridBagConstraints();
gbc_gameLabel.weightx = 1.0;
gbc_gameLabel.anchor = GridBagConstraints.WEST;
gbc_gameLabel.insets = new Insets(5, 0, 0, 5);
gbc_gameLabel.insets = new Insets(0, 0, 0, 5);
gbc_gameLabel.gridx = 0;
gbc_gameLabel.gridy = 0;
gamePanel.add(getGameLabel(), gbc_gameLabel);
GridBagConstraints gbc_gameTextField = new GridBagConstraints();
gbc_gameTextField.anchor = GridBagConstraints.NORTHWEST;
gbc_gameTextField.weighty = 1.0;
gbc_gameTextField.insets = new Insets(1, 0, 5, 5);
gbc_gameTextField.insets = new Insets(1, 0, 0, 5);
gbc_gameTextField.fill = GridBagConstraints.HORIZONTAL;
gbc_gameTextField.gridx = 0;
gbc_gameTextField.gridy = 1;
@ -533,7 +533,7 @@ public class ScreenshotsPanel extends JPanel
gbc_gameButton.weighty = 1.0;
gbc_gameButton.anchor = GridBagConstraints.NORTHWEST;
gbc_gameButton.weightx = 1.0;
gbc_gameButton.insets = new Insets(0, 0, 5, 5);
gbc_gameButton.insets = new Insets(0, 0, 0, 5);
gbc_gameButton.gridx = 1;
gbc_gameButton.gridy = 1;
gamePanel.add(getGameButton(), gbc_gameButton);

View File

@ -83,13 +83,13 @@ public class SystemPanel extends JPanel
add(getRadioPanel(), gbc_radioPanel);
GridBagConstraints gbc_typePanel = new GridBagConstraints();
gbc_typePanel.weightx = 0.5;
gbc_typePanel.insets = new Insets(5, 5, 5, 5);
gbc_typePanel.insets = new Insets(0, 5, 5, 0);
gbc_typePanel.fill = GridBagConstraints.BOTH;
gbc_typePanel.gridx = 0;
gbc_typePanel.gridy = 1;
add(getTypePanel(), gbc_typePanel);
GridBagConstraints gbc_drivePanel = new GridBagConstraints();
gbc_drivePanel.insets = new Insets(5, 0, 5, 5);
gbc_drivePanel.insets = new Insets(0, 0, 5, 5);
gbc_drivePanel.weightx = 0.5;
gbc_drivePanel.fill = GridBagConstraints.BOTH;
gbc_drivePanel.gridx = 1;
@ -171,7 +171,7 @@ public class SystemPanel extends JPanel
GridBagConstraints gbc_vic20Button = new GridBagConstraints();
gbc_vic20Button.weightx = 1.0;
gbc_vic20Button.weighty = 1.0;
gbc_vic20Button.insets = new Insets(0, 5, 5, 5);
gbc_vic20Button.insets = new Insets(0, 5, 0, 5);
gbc_vic20Button.anchor = GridBagConstraints.NORTHWEST;
gbc_vic20Button.gridx = 0;
gbc_vic20Button.gridy = 1;
@ -285,7 +285,6 @@ public class SystemPanel extends JPanel
gbc_accurateDiskCheckBox.gridy = 1;
drivePanel.add(getAccurateDiskCheckBox(), gbc_accurateDiskCheckBox);
GridBagConstraints gbc_readOnlyCheckBox = new GridBagConstraints();
gbc_readOnlyCheckBox.insets = new Insets(0, 0, 5, 0);
gbc_readOnlyCheckBox.anchor = GridBagConstraints.NORTHWEST;
gbc_readOnlyCheckBox.gridx = 0;
gbc_readOnlyCheckBox.gridy = 2;
@ -344,7 +343,7 @@ public class SystemPanel extends JPanel
{
audioReuPanel = new JPanel();
audioReuPanel.setLayout(new BorderLayout());
audioReuPanel.add(getAudioPanel(), BorderLayout.NORTH);
audioReuPanel.add(getAudioPanel(), BorderLayout.WEST);
audioReuPanel.add(getReuPanel(), BorderLayout.CENTER);
}
return audioReuPanel;
@ -398,33 +397,30 @@ public class SystemPanel extends JPanel
gbl_audioPanel.columnWidths = new int[]
{ 0, 0, 0 };
gbl_audioPanel.rowHeights = new int[]
{ 0, 0, 0, 0 };
{ 0, 0, 0, 0, 0 };
gbl_audioPanel.columnWeights = new double[]
{ 0.0, 0.0, Double.MIN_VALUE };
gbl_audioPanel.rowWeights = new double[]
{ 0.0, 0.0, 0.0, Double.MIN_VALUE };
{ 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };
audioPanel.setLayout(gbl_audioPanel);
GridBagConstraints gbc_sid6581RadioButton = new GridBagConstraints();
gbc_sid6581RadioButton.anchor = GridBagConstraints.WEST;
gbc_sid6581RadioButton.insets = new Insets(0, 0, 0, 5);
gbc_sid6581RadioButton.gridx = 0;
gbc_sid6581RadioButton.gridy = 0;
audioPanel.add(getSid6581RadioButton(), gbc_sid6581RadioButton);
GridBagConstraints gbc_noAudioScaleCheckBox = new GridBagConstraints();
gbc_noAudioScaleCheckBox.anchor = GridBagConstraints.WEST;
gbc_noAudioScaleCheckBox.weightx = 1.0;
gbc_noAudioScaleCheckBox.gridx = 1;
gbc_noAudioScaleCheckBox.gridy = 0;
gbc_noAudioScaleCheckBox.gridx = 0;
gbc_noAudioScaleCheckBox.gridy = 3;
audioPanel.add(getNoAudioScaleCheckBox(), gbc_noAudioScaleCheckBox);
GridBagConstraints gbc_sid8580RadioButton = new GridBagConstraints();
gbc_sid8580RadioButton.anchor = GridBagConstraints.WEST;
gbc_sid8580RadioButton.insets = new Insets(0, 0, 0, 5);
gbc_sid8580RadioButton.gridx = 0;
gbc_sid8580RadioButton.gridy = 1;
audioPanel.add(getSid8580RadioButton(), gbc_sid8580RadioButton);
GridBagConstraints gbc_sid8580dRadioButton = new GridBagConstraints();
gbc_sid8580dRadioButton.anchor = GridBagConstraints.WEST;
gbc_sid8580dRadioButton.insets = new Insets(0, 0, 0, 5);
gbc_sid8580dRadioButton.gridx = 0;
gbc_sid8580dRadioButton.gridy = 2;
audioPanel.add(getSid8580dRadioButton(), gbc_sid8580dRadioButton);
@ -454,30 +450,30 @@ public class SystemPanel extends JPanel
ramPanel.add(getBank1CheckBox(), gbc_bank1CheckBox);
GridBagConstraints gbc_bank2CheckBox = new GridBagConstraints();
gbc_bank2CheckBox.weightx = 1.0;
gbc_bank2CheckBox.anchor = GridBagConstraints.WEST;
gbc_bank2CheckBox.anchor = GridBagConstraints.NORTHWEST;
gbc_bank2CheckBox.gridx = 0;
gbc_bank2CheckBox.gridy = 2;
ramPanel.add(getBank2CheckBox(), gbc_bank2CheckBox);
GridBagConstraints gbc_bank3CheckBox = new GridBagConstraints();
gbc_bank3CheckBox.weightx = 1.0;
gbc_bank3CheckBox.anchor = GridBagConstraints.WEST;
gbc_bank3CheckBox.gridx = 0;
gbc_bank3CheckBox.gridy = 3;
gbc_bank3CheckBox.gridx = 1;
gbc_bank3CheckBox.gridy = 0;
ramPanel.add(getBank3CheckBox(), gbc_bank3CheckBox);
GridBagConstraints gbc_bank5CheckBox = new GridBagConstraints();
gbc_bank5CheckBox.weightx = 1.0;
gbc_bank5CheckBox.anchor = GridBagConstraints.WEST;
gbc_bank5CheckBox.insets = new Insets(0, 0, 5, 0);
gbc_bank5CheckBox.gridx = 0;
gbc_bank5CheckBox.gridy = 4;
gbc_bank5CheckBox.gridx = 1;
gbc_bank5CheckBox.gridy = 1;
ramPanel.add(getBank5CheckBox(), gbc_bank5CheckBox);
GridBagConstraints gbc_ramLabel = new GridBagConstraints();
gbc_ramLabel.weighty = 1.0;
gbc_ramLabel.insets = new Insets(0, 5, 10, 5);
gbc_ramLabel.anchor = GridBagConstraints.NORTHWEST;
gbc_ramLabel.weightx = 1.0;
gbc_ramLabel.gridx = 0;
gbc_ramLabel.gridy = 5;
gbc_ramLabel.gridx = 1;
gbc_ramLabel.gridy = 2;
ramPanel.add(getRamLabel(), gbc_ramLabel);
}
return ramPanel;
@ -494,7 +490,7 @@ public class SystemPanel extends JPanel
gbc_configLabel.gridheight = 2;
gbc_configLabel.weighty = 1.0;
gbc_configLabel.anchor = GridBagConstraints.NORTHWEST;
gbc_configLabel.insets = new Insets(15, 5, 5, 5);
gbc_configLabel.insets = new Insets(5, 5, 5, 5);
gbc_configLabel.gridx = 0;
gbc_configLabel.gridy = 0;
configPanel.add(getConfigLabel(), gbc_configLabel);
@ -502,7 +498,7 @@ public class SystemPanel extends JPanel
gbc_configTextField.weighty = 1.0;
gbc_configTextField.fill = GridBagConstraints.HORIZONTAL;
gbc_configTextField.weightx = 1.0;
gbc_configTextField.insets = new Insets(13, 0, 5, 0);
gbc_configTextField.insets = new Insets(3, 0, 5, 0);
gbc_configTextField.anchor = GridBagConstraints.NORTHWEST;
gbc_configTextField.gridx = 1;
gbc_configTextField.gridy = 0;
@ -780,7 +776,8 @@ public class SystemPanel extends JPanel
{
if (bank0CheckBox == null)
{
bank0CheckBox = new JCheckBox("Bank 0 (3K @ $0400-$0FFF)");
bank0CheckBox = new JCheckBox("Bank 0");
bank0CheckBox.setToolTipText("(3K @ $0400-$0FFF)");
bank0CheckBox.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@ -797,7 +794,8 @@ public class SystemPanel extends JPanel
{
if (bank1CheckBox == null)
{
bank1CheckBox = new JCheckBox("Bank 1 (8K @ $2000-$3FFF)");
bank1CheckBox = new JCheckBox("Bank 1");
bank1CheckBox.setToolTipText("(8K @ $2000-$3FFF)");
bank1CheckBox.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@ -814,7 +812,8 @@ public class SystemPanel extends JPanel
{
if (bank2CheckBox == null)
{
bank2CheckBox = new JCheckBox("Bank 2 (8K @ $4000-$5FFF)");
bank2CheckBox = new JCheckBox("Bank 2");
bank2CheckBox.setToolTipText("(8K @ $4000-$5FFF)");
bank2CheckBox.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@ -831,7 +830,8 @@ public class SystemPanel extends JPanel
{
if (bank3CheckBox == null)
{
bank3CheckBox = new JCheckBox("Bank 3 (8K @ $6000-$7FFF)");
bank3CheckBox = new JCheckBox("Bank 3");
bank3CheckBox.setToolTipText("(8K @ $6000-$7FFF)");
bank3CheckBox.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@ -848,7 +848,8 @@ public class SystemPanel extends JPanel
{
if (bank5CheckBox == null)
{
bank5CheckBox = new JCheckBox("Bank 5 (8K @ $A000-$BFFF)");
bank5CheckBox = new JCheckBox("Bank 5");
bank5CheckBox.setToolTipText("(8K @ $A000-$BFFF)");
bank5CheckBox.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@ -901,7 +902,7 @@ public class SystemPanel extends JPanel
{
if (reu512kRadioButton == null)
{
reu512kRadioButton = new JCheckBox("512K RAM Expansion Unit ");
reu512kRadioButton = new JCheckBox("512K");
reu512kRadioButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@ -919,7 +920,7 @@ public class SystemPanel extends JPanel
{
if (reu2mbRadioButton == null)
{
reu2mbRadioButton = new JCheckBox("2Mb RAM Expansion Unit");
reu2mbRadioButton = new JCheckBox("2Mb");
reu2mbRadioButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@ -937,7 +938,7 @@ public class SystemPanel extends JPanel
{
if (reu16mbRadioButton == null)
{
reu16mbRadioButton = new JCheckBox("16Mb RAM Expansion Unit");
reu16mbRadioButton = new JCheckBox("16Mb");
reu16mbRadioButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB