コード例 #1
0
ファイル: AnimationWidget.java プロジェクト: nbearson/IDV
  /**
   * From the "animationInfo" set of animation properties, set all these values into all the
   * Animation objects held as memeber data.
   *
   * @param transfer AnimationInfo to get properties from
   */
  public void setProperties(AnimationInfo transfer) {
    setBoxPanelVisible(transfer.getBoxesVisible());
    animationInfo.set(transfer);
    setSharing(animationInfo.shared);
    if (animationInfo.getAnimationGroup() != null) {
      setShareGroup(animationInfo.getAnimationGroup());
    }
    if (propertiesDialog != null) {
      propertiesDialog.setInfo(animationInfo);
    }

    try {
      if (anime != null) {
        anime.setAnimationInfo(animationInfo);
        DisplayMaster displayMaster = anime.getDisplayMaster();
        if (displayMaster != null) {
          displayMaster.dataChange();
        } else {
          if (getAnimationSetInfo().getActive()) {
            anime.setSet(getAnimationSetInfo().makeTimeSet(null));
          } else {
            anime.setSet(getAnimationSetInfo().getBaseTimes());
          }
        }
      }
    } catch (Exception exp) {
      LogUtil.logException("Error setting properties", exp);
    }
    updateRunButton();
    checkAutoUpdate();
  }
コード例 #2
0
ファイル: AnimationWidget.java プロジェクト: nbearson/IDV
  /**
   * 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);
    }
  }
コード例 #3
0
ファイル: AnimationWidget.java プロジェクト: nbearson/IDV
 /**
  * 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();
 }