Rename clear preferences button
This commit is contained in:
parent
52b582db69
commit
c1145bf008
@ -1303,6 +1303,10 @@ StorageOptChooser.lbl.Saveopt = Save options
|
|||||||
TCMotorSelPan.lbl.Selrocketmotor = Select rocket motor:
|
TCMotorSelPan.lbl.Selrocketmotor = Select rocket motor:
|
||||||
TCMotorSelPan.checkbox.hideSimilar = Hide very similar thrust curves
|
TCMotorSelPan.checkbox.hideSimilar = Hide very similar thrust curves
|
||||||
TCMotorSelPan.checkbox.hideUsed = Hide motors already used in the mount
|
TCMotorSelPan.checkbox.hideUsed = Hide motors already used in the mount
|
||||||
|
TCMotorSelPan.lbl.motorNameColumn = Motor name column:
|
||||||
|
TCMotorSelPan.lbl.motorNameColumn.ttip = Select which motor property to display in the motor name column.
|
||||||
|
TCMotorSelPan.btn.commonName = Use common name
|
||||||
|
TCMotorSelPan.btn.designation = Use manufacturer's designation
|
||||||
TCMotorSelPan.lbl.nrOfMotors = Number of motors:
|
TCMotorSelPan.lbl.nrOfMotors = Number of motors:
|
||||||
TCMotorSelPan.lbl.ttip.nrOfMotors = Number of motors currently visible in the motor selection table
|
TCMotorSelPan.lbl.ttip.nrOfMotors = Number of motors currently visible in the motor selection table
|
||||||
TCMotorSelPan.checkbox.limitlength = Limit motor length to mount length
|
TCMotorSelPan.checkbox.limitlength = Limit motor length to mount length
|
||||||
@ -1695,8 +1699,7 @@ FlightEvent.Type.EXCEPTION = Exception
|
|||||||
|
|
||||||
! ThrustCurveMotorColumns
|
! ThrustCurveMotorColumns
|
||||||
TCurveMotorCol.MANUFACTURER = Manufacturer
|
TCurveMotorCol.MANUFACTURER = Manufacturer
|
||||||
TCurveMotorCol.COMMON_NAME = Name
|
TCurveMotorCol.NAME = Name
|
||||||
TCurveMotorCol.DESIGNATION = Designation
|
|
||||||
TCurveMotorCol.CASEINFO = Case
|
TCurveMotorCol.CASEINFO = Case
|
||||||
TCurveMotorCol.DIAMETER = Diameter
|
TCurveMotorCol.DIAMETER = Diameter
|
||||||
TCurveMotorCol.LENGTH = Length
|
TCurveMotorCol.LENGTH = Length
|
||||||
|
@ -1213,7 +1213,7 @@ FlightEvent.Type.ALTITUDE = Zmena v
|
|||||||
|
|
||||||
! ThrustCurveMotorColumns
|
! ThrustCurveMotorColumns
|
||||||
TCurveMotorCol.MANUFACTURER = Výrobce
|
TCurveMotorCol.MANUFACTURER = Výrobce
|
||||||
TCurveMotorCol.COMMON_NAME = Jméno
|
TCurveMotorCol.NAME = Jméno
|
||||||
! TCurveMotorCol.DESIGNATION = Pojmenování
|
! TCurveMotorCol.DESIGNATION = Pojmenování
|
||||||
TCurveMotorCol.TYPE = Druh
|
TCurveMotorCol.TYPE = Druh
|
||||||
TCurveMotorCol.DIAMETER = Prumer
|
TCurveMotorCol.DIAMETER = Prumer
|
||||||
|
@ -1273,7 +1273,7 @@ FlightEvent.Type.ALTITUDE = H
|
|||||||
|
|
||||||
! ThrustCurveMotorColumns
|
! ThrustCurveMotorColumns
|
||||||
TCurveMotorCol.MANUFACTURER = Hersteller
|
TCurveMotorCol.MANUFACTURER = Hersteller
|
||||||
TCurveMotorCol.COMMON_NAME = Name
|
TCurveMotorCol.NAME = Name
|
||||||
! TCurveMotorCol.DESIGNATION = Bezeichnung
|
! TCurveMotorCol.DESIGNATION = Bezeichnung
|
||||||
TCurveMotorCol.TYPE = Typ
|
TCurveMotorCol.TYPE = Typ
|
||||||
TCurveMotorCol.DIAMETER = Durchmesser
|
TCurveMotorCol.DIAMETER = Durchmesser
|
||||||
|
@ -1157,7 +1157,7 @@ TCurveMotor.ttip.maxThrust = Empuje m\u00e1ximo:
|
|||||||
TCurveMotor.ttip.totalImpulse = Impulso total:
|
TCurveMotor.ttip.totalImpulse = Impulso total:
|
||||||
|
|
||||||
! ThrustCurveMotorColumns
|
! ThrustCurveMotorColumns
|
||||||
TCurveMotorCol.COMMON_NAME = Nombre
|
TCurveMotorCol.NAME = Nombre
|
||||||
! TCurveMotorCol.DESIGNATION = Designaci\u00f3n
|
! TCurveMotorCol.DESIGNATION = Designaci\u00f3n
|
||||||
TCurveMotorCol.DIAMETER = Di\u00e1metro
|
TCurveMotorCol.DIAMETER = Di\u00e1metro
|
||||||
TCurveMotorCol.LENGTH = Longitud
|
TCurveMotorCol.LENGTH = Longitud
|
||||||
|
@ -1151,7 +1151,7 @@ TCurveMotor.ttip.maxThrust = Pouss\u00E9e Maximum:
|
|||||||
TCurveMotor.ttip.totalImpulse = Impulsion Totale:
|
TCurveMotor.ttip.totalImpulse = Impulsion Totale:
|
||||||
|
|
||||||
! ThrustCurveMotorColumns
|
! ThrustCurveMotorColumns
|
||||||
TCurveMotorCol.COMMON_NAME = Nom
|
TCurveMotorCol.NAME = Nom
|
||||||
! TCurveMotorCol.DESIGNATION = D\u00E9signation
|
! TCurveMotorCol.DESIGNATION = D\u00E9signation
|
||||||
TCurveMotorCol.DIAMETER = Diam\u00E8tre
|
TCurveMotorCol.DIAMETER = Diam\u00E8tre
|
||||||
TCurveMotorCol.LENGTH = Longueur
|
TCurveMotorCol.LENGTH = Longueur
|
||||||
|
@ -1276,7 +1276,7 @@ FlightEvent.Type.ALTITUDE = Cambio altitudine
|
|||||||
|
|
||||||
! ThrustCurveMotorColumns
|
! ThrustCurveMotorColumns
|
||||||
TCurveMotorCol.MANUFACTURER = Produttore
|
TCurveMotorCol.MANUFACTURER = Produttore
|
||||||
TCurveMotorCol.COMMON_NAME = Nome
|
TCurveMotorCol.NAME = Nome
|
||||||
! TCurveMotorCol.DESIGNATION = Classe
|
! TCurveMotorCol.DESIGNATION = Classe
|
||||||
TCurveMotorCol.TYPE = Tipo
|
TCurveMotorCol.TYPE = Tipo
|
||||||
TCurveMotorCol.DIAMETER = Diametro
|
TCurveMotorCol.DIAMETER = Diametro
|
||||||
|
@ -1325,7 +1325,7 @@ FlightEvent.Type.ALTITUDE = \u59FF\u52E2\u5909\u66F4
|
|||||||
! ThrustCurveMotorColumns
|
! ThrustCurveMotorColumns
|
||||||
TCurveMotorCol.MANUFACTURER = \u30E1\u30FC\u30AB\u30FC
|
TCurveMotorCol.MANUFACTURER = \u30E1\u30FC\u30AB\u30FC
|
||||||
! TCurveMotorCol.DESIGNATION = \u8A18\u53F7
|
! TCurveMotorCol.DESIGNATION = \u8A18\u53F7
|
||||||
TCurveMotorCol.COMMON_NAME = \u8A18\u53F7
|
TCurveMotorCol.NAME = \u8A18\u53F7
|
||||||
TCurveMotorCol.TYPE = \u30BF\u30A4\u30D7
|
TCurveMotorCol.TYPE = \u30BF\u30A4\u30D7
|
||||||
TCurveMotorCol.DIAMETER = \u76F4\u5F84
|
TCurveMotorCol.DIAMETER = \u76F4\u5F84
|
||||||
TCurveMotorCol.LENGTH = \u9577\u3055
|
TCurveMotorCol.LENGTH = \u9577\u3055
|
||||||
|
@ -1573,7 +1573,7 @@ FlightEvent.Type.EXCEPTION = Uitzondering
|
|||||||
|
|
||||||
! ThrustCurveMotorColumns
|
! ThrustCurveMotorColumns
|
||||||
TCurveMotorCol.MANUFACTURER = Fabrikant
|
TCurveMotorCol.MANUFACTURER = Fabrikant
|
||||||
TCurveMotorCol.COMMON_NAME = Naam
|
TCurveMotorCol.NAME = Naam
|
||||||
! TCurveMotorCol.DESIGNATION = Benaming
|
! TCurveMotorCol.DESIGNATION = Benaming
|
||||||
TCurveMotorCol.CASEINFO = Behuizing
|
TCurveMotorCol.CASEINFO = Behuizing
|
||||||
TCurveMotorCol.DIAMETER = Diameter
|
TCurveMotorCol.DIAMETER = Diameter
|
||||||
|
@ -1217,7 +1217,7 @@ update.dlg.latestVersion = Korzystasz z najnowszej wersji OpenRocket: %s.
|
|||||||
|
|
||||||
! ThrustCurveMotorColumns
|
! ThrustCurveMotorColumns
|
||||||
TCurveMotorCol.MANUFACTURER = Producent
|
TCurveMotorCol.MANUFACTURER = Producent
|
||||||
TCurveMotorCol.COMMON_NAME = Nazwa
|
TCurveMotorCol.NAME = Nazwa
|
||||||
! TCurveMotorCol.DESIGNATION = Oznaczenie
|
! TCurveMotorCol.DESIGNATION = Oznaczenie
|
||||||
TCurveMotorCol.TYPE = Typ
|
TCurveMotorCol.TYPE = Typ
|
||||||
TCurveMotorCol.DIAMETER = \u015Arednica
|
TCurveMotorCol.DIAMETER = \u015Arednica
|
||||||
|
@ -1117,7 +1117,7 @@ TCurveMotor.ttip.maxThrust = M\u00e1ximo de impulso:
|
|||||||
TCurveMotor.ttip.totalImpulse = Impulso total:
|
TCurveMotor.ttip.totalImpulse = Impulso total:
|
||||||
|
|
||||||
# ThrustCurveMotorColumns
|
# ThrustCurveMotorColumns
|
||||||
TCurveMotorCol.COMMON_NAME = Nome
|
TCurveMotorCol.NAME = Nome
|
||||||
! TCurveMotorCol.DESIGNATION = Designa\u00e7\u00e3o
|
! TCurveMotorCol.DESIGNATION = Designa\u00e7\u00e3o
|
||||||
TCurveMotorCol.DIAMETER = Di\u00e2metro
|
TCurveMotorCol.DIAMETER = Di\u00e2metro
|
||||||
TCurveMotorCol.LENGTH = Comprimento
|
TCurveMotorCol.LENGTH = Comprimento
|
||||||
|
@ -1696,7 +1696,7 @@ FlightEvent.Type.EXCEPTION = \u041E\u0448\u0438\u0431\u043A\u0430
|
|||||||
|
|
||||||
! ThrustCurveMotorColumns
|
! ThrustCurveMotorColumns
|
||||||
TCurveMotorCol.MANUFACTURER = \u041F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044C
|
TCurveMotorCol.MANUFACTURER = \u041F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044C
|
||||||
TCurveMotorCol.COMMON_NAME = \u041E\u0431\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435
|
TCurveMotorCol.NAME = \u041E\u0431\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435
|
||||||
TCurveMotorCol.CASEINFO = \u041A\u043E\u0440\u043F\u0443\u0441
|
TCurveMotorCol.CASEINFO = \u041A\u043E\u0440\u043F\u0443\u0441
|
||||||
TCurveMotorCol.TYPE = \u0422\u0438\u043F
|
TCurveMotorCol.TYPE = \u0422\u0438\u043F
|
||||||
TCurveMotorCol.DIAMETER = \u0414\u0438\u0430\u043C\u0435\u0442\u0440
|
TCurveMotorCol.DIAMETER = \u0414\u0438\u0430\u043C\u0435\u0442\u0440
|
||||||
|
@ -1421,7 +1421,7 @@ FlightEvent.Type.EXCEPTION = Exception
|
|||||||
|
|
||||||
! ThrustCurveMotorColumns
|
! ThrustCurveMotorColumns
|
||||||
TCurveMotorCol.MANUFACTURER = Manufacturer
|
TCurveMotorCol.MANUFACTURER = Manufacturer
|
||||||
TCurveMotorCol.COMMON_NAME = Name
|
TCurveMotorCol.NAME = Name
|
||||||
! TCurveMotorCol.DESIGNATION = Designation
|
! TCurveMotorCol.DESIGNATION = Designation
|
||||||
TCurveMotorCol.TYPE = Type
|
TCurveMotorCol.TYPE = Type
|
||||||
TCurveMotorCol.DIAMETER = Diameter
|
TCurveMotorCol.DIAMETER = Diameter
|
||||||
|
@ -1221,7 +1221,7 @@ TCurveMotor.ttip.maxThrust = \u6700\u5927\u63A8\u529B:
|
|||||||
TCurveMotor.ttip.totalImpulse = \u603B\u51B2\u529B:
|
TCurveMotor.ttip.totalImpulse = \u603B\u51B2\u529B:
|
||||||
|
|
||||||
! ThrustCurveMotorColumns
|
! ThrustCurveMotorColumns
|
||||||
TCurveMotorCol.COMMON_NAME = \u540D\u79F0
|
TCurveMotorCol.NAME = \u540D\u79F0
|
||||||
! TCurveMotorCol.DESIGNATION = \u540D\u79F0
|
! TCurveMotorCol.DESIGNATION = \u540D\u79F0
|
||||||
TCurveMotorCol.DIAMETER = \u76F4\u5F84
|
TCurveMotorCol.DIAMETER = \u76F4\u5F84
|
||||||
TCurveMotorCol.LENGTH = \u957F\u5EA6
|
TCurveMotorCol.LENGTH = \u957F\u5EA6
|
||||||
|
@ -65,6 +65,8 @@ public abstract class Preferences implements ChangeSource {
|
|||||||
public static final String MOTOR_HIDE_SIMILAR = "MotorHideSimilar";
|
public static final String MOTOR_HIDE_SIMILAR = "MotorHideSimilar";
|
||||||
public static final String MOTOR_HIDE_UNAVAILABLE = "MotorHideUnavailable";
|
public static final String MOTOR_HIDE_UNAVAILABLE = "MotorHideUnavailable";
|
||||||
|
|
||||||
|
public static final String MOTOR_NAME_COLUMN = "MotorNameColumn";
|
||||||
|
|
||||||
public static final String MATCH_FORE_DIAMETER = "MatchForeDiameter";
|
public static final String MATCH_FORE_DIAMETER = "MatchForeDiameter";
|
||||||
public static final String MATCH_AFT_DIAMETER = "MatchAftDiameter";
|
public static final String MATCH_AFT_DIAMETER = "MatchAftDiameter";
|
||||||
|
|
||||||
|
@ -223,6 +223,15 @@ public class MotorRowFilter extends RowFilter<TableModel, Integer> implements Ch
|
|||||||
continue main;
|
continue main;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure that you can search on both the common name, and designation
|
||||||
|
// Yes, there is some duplication here because the common name or designation is already checked in the previous loop
|
||||||
|
// but it's not worth checking that...
|
||||||
|
String common = m.getCommonName().toLowerCase(Locale.getDefault());
|
||||||
|
String designation = m.getDesignation().toLowerCase(Locale.getDefault());
|
||||||
|
if (common.contains(s) || designation.contains(s)) {
|
||||||
|
continue main;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -4,6 +4,7 @@ import java.text.Collator;
|
|||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
|
||||||
import net.sf.openrocket.database.motor.ThrustCurveMotorSet;
|
import net.sf.openrocket.database.motor.ThrustCurveMotorSet;
|
||||||
|
import net.sf.openrocket.gui.util.SwingPreferences;
|
||||||
import net.sf.openrocket.l10n.Translator;
|
import net.sf.openrocket.l10n.Translator;
|
||||||
import net.sf.openrocket.motor.DesignationComparator;
|
import net.sf.openrocket.motor.DesignationComparator;
|
||||||
import net.sf.openrocket.motor.ThrustCurveMotor;
|
import net.sf.openrocket.motor.ThrustCurveMotor;
|
||||||
@ -31,10 +32,14 @@ enum ThrustCurveMotorColumns {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
//// Common name
|
//// Common name
|
||||||
COMMON_NAME("TCurveMotorCol.COMMON_NAME") {
|
NAME("TCurveMotorCol.NAME") {
|
||||||
@Override
|
@Override
|
||||||
public String getValue(ThrustCurveMotorSet m) {
|
public String getValue(ThrustCurveMotorSet m) {
|
||||||
return m.getCommonName();
|
if (((SwingPreferences) Application.getPreferences()).getMotorNameColumn()) {
|
||||||
|
return m.getDesignation();
|
||||||
|
} else {
|
||||||
|
return m.getCommonName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -42,18 +47,6 @@ enum ThrustCurveMotorColumns {
|
|||||||
return new DesignationComparator();
|
return new DesignationComparator();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//// Designation
|
|
||||||
DESIGNATION("TCurveMotorCol.DESIGNATION") {
|
|
||||||
@Override
|
|
||||||
public String getValue(ThrustCurveMotorSet m) {
|
|
||||||
return m.getDesignation();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Comparator<?> getComparator() {
|
|
||||||
return new DesignationComparator();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//// TotalImpulse
|
//// TotalImpulse
|
||||||
TOTAL_IMPULSE("TCurveMotorCol.TOTAL_IMPULSE") {
|
TOTAL_IMPULSE("TCurveMotorCol.TOTAL_IMPULSE") {
|
||||||
@Override
|
@Override
|
||||||
|
@ -18,6 +18,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
|
|
||||||
|
import javax.swing.ButtonGroup;
|
||||||
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.DefaultComboBoxModel;
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
@ -25,6 +26,7 @@ import javax.swing.JComponent;
|
|||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JList;
|
import javax.swing.JList;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JRadioButton;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JSeparator;
|
import javax.swing.JSeparator;
|
||||||
import javax.swing.JTabbedPane;
|
import javax.swing.JTabbedPane;
|
||||||
@ -228,6 +230,39 @@ public class ThrustCurveMotorSelectionPanel extends JPanel implements MotorSelec
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//// Motor name column
|
||||||
|
{
|
||||||
|
JLabel motorNameColumn = new JLabel(trans.get("TCMotorSelPan.lbl.motorNameColumn"));
|
||||||
|
motorNameColumn.setToolTipText(trans.get("TCMotorSelPan.lbl.motorNameColumn.ttip"));
|
||||||
|
JRadioButton commonName = new JRadioButton(trans.get("TCMotorSelPan.btn.commonName"));
|
||||||
|
JRadioButton designation = new JRadioButton(trans.get("TCMotorSelPan.btn.designation"));
|
||||||
|
ButtonGroup bg = new ButtonGroup();
|
||||||
|
bg.add(commonName);
|
||||||
|
bg.add(designation);
|
||||||
|
commonName.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
((SwingPreferences) Application.getPreferences()).setMotorNameColumn(false);
|
||||||
|
model.fireTableDataChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
designation.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
((SwingPreferences) Application.getPreferences()).setMotorNameColumn(true);
|
||||||
|
model.fireTableDataChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
boolean initValue = ((SwingPreferences) Application.getPreferences()).getMotorNameColumn();
|
||||||
|
commonName.setSelected(!initValue);
|
||||||
|
designation.setSelected(initValue);
|
||||||
|
|
||||||
|
panel.add(motorNameColumn, "gapleft para");
|
||||||
|
panel.add(commonName);
|
||||||
|
panel.add(designation, "spanx, growx, wrap");
|
||||||
|
}
|
||||||
|
|
||||||
//// Motor selection table
|
//// Motor selection table
|
||||||
{
|
{
|
||||||
table = new JTable(model);
|
table = new JTable(model);
|
||||||
|
@ -331,7 +331,23 @@ public class SwingPreferences extends net.sf.openrocket.startup.Preferences {
|
|||||||
// TODO: MEDIUM: Motor fill color (settable?)
|
// TODO: MEDIUM: Motor fill color (settable?)
|
||||||
return new Color(0, 0, 0, 100);
|
return new Color(0, 0, 0, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether to display the common name (false), or designation (true) in the motor selection table "Name" column
|
||||||
|
* @return true to display designation, false to display common name
|
||||||
|
*/
|
||||||
|
public boolean getMotorNameColumn() {
|
||||||
|
return getBoolean(net.sf.openrocket.startup.Preferences.MOTOR_NAME_COLUMN, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set whether to display the common name, or designation in the motor selection table "Name" column
|
||||||
|
* @param value if true, display designation, if false, display common name
|
||||||
|
*/
|
||||||
|
public void setMotorNameColumn(boolean value) {
|
||||||
|
putBoolean(net.sf.openrocket.startup.Preferences.MOTOR_NAME_COLUMN, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static int getMaxThreadCount() {
|
public static int getMaxThreadCount() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user