Merge pull request #2536 from SiboVG/remove-selectcolor
Remove SelectColorButton and SelectColorToggleButton
This commit is contained in:
commit
7e995f2ace
@ -17,8 +17,6 @@ import java.awt.Color;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
/**
|
||||
* A panel implementation of a color chooser. The panel has a label and a textfield. The label identifies
|
||||
* what the color is to be used for (the purpose), and the textfield is uneditable but has its background set
|
||||
@ -60,7 +58,7 @@ public class ColorChooser extends JPanel {
|
||||
field.setBackground(curColor);
|
||||
parent.add(field, "width 50:100:100");
|
||||
|
||||
final JButton button = new SelectColorButton(COLOR_CHOOSER_BUTTON_LABEL);
|
||||
final JButton button = new JButton(COLOR_CHOOSER_BUTTON_LABEL);
|
||||
|
||||
ActionListener actionListener = new ActionListener() {
|
||||
@Override
|
||||
|
@ -10,7 +10,6 @@ import javax.swing.JPanel;
|
||||
import javax.swing.JToggleButton;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorToggleButton;
|
||||
import info.openrocket.core.l10n.Translator;
|
||||
import info.openrocket.core.rocketcomponent.AxialStage;
|
||||
import info.openrocket.core.rocketcomponent.BodyTube;
|
||||
@ -45,7 +44,7 @@ public class StageSelector extends JPanel implements StateChangeListener {
|
||||
|
||||
for (RocketComponent stage : assemblies) {
|
||||
if (!(stage instanceof AxialStage)) continue;
|
||||
JToggleButton button = new SelectColorToggleButton(new StageAction((AxialStage) stage));
|
||||
JToggleButton button = new JToggleButton(new StageAction((AxialStage) stage));
|
||||
button.setSelected(configuration.isStageActive(stage.getStageNumber()));
|
||||
this.add(button);
|
||||
buttons.add(button);
|
||||
|
@ -23,7 +23,6 @@ import info.openrocket.core.l10n.Translator;
|
||||
import info.openrocket.core.startup.Application;
|
||||
import info.openrocket.core.util.Chars;
|
||||
import info.openrocket.core.util.MathUtil;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
|
||||
/**
|
||||
@ -147,7 +146,7 @@ public class CompassSelectionButton extends FlatButton implements Resettable {
|
||||
|
||||
panel.add(new JLabel("" + Chars.DEGREE), "wrap para");
|
||||
|
||||
JButton close = new SelectColorButton("OK");
|
||||
JButton close = new JButton("OK");
|
||||
close.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -64,7 +64,6 @@ import info.openrocket.swing.gui.util.ColorConversion;
|
||||
import info.openrocket.swing.gui.util.EditDecalHelper;
|
||||
import info.openrocket.swing.gui.util.EditDecalHelper.EditDecalHelperException;
|
||||
import info.openrocket.swing.gui.util.SwingPreferences;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
public class AppearancePanel extends JPanel implements Invalidatable, InvalidatingWidget {
|
||||
private static final long serialVersionUID = 2709187552673202019L;
|
||||
@ -270,7 +269,7 @@ public class AppearancePanel extends JPanel implements Invalidatable, Invalidati
|
||||
if (figureColor == null) {
|
||||
figureColor = ((SwingPreferences) Application.getPreferences()).getDefaultColor(c.getClass());
|
||||
}
|
||||
final JButton figureColorButton = new SelectColorButton(
|
||||
final JButton figureColorButton = new JButton(
|
||||
new ColorIcon(figureColor));
|
||||
|
||||
ab.addChangeListener(new StateChangeListener() {
|
||||
@ -320,7 +319,7 @@ public class AppearancePanel extends JPanel implements Invalidatable, Invalidati
|
||||
add(colorDefault);
|
||||
order.add(colorDefault);
|
||||
|
||||
saveAsDefault = new SelectColorButton(
|
||||
saveAsDefault = new JButton(
|
||||
trans.get("RocketCompCfg.but.Saveasdefstyle"));
|
||||
saveAsDefault.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -532,7 +531,7 @@ public class AppearancePanel extends JPanel implements Invalidatable, Invalidati
|
||||
}
|
||||
});
|
||||
|
||||
JButton colorButton = new SelectColorButton(new ColorIcon(builder.getPaint()));
|
||||
JButton colorButton = new JButton(new ColorIcon(builder.getPaint()));
|
||||
|
||||
colorButton.addActionListener(new ColorActionListener(builder, "Paint"));
|
||||
|
||||
@ -592,7 +591,7 @@ public class AppearancePanel extends JPanel implements Invalidatable, Invalidati
|
||||
|
||||
//// Edit button
|
||||
if ((SystemInfo.getPlatform() != Platform.UNIX) || !SystemInfo.isConfined()) {
|
||||
JButton editBtn = new SelectColorButton(
|
||||
JButton editBtn = new JButton(
|
||||
trans.get("AppearanceCfg.but.edit"));
|
||||
// Enable the editBtn only when the appearance builder has an Image
|
||||
// assigned to it.
|
||||
|
@ -9,7 +9,6 @@ import javax.swing.JSpinner;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import info.openrocket.core.logging.Markers;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
|
||||
import info.openrocket.core.document.OpenRocketDocument;
|
||||
@ -156,7 +155,7 @@ public class ComponentAssemblyConfig extends RocketComponentConfig {
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
split = new SelectColorButton(btnText);
|
||||
split = new JButton(btnText);
|
||||
split.setToolTipText(btnTextTtip);
|
||||
split.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
@ -57,7 +57,6 @@ import info.openrocket.swing.gui.components.BasicSlider;
|
||||
import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.components.StyledLabel.Style;
|
||||
import info.openrocket.swing.gui.components.UnitSelector;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -86,7 +85,7 @@ public abstract class FinSetConfig extends RocketComponentConfig {
|
||||
//// Convert buttons
|
||||
if (!(component instanceof FreeformFinSet)) {
|
||||
//// Convert to freeform
|
||||
convert = new SelectColorButton(trans.get("FinSetConfig.but.Converttofreeform"));
|
||||
convert = new JButton(trans.get("FinSetConfig.but.Converttofreeform"));
|
||||
//// Convert this fin set into a freeform fin set
|
||||
convert.setToolTipText(trans.get("FinSetConfig.but.Converttofreeform.ttip"));
|
||||
convert.addActionListener(new ActionListener() {
|
||||
@ -114,7 +113,7 @@ public abstract class FinSetConfig extends RocketComponentConfig {
|
||||
}
|
||||
|
||||
//// Split fins
|
||||
split = new SelectColorButton(trans.get("FinSetConfig.but.Splitfins"));
|
||||
split = new JButton(trans.get("FinSetConfig.but.Splitfins"));
|
||||
//// Split the fin set into separate fins
|
||||
split.setToolTipText(trans.get("FinSetConfig.but.Splitfins.ttip"));
|
||||
split.addActionListener(new ActionListener() {
|
||||
@ -146,7 +145,7 @@ public abstract class FinSetConfig extends RocketComponentConfig {
|
||||
split.setEnabled(((FinSet) component).getFinCount() > 1);
|
||||
|
||||
//// Export to SVG
|
||||
JButton exportSVGBtn = new SelectColorButton(trans.get("FinSetConfig.lbl.exportSVG"));
|
||||
JButton exportSVGBtn = new JButton(trans.get("FinSetConfig.lbl.exportSVG"));
|
||||
exportSVGBtn.setToolTipText(trans.get("FinSetConfig.lbl.exportSVG.ttip"));
|
||||
exportSVGBtn.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -292,7 +291,7 @@ public abstract class FinSetConfig extends RocketComponentConfig {
|
||||
order.add(enumCombo);
|
||||
|
||||
// Calculate fin tab height, length, and position
|
||||
autoCalc = new SelectColorButton(trans.get("FinSetConfig.but.AutoCalc"));
|
||||
autoCalc = new JButton(trans.get("FinSetConfig.but.AutoCalc"));
|
||||
autoCalc.setToolTipText(trans.get("FinSetConfig.but.AutoCalc.ttip"));
|
||||
|
||||
autoCalc.addActionListener(new ActionListener() {
|
||||
|
@ -71,7 +71,6 @@ import info.openrocket.swing.gui.scalefigure.ScaleSelector;
|
||||
import info.openrocket.swing.gui.util.CustomFinImporter;
|
||||
import info.openrocket.swing.gui.util.FileHelper;
|
||||
import info.openrocket.swing.gui.util.SwingPreferences;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class FreeformFinSetConfig extends FinSetConfig {
|
||||
@ -266,7 +265,7 @@ public class FreeformFinSetConfig extends FinSetConfig {
|
||||
});
|
||||
JScrollPane tablePane = new JScrollPane(table);
|
||||
|
||||
JButton scaleButton = new SelectColorButton(trans.get("FreeformFinSetConfig.lbl.scaleFin"));
|
||||
JButton scaleButton = new JButton(trans.get("FreeformFinSetConfig.lbl.scaleFin"));
|
||||
scaleButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -295,7 +294,7 @@ public class FreeformFinSetConfig extends FinSetConfig {
|
||||
// panel.add(new JLabel("Coordinates:"), "aligny bottom, alignx 50%");
|
||||
// panel.add(new JLabel(" View:"), "wrap, aligny bottom");
|
||||
|
||||
JButton exportCsvButton = new SelectColorButton(trans.get("FreeformFinSetConfig.lbl.exportCSV"));
|
||||
JButton exportCsvButton = new JButton(trans.get("FreeformFinSetConfig.lbl.exportCSV"));
|
||||
exportCsvButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -317,7 +316,7 @@ public class FreeformFinSetConfig extends FinSetConfig {
|
||||
}
|
||||
}
|
||||
});
|
||||
JButton importButton = new SelectColorButton(trans.get("CustomFinImport.button.label"));
|
||||
JButton importButton = new JButton(trans.get("CustomFinImport.button.label"));
|
||||
importButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -58,7 +58,6 @@ import info.openrocket.swing.gui.components.DescriptionArea;
|
||||
import info.openrocket.swing.gui.components.UnitSelector;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.theme.UITheme;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
|
||||
|
||||
@ -255,7 +254,7 @@ public class InnerTubeConfig extends RocketComponentConfig {
|
||||
|
||||
|
||||
//// Reset button
|
||||
JButton button = new SelectColorButton(trans.get("ringcompcfg.but.Reset"));
|
||||
JButton button = new JButton(trans.get("ringcompcfg.but.Reset"));
|
||||
//// Reset the component to the rocket centerline
|
||||
button.setToolTipText(trans.get("ringcompcfg.but.Resetcomponant"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@ -405,7 +404,7 @@ public class InnerTubeConfig extends RocketComponentConfig {
|
||||
|
||||
// Split button
|
||||
//// Split cluster
|
||||
JButton split = new SelectColorButton(trans.get("InnerTubeCfg.but.Splitcluster"));
|
||||
JButton split = new JButton(trans.get("InnerTubeCfg.but.Splitcluster"));
|
||||
//// <html>Split the cluster into separate components.<br>
|
||||
//// This also duplicates all components attached to this inner tube.
|
||||
split.setToolTipText(trans.get("InnerTubeCfg.lbl.longA1") +
|
||||
@ -456,7 +455,7 @@ public class InnerTubeConfig extends RocketComponentConfig {
|
||||
|
||||
// Reset button
|
||||
///// Reset settings
|
||||
JButton reset = new SelectColorButton(trans.get("InnerTubeCfg.but.Resetsettings"));
|
||||
JButton reset = new JButton(trans.get("InnerTubeCfg.but.Resetsettings"));
|
||||
//// Reset the separation and rotation to the default values
|
||||
reset.setToolTipText(trans.get("InnerTubeCfg.but.ttip.Resetsettings"));
|
||||
reset.addActionListener(new ActionListener() {
|
||||
|
@ -26,7 +26,6 @@ import info.openrocket.swing.gui.adaptors.DoubleModel;
|
||||
import info.openrocket.swing.gui.adaptors.EnumModel;
|
||||
import info.openrocket.swing.gui.components.BasicSlider;
|
||||
import info.openrocket.swing.gui.components.UnitSelector;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ -195,7 +194,7 @@ public class MassComponentConfig extends RocketComponentConfig {
|
||||
|
||||
|
||||
//// Reset button
|
||||
JButton button = new SelectColorButton(trans.get("MassComponentCfg.but.Reset"));
|
||||
JButton button = new JButton(trans.get("MassComponentCfg.but.Reset"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -17,7 +17,6 @@ import info.openrocket.core.startup.Application;
|
||||
|
||||
import info.openrocket.swing.gui.adaptors.EnumModel;
|
||||
import info.openrocket.swing.gui.adaptors.MaterialModel;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JButton;
|
||||
@ -79,7 +78,7 @@ public class MaterialPanel extends JPanel implements Invalidatable, Invalidating
|
||||
order.add(finishCombo);
|
||||
|
||||
//// Set for all
|
||||
JButton button = new SelectColorButton(trans.get("MaterialPanel.but.SetForAll"));
|
||||
JButton button = new JButton(trans.get("MaterialPanel.but.SetForAll"));
|
||||
//// Set this finish for all components of the rocket.
|
||||
button.setToolTipText(trans.get("MaterialPanel.but.SetForAll.ttip"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
|
@ -40,7 +40,6 @@ import info.openrocket.swing.gui.components.BasicSlider;
|
||||
import info.openrocket.swing.gui.components.HtmlLabel;
|
||||
import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.components.UnitSelector;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
public class ParachuteConfig extends RecoveryDeviceConfig {
|
||||
|
||||
@ -117,7 +116,7 @@ public class ParachuteConfig extends RecoveryDeviceConfig {
|
||||
order.add(((SpinnerEditor) spin.getEditor()).getTextField());
|
||||
|
||||
//// Reset button
|
||||
JButton button = new SelectColorButton(trans.get("ParachuteCfg.but.Reset"));
|
||||
JButton button = new JButton(trans.get("ParachuteCfg.but.Reset"));
|
||||
button.setToolTipText(String.format(trans.get("ParachuteCfg.but.ResetCd.ttip"), Parachute.DEFAULT_CD));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -336,7 +335,7 @@ public class ParachuteConfig extends RecoveryDeviceConfig {
|
||||
|
||||
|
||||
//// Reset button
|
||||
JButton button = new SelectColorButton(trans.get("ParachuteCfg.but.Reset"));
|
||||
JButton button = new JButton(trans.get("ParachuteCfg.but.Reset"));
|
||||
button.setToolTipText("ParachuteCfg.but.ResetRadial.ttip");
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
@ -54,7 +54,6 @@ import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.util.Icons;
|
||||
import info.openrocket.swing.gui.theme.UITheme;
|
||||
import info.openrocket.swing.gui.widgets.IconToggleButton;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import info.openrocket.core.database.ComponentPresetDatabase;
|
||||
import info.openrocket.core.document.OpenRocketDocument;
|
||||
@ -161,7 +160,7 @@ public class RocketComponentConfig extends JPanel implements Invalidatable, Inva
|
||||
this.add(presetComboBox, "growx 110");
|
||||
order.add(presetComboBox);
|
||||
|
||||
final JButton selectPreset = new SelectColorButton(trans.get("PresetModel.lbl.partsLib"));
|
||||
final JButton selectPreset = new JButton(trans.get("PresetModel.lbl.partsLib"));
|
||||
selectPreset.setToolTipText(trans.get("PresetModel.lbl.partsLib.ttip"));
|
||||
selectPreset.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -290,7 +289,7 @@ public class RocketComponentConfig extends JPanel implements Invalidatable, Inva
|
||||
}
|
||||
|
||||
//// Cancel button
|
||||
this.cancelButton = new SelectColorButton(trans.get("dlg.but.cancel"));
|
||||
this.cancelButton = new JButton(trans.get("dlg.but.cancel"));
|
||||
this.cancelButton.setToolTipText(trans.get("RocketCompCfg.btn.Cancel.ttip"));
|
||||
cancelButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -329,7 +328,7 @@ public class RocketComponentConfig extends JPanel implements Invalidatable, Inva
|
||||
buttonPanel.add(cancelButton, "split 2, right, gapleft 30lp");
|
||||
|
||||
//// Ok button
|
||||
this.okButton = new SelectColorButton(trans.get("dlg.but.ok"));
|
||||
this.okButton = new JButton(trans.get("dlg.but.ok"));
|
||||
this.okButton.setToolTipText(trans.get("RocketCompCfg.btn.OK.ttip"));
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
@ -9,7 +9,6 @@ import info.openrocket.core.rocketcomponent.RocketComponent;
|
||||
import info.openrocket.core.startup.Application;
|
||||
|
||||
import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
@ -54,7 +53,7 @@ public class SaveDesignInfoPanel extends RocketConfig {
|
||||
buttonPanel.add(dontShowAgain, "gapright 10, growx");
|
||||
|
||||
//// Cancel button
|
||||
this.cancelButton = new SelectColorButton(trans.get("dlg.but.cancel"));
|
||||
this.cancelButton = new JButton(trans.get("dlg.but.cancel"));
|
||||
this.cancelButton.setToolTipText(trans.get("RocketCompCfg.btn.Cancel.ttip"));
|
||||
cancelButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -86,7 +85,7 @@ public class SaveDesignInfoPanel extends RocketConfig {
|
||||
buttonPanel.add(cancelButton, "split 2, right, gapleft 30lp");
|
||||
|
||||
//// Ok button
|
||||
this.okButton = new SelectColorButton(trans.get("dlg.but.ok"));
|
||||
this.okButton = new JButton(trans.get("dlg.but.ok"));
|
||||
this.okButton.setToolTipText(trans.get("RocketCompCfg.btn.OK.ttip"));
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
@ -16,8 +16,6 @@ import info.openrocket.swing.gui.adaptors.DoubleModel;
|
||||
import info.openrocket.swing.gui.components.BasicSlider;
|
||||
import info.openrocket.swing.gui.components.UnitSelector;
|
||||
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JDialog;
|
||||
@ -168,7 +166,7 @@ public class ShockCordConfig extends RocketComponentConfig {
|
||||
|
||||
|
||||
//// Reset button
|
||||
JButton button = new SelectColorButton(trans.get("ShockCordCfg.but.Reset"));
|
||||
JButton button = new JButton(trans.get("ShockCordCfg.but.Reset"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -39,7 +39,6 @@ import info.openrocket.swing.gui.components.BasicSlider;
|
||||
import info.openrocket.swing.gui.components.HtmlLabel;
|
||||
import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.components.UnitSelector;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
|
||||
public class StreamerConfig extends RecoveryDeviceConfig {
|
||||
@ -316,7 +315,7 @@ public class StreamerConfig extends RecoveryDeviceConfig {
|
||||
|
||||
|
||||
//// Reset button
|
||||
JButton button = new SelectColorButton(trans.get("StreamerCfg.but.Reset"));
|
||||
JButton button = new JButton(trans.get("StreamerCfg.but.Reset"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -34,7 +34,6 @@ import info.openrocket.core.l10n.Translator;
|
||||
import info.openrocket.core.logging.Markers;
|
||||
import info.openrocket.core.simulation.customexpression.CustomExpression;
|
||||
import info.openrocket.core.startup.Application;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class CustomExpressionPanel extends JPanel {
|
||||
@ -66,7 +65,7 @@ public class CustomExpressionPanel extends JPanel {
|
||||
//this.add(desc, "width 1px, growx 1, wrap unrel, wrap");
|
||||
|
||||
//// New expression
|
||||
JButton button = new SelectColorButton(trans.get("customExpressionPanel.but.NewExpression"));
|
||||
JButton button = new JButton(trans.get("customExpressionPanel.but.NewExpression"));
|
||||
button.setToolTipText(trans.get("customExpressionPanel.but.ttip.NewExpression"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -81,7 +80,7 @@ public class CustomExpressionPanel extends JPanel {
|
||||
this.add(button, "split 4, width :100:200");
|
||||
|
||||
//// Import
|
||||
final JButton importButton = new SelectColorButton(trans.get("customExpressionPanel.but.Import"));
|
||||
final JButton importButton = new JButton(trans.get("customExpressionPanel.but.Import"));
|
||||
importButton.setToolTipText(trans.get("customExpressionPanel.but.ttip.Import"));
|
||||
importButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -120,7 +119,7 @@ public class CustomExpressionPanel extends JPanel {
|
||||
this.add(importButton, "width :100:200");
|
||||
|
||||
//// Close button
|
||||
final JButton closeButton = new SelectColorButton(trans.get("dlg.but.close"));
|
||||
final JButton closeButton = new JButton(trans.get("dlg.but.close"));
|
||||
closeButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -215,7 +214,7 @@ public class CustomExpressionPanel extends JPanel {
|
||||
//unitSelector = setLabelStyle(unitSelector);
|
||||
//unitSelector.setBackground(GUIUtil.getUITheme().getBackgroundColor());
|
||||
|
||||
JButton editButton = new SelectColorButton(Icons.EDIT_EDIT);
|
||||
JButton editButton = new JButton(Icons.EDIT_EDIT);
|
||||
editButton.setToolTipText(trans.get("customExpression.Units.but.ttip.Edit"));
|
||||
editButton.setBorderPainted(false);
|
||||
editButton.addActionListener(new ActionListener() {
|
||||
@ -227,7 +226,7 @@ public class CustomExpressionPanel extends JPanel {
|
||||
}
|
||||
});
|
||||
|
||||
JButton upButton = new SelectColorButton(Icons.UP);
|
||||
JButton upButton = new JButton(Icons.UP);
|
||||
upButton.setToolTipText(trans.get("customExpression.Units.but.ttip.MoveUp"));
|
||||
upButton.setBorderPainted(false);
|
||||
upButton.setVisible(showUp);
|
||||
@ -239,7 +238,7 @@ public class CustomExpressionPanel extends JPanel {
|
||||
}
|
||||
});
|
||||
|
||||
JButton downButton = new SelectColorButton(Icons.DOWN);
|
||||
JButton downButton = new JButton(Icons.DOWN);
|
||||
downButton.setToolTipText(trans.get("customExpression.Units.but.ttip.MoveDown"));
|
||||
downButton.setBorderPainted(false);
|
||||
downButton.setVisible(showDown);
|
||||
@ -252,7 +251,7 @@ public class CustomExpressionPanel extends JPanel {
|
||||
});
|
||||
|
||||
|
||||
JButton deleteButton = new SelectColorButton(Icons.EDIT_DELETE);
|
||||
JButton deleteButton = new JButton(Icons.EDIT_DELETE);
|
||||
//// Remove this expression
|
||||
deleteButton.setToolTipText(trans.get("customExpression.Units.but.ttip.Delete"));
|
||||
deleteButton.setBorderPainted(false);
|
||||
|
@ -23,7 +23,6 @@ import info.openrocket.core.startup.Application;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import info.openrocket.swing.gui.util.Icons;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -54,7 +53,7 @@ public class ExpressionBuilderDialog extends JDialog {
|
||||
private final JLabel nameCheck = new JLabel(RedIcon);
|
||||
private final JLabel expressionCheck = new JLabel(RedIcon);
|
||||
private final JLabel unitCheck = new JLabel(RedIcon);
|
||||
private final JButton okButton = new SelectColorButton(trans.get("dlg.but.ok"));
|
||||
private final JButton okButton = new JButton(trans.get("dlg.but.ok"));
|
||||
private final JTextField expressionField = new JTextField(20);
|
||||
|
||||
public ExpressionBuilderDialog(Window parent, OpenRocketDocument doc){
|
||||
@ -157,7 +156,7 @@ public class ExpressionBuilderDialog extends JDialog {
|
||||
|
||||
|
||||
//// Insert variable button
|
||||
final JButton insertVariableButton = new SelectColorButton(trans.get("ExpressionBuilderDialog.InsertVariable"));
|
||||
final JButton insertVariableButton = new JButton(trans.get("ExpressionBuilderDialog.InsertVariable"));
|
||||
insertVariableButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -168,7 +167,7 @@ public class ExpressionBuilderDialog extends JDialog {
|
||||
});
|
||||
|
||||
//// Insert operator button
|
||||
final JButton insertOperatorButton = new SelectColorButton(trans.get("ExpressionBuilderDialog.InsertOperator"));
|
||||
final JButton insertOperatorButton = new JButton(trans.get("ExpressionBuilderDialog.InsertOperator"));
|
||||
insertOperatorButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -192,7 +191,7 @@ public class ExpressionBuilderDialog extends JDialog {
|
||||
});
|
||||
|
||||
//// Cancel button
|
||||
final JButton cancelButton = new SelectColorButton(trans.get("dlg.but.cancel"));
|
||||
final JButton cancelButton = new JButton(trans.get("dlg.but.cancel"));
|
||||
cancelButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -26,7 +26,6 @@ import info.openrocket.core.l10n.Translator;
|
||||
import info.openrocket.core.startup.Application;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -50,7 +49,7 @@ public class OperatorSelector extends JDialog {
|
||||
this.parentWindow = parent;
|
||||
this.parentBuilder = parentBuilder;
|
||||
|
||||
final JButton insertButton = new SelectColorButton(trans.get("ExpressionBuilderDialog.InsertOperator"));
|
||||
final JButton insertButton = new JButton(trans.get("ExpressionBuilderDialog.InsertOperator"));
|
||||
|
||||
JPanel mainPanel = new JPanel(new MigLayout());
|
||||
|
||||
@ -135,7 +134,7 @@ public class OperatorSelector extends JDialog {
|
||||
mainPanel.add(scrollPane, "wrap, push, grow");
|
||||
|
||||
//// Cancel button
|
||||
final JButton cancelButton = new SelectColorButton(trans.get("dlg.but.cancel"));
|
||||
final JButton cancelButton = new JButton(trans.get("dlg.but.cancel"));
|
||||
cancelButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -25,7 +25,6 @@ import info.openrocket.core.l10n.Translator;
|
||||
import info.openrocket.core.startup.Application;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -52,7 +51,7 @@ public class VariableSelector extends JDialog {
|
||||
super(parent, trans.get("CustomVariableSelector.title"), JDialog.ModalityType.DOCUMENT_MODAL);
|
||||
|
||||
this.parentBuilder = parentBuilder;
|
||||
final JButton insertButton = new SelectColorButton(trans.get("ExpressionBuilderDialog.InsertVariable"));
|
||||
final JButton insertButton = new JButton(trans.get("ExpressionBuilderDialog.InsertVariable"));
|
||||
|
||||
JPanel mainPanel = new JPanel(new MigLayout());
|
||||
|
||||
@ -116,7 +115,7 @@ public class VariableSelector extends JDialog {
|
||||
mainPanel.add(scrollPane, "wrap, push, grow");
|
||||
|
||||
//// Cancel button
|
||||
final JButton cancelButton = new SelectColorButton(trans.get("dlg.but.cancel"));
|
||||
final JButton cancelButton = new JButton(trans.get("dlg.but.cancel"));
|
||||
cancelButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -21,7 +21,6 @@ import info.openrocket.core.l10n.Translator;
|
||||
import info.openrocket.core.startup.Application;
|
||||
import info.openrocket.core.util.BuildProperties;
|
||||
import info.openrocket.core.util.Chars;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class AboutDialog extends JDialog {
|
||||
@ -158,7 +157,7 @@ public class AboutDialog extends JDialog {
|
||||
|
||||
|
||||
//Close button
|
||||
JButton close = new SelectColorButton(trans.get("button.close"));
|
||||
JButton close = new JButton(trans.get("button.close"));
|
||||
close.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -37,7 +37,6 @@ import info.openrocket.swing.gui.theme.UITheme;
|
||||
import info.openrocket.swing.logging.LogLevelBufferLogger;
|
||||
import info.openrocket.swing.logging.LogLine;
|
||||
import info.openrocket.swing.logging.LoggingSystemSetup;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class BugReportDialog extends JDialog {
|
||||
@ -98,7 +97,7 @@ public class BugReportDialog extends JDialog {
|
||||
panel.add(new StyledLabel(trans.get("bugreport.lbl.Theinformation"), -1), "wrap para");
|
||||
|
||||
////Close button
|
||||
JButton close = new SelectColorButton(trans.get("dlg.but.close"));
|
||||
JButton close = new JButton(trans.get("dlg.but.close"));
|
||||
close.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -71,8 +71,6 @@ import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.components.UnitSelector;
|
||||
import info.openrocket.swing.gui.scalefigure.RocketPanel;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorToggleButton;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -138,7 +136,7 @@ public class ComponentAnalysisDialog extends JDialog implements StateChangeListe
|
||||
BasicSlider slider = new BasicSlider(theta.getSliderModel(0, 2 * Math.PI));
|
||||
panel.add(slider, "growx, split 2");
|
||||
//// Worst button
|
||||
worstToggle = new SelectColorToggleButton(trans.get("componentanalysisdlg.ToggleBut.worst"));
|
||||
worstToggle = new JToggleButton(trans.get("componentanalysisdlg.ToggleBut.worst"));
|
||||
worstToggle.setSelected(true);
|
||||
worstToggle.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -475,7 +473,7 @@ public class ComponentAnalysisDialog extends JDialog implements StateChangeListe
|
||||
JButton button;
|
||||
|
||||
// TODO: LOW: printing
|
||||
// button = new SelectColorButton("Print");
|
||||
// button = new JButton("Print");
|
||||
// button.addActionListener(new ActionListener() {
|
||||
// public void actionPerformed(ActionEvent e) {
|
||||
// try {
|
||||
@ -489,9 +487,9 @@ public class ComponentAnalysisDialog extends JDialog implements StateChangeListe
|
||||
// });
|
||||
// panel.add(button,"tag ok");
|
||||
|
||||
//button = new SelectColorButton("Close");
|
||||
//button = new JButton("Close");
|
||||
//Close button
|
||||
button = new SelectColorButton(trans.get("dlg.but.close"));
|
||||
button = new JButton(trans.get("dlg.but.close"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -29,7 +29,6 @@ import info.openrocket.swing.gui.adaptors.DoubleModel;
|
||||
import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.components.UnitSelector;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class CustomMaterialDialog extends JDialog {
|
||||
@ -151,7 +150,7 @@ public class CustomMaterialDialog extends JDialog {
|
||||
}
|
||||
|
||||
//// OK button
|
||||
JButton okButton = new SelectColorButton(trans.get("dlg.but.ok"));
|
||||
JButton okButton = new JButton(trans.get("dlg.but.ok"));
|
||||
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -163,7 +162,7 @@ public class CustomMaterialDialog extends JDialog {
|
||||
panel.add(okButton, "span, split, tag ok");
|
||||
|
||||
//// Cancel
|
||||
JButton closeButton = new SelectColorButton(trans.get("dlg.but.cancel"));
|
||||
JButton closeButton = new JButton(trans.get("dlg.but.cancel"));
|
||||
closeButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -60,7 +60,6 @@ import info.openrocket.swing.logging.LogLevelBufferLogger;
|
||||
import info.openrocket.swing.logging.LogLine;
|
||||
import info.openrocket.swing.logging.LoggingSystemSetup;
|
||||
import info.openrocket.swing.logging.StackTraceWriter;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class DebugLogDialog extends JDialog {
|
||||
@ -182,7 +181,7 @@ public class DebugLogDialog extends JDialog {
|
||||
topPanel.add(followBox, "skip, gapright para, right");
|
||||
|
||||
//// Clear button
|
||||
JButton clear = new SelectColorButton(trans.get("debuglogdlg.but.clear"));
|
||||
JButton clear = new JButton(trans.get("debuglogdlg.but.clear"));
|
||||
clear.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -350,7 +349,7 @@ public class DebugLogDialog extends JDialog {
|
||||
|
||||
|
||||
//Close button
|
||||
JButton close = new SelectColorButton(trans.get("dlg.but.close"));
|
||||
JButton close = new JButton(trans.get("dlg.but.close"));
|
||||
close.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -24,7 +24,6 @@ import info.openrocket.core.startup.Application;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.util.SwingPreferences;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class EditDecalDialog extends JDialog {
|
||||
@ -67,7 +66,7 @@ public class EditDecalDialog extends JDialog {
|
||||
commandText.setEnabled(false);
|
||||
panel.add(commandText, "growx, wrap");
|
||||
|
||||
final JButton chooser = new SelectColorButton(trans.get("EditDecalDialog.btn.chooser"));
|
||||
final JButton chooser = new JButton(trans.get("EditDecalDialog.btn.chooser"));
|
||||
chooser.setEnabled(false);
|
||||
chooser.addActionListener(new ActionListener() {
|
||||
|
||||
@ -102,7 +101,7 @@ public class EditDecalDialog extends JDialog {
|
||||
commandText.setEnabled(true);
|
||||
panel.add(commandText, "growx, wrap");
|
||||
|
||||
final JButton chooser = new SelectColorButton(trans.get("EditDecalDialog.btn.chooser"));
|
||||
final JButton chooser = new JButton(trans.get("EditDecalDialog.btn.chooser"));
|
||||
chooser.setEnabled(true);
|
||||
chooser.addActionListener(new ActionListener() {
|
||||
|
||||
@ -147,7 +146,7 @@ public class EditDecalDialog extends JDialog {
|
||||
}
|
||||
|
||||
// OK / Cancel buttons
|
||||
JButton okButton = new SelectColorButton(trans.get("dlg.but.ok"));
|
||||
JButton okButton = new JButton(trans.get("dlg.but.ok"));
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -157,7 +156,7 @@ public class EditDecalDialog extends JDialog {
|
||||
panel.add(okButton, "tag ok, spanx, split");
|
||||
|
||||
//// Cancel button
|
||||
JButton cancelButton = new SelectColorButton(trans.get("dlg.but.cancel"));
|
||||
JButton cancelButton = new JButton(trans.get("dlg.but.cancel"));
|
||||
cancelButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -20,7 +20,6 @@ import info.openrocket.swing.gui.components.DescriptionArea;
|
||||
import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.util.Icons;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
public class LicenseDialog extends JDialog {
|
||||
private static final Translator trans = Application.getTranslator();
|
||||
@ -145,7 +144,7 @@ public class LicenseDialog extends JDialog {
|
||||
panel.add(info, "newline, width 700lp, height 250lp, pushy, grow, spanx, wrap para");
|
||||
|
||||
//Close button
|
||||
JButton close = new SelectColorButton(trans.get("dlg.but.close"));
|
||||
JButton close = new JButton(trans.get("dlg.but.close"));
|
||||
close.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -48,7 +48,6 @@ import info.openrocket.swing.gui.print.components.RocketPrintTree;
|
||||
import info.openrocket.swing.gui.util.FileHelper;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.util.SwingPreferences;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
/**
|
||||
* This class isolates the Swing components used to create a panel that is added to a standard Java print dialog.
|
||||
@ -170,7 +169,7 @@ public class PrintDialog extends JDialog implements TreeSelectionListener {
|
||||
panel.add(new JPanel(), "pad 0, aligny top, growx");
|
||||
|
||||
|
||||
JButton settingsButton = new SelectColorButton(trans.get("printdlg.but.settings"));
|
||||
JButton settingsButton = new JButton(trans.get("printdlg.but.settings"));
|
||||
settingsButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -184,7 +183,7 @@ public class PrintDialog extends JDialog implements TreeSelectionListener {
|
||||
panel.add(settingsButton, "aligny top, wrap para");
|
||||
|
||||
|
||||
previewButton = new SelectColorButton(trans.get("but.previewAndPrint"));
|
||||
previewButton = new JButton(trans.get("but.previewAndPrint"));
|
||||
previewButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -195,7 +194,7 @@ public class PrintDialog extends JDialog implements TreeSelectionListener {
|
||||
panel.add(previewButton, "split, right, gap para");
|
||||
|
||||
|
||||
saveAsPDF = new SelectColorButton(trans.get("printdlg.but.saveaspdf"));
|
||||
saveAsPDF = new JButton(trans.get("printdlg.but.saveaspdf"));
|
||||
saveAsPDF.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -207,7 +206,7 @@ public class PrintDialog extends JDialog implements TreeSelectionListener {
|
||||
panel.add(saveAsPDF, "right, gap para");
|
||||
|
||||
|
||||
cancel = new SelectColorButton(trans.get("button.cancel"));
|
||||
cancel = new JButton(trans.get("button.cancel"));
|
||||
cancel.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -27,7 +27,6 @@ import info.openrocket.swing.gui.print.PaperOrientation;
|
||||
import info.openrocket.swing.gui.print.PaperSize;
|
||||
import info.openrocket.swing.gui.print.PrintSettings;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
/**
|
||||
* This class is a dialog for displaying advanced settings for printing rocket related info.
|
||||
@ -93,7 +92,7 @@ public class PrintSettingsDialog extends JDialog {
|
||||
|
||||
|
||||
//// Reset
|
||||
JButton button = new SelectColorButton(trans.get("but.Reset"));
|
||||
JButton button = new JButton(trans.get("but.Reset"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -107,7 +106,7 @@ public class PrintSettingsDialog extends JDialog {
|
||||
panel.add(button, "spanx, split, right");
|
||||
|
||||
//// Close
|
||||
JButton closeButton = new SelectColorButton(trans.get("but.Close"));
|
||||
JButton closeButton = new JButton(trans.get("but.Close"));
|
||||
closeButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -68,7 +68,6 @@ import info.openrocket.swing.gui.adaptors.DoubleModel;
|
||||
import info.openrocket.swing.gui.components.BasicSlider;
|
||||
import info.openrocket.swing.gui.components.UnitSelector;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
/**
|
||||
* Dialog that allows scaling the rocket design.
|
||||
@ -476,7 +475,7 @@ public class ScaleDialog extends JDialog {
|
||||
|
||||
|
||||
// Scale / Accept Buttons
|
||||
JButton scale = new SelectColorButton(trans.get("button.scale"));
|
||||
JButton scale = new JButton(trans.get("button.scale"));
|
||||
scale.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -495,7 +494,7 @@ public class ScaleDialog extends JDialog {
|
||||
panel.add(scale, "span, split, right, gap para");
|
||||
|
||||
// Cancel Button
|
||||
JButton cancel = new SelectColorButton(trans.get("button.cancel"));
|
||||
JButton cancel = new JButton(trans.get("button.cancel"));
|
||||
cancel.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -23,7 +23,6 @@ import info.openrocket.core.startup.Application;
|
||||
import info.openrocket.core.util.MathUtil;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
|
||||
/**
|
||||
@ -73,7 +72,7 @@ public class SwingWorkerDialog extends JDialog implements PropertyChangeListener
|
||||
panel.add(progressBar, "growx, wrap para");
|
||||
|
||||
//// Cancel button
|
||||
JButton cancel = new SelectColorButton(trans.get("dlg.but.cancel"));
|
||||
JButton cancel = new JButton(trans.get("dlg.but.cancel"));
|
||||
cancel.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -40,7 +40,6 @@ import info.openrocket.swing.gui.util.Icons;
|
||||
import info.openrocket.swing.gui.util.SwingPreferences;
|
||||
import info.openrocket.swing.gui.theme.UITheme;
|
||||
import info.openrocket.swing.gui.util.URLUtil;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -133,7 +132,7 @@ public class UpdateInfoDialog extends JDialog {
|
||||
|
||||
// Lower row buttons
|
||||
//// Remind me later button
|
||||
JButton btnLater = new SelectColorButton(trans.get("update.dlg.btn.remindMeLater"));
|
||||
JButton btnLater = new JButton(trans.get("update.dlg.btn.remindMeLater"));
|
||||
btnLater.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -143,7 +142,7 @@ public class UpdateInfoDialog extends JDialog {
|
||||
panel.add(btnLater, "skip 1, split 2");
|
||||
|
||||
//// Skip this version button
|
||||
JButton btnSkip = new SelectColorButton(trans.get("update.dlg.checkbox.skipThisVersion"));
|
||||
JButton btnSkip = new JButton(trans.get("update.dlg.checkbox.skipThisVersion"));
|
||||
btnSkip.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -181,7 +180,7 @@ public class UpdateInfoDialog extends JDialog {
|
||||
panel.add(comboBox, "pushx, right");
|
||||
|
||||
//// Install update button
|
||||
JButton btnInstall = new SelectColorButton(trans.get("update.dlg.updateAvailable.but.install"));
|
||||
JButton btnInstall = new JButton(trans.get("update.dlg.updateAvailable.but.install"));
|
||||
btnInstall.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -5,7 +5,6 @@ import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.util.Icons;
|
||||
import info.openrocket.swing.gui.util.URLUtil;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -96,7 +95,7 @@ public class WelcomeDialog extends JDialog {
|
||||
});
|
||||
|
||||
// Close button
|
||||
JButton closeBtn = new SelectColorButton(trans.get("button.close"));
|
||||
JButton closeBtn = new JButton(trans.get("button.close"));
|
||||
closeBtn.setToolTipText(trans.get("welcome.dlg.btn.close.ttip"));
|
||||
closeBtn.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
@ -33,7 +33,6 @@ import info.openrocket.swing.gui.adaptors.EnumModel;
|
||||
import info.openrocket.swing.gui.components.BasicSlider;
|
||||
import info.openrocket.swing.gui.components.UnitSelector;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class DeploymentSelectionDialog extends JDialog {
|
||||
@ -125,7 +124,7 @@ public class DeploymentSelectionDialog extends JDialog {
|
||||
|
||||
panel.add(new JPanel(), "span, split, growx");
|
||||
|
||||
JButton okButton = new SelectColorButton(trans.get("button.ok"));
|
||||
JButton okButton = new JButton(trans.get("button.ok"));
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -140,7 +139,7 @@ public class DeploymentSelectionDialog extends JDialog {
|
||||
|
||||
panel.add(okButton, "sizegroup btn");
|
||||
|
||||
JButton cancel = new SelectColorButton(trans.get("button.cancel"));
|
||||
JButton cancel = new JButton(trans.get("button.cancel"));
|
||||
cancel.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -32,7 +32,6 @@ import info.openrocket.swing.gui.SpinnerEditor;
|
||||
import info.openrocket.swing.gui.adaptors.DoubleModel;
|
||||
import info.openrocket.swing.gui.adaptors.EnumModel;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
public class IgnitionSelectionDialog extends JDialog {
|
||||
private static final long serialVersionUID = -3399966098520607837L;
|
||||
@ -101,7 +100,7 @@ public class IgnitionSelectionDialog extends JDialog {
|
||||
|
||||
panel.add(new JPanel(), "span, split, growx");
|
||||
|
||||
JButton okButton = new SelectColorButton(trans.get("button.ok"));
|
||||
JButton okButton = new JButton(trans.get("button.ok"));
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -132,7 +131,7 @@ public class IgnitionSelectionDialog extends JDialog {
|
||||
panel.add(okButton, "sizegroup btn");
|
||||
|
||||
|
||||
JButton cancel = new SelectColorButton(trans.get("button.cancel"));
|
||||
JButton cancel = new JButton(trans.get("button.cancel"));
|
||||
cancel.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -22,7 +22,6 @@ import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.configdialog.CommonStrings;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.theme.UITheme;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
public class RenameConfigDialog extends JDialog {
|
||||
private static final long serialVersionUID = -5423008694485357248L;
|
||||
@ -46,7 +45,7 @@ public class RenameConfigDialog extends JDialog {
|
||||
|
||||
panel.add(new JPanel(), "growx");
|
||||
|
||||
JButton okButton = new SelectColorButton(trans.get("button.ok"));
|
||||
JButton okButton = new JButton(trans.get("button.ok"));
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -57,7 +56,7 @@ public class RenameConfigDialog extends JDialog {
|
||||
});
|
||||
panel.add(okButton);
|
||||
|
||||
JButton resetToDefaultButton = new SelectColorButton(trans.get("RenameConfigDialog.but.reset"));
|
||||
JButton resetToDefaultButton = new JButton(trans.get("RenameConfigDialog.but.reset"));
|
||||
resetToDefaultButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -67,7 +66,7 @@ public class RenameConfigDialog extends JDialog {
|
||||
});
|
||||
panel.add(resetToDefaultButton);
|
||||
|
||||
JButton cancel = new SelectColorButton(trans.get("button.cancel"));
|
||||
JButton cancel = new JButton(trans.get("button.cancel"));
|
||||
cancel.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -33,7 +33,6 @@ import info.openrocket.swing.gui.adaptors.EnumModel;
|
||||
import info.openrocket.swing.gui.components.BasicSlider;
|
||||
import info.openrocket.swing.gui.components.UnitSelector;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class SeparationSelectionDialog extends JDialog {
|
||||
@ -129,7 +128,7 @@ public class SeparationSelectionDialog extends JDialog {
|
||||
|
||||
panel.add(new JPanel(), "span, split, growx");
|
||||
|
||||
JButton okButton = new SelectColorButton(trans.get("button.ok"));
|
||||
JButton okButton = new JButton(trans.get("button.ok"));
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -148,7 +147,7 @@ public class SeparationSelectionDialog extends JDialog {
|
||||
|
||||
panel.add(okButton, "sizegroup btn");
|
||||
|
||||
JButton cancel = new SelectColorButton(trans.get("button.cancel"));
|
||||
JButton cancel = new JButton(trans.get("button.cancel"));
|
||||
cancel.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -22,7 +22,6 @@ import info.openrocket.core.motor.Motor;
|
||||
import info.openrocket.core.rocketcomponent.FlightConfigurationId;
|
||||
import info.openrocket.core.rocketcomponent.MotorMount;
|
||||
import info.openrocket.core.startup.Application;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class MotorChooserDialog extends JDialog implements CloseableDialog {
|
||||
@ -51,7 +50,7 @@ public class MotorChooserDialog extends JDialog implements CloseableDialog {
|
||||
|
||||
|
||||
// OK / Cancel buttons
|
||||
JButton okButton = new SelectColorButton(trans.get("dlg.but.ok"));
|
||||
JButton okButton = new JButton(trans.get("dlg.but.ok"));
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -61,7 +60,7 @@ public class MotorChooserDialog extends JDialog implements CloseableDialog {
|
||||
panel.add(okButton, "tag ok, spanx, split");
|
||||
|
||||
//// Cancel button
|
||||
JButton cancelButton = new SelectColorButton(trans.get("dlg.but.cancel"));
|
||||
JButton cancelButton = new JButton(trans.get("dlg.but.cancel"));
|
||||
cancelButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -39,7 +39,6 @@ import info.openrocket.core.rocketcomponent.RocketComponent;
|
||||
import info.openrocket.core.startup.Application;
|
||||
import info.openrocket.core.unit.Unit;
|
||||
import info.openrocket.core.unit.UnitGroup;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
public abstract class MotorFilterPanel extends JPanel {
|
||||
private static final long serialVersionUID = -2068101000195158181L;
|
||||
@ -184,7 +183,7 @@ public abstract class MotorFilterPanel extends JPanel {
|
||||
JScrollPane scrollPane = new JScrollPane(manufacturerCheckList.getList());
|
||||
sub.add(scrollPane, "grow, pushy, wrap");
|
||||
|
||||
JButton clearMotors = new SelectColorButton(trans.get("TCMotorSelPan.btn.checkNone"));
|
||||
JButton clearMotors = new JButton(trans.get("TCMotorSelPan.btn.checkNone"));
|
||||
clearMotors.addActionListener( new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -195,7 +194,7 @@ public abstract class MotorFilterPanel extends JPanel {
|
||||
|
||||
sub.add(clearMotors,"split 2");
|
||||
|
||||
JButton selectMotors = new SelectColorButton(trans.get("TCMotorSelPan.btn.checkAll"));
|
||||
JButton selectMotors = new JButton(trans.get("TCMotorSelPan.btn.checkAll"));
|
||||
selectMotors.addActionListener( new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -19,7 +19,6 @@ import info.openrocket.core.unit.UnitGroup;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import org.jfree.chart.ChartFactory;
|
||||
import org.jfree.chart.ChartPanel;
|
||||
@ -108,7 +107,7 @@ public class ThrustCurveMotorPlotDialog extends JDialog {
|
||||
|
||||
|
||||
// Close button
|
||||
JButton close = new SelectColorButton(trans.get("dlg.but.close"));
|
||||
JButton close = new JButton(trans.get("dlg.but.close"));
|
||||
close.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -103,9 +103,7 @@ import info.openrocket.swing.gui.scalefigure.RocketFigure;
|
||||
import info.openrocket.swing.gui.scalefigure.ScaleScrollPane;
|
||||
import info.openrocket.swing.gui.util.FileHelper;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorToggleButton;
|
||||
import info.openrocket.swing.gui.util.SwingPreferences;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
/**
|
||||
* General rocket optimization dialog.
|
||||
@ -266,7 +264,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
// // Add/remove buttons
|
||||
sub = new JPanel(new MigLayout("fill"));
|
||||
|
||||
addButton = new SelectColorButton(Chars.LEFT_ARROW + " " + trans.get("btn.add") + " ");
|
||||
addButton = new JButton(Chars.LEFT_ARROW + " " + trans.get("btn.add") + " ");
|
||||
addButton.setToolTipText(trans.get("btn.add.ttip"));
|
||||
addButton.addActionListener(e -> {
|
||||
List<SimulationModifier> mods = getSelectedAvailableModifiers();
|
||||
@ -283,7 +281,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
disableComponents.add(addButton);
|
||||
sub.add(addButton, "wrap para, sg button");
|
||||
|
||||
removeButton = new SelectColorButton(" " + trans.get("btn.delete") + " " + Chars.RIGHT_ARROW);
|
||||
removeButton = new JButton(" " + trans.get("btn.delete") + " " + Chars.RIGHT_ARROW);
|
||||
removeButton.setToolTipText(trans.get("btn.delete.ttip"));
|
||||
removeButton.addActionListener(e -> {
|
||||
List<SimulationModifier> mods = getSelectedModifiers();
|
||||
@ -302,7 +300,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
disableComponents.add(removeButton);
|
||||
sub.add(removeButton, "wrap para*2, sg button");
|
||||
|
||||
removeAllButton = new SelectColorButton(trans.get("btn.deleteAll"));
|
||||
removeAllButton = new JButton(trans.get("btn.deleteAll"));
|
||||
removeAllButton.setToolTipText(trans.get("btn.deleteAll.ttip"));
|
||||
removeAllButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -540,7 +538,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
|
||||
// // Start/Stop button
|
||||
|
||||
startButton = new SelectColorToggleButton(START_TEXT);
|
||||
startButton = new JToggleButton(START_TEXT);
|
||||
startButton.addActionListener(e -> {
|
||||
if (updating) {
|
||||
log.debug("Updating, ignoring event");
|
||||
@ -556,7 +554,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
});
|
||||
sub.add(startButton, "span, growx, wrap para*2");
|
||||
|
||||
plotButton = new SelectColorButton(trans.get("btn.plotPath"));
|
||||
plotButton = new JButton(trans.get("btn.plotPath"));
|
||||
plotButton.setToolTipText(trans.get("btn.plotPath.ttip"));
|
||||
plotButton.addActionListener(e -> {
|
||||
log.info(Markers.USER_MARKER, "Plotting optimization path, dimensionality=" + selectedModifiers.size());
|
||||
@ -573,7 +571,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
disableComponents.add(plotButton);
|
||||
sub.add(plotButton, "span, growx, wrap");
|
||||
|
||||
saveButton = new SelectColorButton(trans.get("btn.save"));
|
||||
saveButton = new JButton(trans.get("btn.save"));
|
||||
saveButton.setToolTipText(trans.get("btn.save.ttip"));
|
||||
saveButton.addActionListener(e -> {
|
||||
log.info(Markers.USER_MARKER, "User selected save path");
|
||||
@ -585,7 +583,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
panel.add(sub, "wrap para*2");
|
||||
|
||||
// // Bottom buttons
|
||||
final JButton applyButton = new SelectColorButton(trans.get("btn.apply"));
|
||||
final JButton applyButton = new JButton(trans.get("btn.apply"));
|
||||
applyButton.setToolTipText(trans.get("btn.apply.ttip"));
|
||||
applyButton.addActionListener(e -> {
|
||||
log.info(Markers.USER_MARKER, "Applying optimization changes");
|
||||
@ -594,7 +592,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
disableComponents.add(applyButton);
|
||||
panel.add(applyButton, "span, split, gapright para, right");
|
||||
|
||||
final JButton resetButton = new SelectColorButton(trans.get("btn.reset"));
|
||||
final JButton resetButton = new JButton(trans.get("btn.reset"));
|
||||
resetButton.setToolTipText(trans.get("btn.reset.ttip"));
|
||||
resetButton.addActionListener(e -> {
|
||||
log.info(Markers.USER_MARKER, "Resetting optimization design");
|
||||
@ -603,7 +601,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
disableComponents.add(resetButton);
|
||||
panel.add(resetButton, "gapright para, right");
|
||||
|
||||
final JButton closeButton = new SelectColorButton(trans.get("btn.close"));
|
||||
final JButton closeButton = new JButton(trans.get("btn.close"));
|
||||
closeButton.setToolTipText(trans.get("btn.close.ttip"));
|
||||
closeButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
@ -30,7 +30,6 @@ import info.openrocket.core.util.MathUtil;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import org.jfree.chart.ChartFactory;
|
||||
import org.jfree.chart.ChartPanel;
|
||||
@ -111,7 +110,7 @@ public class OptimizationPlotDialog extends JDialog {
|
||||
panel.add(label, "");
|
||||
|
||||
|
||||
JButton close = new SelectColorButton(trans.get("button.close"));
|
||||
JButton close = new JButton(trans.get("button.close"));
|
||||
close.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -54,7 +54,6 @@ import info.openrocket.swing.gui.util.SwingPreferences;
|
||||
import info.openrocket.swing.gui.util.PreferencesExporter;
|
||||
import info.openrocket.swing.gui.util.PreferencesImporter;
|
||||
import info.openrocket.swing.gui.theme.UITheme;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class GeneralPreferencesPanel extends PreferencesPanel {
|
||||
@ -193,7 +192,7 @@ public class GeneralPreferencesPanel extends PreferencesPanel {
|
||||
this.add(field, "w 100px, gapright unrel, spanx, growx, split");
|
||||
|
||||
//// Add button
|
||||
JButton button = new SelectColorButton(trans.get("pref.dlg.but.add"));
|
||||
JButton button = new JButton(trans.get("pref.dlg.but.add"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -236,7 +235,7 @@ public class GeneralPreferencesPanel extends PreferencesPanel {
|
||||
this.add(button, "gapright unrel");
|
||||
|
||||
//// Reset button
|
||||
button = new SelectColorButton(trans.get("pref.dlg.but.reset"));
|
||||
button = new JButton(trans.get("pref.dlg.but.reset"));
|
||||
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -270,7 +269,7 @@ public class GeneralPreferencesPanel extends PreferencesPanel {
|
||||
this.add(softwareUpdateBox);
|
||||
|
||||
//// Check now button
|
||||
button = new SelectColorButton(trans.get("pref.dlg.but.checknow"));
|
||||
button = new JButton(trans.get("pref.dlg.but.checknow"));
|
||||
//// Check for software updates now
|
||||
button.setToolTipText(trans.get("pref.dlg.ttip.Checkupdatesnow"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@ -341,7 +340,7 @@ public class GeneralPreferencesPanel extends PreferencesPanel {
|
||||
JPanel buttonPanel = new JPanel(new MigLayout("fillx, ins 0"));
|
||||
|
||||
//// Import preferences
|
||||
final JButton importPreferences = new SelectColorButton(trans.get("pref.dlg.but.importPreferences"));
|
||||
final JButton importPreferences = new JButton(trans.get("pref.dlg.but.importPreferences"));
|
||||
importPreferences.setToolTipText(trans.get("pref.dlg.but.importPreferences.ttip"));
|
||||
importPreferences.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -368,7 +367,7 @@ public class GeneralPreferencesPanel extends PreferencesPanel {
|
||||
buttonPanel.add(importPreferences);
|
||||
|
||||
//// Export preferences
|
||||
final JButton exportPreferences = new SelectColorButton(trans.get("pref.dlg.but.exportPreferences"));
|
||||
final JButton exportPreferences = new JButton(trans.get("pref.dlg.but.exportPreferences"));
|
||||
exportPreferences.setToolTipText(trans.get("pref.dlg.but.exportPreferences.ttip"));
|
||||
exportPreferences.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -379,7 +378,7 @@ public class GeneralPreferencesPanel extends PreferencesPanel {
|
||||
buttonPanel.add(exportPreferences);
|
||||
|
||||
//// Reset all preferences
|
||||
final JButton resetAllPreferences = new SelectColorButton(trans.get("pref.dlg.but.resetAllPreferences"));
|
||||
final JButton resetAllPreferences = new JButton(trans.get("pref.dlg.but.resetAllPreferences"));
|
||||
resetAllPreferences.setToolTipText(trans.get("pref.dlg.but.resetAllPreferences.ttip"));
|
||||
resetAllPreferences.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -424,7 +423,7 @@ public class GeneralPreferencesPanel extends PreferencesPanel {
|
||||
panel.add(bar, "growx, wrap para");
|
||||
|
||||
//// Cancel button
|
||||
JButton cancel = new SelectColorButton(trans.get("dlg.but.cancel"));
|
||||
JButton cancel = new JButton(trans.get("dlg.but.cancel"));
|
||||
cancel.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -34,7 +34,6 @@ import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.components.StyledLabel.Style;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.util.SwingPreferences;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import com.itextpdf.text.Font;
|
||||
|
||||
@ -111,7 +110,7 @@ public class GraphicsPreferencesPanel extends PreferencesPanel {
|
||||
});
|
||||
add(commandText, "growx, wrap");
|
||||
|
||||
final JButton chooser = new SelectColorButton(trans.get("EditDecalDialog.btn.chooser"));
|
||||
final JButton chooser = new JButton(trans.get("EditDecalDialog.btn.chooser"));
|
||||
chooser.setEnabled(commandLineIsSelected);
|
||||
chooser.addActionListener(new ActionListener() {
|
||||
|
||||
|
@ -42,7 +42,6 @@ import info.openrocket.swing.gui.adaptors.ColumnTableModel;
|
||||
import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.components.StyledLabel.Style;
|
||||
import info.openrocket.swing.gui.dialogs.CustomMaterialDialog;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class MaterialEditPanel extends JPanel {
|
||||
@ -149,7 +148,7 @@ public class MaterialEditPanel extends JPanel {
|
||||
|
||||
|
||||
//// New button
|
||||
addButton = new SelectColorButton(trans.get("matedtpan.but.new"));
|
||||
addButton = new JButton(trans.get("matedtpan.but.new"));
|
||||
//// Add a new material
|
||||
addButton.setToolTipText(trans.get("matedtpan.col.but.ttip.New"));
|
||||
addButton.addActionListener(new ActionListener() {
|
||||
@ -173,7 +172,7 @@ public class MaterialEditPanel extends JPanel {
|
||||
this.add(addButton, "gap rel rel para para, split 3, growx 1");
|
||||
|
||||
//// Edit button
|
||||
editButton = new SelectColorButton(trans.get("matedtpan.but.edit"));
|
||||
editButton = new JButton(trans.get("matedtpan.but.edit"));
|
||||
//// Edit an existing material
|
||||
editButton.setToolTipText(trans.get("matedtpan.but.ttip.edit"));
|
||||
editButton.addActionListener(new ActionListener() {
|
||||
@ -244,7 +243,7 @@ public class MaterialEditPanel extends JPanel {
|
||||
this.add(editButton, "gap rel rel para para, growx 1");
|
||||
|
||||
//// Delete button
|
||||
deleteButton = new SelectColorButton(trans.get("matedtpan.but.delete"));
|
||||
deleteButton = new JButton(trans.get("matedtpan.but.delete"));
|
||||
//// Delete a user-defined material
|
||||
deleteButton.setToolTipText(trans.get("matedtpan.but.ttip.delete"));
|
||||
deleteButton.addActionListener(new ActionListener() {
|
||||
@ -265,7 +264,7 @@ public class MaterialEditPanel extends JPanel {
|
||||
this.add(deleteButton, "gap rel rel para para, growx 1, wrap unrel");
|
||||
|
||||
//// Revert all button
|
||||
revertButton = new SelectColorButton(trans.get("matedtpan.but.revertall"));
|
||||
revertButton = new JButton(trans.get("matedtpan.but.revertall"));
|
||||
//// Delete all user-defined materials
|
||||
revertButton.setToolTipText(trans.get("matedtpan.but.ttip.revertall"));
|
||||
revertButton.addActionListener(new ActionListener() {
|
||||
|
@ -29,7 +29,6 @@ import info.openrocket.swing.gui.util.PreferencesImporter;
|
||||
import info.openrocket.swing.gui.util.SwingPreferences;
|
||||
import info.openrocket.core.l10n.Translator;
|
||||
import info.openrocket.core.startup.Application;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -98,7 +97,7 @@ public class PreferencesDialog extends JDialog {
|
||||
|
||||
|
||||
//// Cancel button
|
||||
JButton cancelButton = new SelectColorButton(trans.get("dlg.but.cancel"));
|
||||
JButton cancelButton = new JButton(trans.get("dlg.but.cancel"));
|
||||
cancelButton.setToolTipText(trans.get("SimulationConfigDialog.btn.Cancel.ttip"));
|
||||
cancelButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -121,7 +120,7 @@ public class PreferencesDialog extends JDialog {
|
||||
panel.add(cancelButton, "span, split 2, right, tag cancel");
|
||||
|
||||
//// Ok button
|
||||
JButton okButton = new SelectColorButton(trans.get("dlg.but.ok"));
|
||||
JButton okButton = new JButton(trans.get("dlg.but.ok"));
|
||||
okButton.setToolTipText(trans.get("SimulationConfigDialog.btn.OK.ttip"));
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
@ -23,7 +23,6 @@ import info.openrocket.swing.gui.theme.UITheme;
|
||||
import info.openrocket.core.simulation.RK4SimulationStepper;
|
||||
import info.openrocket.core.unit.UnitGroup;
|
||||
import info.openrocket.core.util.GeodeticComputationStrategy;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
public class SimulationPreferencesPanel extends PreferencesPanel {
|
||||
private static final long serialVersionUID = 7983195730016979888L;
|
||||
@ -170,7 +169,7 @@ public class SimulationPreferencesPanel extends PreferencesPanel {
|
||||
sub.add(subsub, "spanx, wrap para");
|
||||
|
||||
// Reset to default button
|
||||
JButton button = new SelectColorButton(trans.get("simedtdlg.but.resettodefault"));
|
||||
JButton button = new JButton(trans.get("simedtdlg.but.resettodefault"));
|
||||
// Reset the time step to its default value (
|
||||
button.setToolTipText(trans.get("simedtdlg.but.ttip.resettodefault")
|
||||
+ UnitGroup.UNITS_SHORT_TIME
|
||||
|
@ -17,7 +17,6 @@ import net.miginfocom.swing.MigLayout;
|
||||
import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.components.StyledLabel.Style;
|
||||
import info.openrocket.core.unit.UnitGroup;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
public class UnitsPreferencesPanel extends PreferencesPanel {
|
||||
|
||||
@ -176,7 +175,7 @@ public class UnitsPreferencesPanel extends PreferencesPanel {
|
||||
|
||||
|
||||
//// Default metric button
|
||||
JButton button = new SelectColorButton(trans.get("pref.dlg.but.defaultmetric"));
|
||||
JButton button = new JButton(trans.get("pref.dlg.but.defaultmetric"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -188,7 +187,7 @@ public class UnitsPreferencesPanel extends PreferencesPanel {
|
||||
this.add(button, "spanx, split 2, grow");
|
||||
|
||||
//// Default imperial button
|
||||
button = new SelectColorButton(trans.get("pref.dlg.but.defaultimperial"));
|
||||
button = new JButton(trans.get("pref.dlg.but.defaultimperial"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -46,7 +46,6 @@ import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.util.SwingPreferences;
|
||||
import info.openrocket.swing.gui.util.TableUIPreferences;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
import info.openrocket.swing.utils.TableRowTraversalPolicy;
|
||||
|
||||
/**
|
||||
@ -208,7 +207,7 @@ public class ComponentPresetChooserDialog extends JDialog {
|
||||
panel.add(alwaysOpenPreset, "spanx 2");
|
||||
|
||||
// Close buttons
|
||||
JButton closeButton = new SelectColorButton(trans.get("dlg.but.close"));
|
||||
JButton closeButton = new JButton(trans.get("dlg.but.close"));
|
||||
closeButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -49,7 +49,6 @@ import info.openrocket.core.startup.Application;
|
||||
import info.openrocket.core.unit.UnitGroup;
|
||||
import info.openrocket.core.util.ORColor;
|
||||
import info.openrocket.core.util.StateChangeListener;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class PhotoSettingsConfig extends JTabbedPane {
|
||||
@ -133,16 +132,16 @@ public class PhotoSettingsConfig extends JTabbedPane {
|
||||
|
||||
setPreferredSize(new Dimension(240, 320));
|
||||
|
||||
final JButton sunLightColorButton = new SelectColorButton();
|
||||
final JButton sunLightColorButton = new JButton();
|
||||
sunLightColorButton.setMaximumSize(new Dimension(35, 25));
|
||||
|
||||
final JButton skyColorButton = new SelectColorButton();
|
||||
final JButton skyColorButton = new JButton();
|
||||
skyColorButton.setMaximumSize(new Dimension(35, 25));
|
||||
|
||||
final JButton smokeColorButton = new SelectColorButton();
|
||||
final JButton smokeColorButton = new JButton();
|
||||
smokeColorButton.setMaximumSize(new Dimension(35, 25));
|
||||
|
||||
final JButton flameColorButton = new SelectColorButton();
|
||||
final JButton flameColorButton = new JButton();
|
||||
flameColorButton.setMaximumSize(new Dimension(35, 25));
|
||||
|
||||
p.addChangeListener(new StateChangeListener() {
|
||||
|
@ -31,7 +31,6 @@ import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.components.StyledLabel.Style;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.util.Icons;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
public class GuidedTourSelectionDialog extends JDialog {
|
||||
private static final long serialVersionUID = -3643116444821710259L;
|
||||
@ -95,7 +94,7 @@ public class GuidedTourSelectionDialog extends JDialog {
|
||||
tourLength = new StyledLabel(-1);
|
||||
sub.add(tourLength, "wrap unrel");
|
||||
|
||||
JButton start = new SelectColorButton(trans.get("btn.start"));
|
||||
JButton start = new JButton(trans.get("btn.start"));
|
||||
start.setIcon(Icons.HELP_TOURS);
|
||||
start.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -109,7 +108,7 @@ public class GuidedTourSelectionDialog extends JDialog {
|
||||
|
||||
|
||||
|
||||
JButton close = new SelectColorButton(trans.get("button.close"));
|
||||
JButton close = new JButton(trans.get("button.close"));
|
||||
close.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -25,7 +25,6 @@ import info.openrocket.core.util.Chars;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class SlideShowDialog extends JDialog {
|
||||
@ -54,7 +53,7 @@ public class SlideShowDialog extends JDialog {
|
||||
|
||||
JPanel sub = new JPanel(new MigLayout("ins 0, fill"));
|
||||
|
||||
prevButton = new SelectColorButton(Chars.LEFT_ARROW + " " + trans.get("btn.prev"));
|
||||
prevButton = new JButton(Chars.LEFT_ARROW + " " + trans.get("btn.prev"));
|
||||
prevButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -66,7 +65,7 @@ public class SlideShowDialog extends JDialog {
|
||||
|
||||
|
||||
|
||||
nextButton = new SelectColorButton(trans.get("btn.next") + " " + Chars.RIGHT_ARROW);
|
||||
nextButton = new JButton(trans.get("btn.next") + " " + Chars.RIGHT_ARROW);
|
||||
nextButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -81,7 +80,7 @@ public class SlideShowDialog extends JDialog {
|
||||
|
||||
panel.add(sub, "pushx, center");
|
||||
|
||||
closeButton = new SelectColorButton(trans.get("button.close"));
|
||||
closeButton = new JButton(trans.get("button.close"));
|
||||
closeButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -47,7 +47,6 @@ import info.openrocket.swing.gui.dialogs.flightconfiguration.IgnitionSelectionDi
|
||||
import info.openrocket.swing.gui.dialogs.flightconfiguration.MotorMountConfigurationPanel;
|
||||
import info.openrocket.swing.gui.dialogs.motor.MotorChooserDialog;
|
||||
import info.openrocket.swing.gui.main.FlightConfigurationPanel;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount> {
|
||||
@ -118,19 +117,19 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
||||
configurationPanel.add(scroll, "spanx, grow, pushy, wrap");
|
||||
|
||||
//// Select motor
|
||||
selectMotorButton = new SelectColorButton(selectMotorAction);
|
||||
selectMotorButton = new JButton(selectMotorAction);
|
||||
configurationPanel.add(selectMotorButton, "split, align right, sizegroup button");
|
||||
|
||||
//// Delete motor button
|
||||
deleteMotorButton = new SelectColorButton(deleteMotorAction);
|
||||
deleteMotorButton = new JButton(deleteMotorAction);
|
||||
configurationPanel.add(deleteMotorButton, "sizegroup button");
|
||||
|
||||
//// Select Ignition button
|
||||
selectIgnitionButton = new SelectColorButton(selectIgnitionAction);
|
||||
selectIgnitionButton = new JButton(selectIgnitionAction);
|
||||
configurationPanel.add(selectIgnitionButton, "sizegroup button, gapleft para");
|
||||
|
||||
//// Reset Ignition button
|
||||
resetIgnitionButton = new SelectColorButton(resetIgnitionAction);
|
||||
resetIgnitionButton = new JButton(resetIgnitionAction);
|
||||
configurationPanel.add(resetIgnitionButton, "sizegroup button, wrap");
|
||||
|
||||
cards.add(configurationPanel, TABLE_LABEL );
|
||||
|
@ -36,7 +36,6 @@ import info.openrocket.core.unit.UnitGroup;
|
||||
|
||||
import info.openrocket.swing.gui.dialogs.flightconfiguration.DeploymentSelectionDialog;
|
||||
import info.openrocket.swing.gui.main.FlightConfigurationPanel;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
public class RecoveryConfigurationPanel extends FlightConfigurablePanel<RecoveryDevice> {
|
||||
|
||||
@ -72,12 +71,12 @@ public class RecoveryConfigurationPanel extends FlightConfigurablePanel<Recovery
|
||||
popupMenuFull.add(duplicateConfigAction);
|
||||
|
||||
//// Select deployment
|
||||
selectDeploymentButton = new SelectColorButton(selectDeploymentAction);
|
||||
selectDeploymentButton = new JButton(selectDeploymentAction);
|
||||
selectDeploymentButton.setEnabled(false);
|
||||
this.add(selectDeploymentButton, "split, align right, sizegroup button");
|
||||
|
||||
//// Reset deployment
|
||||
resetDeploymentButton = new SelectColorButton(resetDeploymentAction);
|
||||
resetDeploymentButton = new JButton(resetDeploymentAction);
|
||||
resetDeploymentButton.setEnabled(false);
|
||||
this.add(resetDeploymentButton, "sizegroup button, wrap");
|
||||
|
||||
|
@ -35,7 +35,6 @@ import info.openrocket.core.unit.UnitGroup;
|
||||
|
||||
import info.openrocket.swing.gui.dialogs.flightconfiguration.SeparationSelectionDialog;
|
||||
import info.openrocket.swing.gui.main.FlightConfigurationPanel;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
public class SeparationConfigurationPanel extends FlightConfigurablePanel<AxialStage> {
|
||||
private static final long serialVersionUID = -1556652925279847316L;
|
||||
@ -71,12 +70,12 @@ public class SeparationConfigurationPanel extends FlightConfigurablePanel<AxialS
|
||||
popupMenuFull.add(duplicateConfigAction);
|
||||
|
||||
//// Select separation
|
||||
selectSeparationButton = new SelectColorButton(selectSeparationAction);
|
||||
selectSeparationButton = new JButton(selectSeparationAction);
|
||||
selectSeparationButton.setEnabled(false);
|
||||
this.add(selectSeparationButton, "split, align right, sizegroup button");
|
||||
|
||||
//// Reset separation
|
||||
resetDeploymentButton = new SelectColorButton(resetSeparationAction);
|
||||
resetDeploymentButton = new JButton(resetSeparationAction);
|
||||
resetDeploymentButton.setEnabled(false);
|
||||
this.add(resetDeploymentButton, "sizegroup button, wrap");
|
||||
|
||||
|
@ -32,7 +32,6 @@ import info.openrocket.swing.gui.util.Icons;
|
||||
import info.openrocket.swing.gui.util.SwingPreferences;
|
||||
import info.openrocket.swing.gui.theme.UITheme;
|
||||
import info.openrocket.swing.gui.widgets.SaveFileChooser;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import org.jfree.chart.ChartPanel;
|
||||
import org.jfree.chart.ChartUtils;
|
||||
@ -135,7 +134,7 @@ public class SimulationPlotDialog extends JDialog {
|
||||
}
|
||||
|
||||
//// Zoom in button
|
||||
JButton button = new SelectColorButton(Icons.ZOOM_IN);
|
||||
JButton button = new JButton(Icons.ZOOM_IN);
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -150,7 +149,7 @@ public class SimulationPlotDialog extends JDialog {
|
||||
panel.add(button, "gapleft rel");
|
||||
|
||||
//// Reset Zoom button.
|
||||
button = new SelectColorButton(Icons.ZOOM_RESET);
|
||||
button = new JButton(Icons.ZOOM_RESET);
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -161,7 +160,7 @@ public class SimulationPlotDialog extends JDialog {
|
||||
|
||||
|
||||
//// Zoom out button
|
||||
button = new SelectColorButton(Icons.ZOOM_OUT);
|
||||
button = new JButton(Icons.ZOOM_OUT);
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -175,7 +174,7 @@ public class SimulationPlotDialog extends JDialog {
|
||||
panel.add(button, "gapleft rel");
|
||||
|
||||
//// Print chart button
|
||||
button = new SelectColorButton(trans.get("PlotDialog.btn.exportImage"));
|
||||
button = new JButton(trans.get("PlotDialog.btn.exportImage"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -185,7 +184,7 @@ public class SimulationPlotDialog extends JDialog {
|
||||
panel.add(button, "gapleft rel");
|
||||
|
||||
//// Close button
|
||||
button = new SelectColorButton(trans.get("dlg.but.close"));
|
||||
button = new JButton(trans.get("dlg.but.close"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -18,8 +18,6 @@ import java.awt.event.ActionListener;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
/**
|
||||
* The ButtonColumn class provides a renderer and an editor that looks like a
|
||||
* JButton. The renderer and editor will then be used for a specified column
|
||||
@ -63,8 +61,8 @@ public class ButtonColumn extends AbstractCellEditor
|
||||
this.table = table;
|
||||
this.action = action;
|
||||
|
||||
renderButton = new SelectColorButton();
|
||||
editButton = new SelectColorButton();
|
||||
renderButton = new JButton();
|
||||
editButton = new JButton();
|
||||
editButton.setFocusPainted( false );
|
||||
editButton.addActionListener( this );
|
||||
originalBorder = editButton.getBorder();
|
||||
|
@ -65,7 +65,6 @@ import net.miginfocom.swing.MigLayout;
|
||||
import info.openrocket.swing.gui.SpinnerEditor;
|
||||
import info.openrocket.swing.gui.adaptors.DoubleModel;
|
||||
import info.openrocket.swing.gui.components.UnitSelector;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
/**
|
||||
* Preset editor for creating new preset components.
|
||||
@ -376,7 +375,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener {
|
||||
panel.setMinimumSize(new Dimension(200, 200));
|
||||
ncPanel.add(panel, "cell 4 3, span 1 3");
|
||||
panel.setLayout(null);
|
||||
ncImageBtn = new SelectColorButton("No Image");
|
||||
ncImageBtn = new JButton("No Image");
|
||||
ncImageBtn.setMaximumSize(new Dimension(75, 75));
|
||||
ncImageBtn.setMinimumSize(new Dimension(75, 75));
|
||||
panel.add(ncImageBtn);
|
||||
@ -503,7 +502,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener {
|
||||
panel.setMinimumSize(new Dimension(200, 200));
|
||||
trPanel.add(panel, "cell 4 6");
|
||||
panel.setLayout(null);
|
||||
trImageBtn = new SelectColorButton("No Image");
|
||||
trImageBtn = new JButton("No Image");
|
||||
trImageBtn.setMaximumSize(new Dimension(75, 75));
|
||||
trImageBtn.setMinimumSize(new Dimension(75, 75));
|
||||
panel.add(trImageBtn);
|
||||
@ -581,7 +580,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener {
|
||||
panel.setMinimumSize(new Dimension(200, 200));
|
||||
btPanel.add(panel, "cell 4 3");
|
||||
panel.setLayout(null);
|
||||
btImageBtn = new SelectColorButton("No Image");
|
||||
btImageBtn = new JButton("No Image");
|
||||
btImageBtn.setMaximumSize(new Dimension(75, 75));
|
||||
btImageBtn.setMinimumSize(new Dimension(75, 75));
|
||||
panel.add(btImageBtn);
|
||||
@ -659,7 +658,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener {
|
||||
panel.setMinimumSize(new Dimension(200, 200));
|
||||
tcPanel.add(panel, "cell 4 3");
|
||||
panel.setLayout(null);
|
||||
tcImageBtn = new SelectColorButton("No Image");
|
||||
tcImageBtn = new JButton("No Image");
|
||||
tcImageBtn.setMaximumSize(new Dimension(75, 75));
|
||||
tcImageBtn.setMinimumSize(new Dimension(75, 75));
|
||||
panel.add(tcImageBtn);
|
||||
@ -730,7 +729,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener {
|
||||
panel.setMinimumSize(new Dimension(200, 200));
|
||||
bhPanel.add(panel, "cell 4 2");
|
||||
panel.setLayout(null);
|
||||
bhImageBtn = new SelectColorButton("No Image");
|
||||
bhImageBtn = new JButton("No Image");
|
||||
bhImageBtn.setMaximumSize(new Dimension(75, 75));
|
||||
bhImageBtn.setMinimumSize(new Dimension(75, 75));
|
||||
panel.add(bhImageBtn);
|
||||
@ -809,7 +808,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener {
|
||||
panel.setMinimumSize(new Dimension(200, 200));
|
||||
crPanel.add(panel, "cell 4 3");
|
||||
panel.setLayout(null);
|
||||
crImageBtn = new SelectColorButton("No Image");
|
||||
crImageBtn = new JButton("No Image");
|
||||
crImageBtn.setMaximumSize(new Dimension(75, 75));
|
||||
crImageBtn.setMinimumSize(new Dimension(75, 75));
|
||||
panel.add(crImageBtn);
|
||||
@ -887,7 +886,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener {
|
||||
panel.setMinimumSize(new Dimension(200, 200));
|
||||
ebPanel.add(panel, "cell 4 3");
|
||||
panel.setLayout(null);
|
||||
ebImageBtn = new SelectColorButton("No Image");
|
||||
ebImageBtn = new JButton("No Image");
|
||||
ebImageBtn.setMaximumSize(new Dimension(75, 75));
|
||||
ebImageBtn.setMinimumSize(new Dimension(75, 75));
|
||||
panel.add(ebImageBtn);
|
||||
@ -965,7 +964,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener {
|
||||
panel.setMinimumSize(new Dimension(200, 200));
|
||||
llPanel.add(panel, "cell 4 3");
|
||||
panel.setLayout(null);
|
||||
llImageBtn = new SelectColorButton("No Image");
|
||||
llImageBtn = new JButton("No Image");
|
||||
llImageBtn.setMaximumSize(new Dimension(75, 75));
|
||||
llImageBtn.setMinimumSize(new Dimension(75, 75));
|
||||
panel.add(llImageBtn);
|
||||
@ -1062,7 +1061,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener {
|
||||
panel.setMinimumSize(new Dimension(200, 200));
|
||||
rbPanel.add(panel, "cell 4 4");
|
||||
panel.setLayout(null);
|
||||
rbImageBtn = new SelectColorButton("No Image");
|
||||
rbImageBtn = new JButton("No Image");
|
||||
rbImageBtn.setMaximumSize(new Dimension(75, 75));
|
||||
rbImageBtn.setMinimumSize(new Dimension(75, 75));
|
||||
panel.add(rbImageBtn);
|
||||
@ -1140,7 +1139,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener {
|
||||
panel.setMinimumSize(new Dimension(200, 200));
|
||||
stPanel.add(panel, "cell 4 3");
|
||||
panel.setLayout(null);
|
||||
stImageBtn = new SelectColorButton("No Image");
|
||||
stImageBtn = new JButton("No Image");
|
||||
stImageBtn.setMaximumSize(new Dimension(75, 75));
|
||||
stImageBtn.setMinimumSize(new Dimension(75, 75));
|
||||
panel.add(stImageBtn);
|
||||
@ -1232,7 +1231,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener {
|
||||
panel.setMinimumSize(new Dimension(200, 200));
|
||||
pcPanel.add(panel, "cell 1 3, span 1 3");
|
||||
panel.setLayout(null);
|
||||
pcImageBtn = new SelectColorButton("No Image");
|
||||
pcImageBtn = new JButton("No Image");
|
||||
pcImageBtn.setMaximumSize(new Dimension(75, 75));
|
||||
pcImageBtn.setMinimumSize(new Dimension(75, 75));
|
||||
panel.add(pcImageBtn);
|
||||
@ -1255,7 +1254,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener {
|
||||
JPanel buttonPane = new JPanel();
|
||||
getContentPane().add(buttonPane, BorderLayout.SOUTH);
|
||||
buttonPane.setLayout(new MigLayout("", "[130px][176.00px][131.00px]", "[29px]"));
|
||||
JButton btnSaveAndNew = new SelectColorButton("Save and New");
|
||||
JButton btnSaveAndNew = new JButton("Save and New");
|
||||
btnSaveAndNew.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent arg0) {
|
||||
@ -1264,7 +1263,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener {
|
||||
});
|
||||
buttonPane.add(btnSaveAndNew, "cell 0 0,alignx left,aligny top");
|
||||
|
||||
JButton okButton = new SelectColorButton("Save and Close");
|
||||
JButton okButton = new JButton("Save and Close");
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
@ -1277,7 +1276,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener {
|
||||
buttonPane.add(okButton, "cell 1 0,alignx left,aligny top");
|
||||
getRootPane().setDefaultButton(okButton);
|
||||
|
||||
JButton cancelButton = new SelectColorButton("Close");
|
||||
JButton cancelButton = new JButton("Close");
|
||||
cancelButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
|
@ -34,7 +34,6 @@ import info.openrocket.swing.gui.adaptors.BooleanModel;
|
||||
import info.openrocket.swing.gui.adaptors.DoubleModel;
|
||||
import info.openrocket.swing.gui.components.BasicSlider;
|
||||
import info.openrocket.swing.gui.components.UnitSelector;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
public class SimulationConditionsPanel extends JPanel {
|
||||
private static final Translator trans = Application.getTranslator();
|
||||
@ -49,7 +48,7 @@ public class SimulationConditionsPanel extends JPanel {
|
||||
addSimulationConditionsPanel(this, conditions);
|
||||
|
||||
|
||||
JButton restoreDefaults = new SelectColorButton(trans.get("simedtdlg.but.resettodefault"));
|
||||
JButton restoreDefaults = new JButton(trans.get("simedtdlg.but.resettodefault"));
|
||||
restoreDefaults.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
@ -64,7 +63,7 @@ public class SimulationConditionsPanel extends JPanel {
|
||||
});
|
||||
this.add(restoreDefaults, "span, split 3, skip, gapbottom para, gapright para, right");
|
||||
|
||||
JButton saveDefaults = new SelectColorButton(trans.get("simedtdlg.but.savedefault"));
|
||||
JButton saveDefaults = new JButton(trans.get("simedtdlg.but.savedefault"));
|
||||
saveDefaults.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
|
@ -9,7 +9,6 @@ import info.openrocket.swing.gui.components.ConfigurationComboBox;
|
||||
import info.openrocket.swing.gui.components.StyledLabel;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.theme.UITheme;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
import info.openrocket.core.l10n.Translator;
|
||||
import info.openrocket.core.rocketcomponent.FlightConfiguration;
|
||||
import info.openrocket.core.rocketcomponent.FlightConfigurationId;
|
||||
@ -314,7 +313,7 @@ public class SimulationConfigDialog extends JDialog {
|
||||
|
||||
//// Run simulation button
|
||||
// TODO: disable when sim is up to date?
|
||||
/*JButton button = new SelectColorButton(trans.get("SimulationEditDialog.btn.simulateAndPlot"));
|
||||
/*JButton button = new JButton(trans.get("SimulationEditDialog.btn.simulateAndPlot"));
|
||||
if (!isSingleEdit()) {
|
||||
button.setText(trans.get("SimulationEditDialog.btn.simulate"));
|
||||
}
|
||||
@ -332,7 +331,7 @@ public class SimulationConfigDialog extends JDialog {
|
||||
simEditPanel.add(button, "align right, gapright 10lp, tag ok");*/
|
||||
|
||||
//// Cancel button
|
||||
this.cancelButton = new SelectColorButton(trans.get("dlg.but.cancel"));
|
||||
this.cancelButton = new JButton(trans.get("dlg.but.cancel"));
|
||||
this.cancelButton.setToolTipText(trans.get("SimulationConfigDialog.btn.Cancel.ttip"));
|
||||
this.cancelButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@ -350,7 +349,7 @@ public class SimulationConfigDialog extends JDialog {
|
||||
bottomPanel.add(this.cancelButton, "split 2, tag ok");
|
||||
|
||||
//// Ok button
|
||||
this.okButton = new SelectColorButton(trans.get("dlg.but.ok"));
|
||||
this.okButton = new JButton(trans.get("dlg.but.ok"));
|
||||
this.okButton.setToolTipText(trans.get("SimulationConfigDialog.btn.OK.ttip"));
|
||||
this.okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
@ -41,7 +41,6 @@ import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.util.SaveCSVWorker;
|
||||
import info.openrocket.swing.gui.util.SwingPreferences;
|
||||
import info.openrocket.swing.gui.widgets.SaveFileChooser;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
public class SimulationExportPanel extends JPanel {
|
||||
|
||||
@ -143,7 +142,7 @@ public class SimulationExportPanel extends JPanel {
|
||||
panel.add(new JScrollPane(table), "wmin 300lp, width 300lp, height 1, grow 100, wrap");
|
||||
|
||||
// Select all/none buttons
|
||||
button = new SelectColorButton(trans.get("SimExpPan.but.Selectall"));
|
||||
button = new JButton(trans.get("SimExpPan.but.Selectall"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -152,7 +151,7 @@ public class SimulationExportPanel extends JPanel {
|
||||
});
|
||||
panel.add(button, "split 2, growx 1, sizegroup selectbutton");
|
||||
|
||||
button = new SelectColorButton(trans.get("SimExpPan.but.Selectnone"));
|
||||
button = new JButton(trans.get("SimExpPan.but.Selectnone"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -208,7 +207,7 @@ public class SimulationExportPanel extends JPanel {
|
||||
|
||||
/*
|
||||
// Export button
|
||||
button = new SelectColorButton(trans.get("SimExpPan.but.Exporttofile"));
|
||||
button = new JButton(trans.get("SimExpPan.but.Exporttofile"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -48,7 +48,6 @@ import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.util.Icons;
|
||||
import info.openrocket.swing.gui.theme.UITheme;
|
||||
import info.openrocket.swing.simulation.extension.SwingSimulationExtensionConfigurator;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import com.google.inject.Key;
|
||||
|
||||
@ -171,7 +170,7 @@ class SimulationOptionsPanel extends JPanel {
|
||||
sub.add(subsub, "spanx, wrap para");
|
||||
|
||||
// Reset to default button
|
||||
JButton button = new SelectColorButton(trans.get("simedtdlg.but.resettodefault"));
|
||||
JButton button = new JButton(trans.get("simedtdlg.but.resettodefault"));
|
||||
// Reset the time step to its default value (
|
||||
button.setToolTipText(trans.get("simedtdlg.but.ttip.resettodefault")
|
||||
+ UnitGroup.UNITS_SHORT_TIME
|
||||
@ -205,7 +204,7 @@ class SimulationOptionsPanel extends JPanel {
|
||||
sub.add(desc, "aligny 0, hmin 100lp, growx, wrap para");
|
||||
|
||||
|
||||
final JButton addExtension = new SelectColorButton(trans.get("simedtdlg.SimExt.add"));
|
||||
final JButton addExtension = new JButton(trans.get("simedtdlg.SimExt.add"));
|
||||
extensionMenu = getExtensionMenu();
|
||||
addExtension.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent ev) {
|
||||
@ -383,7 +382,7 @@ class SimulationOptionsPanel extends JPanel {
|
||||
|
||||
// Configure
|
||||
if (findConfigurator(extension) != null) {
|
||||
button = new SelectColorButton(Icons.CONFIGURE);
|
||||
button = new JButton(Icons.CONFIGURE);
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -397,7 +396,7 @@ class SimulationOptionsPanel extends JPanel {
|
||||
|
||||
// Help
|
||||
if (extension.getDescription() != null) {
|
||||
button = new SelectColorButton(Icons.HELP);
|
||||
button = new JButton(Icons.HELP);
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -406,7 +405,7 @@ class SimulationOptionsPanel extends JPanel {
|
||||
JPanel panel = new JPanel(new MigLayout("fill"));
|
||||
DescriptionArea area = new DescriptionArea(extension.getDescription(), 10, 0);
|
||||
panel.add(area, "width 400lp, wrap para");
|
||||
JButton close = new SelectColorButton(trans.get("button.close"));
|
||||
JButton close = new JButton(trans.get("button.close"));
|
||||
close.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -424,7 +423,7 @@ class SimulationOptionsPanel extends JPanel {
|
||||
}
|
||||
|
||||
// Delete
|
||||
button = new SelectColorButton(Icons.EDIT_DELETE);
|
||||
button = new JButton(Icons.EDIT_DELETE);
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
|
@ -45,7 +45,6 @@ import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.util.Icons;
|
||||
import info.openrocket.swing.gui.util.SwingPreferences;
|
||||
import info.openrocket.swing.gui.theme.UITheme;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
/**
|
||||
* Panel that displays the simulation plot options to the user.
|
||||
@ -252,7 +251,7 @@ public class SimulationPlotPanel extends JPanel {
|
||||
|
||||
|
||||
//// All + None buttons
|
||||
JButton button = new SelectColorButton(trans.get("simplotpanel.but.All"));
|
||||
JButton button = new JButton(trans.get("simplotpanel.but.All"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -264,7 +263,7 @@ public class SimulationPlotPanel extends JPanel {
|
||||
this.add(button, "split 2, gapleft para, gapright para, growx, sizegroup buttons");
|
||||
|
||||
//// None
|
||||
button = new SelectColorButton(trans.get("simplotpanel.but.None"));
|
||||
button = new JButton(trans.get("simplotpanel.but.None"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -314,7 +313,7 @@ public class SimulationPlotPanel extends JPanel {
|
||||
|
||||
|
||||
//// New Y axis plot type
|
||||
button = new SelectColorButton(trans.get("simplotpanel.but.NewYaxisplottype"));
|
||||
button = new JButton(trans.get("simplotpanel.but.NewYaxisplottype"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -367,7 +366,7 @@ public class SimulationPlotPanel extends JPanel {
|
||||
|
||||
/*
|
||||
//// Plot flight
|
||||
button = new SelectColorButton(trans.get("simplotpanel.but.Plotflight"));
|
||||
button = new JButton(trans.get("simplotpanel.but.Plotflight"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@ -551,7 +550,7 @@ public class SimulationPlotPanel extends JPanel {
|
||||
this.add(axisSelector);
|
||||
|
||||
|
||||
JButton button = new SelectColorButton(Icons.EDIT_DELETE);
|
||||
JButton button = new JButton(Icons.EDIT_DELETE);
|
||||
//// Remove this plot
|
||||
button.setToolTipText(trans.get("simplotpanel.but.ttip.Deletethisplot"));
|
||||
button.setBorderPainted(false);
|
||||
|
@ -52,7 +52,6 @@ import net.miginfocom.swing.MigLayout;
|
||||
import info.openrocket.swing.gui.dialogs.DetailDialog;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.util.SwingPreferences;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
public class SimulationRunDialog extends JDialog {
|
||||
private static final long serialVersionUID = -1593459321777026455L;
|
||||
@ -163,7 +162,7 @@ public class SimulationRunDialog extends JDialog {
|
||||
panel.add(progressBar, "spanx, growx, wrap para");
|
||||
|
||||
// Add cancel button
|
||||
JButton cancel = new SelectColorButton(trans.get("dlg.but.cancel"));
|
||||
JButton cancel = new JButton(trans.get("dlg.but.cancel"));
|
||||
cancel.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -4,13 +4,14 @@ import info.openrocket.swing.gui.util.Icons;
|
||||
|
||||
import javax.swing.Action;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JButton;
|
||||
|
||||
/**
|
||||
* Button specifically for displaying an icon.
|
||||
*
|
||||
* @author Sibo Van Gool <sibo.vangool@hotmail.com>
|
||||
*/
|
||||
public class IconButton extends SelectColorButton {
|
||||
public class IconButton extends JButton {
|
||||
private static final int ICON_GAP = 10;
|
||||
private static final double ICON_SCALE = 0.9;
|
||||
|
||||
|
@ -4,6 +4,7 @@ import info.openrocket.swing.gui.util.Icons;
|
||||
|
||||
import javax.swing.Action;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JToggleButton;
|
||||
import javax.swing.UIManager;
|
||||
import java.awt.Insets;
|
||||
|
||||
@ -16,7 +17,7 @@ import java.awt.Insets;
|
||||
*
|
||||
* @author Sibo Van Gool <sibo.vangool@hotmail.com>
|
||||
*/
|
||||
public class IconToggleButton extends SelectColorToggleButton {
|
||||
public class IconToggleButton extends JToggleButton {
|
||||
private double ICON_SCALE = 1;
|
||||
|
||||
public IconToggleButton(Action a) {
|
||||
|
@ -1,70 +0,0 @@
|
||||
package info.openrocket.swing.gui.widgets;
|
||||
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.theme.UITheme;
|
||||
|
||||
import javax.swing.Action;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import java.awt.event.FocusAdapter;
|
||||
import java.awt.event.FocusEvent;
|
||||
|
||||
public class SelectColorButton extends JButton {
|
||||
|
||||
public SelectColorButton() {
|
||||
addChangeListenerSelectColor();
|
||||
}
|
||||
|
||||
public SelectColorButton(Icon icon) {
|
||||
super(icon);
|
||||
addChangeListenerSelectColor();
|
||||
}
|
||||
|
||||
public SelectColorButton(String text) {
|
||||
super(text);
|
||||
addChangeListenerSelectColor();
|
||||
}
|
||||
|
||||
public SelectColorButton(Action a) {
|
||||
super(a);
|
||||
addChangeListenerSelectColor();
|
||||
}
|
||||
|
||||
public SelectColorButton(String text, Icon icon) {
|
||||
super(text, icon);
|
||||
addChangeListenerSelectColor();
|
||||
}
|
||||
|
||||
private void addChangeListenerSelectColor() {
|
||||
if ((GUIUtil.getUITheme() != UITheme.Themes.LIGHT) ||
|
||||
(UIManager.getColor("Button.selectForeground") == null) ||
|
||||
(UIManager.getColor("Button.foreground") == null))
|
||||
return;
|
||||
|
||||
// Fixes the issue of the background of the button not being blue when selected on macOS
|
||||
putClientProperty("JButton.buttonType", "segmented-only");
|
||||
|
||||
addChangeListener(new ChangeListener() {
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
if (getModel().isArmed()) {
|
||||
setForeground(UIManager.getColor("Button.selectForeground"));
|
||||
}
|
||||
else {
|
||||
setForeground(UIManager.getColor("Button.foreground"));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Need to add this, otherwise the foreground can remain in the selectForeground state when the button is clicked
|
||||
addFocusListener(new FocusAdapter() {
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
setForeground(UIManager.getColor("Button.foreground"));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
package info.openrocket.swing.gui.widgets;
|
||||
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.swing.gui.theme.UITheme;
|
||||
|
||||
import javax.swing.JToggleButton;
|
||||
import javax.swing.Action;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.UIManager;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
|
||||
/**
|
||||
* This class is a replacement for the standard JToggleButton. Its purpose is to be able
|
||||
* to control the foreground color for when the button is (de)selected.
|
||||
*
|
||||
* @author Sibo Van Gool <sibo.vangool@hotmail.com>
|
||||
*/
|
||||
public class SelectColorToggleButton extends JToggleButton {
|
||||
|
||||
public SelectColorToggleButton(Action a) {
|
||||
super(a);
|
||||
addChangeListenerSelectColor();
|
||||
}
|
||||
|
||||
public SelectColorToggleButton(String text) {
|
||||
super(text);
|
||||
addChangeListenerSelectColor();
|
||||
}
|
||||
|
||||
public SelectColorToggleButton() {
|
||||
addChangeListenerSelectColor();
|
||||
}
|
||||
|
||||
public SelectColorToggleButton(Icon icon) {
|
||||
super(icon);
|
||||
addChangeListenerSelectColor();
|
||||
}
|
||||
|
||||
public SelectColorToggleButton(Icon icon, boolean selected) {
|
||||
super(icon, selected);
|
||||
addChangeListenerSelectColor();
|
||||
}
|
||||
|
||||
public SelectColorToggleButton(String text, boolean selected) {
|
||||
super(text, selected);
|
||||
addChangeListenerSelectColor();
|
||||
}
|
||||
|
||||
public SelectColorToggleButton(String text, Icon icon) {
|
||||
super(text, icon);
|
||||
addChangeListenerSelectColor();
|
||||
}
|
||||
|
||||
public SelectColorToggleButton(String text, Icon icon, boolean selected) {
|
||||
super(text, icon, selected);
|
||||
addChangeListenerSelectColor();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method sets the foreground color of the button. If the button is selected, then the selectForeground is used.
|
||||
* If the frame that the button is in goes out of focus or if the button is unselected, then the foreground is used.
|
||||
*
|
||||
* This is to fix an issue on OSX devices where the foreground color would be black on blue (hardly readable)
|
||||
*/
|
||||
private void addChangeListenerSelectColor() {
|
||||
if ((GUIUtil.getUITheme() != UITheme.Themes.LIGHT) ||
|
||||
(UIManager.getColor("ToggleButton.selectForeground") == null) ||
|
||||
(UIManager.getColor("ToggleButton.foreground") == null))
|
||||
return;
|
||||
|
||||
// Fixes the issue of the background of the button not being blue when selected on macOS
|
||||
putClientProperty("JButton.buttonType", "segmented-only");
|
||||
|
||||
// Case: frame goes out of focus
|
||||
addPropertyChangeListener("Frame.active", new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (isSelected() && (boolean)evt.getNewValue()) {
|
||||
setForeground(UIManager.getColor("ToggleButton.selectForeground"));
|
||||
}
|
||||
else {
|
||||
setForeground(UIManager.getColor("ToggleButton.foreground"));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Case: button is clicked
|
||||
addPropertyChangeListener("ancestor", new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (isSelected()) {
|
||||
setForeground(UIManager.getColor("ToggleButton.selectForeground"));
|
||||
}
|
||||
else {
|
||||
setForeground(UIManager.getColor("ToggleButton.foreground"));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -17,7 +17,6 @@ import net.miginfocom.swing.MigLayout;
|
||||
import info.openrocket.core.document.Simulation;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.core.l10n.Translator;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
@ -49,7 +48,7 @@ public abstract class AbstractSwingSimulationExtensionConfigurator<E extends Sim
|
||||
|
||||
panel.add(getConfigurationComponent((E) extension, simulation, sub), "grow, wrap para");
|
||||
|
||||
JButton close = new SelectColorButton(trans.get("button.close"));
|
||||
JButton close = new JButton(trans.get("button.close"));
|
||||
close.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -23,7 +23,6 @@ import info.openrocket.swing.gui.components.StyledLabel.Style;
|
||||
import info.openrocket.swing.gui.util.GUIUtil;
|
||||
import info.openrocket.core.plugin.Plugin;
|
||||
import info.openrocket.swing.simulation.extension.AbstractSwingSimulationExtensionConfigurator;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
|
||||
import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
|
||||
@ -102,7 +101,7 @@ public class ScriptingConfigurator extends AbstractSwingSimulationExtensionConfi
|
||||
|
||||
panel.add(new JPanel(), "growx");
|
||||
|
||||
JButton button = new SelectColorButton(trans.get("SimulationExtension.scripting.text.trusted.clear"));
|
||||
JButton button = new JButton(trans.get("SimulationExtension.scripting.text.trusted.clear"));
|
||||
button.setToolTipText(trans.get("SimulationExtension.scripting.text.trusted.clear.ttip"));
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
@ -45,7 +45,6 @@ import info.openrocket.core.preset.loader.MaterialHolder;
|
||||
import info.openrocket.core.preset.xml.OpenRocketComponentDTO;
|
||||
import info.openrocket.core.preset.xml.OpenRocketComponentSaver;
|
||||
import info.openrocket.core.startup.Application;
|
||||
import info.openrocket.swing.gui.widgets.SelectColorButton;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -207,7 +206,7 @@ public class ComponentPresetEditor extends JPanel implements PresetResultListene
|
||||
});
|
||||
|
||||
|
||||
JButton addBtn = new SelectColorButton("Add");
|
||||
JButton addBtn = new JButton("Add");
|
||||
addBtn.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent arg0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user