myBrush = new RandomBrush((AbstractBrush)brushes.getSelectedBrush());
ShapeBrush sel = (ShapeBrush)brushes.getSelectedBrush(); sel.setSize(((Integer)brushSize.getValue()).intValue()); myBrush = new RandomBrush(sel);
    private void createFromOptions() {        Tile t = null;        if (myBrush instanceof ShapeBrush)            t = ((ShapeBrush)myBrush).getTile();        if (cbRandomBrush.isSelected()) {            myBrush = new RandomBrush((AbstractBrush)brushes.getSelectedBrush());            ((RandomBrush)myBrush).setRatio(sRandomAmount.getValue() / (double)sRandomAmount.getMaximum());            ((ShapeBrush)myBrush).setTile(t);        } else {            myBrush = new ShapeBrush((AbstractBrush)brushes.getSelectedBrush());            ((ShapeBrush)myBrush).setTile(t);        }        myBrush.setAffectedLayers(((Integer)affectLayers.getValue()).intValue());        update();    }