package net.sf.openrocket.rocketcomponent;
-import net.sf.openrocket.util.Coordinate;
-import net.sf.openrocket.util.MathUtil;
-
import java.util.ArrayList;
import java.util.Collection;
+import net.sf.openrocket.l10n.Translator;
+import net.sf.openrocket.startup.Application;
+import net.sf.openrocket.util.Coordinate;
+import net.sf.openrocket.util.MathUtil;
-public class LaunchLug extends ExternalComponent implements Coaxial {
+public class LaunchLug extends ExternalComponent implements Coaxial {
+
+ private static final Translator trans = Application.getTranslator();
+
private double radius;
private double thickness;
}
- public double getOuterRadius () {
+ @Override
+ public double getOuterRadius() {
return radius;
}
- public void setOuterRadius (double radius) {
+ @Override
+ public void setOuterRadius(double radius) {
if (MathUtil.equals(this.radius, radius))
return;
this.radius = radius;
fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE);
}
+ @Override
public double getInnerRadius() {
return radius - thickness;
}
+ @Override
public void setInnerRadius(double innerRadius) {
setOuterRadius(innerRadius + thickness);
}
+ @Override
public double getThickness() {
return thickness;
}
public void componentChanged(ComponentChangeEvent e) {
super.componentChanged(e);
- /*
+ /*
* shiftY and shiftZ must be computed here since calculating them
* in shiftCoordinates() would cause an infinite loop due to .toRelative
*/
@Override
public String getComponentName() {
- return "Launch lug";
+ //// Launch lug
+ return trans.get("LaunchLug.Launchlug");
}
@Override
- public double getLongitudalUnitInertia() {
+ public double getLongitudinalUnitInertia() {
// 1/12 * (3 * (r1^2 + r2^2) + h^2)
- return (3 * (MathUtil.pow2(getInnerRadius())) + MathUtil.pow2(getOuterRadius()) +
- MathUtil.pow2(getLength())) / 12;
+ return (3 * (MathUtil.pow2(getInnerRadius())) + MathUtil.pow2(getOuterRadius()) + MathUtil.pow2(getLength())) / 12;
}
@Override
public double getRotationalUnitInertia() {
// 1/2 * (r1^2 + r2^2)
- return (MathUtil.pow2(getInnerRadius()) + MathUtil.pow2(getOuterRadius()))/2;
+ return (MathUtil.pow2(getInnerRadius()) + MathUtil.pow2(getOuterRadius())) / 2;
}
@Override
return false;
}
- /**
- * Accept a visitor to this LaunchLug in the component hierarchy.
- *
- * @param theVisitor the visitor that will be called back with a reference to this LaunchLug
- */
- @Override
- public void accept (final ComponentVisitor theVisitor) {
- theVisitor.visit(this);
- }
-
}