Package org.jwildfire.create.tina.dance.motion

Examples of org.jwildfire.create.tina.dance.motion.Motion


        return null;
      }

      @Override
      public Object getValueAt(int rowIndex, int columnIndex) {
        Motion motion = rowIndex < project.getMotions().size() ? project.getMotions().get(rowIndex) : null;
        if (motion != null) {
          switch (columnIndex) {
            case COL_MOTION:
              return motion.getDisplayLabel();
            case COL_START_FRAME:
              return (motion.getStartFrame() != null) ? String.valueOf(motion.getStartFrame()) : "";
            case COL_END_FRAME:
              return (motion.getEndFrame() != null) ? String.valueOf(motion.getEndFrame()) : "";
          }
        }
        return null;
      }
View Full Code Here


  }

  private void refreshMotionLinksTable() {
    final int COL_FLAME = 0;
    final int COL_PROPERTY = 1;
    final Motion currMotion = getSelectedMotion();
    motionLinksTable.setModel(new DefaultTableModel() {
      private static final long serialVersionUID = 1L;

      @Override
      public int getRowCount() {
        return currMotion != null ? currMotion.getMotionLinks().size() : 0;
      }

      @Override
      public int getColumnCount() {
        return 2;
      }

      @Override
      public String getColumnName(int columnIndex) {
        switch (columnIndex) {
          case COL_FLAME:
            return "Flame";
          case COL_PROPERTY:
            return "Property";
        }
        return null;
      }

      @Override
      public Object getValueAt(int rowIndex, int columnIndex) {
        MotionLink motionLink = rowIndex < currMotion.getMotionLinks().size() ? currMotion.getMotionLinks().get(rowIndex) : null;
        if (motionLink != null) {
          switch (columnIndex) {
            case COL_FLAME:
              return flamePropertiesTreeService.getFlameCaption(motionLink.getProperyPath().getFlame());
            case COL_PROPERTY:
View Full Code Here

    doRecordCBx.setEnabled(!running);

    motionTable.setEnabled(!running);
    addMotionCmb.setEnabled(!running);
    addMotionBtn.setEnabled(!running);
    Motion selMotion = getSelectedMotion();

    deleteMotionBtn.setEnabled(!running && selMotion != null);
    renameMotionBtn.setEnabled(deleteMotionBtn.isEnabled());
    boolean plainPropertySelected = flamePropertiesTreeService.isPlainPropertySelected(flamePropertiesTree);
    {
      boolean linkMotionEnabled = false;
      if (!running && selMotion != null && selMotion.getParent() == null) {
        if (plainPropertySelected) {
          FlamePropertyPath selPath = flamePropertiesTreeService.getSelectedPropertyPath(flamePropertiesTree);
          linkMotionEnabled = !selMotion.hasLink(selPath);
        }
      }
      linkMotionBtn.setEnabled(linkMotionEnabled);
      unlinkMotionBtn.setEnabled(selMotion != null && motionLinksTable.getSelectedRow() >= 0 && motionLinksTable.getSelectedRow() < selMotion.getMotionLinks().size());
    }

    createMotionsCmb.setEnabled(!running);
    clearMotionsBtn.setEnabled(!running && project.getMotions().size() > 0);
    loadProjectBtn.setEnabled(!running);
View Full Code Here

  public void addMotionBtn_clicked() {
    try {
      MotionType motionType = (MotionType) addMotionCmb.getSelectedItem();
      if (motionType != null) {
        Motion newMotion = motionType.getMotionClass().newInstance();
        project.getMotions().add(newMotion);

        boolean oldRefreshing = refreshing;
        refreshing = true;
        try {
View Full Code Here

      if (motionPropertyPnl != null) {
        motionPropertyRootPnl.remove(motionPropertyPnl);
        motionPropertyPnl = null;
      }
      if (project.getMotions().size() > 0 && motionTable.getSelectedRow() >= 0 && motionTable.getSelectedRow() < project.getMotions().size()) {
        Motion motion = project.getMotions().get(motionTable.getSelectedRow());

        @SuppressWarnings("rawtypes")
        Map<Class, PropertyEditor> editors = new HashMap<Class, PropertyEditor>();
        editors.put(Motion.class, new MotionTypeEditor(project.getMotions()));
View Full Code Here

    motionPropertyRootPnl.invalidate();
    motionPropertyRootPnl.validate();
  }

  public void linkMotionBtn_clicked() {
    Motion currMotion = getSelectedMotion();
    if (currMotion != null && flamePropertiesTreeService.isPlainPropertySelected(flamePropertiesTree)) {
      FlamePropertyPath propertyPath = flamePropertiesTreeService.getSelectedPropertyPath(flamePropertiesTree);
      currMotion.getMotionLinks().add(new MotionLink(propertyPath));
      refreshMotionLinksTable();
      int selectRow = currMotion.getMotionLinks().size() - 1;
      motionLinksTable.getSelectionModel().setSelectionInterval(selectRow, selectRow);
      enableControls();
    }
  }
View Full Code Here

    motionTableClicked();
    enableControls();
  }

  public void unlinkMotionBtn_clicked() {
    Motion selMotion = getSelectedMotion();
    int row = motionLinksTable.getSelectedRow();
    if (selMotion != null && row >= 0 && row <= selMotion.getMotionLinks().size()) {
      int selRow = motionLinksTable.getSelectedRow();
      selMotion.getMotionLinks().remove(row);
      motionTableClicked();
      if (selRow >= selMotion.getMotionLinks().size()) {
        selRow--;
      }
      motionLinksTable.getSelectionModel().setSelectionInterval(selRow, selRow);
      enableControls();
    }
View Full Code Here

  }

  public void renameMotionBtn_clicked() {
    int row = motionTable.getSelectedRow();
    if (row >= 0 && row < project.getMotions().size()) {
      Motion motion = project.getMotions().get(row);
      String s = StandardDialogs.promptForText(rootTabbedPane, "Please enter the new title:", motion.getDisplayLabel());
      if (s != null) {
        motion.setCaption(s);
        refreshMotionTable();
        if (row >= project.getMotions().size()) {
          row--;
        }
        if (row >= 0) {
View Full Code Here

  public List<Motion> getMotions(Flame pFlame) {
    List<Motion> res = new ArrayList<Motion>();
    for (Motion motion : motions) {
      for (MotionLink link : motion.getMotionLinks()) {
        if (link.getProperyPath().getFlame().isEqual(pFlame)) {
          Motion currMotion = motion;
          int iter = 0;
          while (currMotion != null) {
            res.add(currMotion);
            Motion refMotion = currMotion;
            currMotion = null;
            for (Motion nextMotion : getMotions()) {
              if (nextMotion.getParent() == refMotion) {
                currMotion = nextMotion;
                break;
View Full Code Here

TOP

Related Classes of org.jwildfire.create.tina.dance.motion.Motion

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.