Merge pull request #290 from teyrana/warning-cleanup
Warning cleanup ( reduced from 219 to 185 )
This commit is contained in:
commit
597d6c8391
@ -17,6 +17,7 @@ import net.sf.openrocket.rocketcomponent.AxialStage;
|
|||||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||||
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration;
|
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration;
|
||||||
|
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration.SeparationEvent;
|
||||||
import net.sf.openrocket.startup.Application;
|
import net.sf.openrocket.startup.Application;
|
||||||
|
|
||||||
public class AxialStageConfig extends ComponentAssemblyConfig {
|
public class AxialStageConfig extends ComponentAssemblyConfig {
|
||||||
@ -48,16 +49,10 @@ public class AxialStageConfig extends ComponentAssemblyConfig {
|
|||||||
sepConfig = new StageSeparationConfiguration();
|
sepConfig = new StageSeparationConfiguration();
|
||||||
stage.getSeparationConfigurations().set( flConfig.getId(), sepConfig );
|
stage.getSeparationConfigurations().set( flConfig.getId(), sepConfig );
|
||||||
}
|
}
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
JComboBox<?> combo = new JComboBox<StageSeparationConfiguration.SeparationEvent>(
|
JComboBox<?> combo = new JComboBox<StageSeparationConfiguration.SeparationEvent>(
|
||||||
new EnumModel<StageSeparationConfiguration.SeparationEvent>( sepConfig, "SeparationEvent",
|
new EnumModel<StageSeparationConfiguration.SeparationEvent>( sepConfig, "SeparationEvent", SeparationEvent.values()));
|
||||||
new StageSeparationConfiguration.SeparationEvent[] {
|
|
||||||
StageSeparationConfiguration.SeparationEvent.UPPER_IGNITION,
|
|
||||||
StageSeparationConfiguration.SeparationEvent.IGNITION,
|
|
||||||
StageSeparationConfiguration.SeparationEvent.BURNOUT,
|
|
||||||
StageSeparationConfiguration.SeparationEvent.EJECTION,
|
|
||||||
StageSeparationConfiguration.SeparationEvent.LAUNCH,
|
|
||||||
StageSeparationConfiguration.SeparationEvent.NEVER }));
|
|
||||||
//combo.setSelectedItem(sepConfig);
|
//combo.setSelectedItem(sepConfig);
|
||||||
panel.add(combo, "");
|
panel.add(combo, "");
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ import net.sf.openrocket.startup.Application;
|
|||||||
import net.sf.openrocket.unit.UnitGroup;
|
import net.sf.openrocket.unit.UnitGroup;
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
public class MassComponentConfig extends RocketComponentConfig {
|
public class MassComponentConfig extends RocketComponentConfig {
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
@ -34,8 +35,8 @@ public class MassComponentConfig extends RocketComponentConfig {
|
|||||||
|
|
||||||
//// Mass component type
|
//// Mass component type
|
||||||
panel.add(new JLabel(trans.get("MassComponentCfg.lbl.type")));
|
panel.add(new JLabel(trans.get("MassComponentCfg.lbl.type")));
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
JComboBox typecombo = new JComboBox(
|
final JComboBox<?> typecombo = new JComboBox<MassComponent.MassComponentType>(
|
||||||
new EnumModel<MassComponent.MassComponentType>(component, "MassComponentType",
|
new EnumModel<MassComponent.MassComponentType>(component, "MassComponentType",
|
||||||
new MassComponent.MassComponentType[] {
|
new MassComponent.MassComponentType[] {
|
||||||
MassComponent.MassComponentType.MASSCOMPONENT,
|
MassComponent.MassComponentType.MASSCOMPONENT,
|
||||||
@ -108,7 +109,7 @@ public class MassComponentConfig extends RocketComponentConfig {
|
|||||||
//// Position relative to:
|
//// Position relative to:
|
||||||
panel.add(new JLabel(trans.get("MassComponentCfg.lbl.PosRelativeto")));
|
panel.add(new JLabel(trans.get("MassComponentCfg.lbl.PosRelativeto")));
|
||||||
|
|
||||||
JComboBox combo = new JComboBox(
|
final JComboBox<RocketComponent.Position> combo = new JComboBox<RocketComponent.Position>(
|
||||||
new EnumModel<RocketComponent.Position>(component, "RelativePosition",
|
new EnumModel<RocketComponent.Position>(component, "RelativePosition",
|
||||||
new RocketComponent.Position[] {
|
new RocketComponent.Position[] {
|
||||||
RocketComponent.Position.TOP,
|
RocketComponent.Position.TOP,
|
||||||
|
@ -27,9 +27,9 @@ import net.sf.openrocket.rocketcomponent.Transition;
|
|||||||
import net.sf.openrocket.startup.Application;
|
import net.sf.openrocket.startup.Application;
|
||||||
import net.sf.openrocket.unit.UnitGroup;
|
import net.sf.openrocket.unit.UnitGroup;
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
public class NoseConeConfig extends RocketComponentConfig {
|
public class NoseConeConfig extends RocketComponentConfig {
|
||||||
|
|
||||||
private JComboBox typeBox;
|
|
||||||
|
|
||||||
private DescriptionArea description;
|
private DescriptionArea description;
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ public class NoseConeConfig extends RocketComponentConfig {
|
|||||||
Transition.Shape selected = ((NoseCone) component).getType();
|
Transition.Shape selected = ((NoseCone) component).getType();
|
||||||
Transition.Shape[] typeList = Transition.Shape.values();
|
Transition.Shape[] typeList = Transition.Shape.values();
|
||||||
|
|
||||||
typeBox = new JComboBox(typeList);
|
final JComboBox<Transition.Shape> typeBox = new JComboBox<Transition.Shape>(typeList);
|
||||||
typeBox.setEditable(false);
|
typeBox.setEditable(false);
|
||||||
typeBox.setSelectedItem(selected);
|
typeBox.setSelectedItem(selected);
|
||||||
typeBox.addActionListener(new ActionListener() {
|
typeBox.addActionListener(new ActionListener() {
|
||||||
|
@ -22,9 +22,9 @@ import net.sf.openrocket.rocketcomponent.RocketComponent;
|
|||||||
import net.sf.openrocket.startup.Application;
|
import net.sf.openrocket.startup.Application;
|
||||||
import net.sf.openrocket.unit.UnitGroup;
|
import net.sf.openrocket.unit.UnitGroup;
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
public class RailButtonConfig extends RocketComponentConfig {
|
public class RailButtonConfig extends RocketComponentConfig {
|
||||||
|
|
||||||
private MotorConfig motorConfigPane = null;
|
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public RailButtonConfig( OpenRocketDocument document, RocketComponent component) {
|
public RailButtonConfig( OpenRocketDocument document, RocketComponent component) {
|
||||||
@ -78,7 +78,7 @@ public class RailButtonConfig extends RocketComponentConfig {
|
|||||||
|
|
||||||
{ //// Position relative to:
|
{ //// Position relative to:
|
||||||
panel.add(new JLabel(trans.get("RailBtnCfg.lbl.PosRelativeTo")));
|
panel.add(new JLabel(trans.get("RailBtnCfg.lbl.PosRelativeTo")));
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
JComboBox<RocketComponent.Position> relToCombo = new JComboBox<RocketComponent.Position>(
|
JComboBox<RocketComponent.Position> relToCombo = new JComboBox<RocketComponent.Position>(
|
||||||
(ComboBoxModel<RocketComponent.Position>) new EnumModel<RocketComponent.Position>(component, "RelativePosition",
|
(ComboBoxModel<RocketComponent.Position>) new EnumModel<RocketComponent.Position>(component, "RelativePosition",
|
||||||
new RocketComponent.Position[] {
|
new RocketComponent.Position[] {
|
||||||
|
@ -22,6 +22,7 @@ import net.sf.openrocket.rocketcomponent.RocketComponent;
|
|||||||
import net.sf.openrocket.startup.Application;
|
import net.sf.openrocket.startup.Application;
|
||||||
import net.sf.openrocket.unit.UnitGroup;
|
import net.sf.openrocket.unit.UnitGroup;
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
public class RingComponentConfig extends RocketComponentConfig {
|
public class RingComponentConfig extends RocketComponentConfig {
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
@ -125,7 +126,7 @@ public class RingComponentConfig extends RocketComponentConfig {
|
|||||||
//// Position relative to:
|
//// Position relative to:
|
||||||
panel.add(new JLabel(trans.get("ringcompcfg.Positionrelativeto")));
|
panel.add(new JLabel(trans.get("ringcompcfg.Positionrelativeto")));
|
||||||
|
|
||||||
JComboBox combo = new JComboBox(
|
final JComboBox<RocketComponent.Position> positionCombo = new JComboBox<RocketComponent.Position>(
|
||||||
new EnumModel<RocketComponent.Position>(component, "RelativePosition",
|
new EnumModel<RocketComponent.Position>(component, "RelativePosition",
|
||||||
new RocketComponent.Position[] {
|
new RocketComponent.Position[] {
|
||||||
RocketComponent.Position.TOP,
|
RocketComponent.Position.TOP,
|
||||||
@ -133,7 +134,7 @@ public class RingComponentConfig extends RocketComponentConfig {
|
|||||||
RocketComponent.Position.BOTTOM,
|
RocketComponent.Position.BOTTOM,
|
||||||
RocketComponent.Position.ABSOLUTE
|
RocketComponent.Position.ABSOLUTE
|
||||||
}));
|
}));
|
||||||
panel.add(combo, "spanx 3, growx, wrap");
|
panel.add( positionCombo, "spanx 3, growx, wrap");
|
||||||
|
|
||||||
//// plus
|
//// plus
|
||||||
panel.add(new JLabel(trans.get("ringcompcfg.plus")), "right");
|
panel.add(new JLabel(trans.get("ringcompcfg.plus")), "right");
|
||||||
|
@ -25,13 +25,14 @@ import net.sf.openrocket.l10n.Translator;
|
|||||||
import net.sf.openrocket.material.Material;
|
import net.sf.openrocket.material.Material;
|
||||||
import net.sf.openrocket.startup.Application;
|
import net.sf.openrocket.startup.Application;
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
public class CustomMaterialDialog extends JDialog {
|
public class CustomMaterialDialog extends JDialog {
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
private final Material originalMaterial;
|
private final Material originalMaterial;
|
||||||
|
|
||||||
private boolean okClicked = false;
|
private boolean okClicked = false;
|
||||||
private JComboBox typeBox;
|
private JComboBox<Material.Type> typeBox;
|
||||||
private JTextField nameField;
|
private JTextField nameField;
|
||||||
private DoubleModel density;
|
private DoubleModel density;
|
||||||
private JSpinner densitySpinner;
|
private JSpinner densitySpinner;
|
||||||
@ -76,7 +77,7 @@ public class CustomMaterialDialog extends JDialog {
|
|||||||
// Material type (if not known)
|
// Material type (if not known)
|
||||||
panel.add(new JLabel(trans.get("custmatdlg.lbl.Materialtype")));
|
panel.add(new JLabel(trans.get("custmatdlg.lbl.Materialtype")));
|
||||||
if (material == null) {
|
if (material == null) {
|
||||||
typeBox = new JComboBox(Material.Type.values());
|
typeBox = new JComboBox<Material.Type>(Material.Type.values());
|
||||||
typeBox.setSelectedItem(Material.Type.BULK);
|
typeBox.setSelectedItem(Material.Type.BULK);
|
||||||
typeBox.setEditable(false);
|
typeBox.setEditable(false);
|
||||||
typeBox.addActionListener(new ActionListener() {
|
typeBox.addActionListener(new ActionListener() {
|
||||||
|
@ -30,6 +30,7 @@ import net.sf.openrocket.startup.Application;
|
|||||||
/**
|
/**
|
||||||
* This class is a dialog for displaying advanced settings for printing rocket related info.
|
* This class is a dialog for displaying advanced settings for printing rocket related info.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("serial")
|
||||||
public class PrintSettingsDialog extends JDialog {
|
public class PrintSettingsDialog extends JDialog {
|
||||||
private static final Logger log = LoggerFactory.getLogger(PrintSettingsDialog.class);
|
private static final Logger log = LoggerFactory.getLogger(PrintSettingsDialog.class);
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
@ -75,16 +76,16 @@ public class PrintSettingsDialog extends JDialog {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
JComboBox combo = new JComboBox(new EnumModel<PaperSize>(settings, "PaperSize"));
|
final JComboBox<PaperSize> sizeCombo = new JComboBox<PaperSize>(new EnumModel<PaperSize>(settings, "PaperSize"));
|
||||||
////Paper size:
|
////Paper size:
|
||||||
panel.add(new JLabel(trans.get("lbl.Papersize")));
|
panel.add(new JLabel(trans.get("lbl.Papersize")));
|
||||||
panel.add(combo, "growx, wrap para");
|
panel.add( sizeCombo, "growx, wrap para");
|
||||||
|
|
||||||
|
|
||||||
combo = new JComboBox(new EnumModel<PaperOrientation>(settings, "PaperOrientation"));
|
final JComboBox<PaperOrientation> orientCombo = new JComboBox<PaperOrientation>(new EnumModel<PaperOrientation>(settings, "PaperOrientation"));
|
||||||
//// Paper orientation:
|
//// Paper orientation:
|
||||||
panel.add(new JLabel(trans.get("lbl.Paperorientation")));
|
panel.add(new JLabel(trans.get("lbl.Paperorientation")));
|
||||||
panel.add(combo, "growx, wrap para*2");
|
panel.add( orientCombo, "growx, wrap para*2");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,13 +10,13 @@ import javax.swing.JScrollPane;
|
|||||||
import net.sf.openrocket.aerodynamics.Warning;
|
import net.sf.openrocket.aerodynamics.Warning;
|
||||||
import net.sf.openrocket.aerodynamics.WarningSet;
|
import net.sf.openrocket.aerodynamics.WarningSet;
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
public class WarningDialog extends JDialog {
|
public class WarningDialog extends JDialog {
|
||||||
|
|
||||||
public static void showWarnings(Component parent, Object message, String title,
|
public static void showWarnings(Component parent, Object message, String title, WarningSet warnings) {
|
||||||
WarningSet warnings) {
|
|
||||||
|
|
||||||
Warning[] w = warnings.toArray(new Warning[0]);
|
Warning[] w = warnings.toArray(new Warning[0]);
|
||||||
JList list = new JList(w);
|
final JList<Warning> list = new JList<Warning>(w);
|
||||||
JScrollPane pane = new JScrollPane(list);
|
JScrollPane pane = new JScrollPane(list);
|
||||||
|
|
||||||
JOptionPane.showMessageDialog(parent, new Object[] { message, pane },
|
JOptionPane.showMessageDialog(parent, new Object[] { message, pane },
|
||||||
|
@ -78,12 +78,12 @@ public class DeploymentSelectionDialog extends JDialog {
|
|||||||
//// Deploys at:
|
//// Deploys at:
|
||||||
panel.add(new JLabel(trans.get("ParachuteCfg.lbl.Deploysat")), "");
|
panel.add(new JLabel(trans.get("ParachuteCfg.lbl.Deploysat")), "");
|
||||||
|
|
||||||
final JComboBox<?> event = new JComboBox(new EnumModel<DeployEvent>(newConfiguration, "DeployEvent"));
|
final JComboBox<DeployEvent> deployEvent = new JComboBox<DeployEvent>(new EnumModel<DeployEvent>(newConfiguration, "DeployEvent"));
|
||||||
if( (component.getStageNumber() + 1 ) == rocket.getStageCount() ){
|
if( (component.getStageNumber() + 1 ) == rocket.getStageCount() ){
|
||||||
// This is the bottom stage: Restrict deployment options.
|
// This is the bottom stage: Restrict deployment options.
|
||||||
event.removeItem( DeployEvent.LOWER_STAGE_SEPARATION );
|
deployEvent.removeItem( DeployEvent.LOWER_STAGE_SEPARATION );
|
||||||
}
|
}
|
||||||
panel.add(event, "spanx 3, growx, wrap");
|
panel.add( deployEvent, "spanx 3, growx, wrap");
|
||||||
|
|
||||||
// ... and delay
|
// ... and delay
|
||||||
//// plus
|
//// plus
|
||||||
@ -111,7 +111,7 @@ public class DeploymentSelectionDialog extends JDialog {
|
|||||||
altSlider = new BasicSlider(alt.getSliderModel(100, 1000));
|
altSlider = new BasicSlider(alt.getSliderModel(100, 1000));
|
||||||
panel.add(altSlider, "w 100lp, wrap");
|
panel.add(altSlider, "w 100lp, wrap");
|
||||||
|
|
||||||
event.addActionListener(new ActionListener() {
|
deployEvent.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
updateState();
|
updateState();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user