From f9bd7e672cce3a8f8af0e646d50a802457340b97 Mon Sep 17 00:00:00 2001 From: SiboVG Date: Mon, 26 Dec 2022 14:23:03 +0100 Subject: [PATCH] [#1926] Switch to match fore diameter when nose cone is flipped --- core/resources/l10n/messages.properties | 2 ++ .../sf/openrocket/rocketcomponent/NoseCone.java | 3 +++ .../preset/ComponentPresetChooserDialog.java | 14 ++++++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/core/resources/l10n/messages.properties b/core/resources/l10n/messages.properties index a8c1cb10f..6f870c960 100644 --- a/core/resources/l10n/messages.properties +++ b/core/resources/l10n/messages.properties @@ -2151,7 +2151,9 @@ ExportDecalDialog.source.exception = Could not find decal source file ''{0}''.= 0) { foreDiameterFilterCheckBox.setSelected(preferences.isMatchForeDiameter()); @@ -274,8 +276,16 @@ public class ComponentPresetChooserDialog extends JDialog { /* * Add filter by aft diameter */ - aftDiameterFilterCheckBox = new JCheckBox(trans.get("ComponentPresetChooserDialog.checkbox.filterAftDiameter")); - final SymmetricComponent nextSym = curSym.getNextSymmetricComponent(); + final SymmetricComponent nextSym; + if (curSym instanceof NoseCone && ((NoseCone) curSym).isFlipped()) { + aftDiameterFilterCheckBox = new JCheckBox(trans.get("ComponentPresetChooserDialog.checkbox.filterForeDiameter")); + aftDiameterFilterCheckBox.setToolTipText(trans.get("ComponentPresetChooserDialog.checkbox.filterForeDiameter.ttip")); + nextSym = curSym.getPreviousSymmetricComponent(); + } else { + aftDiameterFilterCheckBox = new JCheckBox(trans.get("ComponentPresetChooserDialog.checkbox.filterAftDiameter")); + aftDiameterFilterCheckBox.setToolTipText(trans.get("ComponentPresetChooserDialog.checkbox.filterAftDiameter.ttip")); + nextSym = curSym.getNextSymmetricComponent(); + } if (nextSym != null && aftDiameterColumnIndex >= 0) { aftDiameterFilterCheckBox.setSelected(preferences.isMatchAftDiameter()); aftDiameterFilter = new ComponentPresetRowFilter(nextSym.getForeRadius() * 2.0, aftDiameterColumnIndex);