FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

minor cleanups and very basic modernization · processing/processing4@0e8943f · GitHub

Repository navigation

Commit 0e8943f

Browse files
committed
minor cleanups and very basic modernization
1 parent 8f2dccf commit 0e8943f

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

‎app/src/processing/app/ui/EditorHeader.java‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public class EditorHeader extends JComponent {
6363
// (total tab width will be this plus TEXT_MARGIN*2)
6464
static final int NO_TEXT_WIDTH = Toolkit.zoom(16);
6565

66-
Color textColor[] = new Color[2];
67-
Color tabColor[] = new Color[2];
66+
Color[] textColor = new Color[2];
67+
Color[] tabColor = new Color[2];
6868
Color modifiedColor;
6969
Color arrowColor;
7070

@@ -238,8 +238,8 @@ public void paintComponent(Graphics screen) {
238238
Arrays.sort(visitOrder); // sort on when visited
239239

240240
// 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;
243243
if (placeTabs(Editor.LEFT_GUTTER, tabMax, null)) {
244244
break;
245245
}
@@ -526,11 +526,8 @@ public void actionPerformed(ActionEvent e) {
526526
if (sketch != null) {
527527
menu.addSeparator();
528528

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());
534531
for (SketchCode code : sketch.getCode()) {
535532
item = new JMenuItem(code.getPrettyName());
536533
item.addActionListener(jumpListener);
@@ -542,9 +539,11 @@ public void actionPerformed(ActionEvent e) {
542539
}
543540

544541

542+
/*
545543
public void deselectMenu() {
546544
repaint();
547545
}
546+
*/
548547

549548

550549
public Dimension getPreferredSize() {
@@ -565,7 +564,7 @@ public Dimension getMaximumSize() {
565564
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
566565

567566

568-
static class Tab implements Comparable {
567+
static class Tab implements Comparable<Tab> {
569568
int index;
570569
int left;
571570
int right;
@@ -583,8 +582,7 @@ boolean contains(int x) {
583582
}
584583

585584
// sort by the last time visited
586-
public int compareTo(Object o) {
587-
Tab other = (Tab) o;
585+
public int compareTo(Tab other) {
588586
// do this here to deal with situation where both are 0
589587
if (lastVisited == other.lastVisited) {
590588
return 0;

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL