Package orxanimeditor.data.v1.AnimationSet

Examples of orxanimeditor.data.v1.AnimationSet.Link


          if(sequence.getFrameCount()==0) return;
          if(nextFrameIndex>=sequence.getFrameCount()-1)
            restart();
          else {
            nextFrameIndex++;
            Frame frame = sequence.getFrame(nextFrameIndex);
            Point offset = frame.getOffset();
            accumulatedOffset.x += offset.x; accumulatedOffset.y += offset.y;
            display.display(frame, accumulatedOffset);
            setupNextFrame();
          }
      }});
View Full Code Here


    timer.cancel();
    timer = new Timer();
    nextFrameIndex = 0;
    accumulatedOffset.x = 0; accumulatedOffset.y = 0;
    if(sequence.getFrameCount()>0) {
      Frame frame = sequence.getFrame(nextFrameIndex);
      accumulatedOffset = frame.getOffset();
      setupNextFrame();
    }
    pushFrame();
  }
View Full Code Here

  @Override
  public void actionPerformed(ActionEvent e) {
    if(e.getSource()==newFrameButton) {
      Animation selectedAnimation = getSelectedAnimation();
      Frame     selectedFrame = getSelectedFrame();
      if(selectedAnimation != null) {
        Frame newFrame = new Frame("NewFrame" + newFrameSuffix++);
        selectedAnimation.addFrame(newFrame);
      } else if(selectedFrame != null) {
        Frame newFrame = new Frame("NewFrame" + newFrameSuffix++);
        Animation parent = selectedFrame.getParent();
        parent.addFrame(newFrame, parent.getFrameIndex(selectedFrame)+1);
      } else return;
    }
    if(e.getSource()==newAnimationButton) {
View Full Code Here

        break;       
      }
    } else {
      switch (e.getKeyCode()) {
      case KeyEvent.VK_SPACE:
        Frame selectedFrame = getSelectedFrame();
        editor.frameEditor.openImage(selectedFrame);
        break;
      case KeyEvent.VK_DELETE:
        for(HierarchicalData data: animationTree.getSelectedObjects()) {
          data.remove();
View Full Code Here

  @Override
  public int getFrameCount() {
    int listSize = model.getSize();
    int frameCount = 0;
    for(int i=0; i<listSize; i++) {
      HierarchicalData data = (HierarchicalData) model.get(i);
      if(data instanceof Animation) {
        Animation animation = (Animation) data;
        frameCount+=animation.getFrameCount();
      } else {
        frameCount+=1;
View Full Code Here

  @Override
  public Frame getFrame(int index) {
    assert(index<getFrameCount());
    int listSize = model.getSize();
    for(int i=0; i<listSize; i++) {
      HierarchicalData data = (HierarchicalData) model.get(i);
      if(data instanceof Animation) {
        Animation animation = (Animation) data;
        int frameCount = animation.getFrameCount();
        if(frameCount<=index) index-=frameCount;
        else return animation.getFrame(index);
View Full Code Here

  }
 
  @Override
  protected void fireValueChanged(TreeSelectionEvent e) {
    if(e.isAddedPath()) {
      HierarchicalData selectedObject = (HierarchicalData) e.getPath().getLastPathComponent();
      tree.setSelectedNode(selectedObject);
    } else if(getSelectionCount()>0){
      HierarchicalData selectedObject = (HierarchicalData)getSelectionPaths()[0].getLastPathComponent();
      tree.setSelectedNode(selectedObject);
    } else
      tree.setSelectedNode(null);
    super.fireValueChanged(e);
 
View Full Code Here

    animationTree.addKeyListener(this);
    animationTree.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "EditSelected");
    animationTree.getActionMap().put("EditSelected", new AbstractAction() {     
      @Override
      public void actionPerformed(ActionEvent e) {
        HierarchicalData selected = getSelectedNode();
        if(selected!=null) animationTree.startEditingAtPath(new TreePath(selected.getPath()));
      }
    });
  }
View Full Code Here

  private static void exportFrame(ExportDiagnoser d, Frame f, File baseDirectory) {
    Rectangle rect = f.properRectangle();
    Point     pivot = f.getPivot();
    d.printSection(f.getName());
    RelativeFile relativeImageFile = f.getImageFile();
    if(relativeImageFile!=null) {
      File imageFile = relativeImageFile.getAbsoluteFile();
      File imagePath = new File("");
      try {
        imagePath = getRelativeFile(imageFile, baseDirectory);
        d.printKeyValue("Texture", imagePath.toString());
      } catch (IOException e) {
View Full Code Here

TOP

Related Classes of orxanimeditor.data.v1.AnimationSet.Link

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.