ShapeBrush sb = new ShapeBrush(); sb.makeQuadBrush(new Rectangle(0, 0, 1, 1)); setBrush(sb);
    public MapEditor() {        /*        eraserBrush = new Eraser();        brushes.add(eraserBrush());        setBrush(eraserBrush);        */        /*        try {            Image imgPaintCursor = Resources.getImage("cursor-pencil.png");            curPaint = Toolkit.getDefaultToolkit().createCustomCursor(                    imgPaintCursor, new Point(0,0), "paint");        } catch (Exception e) {            System.out.println("Error while loading custom cursors!");            e.printStackTrace();        }        */        curEyed = new Cursor(Cursor.CROSSHAIR_CURSOR);        curDefault = new Cursor(Cursor.DEFAULT_CURSOR);        undoStack = new UndoStack();        undoSupport = new UndoableEditSupport();        undoSupport.addUndoableEditListener(new UndoAdapter());        cursorHighlight = new SelectionLayer(1, 1);        cursorHighlight.select(0, 0);        cursorHighlight.setVisible(prefs.getBoolean("cursorhighlight", true));        mapEventAdapter = new MapEventAdapter();        // Create a default brush        ShapeBrush sb = new ShapeBrush();        sb.makeQuadBrush(new Rectangle(0, 0, 1, 1));        setBrush(sb);        // Create the actions        saveAction = new SaveAction(this);        saveAsAction = new SaveAsAction(this);        exitAction = new ExitAction(this, saveAction);        zoomInAction = new ZoomInAction();        zoomOutAction = new ZoomOutAction();        zoomNormalAction = new ZoomNormalAction();        undoAction = new UndoAction();        redoAction = new RedoAction();        rot90Action = new LayerTransformAction(MapLayer.ROTATE_90);        rot180Action = new LayerTransformAction(MapLayer.ROTATE_180);        rot270Action = new LayerTransformAction(MapLayer.ROTATE_270);        flipHorAction = new LayerTransformAction(MapLayer.MIRROR_HORIZONTAL);        flipVerAction = new LayerTransformAction(MapLayer.MIRROR_VERTICAL);        selectAllAction = new SelectAllAction();        cancelSelectionAction = new CancelSelectionAction();        inverseAction = new InverseSelectionAction();        addLayerAction = new AddLayerAction(this);        cloneLayerAction = new CloneLayerAction(this);        deleteLayerAction = new DeleteLayerAction(this);        moveLayerUpAction = new MoveLayerUpAction(this);        moveLayerDownAction = new MoveLayerDownAction(this);        mergeLayerDownAction = new MergeLayerDownAction(this);        mergeAllLayersAction = new MergeAllLayersAction(this);        // Create our frame        appFrame = new JFrame(Resources.getString("dialog.main.title"));        appFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);        appFrame.addWindowListener(new WindowAdapter() {            public void windowClosing(WindowEvent event) {                exitAction.actionPerformed(null);            }        });        appFrame.setContentPane(createContentPane());        createMenuBar();        appFrame.setJMenuBar(menuBar);        appFrame.setSize(APP_WIDTH, APP_HEIGHT);        setCurrentMap(null);        updateRecent(null);        appFrame.setVisible(true);        // Load plugins        pluginLoader  = PluginClassLoader.getInstance();        try {            pluginLoader.readPlugins(null, appFrame);        } catch (Exception e) {            e.printStackTrace();            JOptionPane.showMessageDialog(appFrame,                    e.toString(), "Plugin loader",                    JOptionPane.WARNING_MESSAGE);        }        MapHelper.init(pluginLoader);    }