class HeaderSeparatorBorder extends AbstractBorder { protected Color color; public HeaderSeparatorBorder(Color color) { super(); this.color = color; } /** * 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(color); g.drawLine(x, y + height - 1, x + width - 1, y + height - 1); g.setColor(oldColor); } /** * 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(0, 0, 1, 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.left = insets.top = insets.right = insets.bottom = 1; return insets
public class HeaderSeparatorBorder extends AbstractBorder { protected Color color; public HeaderSeparatorBorder(Color color) { super(); this.color = color; } /** * 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(color); g.drawLine(x,y+height-1, x+width-1, y+height-1); g.setColor(oldColor); } /** * 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(0, 0, 1, 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.left = insets.top = insets.right = insets.bottom = 1; return insets
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/contact/gui/box/ContactList.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/viewer/HeaderSeparatorBorder.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
class HeaderSeparatorBorder extends AbstractBorder {
1
public class HeaderSeparatorBorder extends AbstractBorder {
2
		protected Color color;
2
	protected Color color;
3
	
3
	
4
	public HeaderSeparatorBorder(Color color) {
4
	public HeaderSeparatorBorder(Color color) {
5
			super();
5
		super();
6
	
6
		
7
		this.color = color;
7
		this.color = color;
8
		}
8
	}
9
		/**
9
	/**
10
		 * Paints the border for the specified component with the specified
10
	 * Paints the border for the specified component with the specified
11
		 * position
11
 position
12
 and size.
12
	 * and size.
13
		 * 
13
	 * 
14
		 * @param c
14
	 * @param c
15
		 *            the component for which this border is being painted
15
	 *            the component for which this border is being painted
16
		 * @param g
16
	 * @param g
17
		 *            the paint graphics
17
	 *            the paint graphics
18
		 * @param x
18
	 * @param x
19
		 *            the x position of the painted border
19
	 *            the x position of the painted border
20
		 * @param y
20
	 * @param y
21
		 *            the y position of the painted border
21
	 *            the y position of the painted border
22
		 * @param width
22
	 * @param width
23
		 *            the width of the painted border
23
	 *            the width of the painted border
24
		 * @param height
24
	 * @param height
25
		 *            the height of the painted border
25
	 *            the height of the painted border
26
		 */
26
	 */
27
		public void paintBorder(Component c, Graphics g, int x, int y,
27
	public void paintBorder(Component c, Graphics g, int x, int y,
28
				int width, 
28
 int width,
29
int height) {
29
			int height) {
30
			Color oldColor = g.getColor();
30
		Color oldColor = g.getColor();
31
			g.setColor(color);
31
		g.setColor(color);
32
			g.drawLine(x, y + height - 1, x + width - 1, y + height - 1);
32
		g.drawLine(x,y+height-1, x+width-1, y+height-1);
33
		
33
		
34
	g.setColor(oldColor);
34
		g.setColor(oldColor);
35
		}
35
	}
36
		/**
36
	/**
37
		 * Returns the insets of the border.
37
	 * Returns the insets of the border.
38
		 * 
38
	 * 
39
		 * @param c
39
	 * @param c
40
		 *            the component for which this border insets value applies
40
	 *            the component for which this border insets value applies
41
		 */
41
	 */
42
		public Insets getBorderInsets(Component c) {
42
	public Insets getBorderInsets(Component c) {
43
			return new Insets(0, 0, 1, 0);
43
		return new Insets(0, 0, 1, 0);
44
		}
44
	}
45
		/**
45
	/**
46
		 * Reinitialize the insets parameter with this Border's current Insets.
46
	 * Reinitialize the insets parameter with this Border's current Insets.
47
		 * 
47
	 * 
48
		 * @param c
48
	 * @param c
49
		 *            the component for which this border insets value applies
49
	 *            the component for which this border insets value applies
50
		 * @param insets
50
	 * @param insets
51
		 *            the object to be reinitialized
51
	 *            the object to be reinitialized
52
		 */
52
	 */
53
		public Insets getBorderInsets(Component c, Insets insets) {
53
	public Insets getBorderInsets(Component c, Insets insets) {
54
			insets.left = insets.top = insets.right = insets.bottom = 1;
54
		insets.left = insets.top = insets.right = insets.bottom = 1;
55
			return insets
55
		return insets
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0