File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/aliasproperties/ColorPropertiesPanel.java | File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/aliasproperties/ColorPropertiesPanel.java | |||
Method name: void addObjectTreeColorComponents(GridBagConstraints)
|
Method name: void addToolbarColorComponents(GridBagConstraints)
|
|||
Number of AST nodes: 20 | Number of AST nodes: 20 | |||
1 | objectTreeBackgroundColorChk.setSelected(_props.isOverrideObjectTreeBackgroundColor());↵ | 1 | toolbarBackgroundColorChk.setSelected(_props.isOverrideToolbarBackgroundColor());↵ | |
2 | add(objectTreeBackgroundColorChk, gbc);↵ | 2 | add(toolbarBackgroundColorChk, gbc);↵ | |
3 | // Set object tree color button↵ | 3 | // Set toolbar color button↵ | |
4 | ++gbc.gridx;↵ | 4 | ++gbc.gridx;↵ | |
5 | objectTreeBackgroundColorBtn = new JButton(i18n.OBJECT_TREE_BACKGROUND_COLOR_BUTTON_LABEL);↵ | 5 | toolbarBackgroundColorBtn = new JButton(i18n.TOOLBAR_BACKGROUND_COLOR_BUTTON_LABEL);↵ | |
6 | add(objectTreeBackgroundColorBtn, gbc);↵ | 6 | add(toolbarBackgroundColorBtn, gbc);↵ | |
7 | // Set object tree color panel↵ | 7 | // Set toolbar color panel↵ | |
8 | ++gbc.gridx;↵ | 8 | ++gbc.gridx;↵ | |
9 | gbc.anchor = GridBagConstraints.EAST;↵ | 9 | gbc.anchor = GridBagConstraints.EAST;↵ | |
10 | gbc.fill = GridBagConstraints.HORIZONTAL;↵ | 10 | gbc.fill = GridBagConstraints.HORIZONTAL;↵ | |
11 | objectTreeBackgroundColorChk.setSelected(_props.isOverrideObjectTreeBackgroundColor());↵ | 11 | toolbarBackgroundColorChk.setSelected(_props.isOverrideToolbarBackgroundColor());↵ | |
12 | objectTreeBackgroundColorBtn.setEnabled(_props.isOverrideObjectTreeBackgroundColor());↵ | 12 | toolbarBackgroundColorBtn.setEnabled(_props.isOverrideToolbarBackgroundColor());↵ | |
13 | objectTreeBackgroundLbl = new JLabel(i18n.BACKGROUND_COLOR_LABEL);↵ | 13 | toolBarBackgroundLbl = new JLabel(i18n.BACKGROUND_COLOR_LABEL);↵ | |
14 | objectTreeBackgroundColorPnl.add(objectTreeBackgroundLbl);↵ | 14 | toolbarBackgroundColorPnl.add(toolBarBackgroundLbl);↵ | |
15 | objectTreeBackgroundColorPnl.setEnabled(_props.isOverrideObjectTreeBackgroundColor());↵ | 15 | toolbarBackgroundColorPnl.setEnabled(_props.isOverrideToolbarBackgroundColor());↵ | |
16 | objectTreeBackgroundLbl.setEnabled(_props.isOverrideObjectTreeBackgroundColor());↵ | 16 | toolBarBackgroundLbl.setEnabled(_props.isOverrideToolbarBackgroundColor());↵ | |
17 | if (_props.isOverrideObjectTreeBackgroundColor())↵ | 17 | if (_props.isOverrideToolbarBackgroundColor())↵ | |
18 | {↵ | 18 | {↵ | |
19 | objectTreeBackgroundColor = new Color(_props.getObjectTreeBackgroundColorRgbValue());↵ | 19 | toolbarBackgroundColor = new Color(_props.getToolbarBackgroundColorRgbValue());↵ | |
20 | objectTreeBackgroundColorPnl.setBackground(objectTreeBackgroundColor);↵ | 20 | toolbarBackgroundColorPnl.setBackground(toolbarBackgroundColor);↵ | |
21 | }↵ | 21 | }↵ | |
22 | add(objectTreeBackgroundColorPnl, gbc);↵ | 22 | add(toolbarBackgroundColorPnl, gbc);↵ | |
23 | objectTreeBackgroundColorChk.addActionListener(new ActionListener()↵ | 23 | toolbarBackgroundColorChk.addActionListener(new ActionListener()↵ | |
24 | {↵ | 24 | {↵ | |
25 | @Override↵ | 25 | @Override↵ | |
26 | public void actionPerformed(ActionEvent e)↵ | 26 | public void actionPerformed(ActionEvent e)↵ | |
27 | {↵ | 27 | {↵ | |
28 | if (objectTreeBackgroundColorChk.isSelected())↵ | 28 | if (toolbarBackgroundColorChk.isSelected())↵ | |
29 | {↵ | 29 | {↵ | |
30 | objectTreeBackgroundColorBtn.setEnabled(true);↵ | 30 | toolbarBackgroundColorBtn.setEnabled(true);↵ | |
31 | objectTreeBackgroundColorPnl.setEnabled(true);↵ | 31 | toolbarBackgroundColorPnl.setEnabled(true);↵ | |
32 | objectTreeBackgroundLbl.setEnabled(true);↵ | 32 | toolBarBackgroundLbl.setEnabled(true);↵ | |
33 | }↵ | 33 | }↵ | |
34 | else↵ | 34 | else↵ | |
35 | {↵ | 35 | {↵ | |
36 | objectTreeBackgroundColorBtn.setEnabled(false);↵ | 36 | toolbarBackgroundColorBtn.setEnabled(false);↵ | |
37 | objectTreeBackgroundColorPnl.setEnabled(false);↵ | 37 | toolbarBackgroundColorPnl.setEnabled(false);↵ | |
38 | objectTreeBackgroundLbl.setEnabled(false);↵ | 38 | toolBarBackgroundLbl.setEnabled(false);↵ | |
39 | }↵ | 39 | }↵ | |
40 | }↵ | 40 | }↵ | |
41 | });↵ | 41 | });↵ | |
42 | objectTreeBackgroundColorBtn.addActionListener(new ActionListener()↵ | 42 | toolbarBackgroundColorBtn.addActionListener(new ActionListener()↵ | |
43 | {↵ | 43 | {↵ | |
44 | @Override↵ | 44 | @Override↵ | |
45 | public void actionPerformed(ActionEvent e)↵ | 45 | public void actionPerformed(ActionEvent e)↵ | |
46 | {↵ | 46 | {↵ | |
47 | Color startColor = objectTreeBackgroundColor == null ? Color.WHITE : objectTreeBackgroundColor;↵ | 47 | Color startColor = toolbarBackgroundColor == null ? Color.WHITE : toolbarBackgroundColor;↵ | |
48 | Color newColor =↵ | 48 | Color newColor =↵ | |
49 | JColorChooser.showDialog(null, i18n.OBJECT_TREE_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE,↵ | 49 | JColorChooser.showDialog(null, i18n.TOOLBAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE,↵ | |
50 | startColor);↵ | 50 | startColor);↵ | |
51 | if (newColor != null)↵ | 51 | if (newColor != null)↵ | |
52 | {↵ | 52 | {↵ | |
53 | objectTreeBackgroundColor = newColor;↵ | 53 | toolbarBackgroundColor = newColor;↵ | |
54 | objectTreeBackgroundColorPnl.setBackground(newColor);↵ | 54 | toolbarBackgroundColorPnl.setBackground(newColor);↵ | |
55 | objectTreeBackgroundColorPnl.validate();↵ | 55 | toolbarBackgroundColorPnl.validate();↵ | |
56 | }↵ | 56 | }↵ | |
57 | }↵ | 57 | }↵ | |
58 | }); | 58 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 163 |
Number of mapped statements | 20 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 70.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | objectTreeBackgroundColorChk.setSelected(_props.isOverrideObjectTreeBackgroundColor()); |
| 1 | toolbarBackgroundColorChk.setSelected(_props.isOverrideToolbarBackgroundColor()); | |||||||||||||||||||||||||||||||
2 | add(objectTreeBackgroundColorChk, gbc); |
| 2 | add(toolbarBackgroundColorChk, gbc); | |||||||||||||||||||||||||||||||
3 | ++gbc.gridx; | 3 | ++gbc.gridx; | ||||||||||||||||||||||||||||||||
4 | objectTreeBackgroundColorBtn = new JButton(i18n.OBJECT_TREE_BACKGROUND_COLOR_BUTTON_LABEL); |
| 4 | toolbarBackgroundColorBtn = new JButton(i18n.TOOLBAR_BACKGROUND_COLOR_BUTTON_LABEL); | |||||||||||||||||||||||||||||||
5 | add(objectTreeBackgroundColorBtn, gbc); |
| 5 | add(toolbarBackgroundColorBtn, gbc); | |||||||||||||||||||||||||||||||
6 | ++gbc.gridx; | 6 | ++gbc.gridx; | ||||||||||||||||||||||||||||||||
7 | gbc.anchor = GridBagConstraints.EAST; | 7 | gbc.anchor = GridBagConstraints.EAST; | ||||||||||||||||||||||||||||||||
8 | gbc.fill = GridBagConstraints.HORIZONTAL; | 8 | gbc.fill = GridBagConstraints.HORIZONTAL; | ||||||||||||||||||||||||||||||||
9 | objectTreeBackgroundColorChk.setSelected(_props.isOverrideObjectTreeBackgroundColor()); |
| 9 | toolbarBackgroundColorChk.setSelected(_props.isOverrideToolbarBackgroundColor()); | |||||||||||||||||||||||||||||||
10 | objectTreeBackgroundColorBtn.setEnabled(_props.isOverrideObjectTreeBackgroundColor()); |
| 10 | toolbarBackgroundColorBtn.setEnabled(_props.isOverrideToolbarBackgroundColor()); | |||||||||||||||||||||||||||||||
11 | objectTreeBackgroundLbl = new JLabel(i18n.BACKGROUND_COLOR_LABEL); |
| 11 | toolBarBackgroundLbl = new JLabel(i18n.BACKGROUND_COLOR_LABEL); | |||||||||||||||||||||||||||||||
12 | objectTreeBackgroundColorPnl.add(objectTreeBackgroundLbl); |
| 12 | toolbarBackgroundColorPnl.add(toolBarBackgroundLbl); | |||||||||||||||||||||||||||||||
13 | objectTreeBackgroundColorPnl.setEnabled(_props.isOverrideObjectTreeBackgroundColor()); |
| 13 | toolbarBackgroundColorPnl.setEnabled(_props.isOverrideToolbarBackgroundColor()); | |||||||||||||||||||||||||||||||
14 | objectTreeBackgroundLbl.setEnabled(_props.isOverrideObjectTreeBackgroundColor()); |
| 14 | toolBarBackgroundLbl.setEnabled(_props.isOverrideToolbarBackgroundColor()); | |||||||||||||||||||||||||||||||
15 | if (_props.isOverrideObjectTreeBackgroundColor()) |
| 15 | if (_props.isOverrideToolbarBackgroundColor()) | |||||||||||||||||||||||||||||||
16 | objectTreeBackgroundColor = new Color(_props.getObjectTreeBackgroundColorRgbValue()); |
| 16 | toolbarBackgroundColor = new Color(_props.getToolbarBackgroundColorRgbValue()); | |||||||||||||||||||||||||||||||
17 | objectTreeBackgroundColorPnl.setBackground(objectTreeBackgroundColor); |
| 17 | toolbarBackgroundColorPnl.setBackground(toolbarBackgroundColor); | |||||||||||||||||||||||||||||||
18 | add(objectTreeBackgroundColorPnl, gbc); |
| 18 | add(toolbarBackgroundColorPnl, gbc); | |||||||||||||||||||||||||||||||
19 | objectTreeBackgroundColorChk.addActionListener(new ActionListener() {...}); |
| 19 | toolbarBackgroundColorChk.addActionListener(new ActionListener() {...}); | |||||||||||||||||||||||||||||||
20 | objectTreeBackgroundColorBtn.addActionListener(new ActionListener() {...}); |
| 20 | toolbarBackgroundColorBtn.addActionListener(new ActionListener() {...}); |
Row | Violation |
---|---|
1 | Expression _props.getObjectTreeBackgroundColorRgbValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression _props.getToolbarBackgroundColorRgbValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted |