* @{inheritDoc}
*/
public void open() {
CellServerState state = editor.getCellServerState();
AudioTreatmentComponentServerState compState =
(AudioTreatmentComponentServerState) state.getComponentServerState(
AudioTreatmentComponentServerState.class);
if (state == null || compState == null) {
return;
}
originalGroupId = compState.getGroupId();
String[] treatmentList = compState.getTreatments();
originalTreatmentType = compState.getTreatmentType();
treatmentType = originalTreatmentType;
originalTreatments = "";
/*
* XXX We only allow a single treatment to be specified
*/
for (int i = 0; i < treatmentList.length; i++) {
String treatment = treatmentList[i];
if (treatment.length() == 0) {
break;
}
originalTreatments += treatment;
break; // XXX we only allow a single treatment for now
}
originalTreatments = originalTreatments.trim();
originalVolume = volumeConverter.getVolume((float) compState.getVolume());
originalPlayWhen = compState.getPlayWhen();
playWhen = originalPlayWhen;
originalPlayOnce = compState.getPlayOnce();
playOnce = originalPlayOnce;
originalExtentRadius = (float) compState.getExtent();
extentRadius = originalExtentRadius;
originalFullVolumeAreaPercent = (float) compState.getFullVolumeAreaPercent();
originalDistanceAttenuated = compState.getDistanceAttenuated();
distanceAttenuated = originalDistanceAttenuated;
originalFalloff = (int) compState.getFalloff();
originalUseCellBounds = compState.getUseCellBounds();
BoundingVolume bounds = editor.getCell().getLocalBounds();
if (originalUseCellBounds == true && bounds instanceof BoundingBox) {
originalDistanceAttenuated = false;
distanceAttenuated = false;
}
if (bounds instanceof BoundingSphere) {
float radius = ((BoundingSphere) bounds).getRadius();
String text = BUNDLE.getString("Sphere_With_Radius");
text = MessageFormat.format(text, (Math.round(radius * 10) / 10f));
boundsLabel.setText(text);
} else {
Vector3f extent = new Vector3f();
extent = ((BoundingBox) bounds).getExtent(extent);
float x = Math.round(extent.getX() * 10) / 10f;
float y = Math.round(extent.getY() * 10) / 10f;
float z = Math.round(extent.getZ() * 10) / 10f;
String text = BUNDLE.getString("BOX");
text = MessageFormat.format(text, x, y, z);
boundsLabel.setText(text);
}
originalShowBounds = compState.getShowBounds();
restore();
if (currentCell == null) {
currentCell = editor.getCell();