public class LabelTextFieldPanel extends JPanel { private GridBagLayout layout; private int y = 0; public LabelTextFieldPanel() { layout = new GridBagLayout(); setLayout(layout); } public void addLabel(JComponent label) { GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = y; c.weightx = 0.0; c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(0, 0, 0, 11); layout.setConstraints(label, c); add(label); } public void addTextField(JComponent component) { GridBagConstraints c = new GridBagConstraints(); c.gridx = 1; c.weightx = 1.0; c.gridy = y; c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(5, 0, 0, 0); c.anchor = GridBagConstraints.EAST; c.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(component, c); add(component); y += 1; } public void addSeparator() { GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.weightx = 1.0; c.gridy = y; c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(0, 0, 0, 0); c.gridwidth = GridBagConstraints.REMAINDER; Component component = Box.createVerticalStrut(11); layout.setConstraints(component, c); add(component); y += 1
public class WizardTextField extends JPanel { private GridBagLayout layout; private int y = 0; public WizardTextField() { setOpaque(false); layout = new GridBagLayout(); setLayout(layout); } public void addLabel(JLabel label) { GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = y; c.weightx = 0.0; c.anchor = GridBagConstraints.WEST; c.insets = new Insets(0, 0, 0, 20); layout.setConstraints(label, c); add(label); } public void addTextField(JComponent component) { GridBagConstraints c = new GridBagConstraints(); c.gridx = 1; c.weightx = 1.0; c.gridy = y; c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(0, 0, 0, 0); c.anchor = GridBagConstraints.EAST; c.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(component, c); add(component); } public void addExample(JLabel example) { y += 1; GridBagConstraints c = new GridBagConstraints(); c.gridx = 1; c.gridy = y; c.weightx = 0.0; c.insets = new Insets(0, 10, 10, 0); c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.NONE; layout.setConstraints(example, c); add(example); y += 1; } public void addEmptyExample() { y += 2
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/util/LabelTextFieldPanel.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/base/WizardTextField.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class LabelTextFieldPanel extends JPanel {
1
public class WizardTextField extends JPanel {
2
	private GridBagLayout layout;
2
    private GridBagLayout layout;
3
	private int y = 0;
3
    private int y = 0;
4
	public LabelTextFieldPanel() {
4
    public WizardTextField
5
		
5
() {
6
        setOpaque(false);
6
layout = new GridBagLayout();
7
        layout = new GridBagLayout();
7
		setLayout(layout);
8
        setLayout(layout);
8
	}
9
	
9
    }
10
public void addLabel(JComponent label) {
10
    public void addLabel(JLabel label) {
11
		GridBagConstraints c = new GridBagConstraints();
11
        GridBagConstraints c = new GridBagConstraints();
12
		c.gridx = 0;
12
        c.gridx = 0;
13
		c.gridy = y;
13
        c.gridy = y;
14
		c.weightx = 0.0;
14
        c.weightx = 0.0;
15
		c.anchor = GridBagConstraints.WEST;
15
        c.anchor = GridBagConstraints.WEST;
16
		c.fill = GridBagConstraints.HORIZONTAL;
17
		c.insets = new Insets(0, 0, 0, 11);
16
        c.insets = new Insets(0, 0, 0, 20);
18
		layout.setConstraints(label, c);
17
        layout.setConstraints(label, c);
19
		add(label);
18
        add(label);
20
	}
21
	
19
    }
22
public void addTextField(JComponent component) {
20
    public void addTextField(JComponent component) {
23
		GridBagConstraints c = new GridBagConstraints();
21
        GridBagConstraints c = new GridBagConstraints();
24
		c.gridx = 1;
22
        c.gridx = 1;
25
		c.weightx = 1.0;
23
        c.weightx = 1.0;
26
		c.gridy = y;
24
        c.gridy = y;
27
		c.fill = GridBagConstraints.HORIZONTAL;
25
        c.fill = GridBagConstraints.HORIZONTAL;
28
		c.insets = new Insets(5, 0, 0, 0);
26
        c.insets = new Insets(0, 0, 0, 0);
29
		c.anchor = GridBagConstraints.EAST;
27
        c.anchor = GridBagConstraints.EAST;
30
		c.gridwidth = GridBagConstraints.REMAINDER;
28
        c.gridwidth = GridBagConstraints.REMAINDER;
31
		layout.setConstraints(component, c);
29
        layout.setConstraints(component, c);
32
		add(component);
30
        add(component);
33
		y += 1;
34
	}
35
	public void addSeparator() {
36
		
31
    }
32
    public void addExample(JLabel example) {
33
        y += 1;
37
GridBagConstraints c = new GridBagConstraints();
34
        GridBagConstraints c = new GridBagConstraints();
38
		
39
c.gridx = 0;
35
        c.gridx = 1;
40
		c.weightx = 1.0;
41
		c.gridy = y;
42
		c.fill = GridBagConstraints.HORIZONTAL;
43
		
36
        c.gridy = y;
37
        c.weightx = 0.0;
44
c.insets = new Insets(0, 0, 0, 0);
38
        c.insets = new Insets(0, 10, 10, 0);
45
		c.gridwidth = GridBagConstraints.REMAINDER;
39
        c.anchor = GridBagConstraints.
46
		Component component = Box.createVerticalStrut(11);
47
		
40
WEST;
41
        c.fill = GridBagConstraints.NONE;
48
layout.setConstraints(component, c);
42
        layout.setConstraints(
49
		add(component);
50
		y += 1
43
example, c);
44
        add(example);
45
        y += 1;
46
    }
47
    public void addEmptyExample() {
48
        y += 2
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