diff --git a/core/.settings/org.eclipse.jdt.core.prefs b/core/.settings/org.eclipse.jdt.core.prefs
index b2bf28c08..7008edd88 100644
--- a/core/.settings/org.eclipse.jdt.core.prefs
+++ b/core/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -70,7 +71,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/core/build.xml b/core/build.xml
index bc94e848c..8d4ccb82b 100644
--- a/core/build.xml
+++ b/core/build.xml
@@ -55,7 +55,7 @@
Compiling main classes
-
+
diff --git a/core/resources/l10n/messages.properties b/core/resources/l10n/messages.properties
index 2a8eb17b6..d05069199 100644
--- a/core/resources/l10n/messages.properties
+++ b/core/resources/l10n/messages.properties
@@ -1117,6 +1117,13 @@ TrapezoidFinSetCfg.lbl.plus = plus
TrapezoidFinSetCfg.tab.General = General
TrapezoidFinSetCfg.tab.Generalproperties = General properties
+! Fin Fillets
+FinSetCfg.lbl.Finfilletmaterial = Fillet material:
+FinSetCfg.lbl.Filletradius = Fillet radius:
+FinsetCfg.ttip.Finfillets1 = Adds the predicted mass of fin fillets to the root of the fins.
+FinsetCfg.ttip.Finfillets2 = Assumes the fillet is concave and tangent to the body tube and fin.
+FinsetCfg.ttip.Finfillets3 = Zero radius will give no fillet.
+
! StorageOptionChooser
StorageOptChooser.lbl.Simdatatostore = Simulated data to store:
StorageOptChooser.rdbut.Allsimdata = All simulated data
diff --git a/core/src/net/sf/openrocket/file/openrocket/importt/DocumentConfig.java b/core/src/net/sf/openrocket/file/openrocket/importt/DocumentConfig.java
index 5cc77bd01..4734ddffb 100644
--- a/core/src/net/sf/openrocket/file/openrocket/importt/DocumentConfig.java
+++ b/core/src/net/sf/openrocket/file/openrocket/importt/DocumentConfig.java
@@ -207,7 +207,11 @@ class DocumentConfig {
setters.put("FinSet:tablength", new DoubleSetter(
Reflection.findMethod(FinSet.class, "setTabLength", double.class)));
setters.put("FinSet:tabposition", new FinTabPositionSetter());
-
+ setters.put("FinSet:filletradius", new DoubleSetter(
+ Reflection.findMethod(FinSet.class, "setFilletRadius", double.class)));
+ setters.put("FinSet:filletmaterial", new MaterialSetter(
+ Reflection.findMethod(FinSet.class, "setFilletMaterial", Material.class),
+ Material.Type.BULK));
// TrapezoidFinSet
setters.put("TrapezoidFinSet:rootchord", new DoubleSetter(
Reflection.findMethod(TrapezoidFinSet.class, "setRootChord", double.class)));
diff --git a/core/src/net/sf/openrocket/file/openrocket/savers/FinSetSaver.java b/core/src/net/sf/openrocket/file/openrocket/savers/FinSetSaver.java
index 7eaffc693..30e321f40 100644
--- a/core/src/net/sf/openrocket/file/openrocket/savers/FinSetSaver.java
+++ b/core/src/net/sf/openrocket/file/openrocket/savers/FinSetSaver.java
@@ -30,6 +30,9 @@ public class FinSetSaver extends ExternalComponentSaver {
fins.getTabShift() + "");
}
+
+ elements.add("" + fins.getFilletRadius() + "");
+ elements.add(materialParam("filletmaterial", fins.getFilletMaterial()));
}
}
diff --git a/core/src/net/sf/openrocket/rocketcomponent/FinSet.java b/core/src/net/sf/openrocket/rocketcomponent/FinSet.java
index 55cf23095..dfa6c64b0 100644
--- a/core/src/net/sf/openrocket/rocketcomponent/FinSet.java
+++ b/core/src/net/sf/openrocket/rocketcomponent/FinSet.java
@@ -5,6 +5,7 @@ import java.util.Collection;
import java.util.List;
import net.sf.openrocket.l10n.Translator;
+import net.sf.openrocket.material.Material;
import net.sf.openrocket.startup.Application;
import net.sf.openrocket.util.ArrayUtils;
import net.sf.openrocket.util.Coordinate;
@@ -15,6 +16,7 @@ import net.sf.openrocket.util.Transformation;
public abstract class FinSet extends ExternalComponent {
private static final Translator trans = Application.getTranslator();
+
/**
* Maximum allowed cant of fins.
*/
@@ -87,7 +89,7 @@ public abstract class FinSet extends ExternalComponent {
*/
protected Transformation baseRotation = Transformation.rotate_x(rotation);
-
+
/**
* Cant angle of fins.
*/
@@ -96,19 +98,19 @@ public abstract class FinSet extends ExternalComponent {
/* Cached value: */
private Transformation cantRotation = null;
-
+
/**
* Thickness of the fins.
*/
protected double thickness = 0.003;
-
+
/**
* The cross-section shape of the fins.
*/
protected CrossSection crossSection = CrossSection.SQUARE;
-
+
/*
* Fin tab properties.
*/
@@ -117,7 +119,14 @@ public abstract class FinSet extends ExternalComponent {
private double tabShift = 0;
private TabRelativePosition tabRelativePosition = TabRelativePosition.CENTER;
-
+ /*
+ * Fin fillet properties
+ */
+
+ protected Material filletMaterial = null;
+ protected double filletRadius = 0;
+ protected double filletCenterY = 0;
+
// Cached fin area & CG. Validity of both must be checked using finArea!
// Fin area does not include fin tabs, CG does.
private double finArea = -1;
@@ -132,10 +141,11 @@ public abstract class FinSet extends ExternalComponent {
*/
public FinSet() {
super(RocketComponent.Position.BOTTOM);
+ this.filletMaterial = Application.getPreferences().getDefaultComponentMaterial(this.getClass(), Material.Type.BULK);
}
-
+
/**
* Return the number of fins in the set.
* @return The number of fins.
@@ -190,7 +200,7 @@ public abstract class FinSet extends ExternalComponent {
}
-
+
public double getCantAngle() {
return cantAngle;
}
@@ -219,7 +229,7 @@ public abstract class FinSet extends ExternalComponent {
}
-
+
public double getThickness() {
return thickness;
}
@@ -244,9 +254,9 @@ public abstract class FinSet extends ExternalComponent {
}
-
-
-
+
+
+
@Override
public void setRelativePosition(RocketComponent.Position position) {
super.setRelativePosition(position);
@@ -261,8 +271,8 @@ public abstract class FinSet extends ExternalComponent {
}
-
-
+
+
public double getTabHeight() {
return tabHeight;
}
@@ -307,7 +317,7 @@ public abstract class FinSet extends ExternalComponent {
if (this.tabRelativePosition == position)
return;
-
+
double front = getTabFrontEdge();
switch (position) {
case FRONT:
@@ -369,8 +379,8 @@ public abstract class FinSet extends ExternalComponent {
}
-
-
+
+
/////////// Calculation methods ///////////
/**
@@ -401,29 +411,82 @@ public abstract class FinSet extends ExternalComponent {
}
-
+ @Override
+ public double getComponentMass() {
+ return getFilletMass() + getFinMass();
+ }
+
+ public double getFinMass() {
+ return getComponentVolume() * material.getDensity();
+ }
+
+ public double getFilletMass() {
+ return getFilletVolume() * filletMaterial.getDensity();
+ }
+
+
@Override
public double getComponentVolume() {
+ // this is for the fins alone, fillets are taken care of separately.
return fins * (getFinArea() + tabHeight * tabLength) * thickness *
crossSection.getRelativeVolume();
}
+
@Override
public Coordinate getComponentCG() {
if (finArea < 0)
calculateAreaCG();
- double mass = getComponentMass(); // safe
+ double mass = getFinMass();
+ double filletMass = getFilletMass();
+ double filletCenter = length / 2;
+
+ double newCGx = (filletCenter * filletMass + finCGx * mass) / (filletMass + mass);
+
+ // FilletRadius/5 is a good estimate for where the vertical centroid of the fillet
+ // is. Finding the actual position is very involved and won't make a huge difference.
+ double newCGy = (filletRadius / 5 * filletMass + finCGy * mass) / (filletMass + mass);
if (fins == 1) {
return baseRotation.transform(
- new Coordinate(finCGx, finCGy + getBodyRadius(), 0, mass));
+ new Coordinate(finCGx, finCGy + getBodyRadius(), 0, (filletMass + mass)));
} else {
- return new Coordinate(finCGx, 0, 0, mass);
+ return new Coordinate(finCGx, 0, 0, (filletMass + mass));
}
}
+ public double getFilletVolume() {
+ /*
+ * Here is how the volume of the fillet is found. It assumes a circular concave
+ * fillet tangent to the fin and the body tube.
+ *
+ * 1. Form a triangle with vertices at the BT center, the tangent point between
+ * the fillet and the fin, and the center of the fillet radius.
+ * 2. The line between the center of the BT and the center of the fillet radius
+ * will pass through the tangent point between the fillet and the BT.
+ * 3. Find the area of the triangle, then subtract the portion of the BT and
+ * fillet that is in that triangle. (angle/2PI * pi*r^2= angle/2 * r^2)
+ * 4. Multiply the remaining area by the length.
+ * 5. Return twice that since there is a fillet on each side of the fin.
+ *
+ */
+ double btRadius = 1000.0; // assume a really big body tube if we can't get the radius,
+ RocketComponent c = this.getParent();
+ if (BodyTube.class.isInstance(c)) {
+ btRadius = ((BodyTube) c).getOuterRadius();
+ }
+ double totalRad = filletRadius + btRadius;
+ double innerAngle = Math.asin(filletRadius / totalRad);
+ double outerAngle = Math.acos(filletRadius / totalRad);
+
+ double outerArea = Math.tan(outerAngle) * filletRadius * filletRadius / 2;
+ double filletVolume = length * (outerArea
+ - outerAngle * filletRadius * filletRadius / 2
+ - innerAngle * btRadius * btRadius / 2);
+ return 2 * filletVolume;
+ }
private void calculateAreaCG() {
Coordinate[] points = this.getFinPoints();
@@ -594,7 +657,7 @@ public abstract class FinSet extends ExternalComponent {
}
-
+
@Override
public void componentChanged(ComponentChangeEvent e) {
if (e.isAerodynamicChange()) {
@@ -641,8 +704,8 @@ public abstract class FinSet extends ExternalComponent {
}
-
-
+
+
/**
* Return a list of coordinates defining the geometry of a single fin.
* The coordinates are the XY-coordinates of points defining the shape of a single fin,
@@ -686,12 +749,12 @@ public abstract class FinSet extends ExternalComponent {
points[n++] = new Coordinate(x1, y);
if (add1)
points[n++] = new Coordinate(x1, 0);
-
+
return points;
}
-
+
/**
* Get the span of a single fin. That is, the length from the root to the tip of the fin.
* @return Span of a single fin.
@@ -717,4 +780,38 @@ public abstract class FinSet extends ExternalComponent {
return super.copyFrom(c);
}
+
+ /*
+ * Handle fin fillet mass properties
+ */
+
+ public Material getFilletMaterial() {
+ return filletMaterial;
+ }
+
+ public void setFilletMaterial(Material mat) {
+ if (mat.getType() != Material.Type.BULK) {
+ throw new IllegalArgumentException("ExternalComponent requires a bulk material" +
+ " type=" + mat.getType());
+ }
+
+ if (filletMaterial.equals(mat))
+ return;
+ filletMaterial = mat;
+ clearPreset();
+ fireComponentChangeEvent(ComponentChangeEvent.MASS_CHANGE);
+ }
+
+ public double getFilletRadius() {
+ return filletRadius;
+ }
+
+ public void setFilletRadius(double r) {
+ if (MathUtil.equals(filletRadius, r))
+ return;
+ filletRadius = r;
+ clearPreset();
+ fireComponentChangeEvent(ComponentChangeEvent.MASS_CHANGE);
+ }
+
}
diff --git a/swing/.settings/org.eclipse.jdt.core.prefs b/swing/.settings/org.eclipse.jdt.core.prefs
index 16438c33d..790bdcb1e 100644
--- a/swing/.settings/org.eclipse.jdt.core.prefs
+++ b/swing/.settings/org.eclipse.jdt.core.prefs
@@ -6,9 +6,10 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annota
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -43,7 +44,7 @@ org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
@@ -96,4 +97,4 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/swing/build.xml b/swing/build.xml
index 9ea6df315..d6c4f9d10 100644
--- a/swing/build.xml
+++ b/swing/build.xml
@@ -71,7 +71,7 @@
Compiling main classes
-
+
diff --git a/swing/src/net/sf/openrocket/gui/adaptors/MaterialModel.java b/swing/src/net/sf/openrocket/gui/adaptors/MaterialModel.java
index b0b83dbc5..f4f6ba95f 100644
--- a/swing/src/net/sf/openrocket/gui/adaptors/MaterialModel.java
+++ b/swing/src/net/sf/openrocket/gui/adaptors/MaterialModel.java
@@ -25,9 +25,9 @@ public class MaterialModel extends AbstractListModel implements
private final String custom;
- private final Component parentComponent;
+ private final Component parentUIComponent;
- private final RocketComponent component;
+ private final RocketComponent rocketComponent;
private final Material.Type type;
private final Database database;
@@ -44,8 +44,8 @@ public class MaterialModel extends AbstractListModel implements
public MaterialModel(Component parent, RocketComponent component, Material.Type type,
String name) {
- this.parentComponent = parent;
- this.component = component;
+ this.parentUIComponent = parent;
+ this.rocketComponent = component;
this.type = type;
this.custom = trans.get ("Material.CUSTOM");
@@ -81,7 +81,7 @@ public class MaterialModel extends AbstractListModel implements
@Override
public Object getSelectedItem() {
- return getMethod.invoke(component);
+ return getMethod.invoke(rocketComponent);
}
@Override
@@ -98,7 +98,7 @@ public class MaterialModel extends AbstractListModel implements
@Override
public void run() {
CustomMaterialDialog dialog = new CustomMaterialDialog(
- SwingUtilities.getWindowAncestor(parentComponent),
+ SwingUtilities.getWindowAncestor(parentUIComponent),
(Material) getSelectedItem(), true,
//// Define custom material
trans.get("MaterialModel.title.Defcustmat"));
@@ -109,7 +109,7 @@ public class MaterialModel extends AbstractListModel implements
return;
Material material = dialog.getMaterial();
- setMethod.invoke(component, material);
+ setMethod.invoke(rocketComponent, material);
if (dialog.isAddSelected()) {
database.add(material);
@@ -119,7 +119,7 @@ public class MaterialModel extends AbstractListModel implements
} else if (item instanceof Material) {
- setMethod.invoke(component, item);
+ setMethod.invoke(rocketComponent, item);
} else {
throw new IllegalArgumentException("Illegal item class " + item.getClass() +
diff --git a/swing/src/net/sf/openrocket/gui/configdialog/BodyTubeConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/BodyTubeConfig.java
index e490c23a0..51bf75e93 100644
--- a/swing/src/net/sf/openrocket/gui/configdialog/BodyTubeConfig.java
+++ b/swing/src/net/sf/openrocket/gui/configdialog/BodyTubeConfig.java
@@ -98,7 +98,7 @@ public class BodyTubeConfig extends RocketComponentConfig {
panel.add(check, "skip, span 2, wrap");
//// Material
- panel.add(materialPanel(new JPanel(new MigLayout()), Material.Type.BULK),
+ panel.add(materialPanel(Material.Type.BULK),
"cell 4 0, gapleft paragraph, aligny 0%, spany");
//// General and General properties
diff --git a/swing/src/net/sf/openrocket/gui/configdialog/EllipticalFinSetConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/EllipticalFinSetConfig.java
index 7f9857253..509ba867e 100644
--- a/swing/src/net/sf/openrocket/gui/configdialog/EllipticalFinSetConfig.java
+++ b/swing/src/net/sf/openrocket/gui/configdialog/EllipticalFinSetConfig.java
@@ -170,9 +170,10 @@ public class EllipticalFinSetConfig extends FinSetConfig {
//// Material
- materialPanel(panel, Material.Type.BULK);
-
+ panel.add(materialPanel(Material.Type.BULK), "span, wrap");
+ panel.add(filletMaterialPanel(), "span, wrap");
+
diff --git a/swing/src/net/sf/openrocket/gui/configdialog/FinSetConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/FinSetConfig.java
index a68824d67..91a1a751f 100644
--- a/swing/src/net/sf/openrocket/gui/configdialog/FinSetConfig.java
+++ b/swing/src/net/sf/openrocket/gui/configdialog/FinSetConfig.java
@@ -1,16 +1,34 @@
package net.sf.openrocket.gui.configdialog;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSpinner;
+import javax.swing.SwingUtilities;
+
import net.miginfocom.swing.MigLayout;
import net.sf.openrocket.document.OpenRocketDocument;
import net.sf.openrocket.gui.SpinnerEditor;
import net.sf.openrocket.gui.adaptors.DoubleModel;
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.StyledLabel;
import net.sf.openrocket.gui.components.StyledLabel.Style;
import net.sf.openrocket.gui.components.UnitSelector;
import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.logging.Markers;
+import net.sf.openrocket.material.Material;
import net.sf.openrocket.rocketcomponent.CenteringRing;
import net.sf.openrocket.rocketcomponent.Coaxial;
import net.sf.openrocket.rocketcomponent.FinSet;
@@ -20,19 +38,9 @@ import net.sf.openrocket.rocketcomponent.RocketComponent;
import net.sf.openrocket.startup.Application;
import net.sf.openrocket.unit.UnitGroup;
-import javax.swing.*;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-
public abstract class FinSetConfig extends RocketComponentConfig {
private static final Logger log = LoggerFactory.getLogger(FinSetConfig.class);
@@ -469,4 +477,40 @@ public abstract class FinSetConfig extends RocketComponentConfig {
return positionFromTop;
}
}
+
+ protected JPanel filletMaterialPanel(){
+
+ JPanel filletPanel=new JPanel(new MigLayout("", "[][65lp::][30lp::]"));
+ String tip = trans.get("FinsetCfg.ttip.Finfillets1") +
+ trans.get("FinsetCfg.ttip.Finfillets2") +
+ trans.get("FinsetCfg.ttip.Finfillets3");
+ filletPanel.setBorder(BorderFactory.createTitledBorder("Root Fillets"));
+ filletPanel.add(new JLabel(trans.get("FinSetCfg.lbl.Filletradius")));
+
+ DoubleModel m = new DoubleModel(component, "FilletRadius", UnitGroup.UNITS_LENGTH, 0);
+
+ JSpinner spin = new JSpinner(m.getSpinnerModel());
+ spin.setEditor(new SpinnerEditor(spin));
+ spin.setToolTipText(tip);
+ filletPanel.add(spin, "growx, w 40");
+ UnitSelector us = new UnitSelector(m);
+ filletPanel.add(us, "growx");
+ us.setToolTipText(tip);
+ BasicSlider bs =new BasicSlider(m.getSliderModel(0, 10));
+ filletPanel.add(bs, "w 100lp, wrap para");
+ bs.setToolTipText(tip);
+
+ JLabel label = new JLabel(trans.get("FinSetCfg.lbl.Finfilletmaterial"));
+ label.setToolTipText(tip);
+ //// The component material affects the weight of the component.
+ label.setToolTipText(trans.get("RocketCompCfg.lbl.ttip.componentmaterialaffects"));
+ filletPanel.add(label, "spanx 4, wrap rel");
+
+ JComboBox combo = new JComboBox(new MaterialModel(filletPanel, component, Material.Type.BULK, "FilletMaterial"));
+ //// The component material affects the weight of the component.
+ combo.setToolTipText(trans.get("RocketCompCfg.combo.ttip.componentmaterialaffects"));
+ filletPanel.add(combo, "spanx 4, growx, wrap paragraph");
+ filletPanel.setToolTipText(tip);
+ return filletPanel;
+ }
}
diff --git a/swing/src/net/sf/openrocket/gui/configdialog/FreeformFinSetConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/FreeformFinSetConfig.java
index 348ac4f82..1fd28b2ff 100644
--- a/swing/src/net/sf/openrocket/gui/configdialog/FreeformFinSetConfig.java
+++ b/swing/src/net/sf/openrocket/gui/configdialog/FreeformFinSetConfig.java
@@ -24,9 +24,6 @@ import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.table.AbstractTableModel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import net.miginfocom.swing.MigLayout;
import net.sf.openrocket.document.OpenRocketDocument;
import net.sf.openrocket.gui.SpinnerEditor;
@@ -55,6 +52,9 @@ import net.sf.openrocket.startup.Application;
import net.sf.openrocket.unit.UnitGroup;
import net.sf.openrocket.util.Coordinate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
public class FreeformFinSetConfig extends FinSetConfig {
private static final Logger log = LoggerFactory.getLogger(FreeformFinSetConfig.class);
@@ -187,9 +187,10 @@ public class FreeformFinSetConfig extends FinSetConfig {
//// Material
- materialPanel(panel, Material.Type.BULK);
-
+ panel.add(materialPanel(Material.Type.BULK), "span, wrap");
+ panel.add(filletMaterialPanel(), "span, wrap");
+
mainPanel.add(panel, "aligny 20%");
diff --git a/swing/src/net/sf/openrocket/gui/configdialog/InnerTubeConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/InnerTubeConfig.java
index 338feb38c..614785ef4 100644
--- a/swing/src/net/sf/openrocket/gui/configdialog/InnerTubeConfig.java
+++ b/swing/src/net/sf/openrocket/gui/configdialog/InnerTubeConfig.java
@@ -168,7 +168,7 @@ public class InnerTubeConfig extends RocketComponentConfig {
"w 100lp, wrap");
//// Material
- panel.add(materialPanel(new JPanel(new MigLayout()), Material.Type.BULK),
+ panel.add(materialPanel(Material.Type.BULK),
"cell 4 0, gapleft paragraph, aligny 0%, spany");
tabbedPane.insertTab(trans.get("ThicknessRingCompCfg.tab.General"), null, panel,
diff --git a/swing/src/net/sf/openrocket/gui/configdialog/LaunchLugConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/LaunchLugConfig.java
index 6f6ff0a32..3f482f2f4 100644
--- a/swing/src/net/sf/openrocket/gui/configdialog/LaunchLugConfig.java
+++ b/swing/src/net/sf/openrocket/gui/configdialog/LaunchLugConfig.java
@@ -140,7 +140,7 @@ public class LaunchLugConfig extends RocketComponentConfig {
//// Material
- materialPanel(panel, Material.Type.BULK);
+ panel.add(materialPanel( Material.Type.BULK), "span, wrap");
primary.add(panel, "grow");
diff --git a/swing/src/net/sf/openrocket/gui/configdialog/NoseConeConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/NoseConeConfig.java
index e27ee6189..e57fdd900 100644
--- a/swing/src/net/sf/openrocket/gui/configdialog/NoseConeConfig.java
+++ b/swing/src/net/sf/openrocket/gui/configdialog/NoseConeConfig.java
@@ -155,7 +155,7 @@ public class NoseConeConfig extends RocketComponentConfig {
//// Material
- materialPanel(panel2, Material.Type.BULK);
+ panel2.add(materialPanel( Material.Type.BULK), "span, wrap");
panel.add(panel2, "cell 4 0, gapleft paragraph, aligny 0%, spany");
diff --git a/swing/src/net/sf/openrocket/gui/configdialog/RingComponentConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/RingComponentConfig.java
index 10b6e8483..df5267405 100644
--- a/swing/src/net/sf/openrocket/gui/configdialog/RingComponentConfig.java
+++ b/swing/src/net/sf/openrocket/gui/configdialog/RingComponentConfig.java
@@ -152,7 +152,7 @@ public class RingComponentConfig extends RocketComponentConfig {
//// Material
- JPanel sub = materialPanel(new JPanel(new MigLayout()), Material.Type.BULK);
+ JPanel sub = materialPanel( Material.Type.BULK);
if (component instanceof EngineBlock) {
final DescriptionArea desc = new DescriptionArea(6);
diff --git a/swing/src/net/sf/openrocket/gui/configdialog/RocketComponentConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/RocketComponentConfig.java
index dea61a680..30142f4cc 100644
--- a/swing/src/net/sf/openrocket/gui/configdialog/RocketComponentConfig.java
+++ b/swing/src/net/sf/openrocket/gui/configdialog/RocketComponentConfig.java
@@ -196,24 +196,34 @@ public class RocketComponentConfig extends JPanel {
}
- protected JPanel materialPanel(JPanel panel, Material.Type type) {
+ protected JPanel materialPanel(Material.Type type) {
////Component material: and Component finish:
- return materialPanel(panel, type, trans.get("RocketCompCfg.lbl.Componentmaterial"),
- trans.get("RocketCompCfg.lbl.Componentfinish"));
+ return materialPanel(type,
+ trans.get("RocketCompCfg.lbl.Componentmaterial"),
+ trans.get("RocketCompCfg.lbl.Componentfinish"),
+ "Material");
}
- protected JPanel materialPanel(JPanel panel, Material.Type type,
- String materialString, String finishString) {
+ protected JPanel materialPanel(Material.Type type, String partName){
+ return materialPanel(type, trans.get("RocketCompCfg.lbl.Componentmaterial"),
+ trans.get("RocketCompCfg.lbl.Componentfinish"), partName);
+ }
+
+ protected JPanel materialPanel(Material.Type type,
+ String materialString,
+ String finishString,
+ String partName) {
- JLabel label = new JLabel(materialString);
+ JPanel subPanel = new JPanel(new MigLayout());
+ JLabel label = new JLabel(materialString);
//// The component material affects the weight of the component.
label.setToolTipText(trans.get("RocketCompCfg.lbl.ttip.componentmaterialaffects"));
- panel.add(label, "spanx 4, wrap rel");
+ subPanel.add(label, "spanx 4, wrap rel");
- JComboBox combo = new JComboBox(new MaterialModel(panel, component, type));
+ JComboBox combo = new JComboBox(new MaterialModel(subPanel, component, type, partName));
//// The component material affects the weight of the component.
combo.setToolTipText(trans.get("RocketCompCfg.combo.ttip.componentmaterialaffects"));
- panel.add(combo, "spanx 4, growx, wrap paragraph");
+ subPanel.add(combo, "spanx 4, growx, wrap paragraph");
if (component instanceof ExternalComponent) {
@@ -223,11 +233,11 @@ public class RocketComponentConfig extends JPanel {
//// The value indicated is the average roughness height of the surface.
+ trans.get("RocketCompCfg.lbl.longA2");
label.setToolTipText(tip);
- panel.add(label, "spanx 4, wmin 220lp, wrap rel");
+ subPanel.add(label, "spanx 4, wmin 220lp, wrap rel");
combo = new JComboBox(new EnumModel(component, "Finish"));
combo.setToolTipText(tip);
- panel.add(combo, "spanx 4, growx, split");
+ subPanel.add(combo, "spanx 4, growx, split");
//// Set for all
JButton button = new JButton(trans.get("RocketCompCfg.but.Setforall"));
@@ -253,10 +263,9 @@ public class RocketComponentConfig extends JPanel {
}
}
});
- panel.add(button, "wrap paragraph");
+ subPanel.add(button, "wrap paragraph");
}
-
- return panel;
+ return subPanel;
}
diff --git a/swing/src/net/sf/openrocket/gui/configdialog/ShockCordConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/ShockCordConfig.java
index e199c41dc..3fc5d6841 100644
--- a/swing/src/net/sf/openrocket/gui/configdialog/ShockCordConfig.java
+++ b/swing/src/net/sf/openrocket/gui/configdialog/ShockCordConfig.java
@@ -49,7 +49,7 @@ public class ShockCordConfig extends RocketComponentConfig {
// Material
//// Shock cord material:
- materialPanel(panel, Material.Type.LINE, trans.get("ShockCordCfg.lbl.Shockcordmaterial"), null);
+ panel.add(materialPanel(Material.Type.LINE, trans.get("ShockCordCfg.lbl.Shockcordmaterial"), null, "Material"), "span, wrap");
diff --git a/swing/src/net/sf/openrocket/gui/configdialog/TransitionConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/TransitionConfig.java
index 5e0286d89..882364722 100644
--- a/swing/src/net/sf/openrocket/gui/configdialog/TransitionConfig.java
+++ b/swing/src/net/sf/openrocket/gui/configdialog/TransitionConfig.java
@@ -185,7 +185,7 @@ public class TransitionConfig extends RocketComponentConfig {
//// Material
- materialPanel(panel2, Material.Type.BULK);
+ panel2.add(materialPanel(Material.Type.BULK), "span, wrap");
panel.add(panel2, "cell 4 0, gapleft paragraph, aligny 0%, spany");
//// General and General properties
diff --git a/swing/src/net/sf/openrocket/gui/configdialog/TrapezoidFinSetConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/TrapezoidFinSetConfig.java
index 7c343fbf2..a3611299b 100644
--- a/swing/src/net/sf/openrocket/gui/configdialog/TrapezoidFinSetConfig.java
+++ b/swing/src/net/sf/openrocket/gui/configdialog/TrapezoidFinSetConfig.java
@@ -163,6 +163,34 @@ public class TrapezoidFinSetConfig extends FinSetConfig {
"w 100lp, wrap paragraph");
+ //// Position
+ //// Position relative to:
+ panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Posrelativeto")));
+
+ combo = new JComboBox(
+ new EnumModel(component, "RelativePosition",
+ new RocketComponent.Position[] {
+ RocketComponent.Position.TOP,
+ RocketComponent.Position.MIDDLE,
+ RocketComponent.Position.BOTTOM,
+ RocketComponent.Position.ABSOLUTE
+ }));
+ panel.add(combo, "spanx, growx, wrap");
+ //// plus
+ panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.plus")), "right");
+
+ m = new DoubleModel(component, "PositionValue", UnitGroup.UNITS_LENGTH);
+ spin = new JSpinner(m.getSpinnerModel());
+ spin.setEditor(new SpinnerEditor(spin));
+ panel.add(spin, "growx");
+
+ panel.add(new UnitSelector(m), "growx");
+ panel.add(new BasicSlider(m.getSliderModel(
+ new DoubleModel(component.getParent(), "Length", -1.0, UnitGroup.UNITS_NONE),
+ new DoubleModel(component.getParent(), "Length"))),
+ "w 100lp, wrap para");
+
+
@@ -196,43 +224,15 @@ public class TrapezoidFinSetConfig extends FinSetConfig {
panel.add(new BasicSlider(m.getSliderModel(0, 0.01)), "w 100lp, wrap para");
- //// Position
- //// Position relative to:
- panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Posrelativeto")));
-
- combo = new JComboBox(
- new EnumModel(component, "RelativePosition",
- new RocketComponent.Position[] {
- RocketComponent.Position.TOP,
- RocketComponent.Position.MIDDLE,
- RocketComponent.Position.BOTTOM,
- RocketComponent.Position.ABSOLUTE
- }));
- panel.add(combo, "spanx, growx, wrap");
- //// plus
- panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.plus")), "right");
-
- m = new DoubleModel(component, "PositionValue", UnitGroup.UNITS_LENGTH);
- spin = new JSpinner(m.getSpinnerModel());
- spin.setEditor(new SpinnerEditor(spin));
- panel.add(spin, "growx");
-
- panel.add(new UnitSelector(m), "growx");
- panel.add(new BasicSlider(m.getSliderModel(
- new DoubleModel(component.getParent(), "Length", -1.0, UnitGroup.UNITS_NONE),
- new DoubleModel(component.getParent(), "Length"))),
- "w 100lp, wrap para");
-
-
//// Material
- materialPanel(panel, Material.Type.BULK);
-
+ panel.add(materialPanel(Material.Type.BULK), "span, wrap");
mainPanel.add(panel, "aligny 20%");
+ panel.add(filletMaterialPanel(), "span, wrap");
//// General and General properties
tabbedPane.insertTab(trans.get("TrapezoidFinSetCfg.tab.General"), null, mainPanel,
trans.get("TrapezoidFinSetCfg.tab.Generalproperties"), 0);