Package fcagnin.jgltut.tut08

Examples of fcagnin.jgltut.tut08.Interpolation$Orientation$Animation


    contentProvider.restart();
  }

  @Override
  public void frameMoved(Animation oldParent, Frame frame) {
    Animation newParent = frame.getParent();
    if(newParent == selectedAnimation || oldParent == selectedAnimation)
      contentProvider.restart();
  }
View Full Code Here


    if(e.getButton() == MouseEvent.BUTTON1) {
      if(selectedAnimation == null) {
        selectedAnimation = pickAnimation(screenToWorld(e.getPoint()));
        selectedLink      = null;
      } else {
        Animation otherAnimation = pickAnimation(screenToWorld(e.getPoint()));
        if(otherAnimation!=null) {
          selectedLink = set.getOrCreateLink(selectedAnimation,otherAnimation);
          selectedAnimation = null;
        } else {
          selectedAnimation = null;
View Full Code Here

    repaint(20);
  }
  private Animation pickAnimation(Point point) {
    Animation[] animations = set.getAnimations();
    for(int ai=0; ai<animations.length; ai++) {
      Animation animation = animations[ai];
      if(getCenter(animation).distance(point)<ANIMATIONRADIUS) {
        return animation;
      }
    }
    return null;
View Full Code Here

    try {
      HierarchicalData[] data = (HierarchicalData[]) t.getTransferData(AnimationTreeTransferHandler.HierarchicalDataFlavor);
      FrameEditor rec = (FrameEditor) support.getComponent();
      for(Object obj:data)
        if(obj instanceof Animation) {
          Animation animation = (Animation) obj;
          for(Frame frame: animation.getFrames()) {
            rec.openImage(frame);
          }
        } else if(obj instanceof Frame) {
          rec.openImage((Frame) obj);
        }
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) {
      Animation newAnimation = new Animation("NewAnimation" + newAnimationSuffix++);
      editor.getData().addAnimation(newAnimation);
    }
  }
View Full Code Here

        clipboard = getSelectedNodes();
        break;
      case KeyEvent.VK_V:
        for(Object node: clipboard) {
          Object nodeObject = node;
          Animation selectedAnimation = getSelectedAnimation();
          if(nodeObject instanceof Frame && selectedAnimation!=null) {
            selectedAnimation.addFrame(((Frame)nodeObject).clone());
          }
          if(nodeObject instanceof Animation) {
            editor.getData().addAnimation(((Animation)nodeObject).clone());
          }
        }
View Full Code Here

  }


  @Override
  public void frameEdited(Frame frame) {
    Animation parent = frame.getParent();
    animationTreeModel.fireTreeNodesChanged(new TreeModelEvent(this,
        new Object[]{editor.getData(),parent},
        new int[]{animationTreeModel.getIndexOfChild(parent, frame)},
        new Object[]{frame}));
  }
View Full Code Here

TOP

Related Classes of fcagnin.jgltut.tut08.Interpolation$Orientation$Animation

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.