content: /*
   * Copyright 2008-2013 Andre Pfeiler
   *
   * This file is part of FindBugs-IDEA.
   *
   * FindBugs-IDEA is free software: you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
   *
   * FindBugs-IDEA 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 General Public License for more details.
   *
   * You should have received a copy of the GNU General Public License
   * along with FindBugs-IDEA.  If not, see <http://www.gnu.org/licenses/>.
   */
  package org.twodividedbyzero.idea.findbugs.gui.common;
  
  import javax.swing.border.LineBorder;
  import java.awt.BasicStroke;
  import java.awt.Color;
  import java.awt.Component;
  import java.awt.Graphics;
  import java.awt.Graphics2D;
  
  
  /**
   * $Date$
   *
   * @author Andre Pfeiler<andrep@twodividedbyzero.org>
   * @version $Revision$
   * @since 0.9.7-dev
   */
  public class DashedBorder extends LineBorder {
  
  	private static final long serialVersionUID = 0L;
  
  	private static final BasicStroke _stroke = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 1, new float[] {5, 5}, 0);
  
  
  	public DashedBorder(final Color color, final int thickness) {
  		super(color, thickness);
  	}
  
  
  	@Override
  	public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) {
  		final Graphics2D g2d = (Graphics2D) g.create();
  		g2d.setStroke(_stroke);
  		super.paintBorder(c, g2d, x, y, width, height);
  		g2d.dispose();
  	}
  
  
  	public static BasicStroke getStroke() {
  		return _stroke;
  	}
  }
  