Package jodd.asm5

Examples of jodd.asm5.Frame


    return e.getY()/zoom;
 
 
  @Override
  public void mouseReleased(MouseEvent e) {
    Frame frame = getSelectedFrame();
    if(parent.isSettingOffsetWithRelativePos()) {
      if(frame!=null) {
        frame.setOffset(new Point(freeOffsetEnd.x-freeOffsetStart.x, freeOffsetEnd.y-freeOffsetStart.y));
      }
      freeOffsetEnd = null;
      freeOffsetStart = null;
      repaint(20);
    }
View Full Code Here


    JTree.DropLocation loc = (JTree.DropLocation) support.getDropLocation();
    Object parent = loc.getPath().getLastPathComponent();
    int index = loc.getChildIndex();
    if(index==-1) { // We're dropping "ON" something
      if(parent instanceof Frame) {
        Frame frame = (Frame) parent;
        index = frame.getParent().getFrameIndex(frame)+1;
        parent = frame.getParent();
      } else if(parent instanceof Animation) {
        index = ((Animation) parent).getFrameCount();
      }
    }
    if(parent instanceof Animation) {
      try {
        Frame[] frames = (Frame[]) support.getTransferable().getTransferData(FrameFlavor);
        if(support.getDropAction() == COPY)
          for(Frame frame:frames) ((Animation) parent).addFrame(frame.clone(),index++);
        else if (support.getDropAction() == MOVE) {
          index--;
          for(Frame frame:frames) index = frame.move(parent,index);                   
        }
        return true;
      } catch (Exception e) {
          e.printStackTrace();
          return false;
View Full Code Here

    return null;
  }

  @Override
  public long getFrameDelay(int index) {
    Frame frame = getFrame(index);
    return (long) (frame.getFinalFrameDuration()*1000);
  }
 
View Full Code Here

    restart();
  }
 
  private boolean isValidFrame(Object object) {
    if(object instanceof Frame) {
      Frame frame = (Frame) object;
      if(frame.getRectangle() == null) return false;
      else return true;
    } else
      return false;
  }
View Full Code Here

    int index;
    if(objects[0]!=selectedFrame)
      index=0;
    else
      index=1;
    Frame frame = (Frame) objects[index];
    return frame.getPivot();
  }
View Full Code Here

          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

TOP

Related Classes of jodd.asm5.Frame

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.