Exemplo n.º 1
0
  /**
   * Method called when sharing is turned on.
   *
   * @param from source of shareable information
   * @param dataId ID for the data
   * @param data the shareable data
   */
  public void receiveShareData(Sharable from, Object dataId, Object[] data) {

    if (dataId.equals(SHARE_INDEX)) {
      if (anime != null) {
        anime.setCurrent(((Integer) data[0]).intValue());
      }
    } else if (dataId.equals(SHARE_VALUE)) {
      Real sharedValue = (Real) data[0];
      debug("receiveShareData " + sharedValue);
      handleSharedTime(sharedValue);
    } else if (dataId.equals(CMD_STARTSTOP)) {
      setRunning(((Boolean) data[0]).booleanValue());
    } else if (dataId.equals(CMD_FORWARD)) {
      stepForward();
    } else if (dataId.equals(CMD_BACKWARD)) {
      stepBackward();
    } else if (dataId.equals(CMD_BEGINNING)) {
      gotoBeginning();
    } else if (dataId.equals(CMD_END)) {
      gotoEnd();
    } else if (dataId.equals(CMD_PROPS)) {
      AnimationInfo newInfo = (AnimationInfo) data[0];
      if (propertiesDialog != null) {
        newInfo.shared = getSharing();
        propertiesDialog.setInfo(newInfo);
      }
      setProperties(newInfo);
    } else {
      super.receiveShareData(from, dataId, data);
    }
  }
Exemplo n.º 2
0
 /**
  * Make and show an AnimationPropertiesDialog; if that returns animationInfo ok, set the new
  * animationInfo data into the the Animations.
  */
 protected void showPropertiesDialog() {
   if (propertiesDialog == null) {
     AnimationBoxPanel propertiesBoxPanel = new AnimationBoxPanel(null, boxPanel.getStepsOk());
     propertiesDialog =
         new AnimationPropertiesDialog(this, GuiUtils.getFrame(getContents()), propertiesBoxPanel);
     animationInfo.shared = getSharing();
     animationInfo.boxesVisible = getBoxPanelVisible();
     propertiesDialog.setInfo(animationInfo);
   }
   propertiesDialog.boxPanel.applyProperties(boxPanel);
   propertiesDialog.show();
 }