Added optional Thickness element/property.
This commit is contained in:
parent
c71049a88d
commit
b990a5acb2
@ -39,6 +39,9 @@ public class TransitionDTO extends BaseComponentDTO {
|
||||
@XmlElement(name = "Length")
|
||||
private double length;
|
||||
|
||||
@XmlElement(name = "Thickness")
|
||||
private Double thickness;
|
||||
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
@ -63,6 +66,9 @@ public class TransitionDTO extends BaseComponentDTO {
|
||||
setAftShoulderDiameter(thePreset.get(ComponentPreset.AFT_SHOULDER_DIAMETER));
|
||||
setAftShoulderLength(thePreset.get(ComponentPreset.AFT_SHOULDER_LENGTH));
|
||||
setLength(thePreset.get(ComponentPreset.LENGTH));
|
||||
if ( thePreset.has(ComponentPreset.THICKNESS)) {
|
||||
setThickness(thePreset.get(ComponentPreset.THICKNESS));
|
||||
}
|
||||
}
|
||||
|
||||
public ShapeDTO getShape() {
|
||||
@ -129,6 +135,14 @@ public class TransitionDTO extends BaseComponentDTO {
|
||||
length = theLength;
|
||||
}
|
||||
|
||||
public Double getThickness() {
|
||||
return thickness;
|
||||
}
|
||||
|
||||
public void setThickness(Double thickness) {
|
||||
this.thickness = thickness;
|
||||
}
|
||||
|
||||
public ComponentPreset asComponentPreset(List<MaterialDTO> materials) throws InvalidComponentPresetException {
|
||||
TypedPropertyMap props = new TypedPropertyMap();
|
||||
addProps(props, materials);
|
||||
@ -141,6 +155,9 @@ public class TransitionDTO extends BaseComponentDTO {
|
||||
props.put(ComponentPreset.AFT_SHOULDER_LENGTH, this.getAftShoulderLength());
|
||||
props.put(ComponentPreset.LENGTH, this.getLength());
|
||||
props.put(ComponentPreset.TYPE, ComponentPreset.Type.TRANSITION);
|
||||
if ( thickness != null ) {
|
||||
props.put(ComponentPreset.THICKNESS, thickness);
|
||||
}
|
||||
|
||||
return ComponentPresetFactory.create(props);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user