| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -63,8 +63,8 @@ public class EditorHeader extends JComponent { | |||
| 63 | 63 | // (total tab width will be this plus TEXT_MARGIN*2) | |
| 64 | 64 | static final int NO_TEXT_WIDTH = Toolkit.zoom(16); | |
| 65 | 65 | ||
| 66 | - Color textColor[] = new Color[2]; | ||
| 67 | - Color tabColor[] = new Color[2]; | ||
| 66 | + Color[] textColor = new Color[2]; | ||
| 67 | + Color[] tabColor = new Color[2]; | ||
| 68 | 68 | Color modifiedColor; | |
| 69 | 69 | Color arrowColor; | |
| 70 | 70 | ||
@@ -238,8 +238,8 @@ public void paintComponent(Graphics screen) { | |||
| 238 | 238 | Arrays.sort(visitOrder); // sort on when visited | |
| 239 | 239 | ||
| 240 | 240 | // Keep shrinking the tabs one-by-one until things fit properly | |
| 241 | - for (int i = 0; i < visitOrder.length; i++) { | ||
| 242 | - tabs[visitOrder[i].index].textVisible = false; | ||
| 241 | + for (Tab tab : visitOrder) { | ||
| 242 | + tabs[tab.index].textVisible = false; | ||
| 243 | 243 | if (placeTabs(Editor.LEFT_GUTTER, tabMax, null)) { | |
| 244 | 244 | break; | |
| 245 | 245 | } | |
@@ -526,11 +526,8 @@ public void actionPerformed(ActionEvent e) { | |||
| 526 | 526 | if (sketch != null) { | |
| 527 | 527 | menu.addSeparator(); | |
| 528 | 528 | ||
| 529 | - ActionListener jumpListener = new ActionListener() { | ||
| 530 | - public void actionPerformed(ActionEvent e) { | ||
| 531 | - editor.getSketch().setCurrentCode(e.getActionCommand()); | ||
| 532 | - } | ||
| 533 | - }; | ||
| 529 | + ActionListener jumpListener = | ||
| 530 | + e -> editor.getSketch().setCurrentCode(e.getActionCommand()); | ||
| 534 | 531 | for (SketchCode code : sketch.getCode()) { | |
| 535 | 532 | item = new JMenuItem(code.getPrettyName()); | |
| 536 | 533 | item.addActionListener(jumpListener); | |
@@ -542,9 +539,11 @@ public void actionPerformed(ActionEvent e) { | |||
| 542 | 539 | } | |
| 543 | 540 | ||
| 544 | 541 | ||
| 542 | + /* | ||
| 545 | 543 | public void deselectMenu() { | |
| 546 | 544 | repaint(); | |
| 547 | 545 | } | |
| 546 | + */ | ||
| 548 | 547 | ||
| 549 | 548 | ||
| 550 | 549 | public Dimension getPreferredSize() { | |
@@ -565,7 +564,7 @@ public Dimension getMaximumSize() { | |||
| 565 | 564 | // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | |
| 566 | 565 | ||
| 567 | 566 | ||
| 568 | - static class Tab implements Comparable { | ||
| 567 | + static class Tab implements Comparable<Tab> { | ||
| 569 | 568 | int index; | |
| 570 | 569 | int left; | |
| 571 | 570 | int right; | |
@@ -583,8 +582,7 @@ boolean contains(int x) { | |||
| 583 | 582 | } | |
| 584 | 583 | ||
| 585 | 584 | // sort by the last time visited | |
| 586 | - public int compareTo(Object o) { | ||
| 587 | - Tab other = (Tab) o; | ||
| 585 | + public int compareTo(Tab other) { | ||
| 588 | 586 | // do this here to deal with situation where both are 0 | |
| 589 | 587 | if (lastVisited == other.lastVisited) { | |
| 590 | 588 | return 0; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments