Examples of NewTilesetDialog


Examples of com.onpositive.mapper.dialogs.NewTilesetDialog

    setDescription("Please specify file name and map parameters");
    setFileExtension("tmx");
  }
 
  public void addTileset() {
    NewTilesetDialog dialog = new NewTilesetDialog(getShell());
    String widthTxt = tileWidthCombo.getText();
    String heightTxt = tileHeightCombo.getText();
    if (!widthTxt.isEmpty() && !heightTxt.isEmpty()) {
    dialog.setInitialTileSize(Integer.parseInt(widthTxt),Integer.parseInt(heightTxt));
    }
    dialog.open();
    TileSet result = dialog.getResult();
    if (result != null)
      tilesetsField.addElement(result);
  }
View Full Code Here

Examples of com.onpositive.mapper.dialogs.NewTilesetDialog

  public AddTilesetAction() {
  }
 
  @Override
  public void runForMap(IAction action, Map map) {
    NewTilesetDialog dialog = new NewTilesetDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
    dialog.setInitialTileSize(map.getTileWidth(),map.getTileHeight());
    int open = dialog.open();
    if (open == Dialog.OK) {
      map.addTileset(dialog.getCuttedResult());
    }
   
  }
View Full Code Here

Examples of de.yaams.extensions.basemap.tiled.mapeditor.dialogs.NewTilesetDialog

    if (command.equals(Resources.getString("menu.edit.brush"))) {
      BrushDialog bd = new BrushDialog(this, YaFrame.get(), currentBrush);
      bd.setVisible(true);
    } else if (command.equals(Resources.getString("menu.tilesets.new"))) {
      if (currentMap != null) {
        NewTilesetDialog dialog = new NewTilesetDialog(YaFrame.get(), currentMap);
        TileSet newSet = dialog.create();
        if (newSet != null) {
          currentMap.addTileset(newSet);
        }
      }
    } else if (command.equals(Resources.getString("menu.tilesets.import"))) {
      if (currentMap != null) {
        JFileChooser chooser = new JFileChooser(currentMap.getFilename());
        MapHelper.addExtension(chooser);

        int ret = chooser.showOpenDialog(appFrame);
        if (ret == JFileChooser.APPROVE_OPTION) {
          String filename = chooser.getSelectedFile().getAbsolutePath();
          try {
            TileSet set = MapHelper.loadTileset(filename);
            currentMap.addTileset(set);
          } catch (Exception e) {
            e.printStackTrace();
          }
        }
      }
    } else if (command.equals(Resources.getString("menu.tilesets.refresh"))) {
      if (currentMap != null) {
        Vector<TileSet> tilesets = currentMap.getTilesets();
        for (TileSet tileset : tilesets) {
          try {
            tileset.checkUpdate();
          } catch (IOException e) {
            JOptionPane.showMessageDialog(appFrame, e.getLocalizedMessage(), IMPORT_ERROR_MSG, JOptionPane.WARNING_MESSAGE);
          }
        }
        mapView.repaint();
        brushPreview.setBrush(currentBrush);
      }
    } else if (command.equals(Resources.getString("menu.tilesets.manager"))) {
      if (currentMap != null) {
        TilesetManager manager = new TilesetManager(YaFrame.get(), currentMap);
        manager.setVisible(true);
      }
    } else if (command.equals(Resources.getString("menu.map.properties"))) {
      PropertiesDialog pd = new PropertiesDialog(YaFrame.get(), currentMap.getProperties());
      pd.setTitle(Resources.getString("dialog.properties.map.title"));
      pd.getProps();
    } else if (command.equals(Resources.getString("menu.layer.properties"))) {
      MapLayer layer = getCurrentLayer();
      PropertiesDialog lpd = new PropertiesDialog(YaFrame.get(), layer.getProperties());
      lpd.setTitle(layer.getName() + " " + Resources.getString("dialog.properties.title"));
      lpd.getProps();
    } else if (command.equals(Resources.getString("menu.view.boundaries")) || command.equals("Hide Boundaries")) {
      mapView.toggleMode(MapView.PF_BOUNDARYMODE);
    } else if (command.equals(Resources.getString("menu.view.grid"))) {
      // Toggle grid
      Preferences displayPrefs = prefs.node("display");
      boolean showGrid = displayPrefs.getBoolean("showGrid", false);
      displayPrefs.putBoolean("showGrid", !showGrid);
    } else if (command.equals(Resources.getString("menu.view.coordinates"))) {
      // Toggle coordinates
      mapView.toggleMode(MapView.PF_COORDINATES);
    } else if (command.equals(Resources.getString("menu.view.cursor"))) {
      prefs.putBoolean("cursorhighlight", cursorMenuItem.isSelected());
      cursorHighlight.setVisible(cursorMenuItem.isSelected());
    } else if (command.equals(Resources.getString("menu.map.resize"))) {
      ResizeDialog rd = new ResizeDialog(YaFrame.get(), this);
      rd.setVisible(true);
    } else if (command.equals(Resources.getString("menu.map.search"))) {
      SearchDialog sd = new SearchDialog(YaFrame.get(), currentMap);
      sd.setVisible(true);
    } else if (command.equals(Resources.getString("menu.help.about"))) {
      showAboutDialog();
    } else if (command.equals(Resources.getString("menu.edit.preferences"))) {
      ConfigurationDialog dialog = new ConfigurationDialog(YaFrame.get());
      dialog.configure();
    } else {
      System.out.println(event);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.