Package orxanimeditor.data.v1.AnimationSet

Examples of orxanimeditor.data.v1.AnimationSet.Link


    Animation[] animations = set.getAnimations();
    if(animations.length>0) {
      String key = "AnimationList";
      String value = "";
      for(int ai=0; ai<animations.length; ai++) {
        Animation animation = animations[ai];
        value+=animation.getName();
        if(ai!=animations.length-1) value+="#";
      }
      d.printKeyValue(key, value);
    }
    Link[] links = set.getLinks();
View Full Code Here


        return;
      }
      if(e.getSource() == deleteAnimationSetButton) {
        editor.getData().removeAnimationSet(view.set);
      } else if(e.getSource() == addAnimationButton) {
        Animation chosen = (Animation) JOptionPane.showInputDialog(editor, "Choose the animation to add to the current set", "Add Animation",
              JOptionPane.QUESTION_MESSAGE, editor.animationManager.animationIcon,
            editor.getData().getAnimations(), null);
        if(chosen == null) return;
        view.addAnimation(chosen);
      } else if(e.getSource() == immediateLinkButton) {
View Full Code Here

    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;
      }
    }
    return frameCount;
View Full Code Here

    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);
      } else {
        if(index==0) return (Frame) data;
        else --index;
      }
    }
View Full Code Here

    g.fillRect(0, 0, getWidth(), getHeight());
    Utilities.drawCheckerPattern(g.create(0, 0, getViewWidth(), getViewHeight()),checkerSize);
    g.drawImage(image,0,0, image.getWidth()*zoom, image.getHeight()*zoom,0,0,image.getWidth(),image.getHeight(),null);
    for(Object selected: editorFrame.animationManager.getSelectedObjects()) {
      if(selected instanceof Animation) {
        Animation animation = (Animation) selected;
        for(Frame frame: animation.getFrames()) {
          paintFrame(g, frame);
        }
      }
      if (selected instanceof Frame) {
        Frame frame = (Frame) selected;
View Full Code Here

      animation.setDefaultKeyDuration(animation.getDefaultKeyDuration()
          * multiplier);
    }
    public void edit(Frame frame) {
      if(frame.getKeyDuration() < 0) {
        Animation parent = (Animation) frame.getParent();
        frame.setKeyDuration(parent.getDefaultKeyDuration()*multiplier);
      }
      frame.setKeyDuration(frame.getKeyDuration() * multiplier);
   
 
View Full Code Here

    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

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.