a little more cleaning inside processing.app.contrib

This commit is contained in:
Ben Fry
2022-01-17 18:03:26 -05:00
parent 04604c1a0e
commit a1f429f37e
4 changed files with 9 additions and 17 deletions

View File

@@ -54,12 +54,7 @@ abstract class ContribProgressBar extends ContribProgressMonitor {
public final void finished() {
super.finished();
try {
EventQueue.invokeAndWait(new Runnable() {
@Override
public void run() {
finishedAction();
}
});
EventQueue.invokeAndWait(this::finishedAction);
} catch (InterruptedException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
@@ -78,12 +73,7 @@ abstract class ContribProgressBar extends ContribProgressMonitor {
public final void cancel() {
super.cancel();
try {
EventQueue.invokeAndWait(new Runnable() {
@Override
public void run() {
cancelAction();
}
});
EventQueue.invokeAndWait(this::cancelAction);
} catch (InterruptedException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {

View File

@@ -154,9 +154,9 @@ class DetailPanel extends JPanel {
}
boolean isSelected() {
return listPanel.getSelectedPanel() == this;
}
// private boolean isSelected() {
// return listPanel.getSelectedPanel() == this;
// }
public void install() {

View File

@@ -654,7 +654,9 @@ implements Scrollable, ContributionListing.ChangeListener {
Color bgColor = null;
Color fgColor = UIManager.getColor("List.foreground");
if (panel.isSelected()) {
//if (panel.isSelected()) {
//if (getSelectedPanel() == panel) {
if (selectedPanel == panel) {
bgColor = UIManager.getColor("List.selectionBackground");
fgColor = UIManager.getColor("List.selectionForeground");
border = UIManager.getBorder("List.focusCellHighlightBorder");

View File

@@ -305,7 +305,7 @@ class StatusPanel extends JPanel {
}
public void update(DetailPanel panel) {
void update(DetailPanel panel) {
System.out.println("rebuilding status panel for " + panel.getContrib().name);
progressPanel.removeAll();