public void apply() {
// Figure out whether there already exists a server state for the
// component. If it does not exist, then return, but we could always
// create a new one really.
CellServerState cellServerState = editor.getCellServerState();
ConeOfSilenceComponentServerState state =
(ConeOfSilenceComponentServerState) cellServerState.getComponentServerState(
ConeOfSilenceComponentServerState.class);
if (state == null) {
return;
}
state.setName(nameTextField.getText());
if (useCellBoundsRadioButton.isSelected()) {
state.setBoundsType(COSBoundsType.CELL_BOUNDS);
} else if (specifyRadiusRadioButton.isSelected()) {
state.setBoundsType(COSBoundsType.SPHERE);
state.setBounds(new Vector3f((Float) fullVolumeRadiusModel.getValue(), 0f, 0));
} else {
state.setBoundsType(COSBoundsType.BOX);
state.setBounds(new Vector3f((Float) xExtentSpinner.getValue(),
(Float) yExtentSpinner.getValue(), (Float) zExtentSpinner.getValue()));
}
state.setOutsideAudioVolume(volumeConverter.getVolume(outsideVolumeSlider.getValue()));
state.setShowBounds(showBoundsCheckBox.isSelected());
editor.addToUpdateList(state);
}