I10n for the GL preferences
This commit is contained in:
parent
321761cf0f
commit
de2e2e6bd5
@ -253,7 +253,15 @@ pref.dlg.tab.Materials = Materials
|
|||||||
pref.dlg.tab.Custommaterials = Custom materials
|
pref.dlg.tab.Custommaterials = Custom materials
|
||||||
pref.dlg.tab.Options = Options
|
pref.dlg.tab.Options = Options
|
||||||
pref.dlg.tab.Miscellaneousoptions = Miscellaneous options
|
pref.dlg.tab.Miscellaneousoptions = Miscellaneous options
|
||||||
pref.dlg.tab.DecalEditor = Graphics Editor
|
|
||||||
|
pref.dlg.tab.Graphics = Graphics
|
||||||
|
pref.dlg.lbl.DecalEditor = Graphics Editor
|
||||||
|
pref.dlg.opengl.lbl.title = 3D Graphics
|
||||||
|
pref.dlg.opengl.but.enableGL = Enable 3D Graphics
|
||||||
|
pref.dlg.opengl.but.enableAA = Enable Antialiasing
|
||||||
|
pref.dlg.opengl.lbl.useFBO = Use Off-screen Rendering
|
||||||
|
|
||||||
|
|
||||||
pref.dlg.lbl.Positiontoinsert = Position to insert new body components:
|
pref.dlg.lbl.Positiontoinsert = Position to insert new body components:
|
||||||
pref.dlg.lbl.Confirmdeletion = Confirm deletion of simulations:
|
pref.dlg.lbl.Confirmdeletion = Confirm deletion of simulations:
|
||||||
pref.dlg.lbl.User-definedthrust = User-defined thrust curves:
|
pref.dlg.lbl.User-definedthrust = User-defined thrust curves:
|
||||||
|
@ -16,6 +16,7 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import javax.swing.AbstractListModel;
|
import javax.swing.AbstractListModel;
|
||||||
|
import javax.swing.BorderFactory;
|
||||||
import javax.swing.ButtonGroup;
|
import javax.swing.ButtonGroup;
|
||||||
import javax.swing.ComboBoxModel;
|
import javax.swing.ComboBoxModel;
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
@ -28,12 +29,11 @@ import javax.swing.JOptionPane;
|
|||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JProgressBar;
|
import javax.swing.JProgressBar;
|
||||||
import javax.swing.JRadioButton;
|
import javax.swing.JRadioButton;
|
||||||
import javax.swing.JSeparator;
|
|
||||||
import javax.swing.JTabbedPane;
|
import javax.swing.JTabbedPane;
|
||||||
import javax.swing.JTextField;
|
import javax.swing.JTextField;
|
||||||
import javax.swing.SwingConstants;
|
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.Timer;
|
import javax.swing.Timer;
|
||||||
|
import javax.swing.border.TitledBorder;
|
||||||
import javax.swing.event.ChangeEvent;
|
import javax.swing.event.ChangeEvent;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
import javax.swing.event.DocumentEvent;
|
import javax.swing.event.DocumentEvent;
|
||||||
@ -64,6 +64,8 @@ import net.sf.openrocket.util.Utils;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.itextpdf.text.Font;
|
||||||
|
|
||||||
|
|
||||||
public class PreferencesDialog extends JDialog {
|
public class PreferencesDialog extends JDialog {
|
||||||
private static final Logger log = LoggerFactory.getLogger(PreferencesDialog.class);
|
private static final Logger log = LoggerFactory.getLogger(PreferencesDialog.class);
|
||||||
@ -94,7 +96,7 @@ public class PreferencesDialog extends JDialog {
|
|||||||
tabbedPane.addTab(trans.get("pref.dlg.tab.Options"), null, optionsPane(),
|
tabbedPane.addTab(trans.get("pref.dlg.tab.Options"), null, optionsPane(),
|
||||||
trans.get("pref.dlg.tab.Miscellaneousoptions"));
|
trans.get("pref.dlg.tab.Miscellaneousoptions"));
|
||||||
//// Decal Editor selection
|
//// Decal Editor selection
|
||||||
tabbedPane.addTab("Graphics", graphicsOptionsPane()); //TODO Translation
|
tabbedPane.addTab(trans.get("pref.dlg.tab.Graphics"), graphicsOptionsPane());
|
||||||
|
|
||||||
//// Close button
|
//// Close button
|
||||||
JButton close = new JButton(trans.get("dlg.but.close"));
|
JButton close = new JButton(trans.get("dlg.but.close"));
|
||||||
@ -475,9 +477,13 @@ public class PreferencesDialog extends JDialog {
|
|||||||
|
|
||||||
private JPanel graphicsOptionsPane() {
|
private JPanel graphicsOptionsPane() {
|
||||||
|
|
||||||
JPanel panel = new JPanel(new MigLayout("fill, ins n n n"));
|
JPanel panel = new JPanel(new MigLayout("fillx"));
|
||||||
|
|
||||||
panel.add(new StyledLabel(trans.get("pref.dlg.tab.DecalEditor"), Style.BOLD), "wrap"); //TODO Translation
|
panel.add(new JPanel(new MigLayout("fill, ins n n n")) {
|
||||||
|
{ //Editor Options
|
||||||
|
TitledBorder border = BorderFactory.createTitledBorder(trans.get("pref.dlg.lbl.DecalEditor"));
|
||||||
|
GUIUtil.changeFontStyle(border, Font.BOLD);
|
||||||
|
setBorder(border);
|
||||||
|
|
||||||
ButtonGroup execGroup = new ButtonGroup();
|
ButtonGroup execGroup = new ButtonGroup();
|
||||||
|
|
||||||
@ -491,7 +497,7 @@ public class PreferencesDialog extends JDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
panel.add(showPrompt, "wrap");
|
add(showPrompt, "wrap");
|
||||||
execGroup.add(showPrompt);
|
execGroup.add(showPrompt);
|
||||||
|
|
||||||
if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.EDIT)) {
|
if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.EDIT)) {
|
||||||
@ -506,7 +512,7 @@ public class PreferencesDialog extends JDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
panel.add(systemRadio, "wrap");
|
add(systemRadio, "wrap");
|
||||||
execGroup.add(systemRadio);
|
execGroup.add(systemRadio);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -514,7 +520,7 @@ public class PreferencesDialog extends JDialog {
|
|||||||
boolean commandLineIsSelected = preferences.isDecalEditorPreferenceSet() && !preferences.isDecalEditorPreferenceSystem();
|
boolean commandLineIsSelected = preferences.isDecalEditorPreferenceSet() && !preferences.isDecalEditorPreferenceSystem();
|
||||||
final JRadioButton commandRadio = new JRadioButton(trans.get("EditDecalDialog.lbl.cmdline"));
|
final JRadioButton commandRadio = new JRadioButton(trans.get("EditDecalDialog.lbl.cmdline"));
|
||||||
commandRadio.setSelected(commandLineIsSelected);
|
commandRadio.setSelected(commandLineIsSelected);
|
||||||
panel.add(commandRadio, "wrap");
|
add(commandRadio, "wrap");
|
||||||
execGroup.add(commandRadio);
|
execGroup.add(commandRadio);
|
||||||
|
|
||||||
final JTextField commandText = new JTextField();
|
final JTextField commandText = new JTextField();
|
||||||
@ -538,7 +544,7 @@ public class PreferencesDialog extends JDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
panel.add(commandText, "growx, wrap");
|
add(commandText, "growx, wrap");
|
||||||
|
|
||||||
final JButton chooser = new JButton(trans.get("EditDecalDialog.btn.chooser"));
|
final JButton chooser = new JButton(trans.get("EditDecalDialog.btn.chooser"));
|
||||||
chooser.setEnabled(commandLineIsSelected);
|
chooser.setEnabled(commandLineIsSelected);
|
||||||
@ -557,7 +563,7 @@ public class PreferencesDialog extends JDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
panel.add(chooser, "wrap");
|
add(chooser, "wrap");
|
||||||
|
|
||||||
|
|
||||||
commandRadio.addChangeListener(new ChangeListener() {
|
commandRadio.addChangeListener(new ChangeListener() {
|
||||||
@ -570,28 +576,32 @@ public class PreferencesDialog extends JDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
}, "growx, span");
|
||||||
|
|
||||||
/////GL Options
|
panel.add(new JPanel(new MigLayout("fill, ins n n n")) {
|
||||||
panel.add(new JSeparator(SwingConstants.HORIZONTAL), "span, wrap, growx");
|
{/////GL Options
|
||||||
panel.add(new StyledLabel("3D Graphics", Style.BOLD), "wrap"); //TODO Translation
|
TitledBorder border = BorderFactory.createTitledBorder(trans.get("pref.dlg.opengl.lbl.title"));
|
||||||
|
GUIUtil.changeFontStyle(border, Font.BOLD);
|
||||||
|
setBorder(border);
|
||||||
|
|
||||||
//// The effects will take place the next time you open a window.
|
//// The effects will take place the next time you open a window.
|
||||||
panel.add(new StyledLabel(
|
add(new StyledLabel(
|
||||||
trans.get("pref.dlg.lbl.effect1"), -2, Style.ITALIC),
|
trans.get("pref.dlg.lbl.effect1"), -2, Style.ITALIC),
|
||||||
"spanx, wrap");
|
"spanx, wrap");
|
||||||
|
|
||||||
BooleanModel enableGLModel = new BooleanModel(preferences.getBoolean(Preferences.OPENGL_ENABLED, true));
|
BooleanModel enableGLModel = new BooleanModel(preferences.getBoolean(Preferences.OPENGL_ENABLED, true));
|
||||||
final JCheckBox enableGL = new JCheckBox(enableGLModel);
|
final JCheckBox enableGL = new JCheckBox(enableGLModel);
|
||||||
enableGL.setText("Enable 3D Graphics"); //TODO Translation
|
enableGL.setText(trans.get("pref.dlg.opengl.but.enableGL"));
|
||||||
enableGL.addActionListener(new ActionListener() {
|
enableGL.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
preferences.putBoolean(Preferences.OPENGL_ENABLED, enableGL.isSelected());
|
preferences.putBoolean(Preferences.OPENGL_ENABLED, enableGL.isSelected());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
panel.add(enableGL, "wrap");
|
add(enableGL, "wrap");
|
||||||
|
|
||||||
final JCheckBox enableAA = new JCheckBox("Enable Antialiasing"); //TODO Translation
|
final JCheckBox enableAA = new JCheckBox(trans.get("pref.dlg.opengl.but.enableAA"));
|
||||||
enableAA.setSelected(preferences.getBoolean(Preferences.OPENGL_ENABLE_AA, true));
|
enableAA.setSelected(preferences.getBoolean(Preferences.OPENGL_ENABLE_AA, true));
|
||||||
enableAA.addActionListener(new ActionListener() {
|
enableAA.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -600,9 +610,9 @@ public class PreferencesDialog extends JDialog {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
enableGLModel.addEnableComponent(enableAA);
|
enableGLModel.addEnableComponent(enableAA);
|
||||||
panel.add(enableAA, "wrap");
|
add(enableAA, "wrap");
|
||||||
|
|
||||||
final JCheckBox useFBO = new JCheckBox("Use Offscreen Rendering"); //TODO Translation
|
final JCheckBox useFBO = new JCheckBox(trans.get("pref.dlg.opengl.lbl.useFBO"));
|
||||||
useFBO.setSelected(preferences.getBoolean(Preferences.OPENGL_USE_FBO, false));
|
useFBO.setSelected(preferences.getBoolean(Preferences.OPENGL_USE_FBO, false));
|
||||||
useFBO.addActionListener(new ActionListener() {
|
useFBO.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -611,14 +621,14 @@ public class PreferencesDialog extends JDialog {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
enableGLModel.addEnableComponent(useFBO);
|
enableGLModel.addEnableComponent(useFBO);
|
||||||
panel.add(useFBO, "wrap");
|
add(useFBO, "wrap");
|
||||||
|
}
|
||||||
|
}, "growx, span");
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private class DefaultUnitSelector extends AbstractListModel implements ComboBoxModel {
|
private class DefaultUnitSelector extends AbstractListModel implements ComboBoxModel {
|
||||||
|
|
||||||
private final UnitGroup group;
|
private final UnitGroup group;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user