mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
add cloud browser frame
This commit is contained in:
+1
-1
@@ -42,7 +42,7 @@ public enum IconLoader {
|
||||
"rotate_ccw.png"), ElementInto("element_into.png"), Arrow(
|
||||
"arrow.png"), Cloud("cloud.png"), CloudUp("cloud_up.png"), CloudGear(
|
||||
"cloud_gear.png"), IdCardEdit("id_card_edit.png"), KeyEdit(
|
||||
"key_edit.png");
|
||||
"key_edit.png"), Find("find.png"), Dashboard("dashboard.png");
|
||||
|
||||
protected String name;
|
||||
|
||||
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 601 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 751 B |
+12
-2
@@ -16,6 +16,7 @@ import org.diylc.plugins.cloud.presenter.CloudPresenter;
|
||||
import org.diylc.swing.gui.components.OverwritePromptFileChooser;
|
||||
import org.diylc.swing.gui.editor.PropertyEditorDialog;
|
||||
import org.diylc.swing.plugins.cloud.view.ChangePasswordDialog;
|
||||
import org.diylc.swing.plugins.cloud.view.CloudBrowserFrame;
|
||||
import org.diylc.swing.plugins.cloud.view.LoginDialog;
|
||||
import org.diylc.swing.plugins.cloud.view.UserEditDialog;
|
||||
import org.diylc.swing.plugins.cloud.view.UploadDialog;
|
||||
@@ -152,8 +153,10 @@ public class DialogFactory {
|
||||
return dialog;
|
||||
}
|
||||
|
||||
public UploadDialog createUploadDialog(IPlugInPort plugInPort, CloudPresenter cloudPresenter) {
|
||||
UploadDialog dialog = new UploadDialog(mainFrame, plugInPort, cloudPresenter);
|
||||
public UploadDialog createUploadDialog(IPlugInPort plugInPort,
|
||||
CloudPresenter cloudPresenter) {
|
||||
UploadDialog dialog = new UploadDialog(mainFrame, plugInPort,
|
||||
cloudPresenter);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@@ -162,6 +165,13 @@ public class DialogFactory {
|
||||
return dialog;
|
||||
}
|
||||
|
||||
public CloudBrowserFrame createCloudBrowserFrame(IPlugInPort plugInPort,
|
||||
CloudPresenter cloudPresenter) {
|
||||
CloudBrowserFrame frame = new CloudBrowserFrame(mainFrame, plugInPort,
|
||||
cloudPresenter);
|
||||
return frame;
|
||||
}
|
||||
|
||||
public ProgressDialog createProgressDialog(String title,
|
||||
String[] buttonCaptions, String description, boolean useProgress) {
|
||||
ProgressDialog dialog = new ProgressDialog(mainFrame, title,
|
||||
|
||||
+6
-2
@@ -18,6 +18,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import javax.swing.Action;
|
||||
import javax.swing.BoxLayout;
|
||||
@@ -330,8 +331,11 @@ public class MainFrame extends JFrame implements ISwingUI {
|
||||
try {
|
||||
T result = get();
|
||||
task.complete(result);
|
||||
} catch (Exception e) {
|
||||
LOG.error("Task failed", e);
|
||||
} catch (ExecutionException e) {
|
||||
LOG.error("Background task execution failed", e);
|
||||
task.failed(e);
|
||||
} catch (InterruptedException e) {
|
||||
LOG.error("Background task execution interrupted", e);
|
||||
task.failed(e);
|
||||
}
|
||||
getGlassPane().setVisible(false);
|
||||
|
||||
+4
@@ -23,6 +23,7 @@ import org.diylc.swing.ISwingUI;
|
||||
import org.diylc.swing.gui.DialogFactory;
|
||||
import org.diylc.swing.gui.DummyView;
|
||||
import org.diylc.swing.plugins.cloud.view.ChangePasswordDialog;
|
||||
import org.diylc.swing.plugins.cloud.view.CloudBrowserFrame;
|
||||
import org.diylc.swing.plugins.cloud.view.LoginDialog;
|
||||
import org.diylc.swing.plugins.cloud.view.UserEditDialog;
|
||||
import org.diylc.swing.plugins.cloud.view.UploadDialog;
|
||||
@@ -186,6 +187,9 @@ public class CloudPlugIn implements IPlugIn, CloudListener {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
CloudBrowserFrame frame = DialogFactory.getInstance()
|
||||
.createCloudBrowserFrame(plugInPort, cloudPresenter);
|
||||
frame.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package org.diylc.swing.plugins.cloud.view;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.Insets;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTabbedPane;
|
||||
|
||||
import org.diylc.common.IPlugInPort;
|
||||
import org.diylc.images.IconLoader;
|
||||
import org.diylc.plugins.cloud.presenter.CloudPresenter;
|
||||
|
||||
public class CloudBrowserFrame extends JFrame {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private JPanel mainPanel;
|
||||
private JTabbedPane tabbedPane;
|
||||
private JPanel dashboardPanel;
|
||||
private JPanel browsePanel;
|
||||
|
||||
private IPlugInPort plugInPort;
|
||||
private CloudPresenter cloudPresenter;
|
||||
|
||||
public CloudBrowserFrame(JFrame owner, IPlugInPort plugInPort,
|
||||
CloudPresenter cloudPresenter) {
|
||||
super("DIY Cloud Browser");
|
||||
this.setIconImage(IconLoader.Cloud.getImage());
|
||||
this.setPreferredSize(new Dimension(800, 600));
|
||||
this.plugInPort = plugInPort;
|
||||
this.cloudPresenter = cloudPresenter;
|
||||
|
||||
setContentPane(getMainPanel());
|
||||
this.pack();
|
||||
this.setLocationRelativeTo(owner);
|
||||
}
|
||||
|
||||
public JPanel getMainPanel() {
|
||||
if (mainPanel == null) {
|
||||
mainPanel = new JPanel(new GridBagLayout());
|
||||
GridBagConstraints gbc = new GridBagConstraints();
|
||||
gbc.anchor = GridBagConstraints.NORTHWEST;
|
||||
gbc.insets = new Insets(2, 2, 2, 2);
|
||||
|
||||
gbc.gridx = 0;
|
||||
gbc.gridy = 0;
|
||||
gbc.fill = GridBagConstraints.BOTH;
|
||||
gbc.weightx = 1;
|
||||
gbc.weighty = 1;
|
||||
mainPanel.add(getTabbedPane(), gbc);
|
||||
}
|
||||
return mainPanel;
|
||||
}
|
||||
|
||||
private JTabbedPane getTabbedPane() {
|
||||
if (tabbedPane == null) {
|
||||
tabbedPane = new JTabbedPane();
|
||||
tabbedPane.addTab("Dashboard", IconLoader.Dashboard.getIcon(), getDashboardPanel());
|
||||
tabbedPane.addTab("Search For Projects", IconLoader.Find.getIcon(), getBrowsePanel());
|
||||
}
|
||||
return tabbedPane;
|
||||
}
|
||||
|
||||
private JPanel getDashboardPanel() {
|
||||
if (dashboardPanel == null) {
|
||||
dashboardPanel = new JPanel();
|
||||
}
|
||||
return dashboardPanel;
|
||||
}
|
||||
|
||||
private JPanel getBrowsePanel() {
|
||||
if (browsePanel == null) {
|
||||
browsePanel = new JPanel();
|
||||
}
|
||||
return browsePanel;
|
||||
}
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
package org.diylc.swing.plugins.cloud.view;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public class LibraryFrame extends JFrame {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public LibraryFrame() {
|
||||
super("Online Library");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user