import net.sf.openrocket.gui.adaptors.EnumModel;
import net.sf.openrocket.gui.adaptors.MaterialModel;
import net.sf.openrocket.gui.components.BasicSlider;
-import net.sf.openrocket.gui.components.ResizeLabel;
+import net.sf.openrocket.gui.components.HtmlLabel;
+import net.sf.openrocket.gui.components.StyledLabel;
import net.sf.openrocket.gui.components.UnitSelector;
+import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.material.Material;
import net.sf.openrocket.rocketcomponent.MassComponent;
import net.sf.openrocket.rocketcomponent.RocketComponent;
import net.sf.openrocket.rocketcomponent.MotorMount.IgnitionEvent;
+import net.sf.openrocket.startup.Application;
import net.sf.openrocket.unit.UnitGroup;
public class StreamerConfig extends RecoveryDeviceConfig {
-
+ private static final Translator trans = Application.getTranslator();
+
public StreamerConfig(final RocketComponent component) {
super(component);
JPanel panel = new JPanel(new MigLayout("gap rel unrel","[][65lp::][30lp::][]",""));
-
- panel.add(new JLabel("Strip length:"));
+ //// Strip length:
+ panel.add(new JLabel(trans.get("StreamerCfg.lbl.Striplength")));
DoubleModel m = new DoubleModel(component,"StripLength",UnitGroup.UNITS_LENGTH,0);
panel.add(new UnitSelector(m),"growx");
panel.add(new BasicSlider(m.getSliderModel(0, 0.6, 1.5)),"w 100lp, wrap");
-
- panel.add(new JLabel("Strip width:"));
+ //// Strip width:
+ panel.add(new JLabel(trans.get("StreamerCfg.lbl.Stripwidth")));
m = new DoubleModel(component,"StripWidth",UnitGroup.UNITS_LENGTH,0);
-
- panel.add(new JLabel("Strip area:"));
+ //// Strip area:
+ panel.add(new JLabel(trans.get("StreamerCfg.lbl.Striparea")));
m = new DoubleModel(component,"Area",UnitGroup.UNITS_AREA,0);
panel.add(new UnitSelector(m),"growx");
panel.add(new BasicSlider(m.getSliderModel(0, 0.04, 0.25)),"w 100lp, wrap");
-
- panel.add(new JLabel("Aspect ratio:"));
+ //// Aspect ratio:
+ panel.add(new JLabel(trans.get("StreamerCfg.lbl.Aspectratio")));
m = new DoubleModel(component,"AspectRatio",UnitGroup.UNITS_NONE,0);
panel.add(new BasicSlider(m.getSliderModel(2, 15)),"skip, w 100lp, wrap 20lp");
-
- panel.add(new JLabel("Material:"));
+ //// Material:
+ panel.add(new JLabel(trans.get("StreamerCfg.lbl.Material")));
JComboBox combo = new JComboBox(new MaterialModel(panel, component,
Material.Type.SURFACE));
- combo.setToolTipText("The component material affects the weight of the component.");
+ //// The component material affects the weight of the component.
+ combo.setToolTipText(trans.get("StreamerCfg.combo.ttip.MaterialModel"));
panel.add(combo,"spanx 3, growx, wrap 20lp");
// CD
- JLabel label = new JLabel("<html>Drag coefficient C<sub>D</sub>:");
- String tip = "<html>The drag coefficient relative to the total area of the streamer.<br>" +
- "A larger drag coefficient yields a slowed descent rate.";
+ //// <html>Drag coefficient C<sub>D</sub>:
+ JLabel label = new HtmlLabel(trans.get("StreamerCfg.lbl.longA1"));
+ //// <html>The drag coefficient relative to the total area of the streamer.<br>
+ String tip = trans.get("StreamerCfg.lbl.longB1") +
+ //// "A larger drag coefficient yields a slowed descent rate.
+ trans.get("StreamerCfg.lbl.longB2");
label.setToolTipText(tip);
panel.add(label);
panel.add(spin,"growx");
JCheckBox check = new JCheckBox(m.getAutomaticAction());
- check.setText("Automatic");
+ //// Automatic
+ check.setText(trans.get("StreamerCfg.lbl.Automatic"));
panel.add(check,"skip, span, wrap");
- panel.add(new ResizeLabel("The drag coefficient is relative to the area of the streamer.",
+ //// The drag coefficient is relative to the area of the streamer.
+ panel.add(new StyledLabel(trans.get("StreamerCfg.lbl.longC1"),
-2), "span, wrap");
//// Position
-
- panel.add(new JLabel("Position relative to:"));
+ //// Position relative to:
+ panel.add(new JLabel(trans.get("StreamerCfg.lbl.Posrelativeto")));
combo = new JComboBox(
new EnumModel<RocketComponent.Position>(component, "RelativePosition",
}));
panel.add(combo,"spanx, growx, wrap");
- panel.add(new JLabel("plus"),"right");
+ //// plus
+ panel.add(new JLabel(trans.get("StreamerCfg.lbl.plus")),"right");
m = new DoubleModel(component,"PositionValue",UnitGroup.UNITS_LENGTH);
spin = new JSpinner(m.getSpinnerModel());
"w 100lp, wrap");
- //// Spatial length
- panel.add(new JLabel("Packed length:"));
+ //// Spatial length:
+ panel.add(new JLabel(trans.get("StreamerCfg.lbl.Packedlength")));
m = new DoubleModel(component,"Length",UnitGroup.UNITS_LENGTH,0);
//// Tube diameter
- panel.add(new JLabel("Packed diameter:"));
+ //// Packed diameter:
+ panel.add(new JLabel(trans.get("StreamerCfg.lbl.Packeddiam")));
DoubleModel od = new DoubleModel(component,"Radius",2,UnitGroup.UNITS_LENGTH,0);
// Diameter = 2*Radius
//// Deployment
-
- panel.add(new JLabel("Deploys at:"),"");
+ //// Deploys at:
+ panel.add(new JLabel(trans.get("StreamerCfg.lbl.Deploysat")),"");
combo = new JComboBox(new EnumModel<IgnitionEvent>(component, "DeployEvent"));
panel.add(combo,"spanx 3, growx, wrap");
// ... and delay
- panel.add(new JLabel("plus"),"right");
+ //// plus
+ panel.add(new JLabel(trans.get("StreamerCfg.lbl.plus")),"right");
m = new DoubleModel(component,"DeployDelay",0);
spin = new JSpinner(m.getSpinnerModel());
spin.setEditor(new SpinnerEditor(spin));
panel.add(spin,"spanx, split");
- panel.add(new JLabel("seconds"),"wrap paragraph");
+ //// seconds
+ panel.add(new JLabel(trans.get("StreamerCfg.lbl.seconds")),"wrap paragraph");
- // Altitude
- label = new JLabel("Altitude:");
+ // Altitude:
+ label = new JLabel(trans.get("StreamerCfg.lbl.Altitude"));
altitudeComponents.add(label);
panel.add(label);
primary.add(panel, "grow");
updateFields();
-
- tabbedPane.insertTab("General", null, primary, "General properties", 0);
- tabbedPane.insertTab("Radial position", null, positionTab(),
- "Radial position configuration", 1);
+
+ //// General and General properties
+ tabbedPane.insertTab(trans.get("StreamerCfg.tab.General"), null, primary,
+ trans.get("StreamerCfg.tab.ttip.General"), 0);
+ //// Radial position and Radial position configuration
+ tabbedPane.insertTab(trans.get("StreamerCfg.tab.Radialpos"), null, positionTab(),
+ trans.get("StreamerCfg.tab.ttip.Radialpos"), 1);
tabbedPane.setSelectedIndex(0);
}
JPanel panel = new JPanel(new MigLayout("gap rel unrel","[][65lp::][30lp::]",""));
//// Radial position
- panel.add(new JLabel("Radial distance:"));
+ //// Radial distance:
+ panel.add(new JLabel(trans.get("StreamerCfg.lbl.Radialdistance")));
DoubleModel m = new DoubleModel(component,"RadialPosition",UnitGroup.UNITS_LENGTH,0);
//// Radial direction
- panel.add(new JLabel("Radial direction:"));
+ //// Radial direction:
+ panel.add(new JLabel(trans.get("StreamerCfg.lbl.Radialdirection")));
m = new DoubleModel(component,"RadialDirection",UnitGroup.UNITS_ANGLE,0);
//// Reset button
- JButton button = new JButton("Reset");
+ JButton button = new JButton(trans.get("StreamerCfg.but.Reset"));
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {