Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.richfaces.renderkit.html.images;
 
 import java.awt.Color;
 
import  org.richfaces.resource.DynamicUserResource;
@DynamicUserResource
public class GridSeparatorImage extends ToolbarSeparatorImage {
    public Dimension getDimension() {
        return calculateDimension();
    }
    public void paint(Graphics2D g2d) {
        Dimension dimensions = calculateDimension();
        BufferedImage texture = new BufferedImage(3, 3, .);
        Graphics2D txG2d = texture.createGraphics();
        txG2d.setColor(new Color(this.getHeaderBackgroundColor()));
        txG2d.fillRect(0, 0, 2, 2);
        txG2d.setColor(new Color(255, 255, 255, 150));
        txG2d.fillRect(0, 0, 1, 1);
        txG2d.dispose();
        g2d.setPaint(new TexturePaint(texturenew Rectangle(1, 1, 3, 3)));
        g2d.fillRect(0, 0, dimensions.widthdimensions.height);
    }
    private Dimension calculateDimension() {
        int h = (int) (this.getSeparatorHeight() * 0.8);
        h = h - h % 3;
        int w = 9;
        return new Dimension(wh);
    }
New to GrepCode? Check out our FAQ X