Code cleanup
This commit is contained in:
parent
509ef101b8
commit
84e7c951e6
@ -911,7 +911,7 @@ public class RocketActions {
|
|||||||
}
|
}
|
||||||
ComponentConfigDialog.showDialog(parentFrame, document, components.get(0), listeners);
|
ComponentConfigDialog.showDialog(parentFrame, document, components.get(0), listeners);
|
||||||
} else if (sims != null && sims.length > 0 && (simulationPanel != null)) {
|
} else if (sims != null && sims.length > 0 && (simulationPanel != null)) {
|
||||||
simulationPanel.editSimulationAction();
|
simulationPanel.editSimulation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
editButton.addActionListener(new ActionListener() {
|
editButton.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
editSimulationAction();
|
editSimulation();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.add(editButton, "gapright para");
|
this.add(editButton, "gapright para");
|
||||||
@ -149,7 +149,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
runButton.addActionListener(new ActionListener() {
|
runButton.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
runSimulationAction();
|
runSimulation();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.add(runButton, "gapright para");
|
this.add(runButton, "gapright para");
|
||||||
@ -161,7 +161,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
deleteButton.addActionListener(new ActionListener() {
|
deleteButton.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
deleteSimulationAction();
|
deleteSimulation();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.add(deleteButton, "gapright para");
|
this.add(deleteButton, "gapright para");
|
||||||
@ -172,7 +172,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
plotButton.addActionListener(new ActionListener() {
|
plotButton.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
plotSimulationAction();
|
plotSimulation();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.add(plotButton, "wrap para");
|
this.add(plotButton, "wrap para");
|
||||||
@ -524,7 +524,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
updateButtonStates();
|
updateButtonStates();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void plotSimulationAction() {
|
private void plotSimulation() {
|
||||||
int selected = simulationTable.getSelectedRow();
|
int selected = simulationTable.getSelectedRow();
|
||||||
if (selected < 0) {
|
if (selected < 0) {
|
||||||
return;
|
return;
|
||||||
@ -546,7 +546,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
openDialog(true, sim);
|
openDialog(true, sim);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteSimulationAction() {
|
private void deleteSimulation() {
|
||||||
int[] selection = simulationTable.getSelectedRows();
|
int[] selection = simulationTable.getSelectedRows();
|
||||||
if (selection.length == 0) {
|
if (selection.length == 0) {
|
||||||
return;
|
return;
|
||||||
@ -593,7 +593,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
simulationTableModel.fireTableDataChanged();
|
simulationTableModel.fireTableDataChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void runSimulationAction() {
|
private void runSimulation() {
|
||||||
Simulation[] sims = getSelectedSimulations();
|
Simulation[] sims = getSelectedSimulations();
|
||||||
if (sims == null) return;
|
if (sims == null) return;
|
||||||
|
|
||||||
@ -604,7 +604,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
fireMaintainSelection();
|
fireMaintainSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void editSimulationAction() {
|
public void editSimulation() {
|
||||||
Simulation[] sims = getSelectedSimulations();
|
Simulation[] sims = getSelectedSimulations();
|
||||||
if (sims == null) return;
|
if (sims == null) return;
|
||||||
|
|
||||||
@ -661,7 +661,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
cb.setContents(sel, sel);
|
cb.setContents(sel, sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void duplicateSimulationAction() {
|
private void duplicateSimulation() {
|
||||||
Simulation[] sims = getSelectedSimulations();
|
Simulation[] sims = getSelectedSimulations();
|
||||||
if (sims == null) return;
|
if (sims == null) return;
|
||||||
|
|
||||||
@ -780,7 +780,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
editSimulationAction();
|
editSimulation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -792,7 +792,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
runSimulationAction();
|
runSimulation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -806,7 +806,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
deleteSimulationAction();
|
deleteSimulation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -818,7 +818,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
plotSimulationAction();
|
plotSimulation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -832,7 +832,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
duplicateSimulationAction();
|
duplicateSimulation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package net.sf.openrocket.gui.main.flightconfigpanel;
|
package net.sf.openrocket.gui.main.flightconfigpanel;
|
||||||
|
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
@ -144,7 +143,7 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe
|
|||||||
stateChanged(null);
|
stateChanged(null);
|
||||||
switch (tabs.getSelectedIndex()) {
|
switch (tabs.getSelectedIndex()) {
|
||||||
case MOTOR_TAB_INDEX:
|
case MOTOR_TAB_INDEX:
|
||||||
motorConfigurationPanel.selectMotorAction();
|
motorConfigurationPanel.selectMotor();
|
||||||
break;
|
break;
|
||||||
case RECOVERY_TAB_INDEX:
|
case RECOVERY_TAB_INDEX:
|
||||||
recoveryConfigurationPanel.selectDeployment();
|
recoveryConfigurationPanel.selectDeployment();
|
||||||
|
@ -148,7 +148,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
|||||||
table.getActionMap().put("Enter", new AbstractAction() {
|
table.getActionMap().put("Enter", new AbstractAction() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent ae) {
|
public void actionPerformed(ActionEvent ae) {
|
||||||
selectMotorAction();
|
selectMotor();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
|||||||
|
|
||||||
if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) {
|
if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) {
|
||||||
if (selectedColumn > 0) {
|
if (selectedColumn > 0) {
|
||||||
selectMotorAction();
|
selectMotor();
|
||||||
}
|
}
|
||||||
} else if (e.getButton() == MouseEvent.BUTTON3 && e.getClickCount() == 1) {
|
} else if (e.getButton() == MouseEvent.BUTTON3 && e.getClickCount() == 1) {
|
||||||
if (selectedColumn > 0) {
|
if (selectedColumn > 0) {
|
||||||
@ -285,7 +285,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void selectMotorAction() {
|
public void selectMotor() {
|
||||||
List<MotorMount> mounts = getSelectedComponents();
|
List<MotorMount> mounts = getSelectedComponents();
|
||||||
List<FlightConfigurationId> fcIds = getSelectedConfigurationIds();
|
List<FlightConfigurationId> fcIds = getSelectedConfigurationIds();
|
||||||
if ((mounts == null) || (fcIds == null) || mounts.size() == 0 || fcIds.size() == 0) {
|
if ((mounts == null) || (fcIds == null) || mounts.size() == 0 || fcIds.size() == 0) {
|
||||||
@ -332,7 +332,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeMotorAction() {
|
private void removeMotor() {
|
||||||
List<MotorMount> mounts = getSelectedComponents();
|
List<MotorMount> mounts = getSelectedComponents();
|
||||||
List<FlightConfigurationId> fcIds = getSelectedConfigurationIds();
|
List<FlightConfigurationId> fcIds = getSelectedConfigurationIds();
|
||||||
if ((mounts == null) || (fcIds == null) || mounts.size() == 0 || fcIds.size() == 0) {
|
if ((mounts == null) || (fcIds == null) || mounts.size() == 0 || fcIds.size() == 0) {
|
||||||
@ -348,7 +348,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
|||||||
fireTableDataChanged(ComponentChangeEvent.MOTOR_CHANGE);
|
fireTableDataChanged(ComponentChangeEvent.MOTOR_CHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectIgnitionAction() {
|
private void selectIgnition() {
|
||||||
List<MotorMount> mounts = getSelectedComponents();
|
List<MotorMount> mounts = getSelectedComponents();
|
||||||
List<FlightConfigurationId> fcIds = getSelectedConfigurationIds();
|
List<FlightConfigurationId> fcIds = getSelectedConfigurationIds();
|
||||||
if ((mounts == null) || (fcIds == null) || mounts.size() == 0 || fcIds.size() == 0) {
|
if ((mounts == null) || (fcIds == null) || mounts.size() == 0 || fcIds.size() == 0) {
|
||||||
@ -397,7 +397,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void resetIgnitionAction() {
|
private void resetIgnition() {
|
||||||
List<MotorMount> mounts = getSelectedComponents();
|
List<MotorMount> mounts = getSelectedComponents();
|
||||||
List<FlightConfigurationId> fcIds = getSelectedConfigurationIds();
|
List<FlightConfigurationId> fcIds = getSelectedConfigurationIds();
|
||||||
if ((mounts == null) || (fcIds == null) || mounts.size() == 0 || fcIds.size() == 0) {
|
if ((mounts == null) || (fcIds == null) || mounts.size() == 0 || fcIds.size() == 0) {
|
||||||
@ -432,7 +432,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
selectMotorAction();
|
selectMotor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -443,7 +443,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
removeMotorAction();
|
removeMotor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,7 +454,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
selectIgnitionAction();
|
selectIgnition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
resetIgnitionAction();
|
resetIgnition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user