class SeparatorBorder implements Border { boolean isFirst(Component c) { return c.getParent() == null || c.getParent().getComponent(0) == c; } public Insets getBorderInsets(Component c) { // if the collapsible is collapsed, we do not want its border to be // painted. if (c instanceof JXCollapsiblePane) { if (((JXCollapsiblePane) c).isCollapsed()) { return new Insets(0, 0, 0, 0); } } return new Insets(isFirst(c) ? 4 : 1, 0, 1, 0); } public boolean isBorderOpaque() { return true; } public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { g.setColor(borderColor1); if (isFirst(c)) { g.drawLine(x, y + 2, x + width, y + 2);
class SeparatorBorder implements Border { boolean isFirst(Component c) { return c.getParent() == null || c.getParent().getComponent(0) == c; } public Insets getBorderInsets(Component c) { // if the collapsible is collapsed, we do not want its border to be // painted. if (c instanceof JXCollapsiblePane) { if (((JXCollapsiblePane) c).isCollapsed()) { return new Insets(0, 0, 0, 0); } } return new Insets(isFirst(c) ? 4 : 1, 0, 1, 0); } public boolean isBorderOpaque() { return true; } public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { g.setColor(borderColor1); if (isFirst(c)) { g.drawLine(x, y + 2, x + width, y + 2);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/search/ComponentBoxContainer.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/search/SearchResultBox.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
class SeparatorBorder implements Border {
1
class SeparatorBorder implements Border {
2
		boolean isFirst(Component c) {
2
		boolean isFirst(Component c) {
3
			return c.getParent() == null || c.getParent().getComponent(0) == c;
3
			return c.getParent() == null || c.getParent().getComponent(0) == c;
4
		}
4
		}
5
		public Insets getBorderInsets(Component c) {
5
		public Insets getBorderInsets(Component c) {
6
			// if the collapsible is collapsed, we do not want its border to be
6
			// if the collapsible is collapsed, we do not want its border to be
7
			// painted.
7
			// painted.
8
			if (c instanceof JXCollapsiblePane) {
8
			if (c instanceof JXCollapsiblePane) {
9
				if (((JXCollapsiblePane) c).isCollapsed()) {
9
				if (((JXCollapsiblePane) c).isCollapsed()) {
10
					return new Insets(0, 0, 0, 0);
10
					return new Insets(0, 0, 0, 0);
11
				}
11
				}
12
			}
12
			}
13
			return new Insets(isFirst(c) ? 4 : 1, 0, 1, 0);
13
			return new Insets(isFirst(c) ? 4 : 1, 0, 1, 0);
14
		}
14
		}
15
		public boolean isBorderOpaque() {
15
		public boolean isBorderOpaque() {
16
			return true;
16
			return true;
17
		}
17
		}
18
		public void paintBorder(Component c, Graphics g, int x, int y,
18
		public void paintBorder(Component c, Graphics g, int x, int y,
19
				int width, int height) {
19
				int width, int height) {
20
			g.setColor(borderColor1);
20
			g.setColor(borderColor1);
21
			if (isFirst(c)) {
21
			if (isFirst(c)) {
22
				g.drawLine(x, y + 2, x + width, y + 2);
22
				g.drawLine(x, y + 2, x + width, y + 2);
23
			
23
			
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