Package org.jdesktop.wonderland.modules.audiomanager.common

Examples of org.jdesktop.wonderland.modules.audiomanager.common.ConeOfSilenceComponentServerState


    @Override
    public void setServerState(CellComponentServerState serverState) {
        super.setServerState(serverState);

        // Fetch the component-specific state and set member variables
        ConeOfSilenceComponentServerState cs = (ConeOfSilenceComponentServerState) serverState;

  if (name == null) {
      name = DEFAULT_NAME;
  } else {
      name = cs.getName();
  }

  String appendName = "-" + cellRef.get().getCellID();

  if (name.indexOf(appendName) < 0) {
      name += "-" + cellRef.get().getCellID();
  }

  boundsType = cs.getBoundsType();

  bounds = cs.getBounds();

  showBounds = cs.getShowBounds();

  outsideAudioVolume = cs.getOutsideAudioVolume();

  addProximityListener(isLive());
    }
View Full Code Here


    /**
     * @{inheritDoc}
     */
    @Override
    public CellComponentServerState getServerState(CellComponentServerState serverState) {
  ConeOfSilenceComponentServerState state = (ConeOfSilenceComponentServerState) serverState;

        // Create the proper server state object if it does not yet exist
        if (state == null) {
            state = new ConeOfSilenceComponentServerState();
        }

  if (name == null) {
      name = DEFAULT_NAME;
  }

  String appendName = "-" + cellRef.get().getCellID();

  if (name.indexOf(appendName) < 0) {
      name += "-" + cellRef.get().getCellID();
  }

        state.setName(name);
  state.setBoundsType(boundsType);
  state.setBounds(bounds);
  state.setShowBounds(showBounds);
        state.setOutsideAudioVolume(outsideAudioVolume);

        return super.getServerState(state);
    }
View Full Code Here

    /**
     * @{inheritDoc}
     */
    public void open() {
        CellServerState cellServerState = editor.getCellServerState();
        ConeOfSilenceComponentServerState state =
                (ConeOfSilenceComponentServerState) cellServerState.getComponentServerState(
                ConeOfSilenceComponentServerState.class);

        if (state == null) {
            return;
        }

        originalName = state.getName();
  originalBoundsType = state.getBoundsType();
  boundsType = originalBoundsType;
  originalBounds = state.getBounds();
  originalShowBounds = state.getShowBounds();

        originalOutsideAudioVolume = volumeConverter.getVolume((float) state.getOutsideAudioVolume());

  restore();
    }
View Full Code Here

    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);
    }
View Full Code Here

    public String getDisplayName() {
        return BUNDLE.getString("ConeOfSilence");
    }

    public <T extends CellComponentServerState> T getDefaultCellComponentServerState() {
        ConeOfSilenceComponentServerState state = new ConeOfSilenceComponentServerState();
  state.setName(BUNDLE.getString("ConeOfSilence"));
        return (T) state;
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.audiomanager.common.ConeOfSilenceComponentServerState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.