Update button states with every selection and corrected display of
separation configuration.
This commit is contained in:
parent
9916a98ccb
commit
5dbb723736
@ -22,6 +22,7 @@ import net.sf.openrocket.rocketcomponent.Stage;
|
|||||||
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration;
|
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration;
|
||||||
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration.SeparationEvent;
|
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration.SeparationEvent;
|
||||||
import net.sf.openrocket.startup.Application;
|
import net.sf.openrocket.startup.Application;
|
||||||
|
import net.sf.openrocket.unit.UnitGroup;
|
||||||
|
|
||||||
public class SeparationConfigurationPanel extends JPanel {
|
public class SeparationConfigurationPanel extends JPanel {
|
||||||
|
|
||||||
@ -67,11 +68,8 @@ public class SeparationConfigurationPanel extends JPanel {
|
|||||||
separationTable.addMouseListener(new MouseAdapter() {
|
separationTable.addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mouseClicked(MouseEvent e) {
|
public void mouseClicked(MouseEvent e) {
|
||||||
if (e.getClickCount() == 1) {
|
updateButtonState();
|
||||||
// FIXME: Listen to selection change, not clicks
|
if (e.getClickCount() == 2) {
|
||||||
// Single click updates selection
|
|
||||||
updateButtonState();
|
|
||||||
} else if (e.getClickCount() == 2) {
|
|
||||||
// Double-click edits
|
// Double-click edits
|
||||||
selectDeployment();
|
selectDeployment();
|
||||||
}
|
}
|
||||||
@ -174,6 +172,9 @@ public class SeparationConfigurationPanel extends JPanel {
|
|||||||
str = str.replace("{0}", event.toString());
|
str = str.replace("{0}", event.toString());
|
||||||
} else {
|
} else {
|
||||||
str = event.toString();
|
str = event.toString();
|
||||||
|
if (separationConfig.getSeparationDelay() > 0) {
|
||||||
|
str = str + " + " + UnitGroup.UNITS_SHORT_TIME.toStringUnit(separationConfig.getSeparationDelay());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user