mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
improve search looks
This commit is contained in:
@@ -33,7 +33,8 @@ public enum IconLoader {
|
||||
"arrow.png"), Cloud("cloud.png"), CloudUp("cloud_up.png"), CloudGear("cloud_gear.png"), IdCardEdit(
|
||||
"id_card_edit.png"), KeyEdit("key_edit.png"), Find("find.png"), Dashboard("dashboard.png"), DataFind(
|
||||
"data_find.png"), CloudDownload("cloud-download.png"), NavLeftBlue("nav_left_blue.png"), NavRightBlue(
|
||||
"nav_right_blue.png"), MissingImage("missing_image.png"), CloudBg("cloud_bg.png"), CloudBig("cloud_big.png");
|
||||
"nav_right_blue.png"), MissingImage("missing_image.png"), CloudBg("cloud_bg.png"), CloudBig("cloud_big.png"), CloudWait(
|
||||
"cloud_wait.png"), Spinning("spinning.gif");
|
||||
|
||||
protected String name;
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 433 B |
+12
-6
@@ -66,6 +66,8 @@ public class ResultsScrollPanel extends JScrollPane {
|
||||
private boolean armed;
|
||||
private PagingProvider provider;
|
||||
|
||||
private Icon spinnerIcon = IconLoader.Spinning.getIcon();
|
||||
|
||||
public ResultsScrollPanel(ISwingUI mainUI, CloudBrowserFrame cloudUI, IPlugInPort plugInPort, PagingProvider provider) {
|
||||
super();
|
||||
this.mainUI = mainUI;
|
||||
@@ -109,6 +111,8 @@ public class ResultsScrollPanel extends JScrollPane {
|
||||
gbc.weightx = 1;
|
||||
gbc.weighty = Integer.MAX_VALUE;
|
||||
getResultsPanel().add(label, gbc);
|
||||
getLoadMoreLabel().setText("");
|
||||
getLoadMoreLabel().setIcon(null);
|
||||
}
|
||||
|
||||
public void addData(List<ProjectEntity> projects) {
|
||||
@@ -121,9 +125,14 @@ public class ResultsScrollPanel extends JScrollPane {
|
||||
this.currentLocation++;
|
||||
}
|
||||
armed = true;
|
||||
if (provider.hasMoreData()) {
|
||||
getLoadMoreLabel().setText("Querying the cloud for more results...");
|
||||
getLoadMoreLabel().setIcon(spinnerIcon);
|
||||
} else {
|
||||
getLoadMoreLabel().setText("No more results.");
|
||||
getLoadMoreLabel().setIcon(null);
|
||||
}
|
||||
}
|
||||
|
||||
getLoadMoreLabel().setText(provider.hasMoreData() ? "Loading more data..." : "");
|
||||
}
|
||||
|
||||
private JComponent addProjectToDisplay(final ProjectEntity project) {
|
||||
@@ -290,10 +299,7 @@ public class ResultsScrollPanel extends JScrollPane {
|
||||
protected void done() {
|
||||
try {
|
||||
List<ProjectEntity> newResults = get();
|
||||
if (newResults != null && !newResults.isEmpty())
|
||||
addData(newResults);
|
||||
else
|
||||
getLoadMoreLabel().setText("");
|
||||
addData(newResults);
|
||||
} catch (Exception e) {
|
||||
cloudUI.showMessage("Search failed! Detailed message is in the logs. Please report to the author.",
|
||||
"Search Failed", IView.ERROR_MESSAGE);
|
||||
|
||||
+9
-9
@@ -37,20 +37,20 @@ public class SimpleCloudGlassPane extends JPanel implements MouseListener, KeyLi
|
||||
GridBagConstraints gbc = new GridBagConstraints();
|
||||
gbc.gridx = 0;
|
||||
gbc.gridy = 0;
|
||||
gbc.anchor = GridBagConstraints.LAST_LINE_START;
|
||||
gbc.anchor = GridBagConstraints.CENTER;
|
||||
gbc.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc.weightx = 1;
|
||||
gbc.weighty = 1;
|
||||
JLabel cloudLabel = new JLabel(IconLoader.CloudBig.getIcon());
|
||||
JLabel cloudLabel = new JLabel(IconLoader.CloudWait.getIcon());
|
||||
cloudLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
add(cloudLabel, gbc);
|
||||
|
||||
gbc.gridy = 1;
|
||||
gbc.weighty = 1.5;
|
||||
gbc.anchor = GridBagConstraints.FIRST_LINE_START;
|
||||
JLabel label = new JLabel("<html><font size='5' color='#999999'>Querying the cloud...</font></html>");
|
||||
label.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
add(label, gbc);
|
||||
//
|
||||
// gbc.gridy = 1;
|
||||
// gbc.weighty = 1.5;
|
||||
// gbc.anchor = GridBagConstraints.FIRST_LINE_START;
|
||||
// JLabel label = new JLabel("<html><font size='5' color='#999999'>Querying the cloud...</font></html>");
|
||||
// label.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
// add(label, gbc);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user