/*
* Copyright (C) 2011-2014 GeoForge Project
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.geoforge.java.awt.paint;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Rectangle;
import java.awt.TexturePaint;
import java.awt.image.BufferedImage;
/**
*
* @author Amadeus.Sowerby
*
* email: Amadeus.Sowerby_AT_gmail.com
* ... please remove "_AT_" from the above string to get the right email address
*/
public class GfrUtilPaint
{
public static Paint s_getTexturePoint()
{
BufferedImage bi = new BufferedImage(5, 5, BufferedImage.TYPE_INT_RGB);
Graphics2D big = bi.createGraphics();
big.setColor(new Color(251,198,68));
big.fillRect(0, 0, 5, 5);
big.setColor(Color.DARK_GRAY);
big.fillRect(1, 3, 1, 1);
Rectangle r = new Rectangle(0, 0, 5, 5);
return new TexturePaint(bi, r);
}
public static Paint s_getTextureDash()
{
BufferedImage bi = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
Graphics2D big = bi.createGraphics();
big.setColor(new Color(148,165,160));
big.fillRect(0, 0, 10, 10);
big.setColor(Color.DARK_GRAY);
big.fillRect(1, 1, 5, 1);
big.fillRect(6, 6, 5, 1);
Rectangle r = new Rectangle(0, 0, 10, 10);
return new TexturePaint(bi, r);
}
}