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