// BlogBridge -- RSS feed reader, manager, and web based service // Copyright (C) 2002-2007 by R. Pito Salas // // This program 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 2 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 General Public License for more details. // // You should have received a copy of the GNU General Public License along with this program; // if not, write to the Free Software Foundation, Inc., 59 Temple Place, // Suite 330, Boston, MA 02111-1307 USA // // Contact: R. Pito Salas // mailto:pitosalas@users.sourceforge.net // More information: about BlogBridge // http://www.blogbridge.com // http://sourceforge.net/projects/blogbridge // // $Id: ResultItemBorder.java,v 1.1 2007/06/07 09:37:39 spyromus Exp $ // package com.salas.bb.search; import javax.swing.border.LineBorder; import java.awt.*; /** * The border around the icon. */ class ResultItemBorder extends LineBorder { /** * Creates a line border with the specified color and a thickness = 1. * * @param color the color for the border */ public ResultItemBorder(Color color) { super(color); } /** * Returns the insets of the border. * * @param c the component for which this border insets value applies */ public Insets getBorderInsets(Component c) { return new Insets(thickness, 0, 0, 0); } /** * Reinitialize the insets parameter with this Border's current Insets. * * @param c the component for which this border insets value applies * @param insets the object to be reinitialized */ public Insets getBorderInsets(Component c, Insets insets) { insets.top = thickness; insets.left = insets.bottom = insets.right = 0; return insets; } /** * Paints the border for the specified component with the specified position and size. * * @param c the component for which this border is being painted * @param g the paint graphics * @param x the x position of the painted border * @param y the y position of the painted border * @param width the width of the painted border * @param height the height of the painted border */ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Color oldColor = g.getColor(); g.setColor(lineColor); for (int i = 0; i < thickness; i++) g.drawLine(x, y + i, width, y + i); g.setColor(oldColor); } }