コード例 #1
0
 @Override
 public boolean importData(TransferSupport support) {
   Transferable t = support.getTransferable();
   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);
       }
     return true;
   } catch (Exception e) {
     e.printStackTrace();
     return false;
   }
 }