Package orxanimeditor.data.v1.AnimationSet

Examples of orxanimeditor.data.v1.AnimationSet.Link


 

  @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

  public void actionPerformed(ActionEvent e) {
    AnimationSetViewer view = (AnimationSetViewer) animationSets.getSelectedComponent();
    if(e.getSource()==newAnimationSetButton) {
      String newSetName = JOptionPane.showInputDialog("New Animation Set Name:");
      if(newSetName==null || newSetName.isEmpty()) return;
      AnimationSet newSet = new AnimationSet(newSetName);
      editor.getData().addAnimationSet(newSet);
    } else  { // The rest of the buttons are related to a view
      if(view==null) { // So if no view is selected, an error is shown
        JOptionPane.showMessageDialog(editor, "No animation set selected!","Error!",JOptionPane.ERROR_MESSAGE);
        return;
View Full Code Here

    d.printEmptyLine();
    if(links.length>0) {
      String key = "LinkList";
      String value = "";
      for(int li = 0; li<links.length; li++) {
        Link link = links[li];
        value+=link.getName();
        if(li!=links.length-1) value+="#";
      }
      d.printKeyValue(key, value);
    }
    d.printEmptyLine();
View Full Code Here

              JOptionPane.QUESTION_MESSAGE, editor.animationManager.animationIcon,
            editor.getData().getAnimations(), null);
        if(chosen == null) return;
        view.addAnimation(chosen);
      } else if(e.getSource() == immediateLinkButton) {
        Link selectedLink = view.selectedLink;
        if(selectedLink!=null) {
          if(selectedLink.getProperty()==Link.IMMEDIATE_PROPERTY)
            selectedLink.setProperty(Link.NONE_PROPERTY);
          else
            selectedLink.setProperty(Link.IMMEDIATE_PROPERTY);
         
        }
      }
    }
  }
View Full Code Here

  }

 
  private Point getCenter(Animation animation) {
    if(set.containsSetSpecificAnimationData(animation)) {
      SetSpecificAnimationData animationData = set.getSetSpecificAnimationData(animation);
      if(animationData.getCenter()!=null)
        return animationData.getCenter();
    }
   
    return getDefaultCenter(animation);
  }
View Full Code Here

  public static void readEditorData(File file, EditorData data) {
        try
        {
           FileInputStream fileIn = new FileInputStream(file);
           ObjectInputStream in = new PackageNameModifiedObjectInputStream(fileIn);
           EditorData newData = (EditorData) in.readObject();
           in.close();
           fileIn.close();
           data.acquireFromData(newData,file);
           return;
       }catch(IOException i)
View Full Code Here

    return animationManager.getSelectedObjects();
  }
 
  public EditorMainWindow() {
    super("Orx Animation Editor");
    setData(new EditorData());
    prepareTree();
    setLayout(new BorderLayout());
   
    infoBar        = new InfoBar();
   
View Full Code Here

    if(editorDataChooser.showSaveDialog(EditorMainWindow.this)==JFileChooser.APPROVE_OPTION) {
      File projectFile=editorDataChooser.getSelectedFile();
      if(!projectFile.exists() && !Pattern.matches(".*\\..*",projectFile.getName())) {
        projectFile = new File(projectFile.getPath()+".oap");
      }
      getData().acquireFromData(new EditorData(),projectFile);
      projectChanged();
    }
  }
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.