minor improvements

This commit is contained in:
Branislav Stojkovic
2016-10-26 21:32:25 +02:00
parent 8c85e7351c
commit e48b94c91b
3 changed files with 12 additions and 3 deletions
@@ -7,7 +7,6 @@ import java.awt.GridBagConstraints;
import java.awt.GridBagLayout; import java.awt.GridBagLayout;
import java.awt.Insets; import java.awt.Insets;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@@ -123,12 +122,20 @@ public class ResultsScrollPanel extends JScrollPane {
if (projects == null || projects.isEmpty() && currentLocation == 0) { if (projects == null || projects.isEmpty() && currentLocation == 0) {
showNoMatches(); showNoMatches();
} else { } else {
final Point old = getViewport().getViewPosition();
LOG.info("Adding " + projects.size() + " projects to display."); LOG.info("Adding " + projects.size() + " projects to display.");
for (int i = 0; i < projects.size(); i++) { for (int i = 0; i < projects.size(); i++) {
addProjectToDisplay(projects.get(i)); addProjectToDisplay(projects.get(i));
this.currentLocation++; this.currentLocation++;
} }
armed = true; armed = true;
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
getViewport().setViewPosition(old);
}
});
if (provider.hasMoreData()) { if (provider.hasMoreData()) {
getLoadMoreLabel().setText("Querying the cloud for more results..."); getLoadMoreLabel().setText("Querying the cloud for more results...");
getLoadMoreLabel().setIcon(spinnerIcon); getLoadMoreLabel().setIcon(spinnerIcon);
@@ -3,6 +3,7 @@ package org.diylc.swing.plugins.cloud.view.browser;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.GridBagConstraints; import java.awt.GridBagConstraints;
import java.awt.GridBagLayout; import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.event.KeyListener; import java.awt.event.KeyListener;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
@@ -41,6 +42,7 @@ public class SimpleCloudGlassPane extends JPanel implements MouseListener, KeyLi
gbc.fill = GridBagConstraints.HORIZONTAL; gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 1; gbc.weightx = 1;
gbc.weighty = 1; gbc.weighty = 1;
gbc.insets = new Insets(0, 0, 80, 0);
JLabel cloudLabel = new JLabel(IconLoader.CloudWait.getIcon()); JLabel cloudLabel = new JLabel(IconLoader.CloudWait.getIcon());
cloudLabel.setHorizontalAlignment(SwingConstants.CENTER); cloudLabel.setHorizontalAlignment(SwingConstants.CENTER);
add(cloudLabel, gbc); add(cloudLabel, gbc);
@@ -108,7 +108,7 @@ public class StatusBar extends JPanel implements IPlugIn {
@Override @Override
public void complete(String result) { public void complete(String result) {
if (result != null && result.length() > 0) { if (result != null && result.length() > 0) {
StatusBar.this.swingUI.showMessage(result, "Public Announcements", IView.INFORMATION_MESSAGE); StatusBar.this.swingUI.showMessage(result, "Public Announcement", IView.INFORMATION_MESSAGE);
announcementProvider.dismissed(); announcementProvider.dismissed();
} }
} }
@@ -169,7 +169,7 @@ public class StatusBar extends JPanel implements IPlugIn {
@Override @Override
public void complete(String result) { public void complete(String result) {
if (result != null && result.length() > 0) { if (result != null && result.length() > 0) {
swingUI.showMessage(result, "Public Announcements", IView.INFORMATION_MESSAGE); swingUI.showMessage(result, "Public Announcement", IView.INFORMATION_MESSAGE);
announcementProvider.dismissed(); announcementProvider.dismissed();
} else } else
swingUI.showMessage("No new public announcements available.", "Public Announcements", swingUI.showMessage("No new public announcements available.", "Public Announcements",