File path: /jEdit-4.2/src/org/gjt/sp/jedit/menu/EnhancedCheckBoxMenuItem.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/menu/EnhancedMenuItem.java | |||
Method name: void paint(Graphics)
|
Method name: void paint(Graphics)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | super.paint(g);↵ | 1 | super.paint(g);↵ | |
2 | if(shortcut != null)↵ | 2 | if(shortcut != null)↵ | |
3 | {↵ | 3 | {↵ | |
4 | g.setFont(EnhancedMenuItem.acceleratorFont);↵ | 4 | g.setFont(acceleratorFont);↵ | |
5 | g.setColor(getModel().isArmed() ?↵ | 5 | g.setColor(getModel().isArmed() ?↵ | |
6 | EnhancedMenuItem.acceleratorSelectionForeground :↵ | 6 | acceleratorSelectionForeground :↵ | |
7 | EnhancedMenuItem.acceleratorForeground);↵ | 7 | acceleratorForeground);↵ | |
8 | FontMetrics fm = g.getFontMetrics();↵ | 8 | FontMetrics fm = g.getFontMetrics();↵ | |
9 | Insets insets = getInsets();↵ | 9 | Insets insets = getInsets();↵ | |
10 | g.drawString(shortcut,getWidth() - (fm.stringWidth(↵ | 10 | g.drawString(shortcut,getWidth() - (fm.stringWidth(↵ | |
11 | shortcut) + insets.right + insets.left + 5),↵ | 11 | shortcut) + insets.right + insets.left + 5),↵ | |
12 | getFont().getSize() + (insets.top - ↵ | 12 | getFont().getSize() + (insets.top - ↵ | |
13 | (OperatingSystem.isMacOSLF() ? 0 : 1))↵ | 13 | (OperatingSystem.isMacOSLF() ? 0 : 1))↵ | |
14 | /* XXX magic number */);↵ | 14 | /* XXX magic number */);↵ | |
15 | } | 15 |
| |
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 37 |
Number of mapped statements | 7 |
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) | 2.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | super.paint(g); | 1 | super.paint(g); | ||||||||||||||
2 | if (shortcut != null) | 2 | if (shortcut != null) | ||||||||||||||
3 | g.setFont(EnhancedMenuItem.acceleratorFont); |
| 3 | g.setFont(acceleratorFont); | |||||||||||||
4 | g.setColor(getModel().isArmed() ? EnhancedMenuItem.acceleratorSelectionForeground : EnhancedMenuItem.acceleratorForeground); |
| 4 | g.setColor(getModel().isArmed() ? acceleratorSelectionForeground : acceleratorForeground); | |||||||||||||
5 | FontMetrics fm = g.getFontMetrics(); | 5 | FontMetrics fm = g.getFontMetrics(); | ||||||||||||||
6 | Insets insets = getInsets(); | 6 | Insets insets = getInsets(); | ||||||||||||||
7 | g.drawString(shortcut, getWidth() - (fm.stringWidth(shortcut) + insets.right + insets.left + 5), getFont().getSize() + (insets.top - (OperatingSystem.isMacOSLF() ? 0 : 1))); | 7 | g.drawString(shortcut, getWidth() - (fm.stringWidth(shortcut) + insets.right + insets.left + 5), getFont().getSize() + (insets.top - (OperatingSystem.isMacOSLF() ? 0 : 1))); |
Row | Violation |
---|