Пример #1
0
 // ImageResourceListener
 public void animatedTileAdded(ImageResource source, AnimatedTile tile) {
   if (tile.getWidth() == AnimatedTileList.this.editorComponent.getTiledLayer().getTileWidth()
       && tile.getHeight()
           == AnimatedTileList.this.editorComponent.getTiledLayer().getTileHeight()) {
     this.addElement(tile);
     tile.addSequenceContainerListener(this);
   }
 }
Пример #2
0
 private void init() {
   List animatedTiles =
       this.imageResource.getAnimatedTiles(
           this.editorComponent.getTiledLayer().getTileWidth(),
           this.editorComponent.getTiledLayer().getTileHeight());
   for (Iterator iter = animatedTiles.iterator(); iter.hasNext(); ) {
     AnimatedTile tile = (AnimatedTile) iter.next();
     tile.addSequenceContainerListener(this.model);
     this.model.addElement(tile);
   }
 }
Пример #3
0
 private void handlePopup(MouseEvent e) {
   JPopupMenu menu = new JPopupMenu();
   int row = AnimatedTileList.this.locationToIndex(e.getPoint());
   if (row == -1) { //  clicked on empty area
     return;
   }
   setSelectedIndex(row);
   AnimatedTile at = (AnimatedTile) AnimatedTileList.this.getModel().getElementAt(row);
   List<Action> actions = at.getActions();
   for (Action action : actions) {
     menu.add(action);
   }
   menu.show(this, e.getX(), e.getY());
 }
Пример #4
0
 public void animatedTileRemoved(ImageResource source, AnimatedTile tile) {
   tile.removeSequenceContainerListener(this);
   this.removeElement(tile);
 }
Пример #5
0
 @Override
 public void addElement(Object obj) {
   AnimatedTile tile = (AnimatedTile) obj;
   super.addElement(tile);
   tile.addPropertyChangeListener(this);
 }