GT-2376-b: fixing some bugs from internal users (gui shenanigans)

This commit is contained in:
adamopolous 2019-05-09 12:39:39 -04:00
parent f57af0b730
commit ea9e1c2dda
8 changed files with 10 additions and 11 deletions

View File

@ -329,7 +329,7 @@ public class TaskMonitorServiceTest extends AbstractGhidraHeadedIntegrationTest
monitor1 = TaskMonitorService.getMonitor();
assertTrue(monitor1 instanceof SecondaryTaskMonitor);
monitor1.reset();
monitor1.release();
monitor1 = TaskMonitorService.getMonitor();
assertTrue(monitor1 instanceof TaskDialog);

View File

@ -942,17 +942,18 @@ public class DialogComponentProvider
}
});
subStatusLabel = new JLabel();
subStatusLabel = new JLabel(" ");
subStatusLabel.setName("subStatusLabel");
subStatusLabel.setHorizontalAlignment(SwingConstants.CENTER);
subStatusLabel.setForeground(Color.blue);
subStatusLabel.setFont(subStatusLabel.getFont().deriveFont(Font.ITALIC));
subStatusLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
subStatusLabel.setFont(subStatusLabel.getFont().deriveFont(11.0f));
subStatusLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 3, 5));
subStatusLabel.setFont(subStatusLabel.getFont().deriveFont(9.0f));
// use a strut panel so the size of the message area does not change if we make
// the message label not visible
int height = statusLabel.getPreferredSize().height;
int height =
statusLabel.getPreferredSize().height + subStatusLabel.getPreferredSize().height + 5;
panel.add(Box.createVerticalStrut(height), BorderLayout.WEST);
panel.add(statusLabel, BorderLayout.CENTER);

View File

@ -54,6 +54,6 @@ public class HourglassAnimationPanel extends JPanel {
iconList.add(ResourceManager.loadImage("images/hourglass24_11.png"));
AnimatedIcon progressIcon = new AnimatedIcon(iconList, 150, 0);
add (new JLabel(progressIcon), BorderLayout.CENTER);
add(new JLabel(progressIcon), BorderLayout.NORTH);
}
}

View File

@ -50,6 +50,7 @@ public class SecondaryTaskMonitor implements TaskMonitor {
public void setMessage(String message) {
if (parentMonitor instanceof TaskDialog) {
((TaskDialog) parentMonitor).setSecondaryMessage(message);
return;
}
parentMonitor.setMessage(message);
}

View File

@ -336,7 +336,6 @@ public class TaskDialog extends DialogComponentProvider implements TaskMonitor {
SwingUtilities.invokeLater(closeDialog);
}
@Override
public synchronized void reset() {
taskDone = false;
taskID.incrementAndGet();
@ -476,5 +475,4 @@ public class TaskDialog extends DialogComponentProvider implements TaskMonitor {
}
return secondaryTaskMonitor;
}
}

View File

@ -257,7 +257,6 @@ public class TaskMonitorComponent extends JPanel implements TaskMonitor {
/**
* Reset this monitor so that it can be reused
*/
@Override
public synchronized void reset() {
isCancelled = false;
taskID.incrementAndGet();

View File

@ -112,7 +112,7 @@ public class DefaultLanguageService implements LanguageService, ChangeListener {
return lang;
}
finally {
monitor.setMessage("");
monitor.release();
}
}

View File

@ -66,7 +66,7 @@ public interface TaskMonitor {
* monitor being returned from the {@link TaskMonitorService} on the next
* invocation.
*/
public default void reset() {
public default void release() {
synchronized (this) {
setMessage("");
setProgress(0);