Package de.yaams.extensions.basemap.tiled.mapeditor.brush

Examples of de.yaams.extensions.basemap.tiled.mapeditor.brush.Brush


        int x = e.getX() / maxWidth;
        int y = e.getY() / maxWidth;
        int selectedIndex = y * perLine + (x > perLine - 1 ? perLine - 1 : x);

        if (selectedIndex >= 0 && selectedIndex < brushes.size()) {
          Brush previousBrush = selectedBrush;
          selectedBrush = brushes.get(selectedIndex);
          firePropertyChange("selectedbrush", previousBrush, selectedBrush);
          repaint();
        }
      }
View Full Code Here


    // Draw the brushes
    Iterator<Brush> itr = brushes.iterator();
    int x = 0;
    while (itr.hasNext()) {
      Brush brush = itr.next();
      Rectangle bb = brush.getBounds();
      float o = maxWidth / 2.0f - bb.width / 2.0f;
      g.translate((int) o, (int) o);
      brush.drawPreview((Graphics2D) g, new Dimension(maxWidth, maxWidth), null);
      g.translate((int) -o, (int) -o);

      if (brush == selectedBrush) {
        g.drawRect(0, 0, maxWidth, maxWidth);
      }
View Full Code Here

  }

  @Override
  public void propertyChange(PropertyChangeEvent evt) {
    if (evt.getPropertyName().equals("selectedbrush")) {
      Brush b = brushes.getSelectedBrush();
      if (b != null) {
        brushSize.setValue(b.getBounds().width);
      }
    }

    bApply.setEnabled(true);
  }
View Full Code Here

TOP

Related Classes of de.yaams.extensions.basemap.tiled.mapeditor.brush.Brush

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.