Package tiled.mapeditor.brush

Examples of tiled.mapeditor.brush.Brush


                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 = (Brush) brushes.get(selectedIndex);
                    firePropertyChange("selectedbrush", previousBrush, selectedBrush);
                    repaint();
                }
            }
View Full Code Here


        // Draw the brushes
        Iterator itr = brushes.iterator();
        int x = 0;
        while (itr.hasNext()) {
            Brush 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

    }

    public void setSelectedBrush(Brush brush) {
        Iterator itr = brushes.iterator();
        while (itr.hasNext()) {
            Brush br = (Brush) itr.next();
            if (br.equals(brush)) {
                selectedBrush = br;
                break;
            }
        }
    }
View Full Code Here

TOP

Related Classes of 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.