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 addStatusBarColorComponents(GridBagConstraints)
|
Method name: void addToolbarColorComponents(GridBagConstraints)
|
|||
Number of AST nodes: 20 | Number of AST nodes: 20 | |||
1 | statusBarBackgroundColorChk.setSelected(_props.isOverrideStatusBarBackgroundColor());↵ | 1 | toolbarBackgroundColorChk.setSelected(_props.isOverrideToolbarBackgroundColor());↵ | |
2 | add(statusBarBackgroundColorChk, gbc);↵ | 2 | add(toolbarBackgroundColorChk, gbc);↵ | |
3 | // Set object tree color button↵ | 3 | // Set toolbar color button↵ | |
4 | ++gbc.gridx;↵ | 4 | ++gbc.gridx;↵ | |
5 | statusBarBackgroundColorBtn = new JButton(i18n.STATUS_BAR_BACKGROUND_COLOR_BUTTON_LABEL);↵ | 5 | toolbarBackgroundColorBtn = new JButton(i18n.TOOLBAR_BACKGROUND_COLOR_BUTTON_LABEL);↵ | |
6 | add(statusBarBackgroundColorBtn, 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 | statusBarBackgroundColorChk.setSelected(_props.isOverrideStatusBarBackgroundColor());↵ | 11 | toolbarBackgroundColorChk.setSelected(_props.isOverrideToolbarBackgroundColor());↵ | |
12 | statusBarBackgroundColorBtn.setEnabled(_props.isOverrideObjectTreeBackgroundColor());↵ | 12 | toolbarBackgroundColorBtn.setEnabled(_props.isOverrideToolbarBackgroundColor());↵ | |
13 | statusBarBackgroundLbl = new JLabel(i18n.BACKGROUND_COLOR_LABEL);↵ | 13 | toolBarBackgroundLbl = new JLabel(i18n.BACKGROUND_COLOR_LABEL);↵ | |
14 | statusBarBackgroundLbl.setEnabled(_props.isOverrideStatusBarBackgroundColor());↵ | 14 | toolbarBackgroundColorPnl.add(toolBarBackgroundLbl);↵ | |
15 | statusBarBackgroundColorPnl.add(statusBarBackgroundLbl);↵ | 15 | toolbarBackgroundColorPnl.setEnabled(_props.isOverrideToolbarBackground↵ | |
16 | status↵ | 16 | Color());↵ | |
17 | BarBackgroundColorPnl.setEnabled(_props.isOverrideStatusBarBackgroundColor());↵ | 17 | toolBarBackgroundLbl.setEnabled(_props.isOverrideToolbarBackgroundColor());↵ | |
18 | if (_props.isOverrideStatusBarBackgroundColor())↵ | 18 | if (_props.isOverrideToolbarBackgroundColor())↵ | |
19 | {↵ | 19 | {↵ | |
20 | statusBarBackgroundColor = new Color(_props.getStatusBarBackgroundColorRgbValue());↵ | 20 | toolbarBackgroundColor = new Color(_props.getToolbarBackgroundColorRgbValue());↵ | |
21 | statusBarBackgroundColorPnl.setBackground(statusBarBackgroundColor);↵ | 21 | toolbarBackgroundColorPnl.setBackground(toolbarBackgroundColor);↵ | |
22 | }↵ | 22 | }↵ | |
23 | add(statusBarBackgroundColorPnl, gbc);↵ | 23 | add(toolbarBackgroundColorPnl, gbc);↵ | |
24 | statusBarBackgroundColorChk.addActionListener(new ActionListener()↵ | 24 | toolbarBackgroundColorChk.addActionListener(new ActionListener()↵ | |
25 | {↵ | 25 | {↵ | |
26 | @Override↵ | 26 | @Override↵ | |
27 | public void actionPerformed(ActionEvent e)↵ | 27 | public void actionPerformed(ActionEvent e)↵ | |
28 | {↵ | 28 | {↵ | |
29 | if (statusBarBackgroundColorChk.isSelected())↵ | 29 | if (toolbarBackgroundColorChk.isSelected())↵ | |
30 | {↵ | 30 | {↵ | |
31 | statusBarBackgroundColorBtn.setEnabled(true);↵ | 31 | toolbarBackgroundColorBtn.setEnabled(true);↵ | |
32 | statusBarBackgroundColorPnl.setEnabled(true);↵ | 32 | toolbarBackgroundColorPnl.setEnabled(true);↵ | |
33 | statusBarBackgroundLbl.setEnabled(true);↵ | 33 | toolBarBackgroundLbl.setEnabled(true);↵ | |
34 | }↵ | 34 | }↵ | |
35 | else↵ | 35 | else↵ | |
36 | {↵ | 36 | {↵ | |
37 | statusBarBackgroundColorBtn.setEnabled(false);↵ | 37 | toolbarBackgroundColorBtn.setEnabled(false);↵ | |
38 | statusBarBackgroundColorPnl.setEnabled(false);↵ | 38 | toolbarBackgroundColorPnl.setEnabled(false);↵ | |
39 | statusBarBackgroundLbl.setEnabled(false);↵ | 39 | toolBarBackgroundLbl.setEnabled(false);↵ | |
40 | }↵ | 40 | }↵ | |
41 | }↵ | 41 | }↵ | |
42 | });↵ | 42 | });↵ | |
43 | statusBarBackgroundColorBtn.addActionListener(new ActionListener()↵ | 43 | toolbarBackgroundColorBtn.addActionListener(new ActionListener()↵ | |
44 | {↵ | 44 | {↵ | |
45 | @Override↵ | 45 | @Override↵ | |
46 | public void actionPerformed(ActionEvent e)↵ | 46 | public void actionPerformed(ActionEvent e)↵ | |
47 | {↵ | 47 | {↵ | |
48 | Color startColor = statusBarBackgroundColor == null ? Color.WHITE : statusBarBackgroundColor;↵ | 48 | Color startColor = toolbarBackgroundColor == null ? Color.WHITE : toolbarBackgroundColor;↵ | |
49 | Color newColor =↵ | 49 | Color newColor =↵ | |
50 | JColorChooser.showDialog(null, i18n.STATUS_BAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE,↵ | 50 | JColorChooser.showDialog(null, i18n.TOOLBAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE,↵ | |
51 | startColor);↵ | 51 | startColor);↵ | |
52 | if (newColor != null)↵ | 52 | if (newColor != null)↵ | |
53 | {↵ | 53 | {↵ | |
54 | statusBarBackgroundColor = newColor;↵ | 54 | toolbarBackgroundColor = newColor;↵ | |
55 | statusBarBackgroundColorPnl.setBackground(newColor);↵ | 55 | toolbarBackgroundColorPnl.setBackground(newColor);↵ | |
56 | statusBarBackgroundColorPnl.validate();↵ | 56 | toolbarBackgroundColorPnl.validate();↵ | |
57 | }↵ | 57 | }↵ | |
58 | }↵ | 58 | }↵ | |
59 | }); | 59 |
| |
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.5 |
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) | 86.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | statusBarBackgroundColorChk.setSelected(_props.isOverrideStatusBarBackgroundColor()); |
| 1 | toolbarBackgroundColorChk.setSelected(_props.isOverrideToolbarBackgroundColor()); | |||||||||||||||||||||||||||||||
2 | add(statusBarBackgroundColorChk, gbc); |
| 2 | add(toolbarBackgroundColorChk, gbc); | |||||||||||||||||||||||||||||||
3 | ++gbc.gridx; | 3 | ++gbc.gridx; | ||||||||||||||||||||||||||||||||
4 | statusBarBackgroundColorBtn = new JButton(i18n.STATUS_BAR_BACKGROUND_COLOR_BUTTON_LABEL); |
| 4 | toolbarBackgroundColorBtn = new JButton(i18n.TOOLBAR_BACKGROUND_COLOR_BUTTON_LABEL); | |||||||||||||||||||||||||||||||
5 | add(statusBarBackgroundColorBtn, 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 | statusBarBackgroundColorChk.setSelected(_props.isOverrideStatusBarBackgroundColor()); |
| 9 | toolbarBackgroundColorChk.setSelected(_props.isOverrideToolbarBackgroundColor()); | |||||||||||||||||||||||||||||||
10 | statusBarBackgroundColorBtn.setEnabled(_props.isOverrideObjectTreeBackgroundColor()); |
| 10 | toolbarBackgroundColorBtn.setEnabled(_props.isOverrideToolbarBackgroundColor()); | |||||||||||||||||||||||||||||||
11 | statusBarBackgroundLbl = new JLabel(i18n.BACKGROUND_COLOR_LABEL); |
| 11 | toolBarBackgroundLbl = new JLabel(i18n.BACKGROUND_COLOR_LABEL); | |||||||||||||||||||||||||||||||
12 | statusBarBackgroundLbl.setEnabled(_props.isOverrideStatusBarBackgroundColor()); |
| 14 | toolBarBackgroundLbl.setEnabled(_props.isOverrideToolbarBackgroundColor()); | |||||||||||||||||||||||||||||||
13 | statusBarBackgroundColorPnl.add(statusBarBackgroundLbl); |
| 12 | toolbarBackgroundColorPnl.add(toolBarBackgroundLbl); | |||||||||||||||||||||||||||||||
14 | statusBarBackgroundColorPnl.setEnabled(_props.isOverrideStatusBarBackgroundColor()); |
| 13 | toolbarBackgroundColorPnl.setEnabled(_props.isOverrideToolbarBackgroundColor()); | |||||||||||||||||||||||||||||||
15 | if (_props.isOverrideStatusBarBackgroundColor()) |
| 15 | if (_props.isOverrideToolbarBackgroundColor()) | |||||||||||||||||||||||||||||||
16 | statusBarBackgroundColor = new Color(_props.getStatusBarBackgroundColorRgbValue()); |
| 16 | toolbarBackgroundColor = new Color(_props.getToolbarBackgroundColorRgbValue()); | |||||||||||||||||||||||||||||||
17 | statusBarBackgroundColorPnl.setBackground(statusBarBackgroundColor); |
| 17 | toolbarBackgroundColorPnl.setBackground(toolbarBackgroundColor); | |||||||||||||||||||||||||||||||
18 | add(statusBarBackgroundColorPnl, gbc); |
| 18 | add(toolbarBackgroundColorPnl, gbc); | |||||||||||||||||||||||||||||||
19 | statusBarBackgroundColorChk.addActionListener(new ActionListener() {...}); |
| 19 | toolbarBackgroundColorChk.addActionListener(new ActionListener() {...}); | |||||||||||||||||||||||||||||||
20 | statusBarBackgroundColorBtn.addActionListener(new ActionListener() {...}); |
| 20 | toolbarBackgroundColorBtn.addActionListener(new ActionListener() {...}); |
Row | Violation |
---|---|
1 | Expression _props.getStatusBarBackgroundColorRgbValue() 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 |