mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-07 00:38:16 +00:00
[TASK] Added link to Scripts page
This commit is contained in:
@@ -28,4 +28,5 @@ public class Configuration extends org.parabot.api.Configuration {
|
|||||||
|
|
||||||
public static final String COMMUNITY_PAGE = "https://www.parabot.org/community/";
|
public static final String COMMUNITY_PAGE = "https://www.parabot.org/community/";
|
||||||
public static final String REGISTRATION_PAGE = COMMUNITY_PAGE + "register/";
|
public static final String REGISTRATION_PAGE = COMMUNITY_PAGE + "register/";
|
||||||
|
public static final String BDN_PAGE = "http://bdn.parabot.org/scripts/";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.parabot.core.ui;
|
package org.parabot.core.ui;
|
||||||
|
|
||||||
|
import org.parabot.core.Configuration;
|
||||||
import org.parabot.core.Context;
|
import org.parabot.core.Context;
|
||||||
import org.parabot.core.Directories;
|
import org.parabot.core.Directories;
|
||||||
import org.parabot.core.desc.ScriptDescription;
|
import org.parabot.core.desc.ScriptDescription;
|
||||||
@@ -17,8 +18,10 @@ import java.awt.*;
|
|||||||
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;
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URI;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
@@ -42,8 +45,8 @@ public final class ScriptSelector extends JFrame {
|
|||||||
private JEditorPane scriptInfo;
|
private JEditorPane scriptInfo;
|
||||||
|
|
||||||
public ScriptSelector() {
|
public ScriptSelector() {
|
||||||
this.categories = new HashMap<String, DefaultMutableTreeNode>();
|
this.categories = new HashMap<>();
|
||||||
this.format = new HashMap<String, ScriptDescription>();
|
this.format = new HashMap<>();
|
||||||
this.root = new DefaultMutableTreeNode("Scripts");
|
this.root = new DefaultMutableTreeNode("Scripts");
|
||||||
this.WIDTH = 640;
|
this.WIDTH = 640;
|
||||||
this.HEIGHT = 256 + 128;
|
this.HEIGHT = 256 + 128;
|
||||||
@@ -185,10 +188,29 @@ public final class ScriptSelector extends JFrame {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
JButton cmdScripts = new JButton("Add scripts");
|
||||||
|
cmdScripts.setBounds(12, HEIGHT - 24 - 4, 96 + 32,
|
||||||
|
24);
|
||||||
|
cmdScripts.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
URI uri = URI
|
||||||
|
.create(Configuration.BDN_PAGE);
|
||||||
|
try {
|
||||||
|
Desktop.getDesktop().browse(uri);
|
||||||
|
} catch (IOException e1) {
|
||||||
|
JOptionPane.showMessageDialog(null, "Connection Error",
|
||||||
|
"Error", JOptionPane.ERROR_MESSAGE);
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
panel.add(scrlScriptTree);
|
panel.add(scrlScriptTree);
|
||||||
panel.add(scrlScriptInfo);
|
panel.add(scrlScriptInfo);
|
||||||
panel.add(cmdStart);
|
panel.add(cmdStart);
|
||||||
panel.add(cmdHome);
|
panel.add(cmdHome);
|
||||||
|
panel.add(cmdScripts);
|
||||||
|
|
||||||
this.add(panel);
|
this.add(panel);
|
||||||
this.pack();
|
this.pack();
|
||||||
|
|||||||
Reference in New Issue
Block a user