From d4cda5394063971e3b818cb54e2b9e9466f2bef0 Mon Sep 17 00:00:00 2001 From: Skylar Date: Thu, 3 Dec 2015 15:38:04 -0700 Subject: [PATCH] Add icons and home button to Web Browser, add Clear Output button to Pad Editor. --- src/net/apocalypselabs/symat/PadEditor.form | 72 ++++++++++++--- src/net/apocalypselabs/symat/PadEditor.java | 47 +++++++++- src/net/apocalypselabs/symat/WebBrowser.form | 85 +++++++++++++----- src/net/apocalypselabs/symat/WebBrowser.java | 57 ++++++++++-- .../apocalypselabs/symat/icons/arrow-left.png | Bin 0 -> 290 bytes .../symat/icons/arrow-right.png | Bin 0 -> 285 bytes .../apocalypselabs/symat/icons/goarrow.png | Bin 0 -> 474 bytes src/net/apocalypselabs/symat/icons/home.png | Bin 0 -> 363 bytes 8 files changed, 215 insertions(+), 46 deletions(-) create mode 100644 src/net/apocalypselabs/symat/icons/arrow-left.png create mode 100644 src/net/apocalypselabs/symat/icons/arrow-right.png create mode 100644 src/net/apocalypselabs/symat/icons/goarrow.png create mode 100644 src/net/apocalypselabs/symat/icons/home.png diff --git a/src/net/apocalypselabs/symat/PadEditor.form b/src/net/apocalypselabs/symat/PadEditor.form index 8daefd9..98b2d19 100644 --- a/src/net/apocalypselabs/symat/PadEditor.form +++ b/src/net/apocalypselabs/symat/PadEditor.form @@ -85,7 +85,7 @@ - + @@ -107,16 +107,19 @@ - + - + + + + @@ -143,23 +146,66 @@ - - - - + - + - + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + diff --git a/src/net/apocalypselabs/symat/PadEditor.java b/src/net/apocalypselabs/symat/PadEditor.java index a5ba409..f65dee0 100644 --- a/src/net/apocalypselabs/symat/PadEditor.java +++ b/src/net/apocalypselabs/symat/PadEditor.java @@ -219,8 +219,11 @@ public class PadEditor extends javax.swing.JInternalFrame implements RunScriptLi jSplitPane1 = new javax.swing.JSplitPane(); browserBox = new javax.swing.JPanel(); + jPanel1 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); outputBox = new javax.swing.JTextArea(); + clearBtn = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); statusBar = new javax.swing.JToolBar(); statusLbl = new javax.swing.JLabel(); jMenuBar1 = new javax.swing.JMenuBar(); @@ -239,7 +242,7 @@ public class PadEditor extends javax.swing.JInternalFrame implements RunScriptLi setTitle("Pad Editor"); setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/editor.png"))); // NOI18N setMinimumSize(new java.awt.Dimension(300, 300)); - setPreferredSize(new java.awt.Dimension(480, 400)); + setPreferredSize(new java.awt.Dimension(550, 391)); addInternalFrameListener(new javax.swing.event.InternalFrameListener() { public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) { } @@ -266,9 +269,10 @@ public class PadEditor extends javax.swing.JInternalFrame implements RunScriptLi } }); - jSplitPane1.setDividerLocation(260); + jSplitPane1.setDividerLocation(200); jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); jSplitPane1.setResizeWeight(0.7); + jSplitPane1.setPreferredSize(new java.awt.Dimension(550, 375)); browserBox.setMinimumSize(new java.awt.Dimension(100, 25)); browserBox.addComponentListener(new java.awt.event.ComponentAdapter() { @@ -284,7 +288,37 @@ public class PadEditor extends javax.swing.JInternalFrame implements RunScriptLi outputBox.setTabSize(4); jScrollPane1.setViewportView(outputBox); - jSplitPane1.setRightComponent(jScrollPane1); + clearBtn.setText("Clear"); + clearBtn.setToolTipText(""); + clearBtn.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + clearBtnActionPerformed(evt); + } + }); + + jLabel1.setText("Output:"); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 437, Short.MAX_VALUE) + .addComponent(clearBtn)) + .addComponent(jScrollPane1) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addComponent(clearBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(0, 0, 0) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)) + ); + + jSplitPane1.setBottomComponent(jPanel1); getContentPane().add(jSplitPane1, java.awt.BorderLayout.CENTER); @@ -447,6 +481,10 @@ public class PadEditor extends javax.swing.JInternalFrame implements RunScriptLi resizeAll(); }//GEN-LAST:event_browserBoxComponentResized + private void clearBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearBtnActionPerformed + outputBox.setText(""); + }//GEN-LAST:event_clearBtnActionPerformed + private void resizeAll() { Platform.runLater(new Runnable() { @Override @@ -460,8 +498,11 @@ public class PadEditor extends javax.swing.JInternalFrame implements RunScriptLi // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JPanel browserBox; + private javax.swing.JButton clearBtn; private javax.swing.JMenu codeLangMenu; + private javax.swing.JLabel jLabel1; private javax.swing.JMenuBar jMenuBar1; + private javax.swing.JPanel jPanel1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JSplitPane jSplitPane1; private javax.swing.JRadioButtonMenuItem javaOption; diff --git a/src/net/apocalypselabs/symat/WebBrowser.form b/src/net/apocalypselabs/symat/WebBrowser.form index 269846b..fa9f7a9 100644 --- a/src/net/apocalypselabs/symat/WebBrowser.form +++ b/src/net/apocalypselabs/symat/WebBrowser.form @@ -61,11 +61,14 @@ - + + + + - + @@ -93,31 +96,69 @@ - + - - - - - - - - - - - - - + + + - - - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/net/apocalypselabs/symat/WebBrowser.java b/src/net/apocalypselabs/symat/WebBrowser.java index abe6457..de0ca74 100644 --- a/src/net/apocalypselabs/symat/WebBrowser.java +++ b/src/net/apocalypselabs/symat/WebBrowser.java @@ -211,15 +211,21 @@ public class WebBrowser extends javax.swing.JInternalFrame { this(title, url); switch (icon) { case WIKI_LOGO: + homeBtn.setVisible(false); + sepBar.setVisible(false); setFrameIcon(new ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/wiki.png"))); break; case FORUM_LOGO: + homeBtn.setVisible(false); + sepBar.setVisible(false); setFrameIcon(new ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/forum.png"))); break; case PAD_LOGO: navBar.setVisible(false); goBtn.setEnabled(false); backBtn.setEnabled(false); + homeBtn.setVisible(false); + sepBar.setVisible(false); setFrameIcon(new ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/editor.png"))); break; default: @@ -373,7 +379,10 @@ public class WebBrowser extends javax.swing.JInternalFrame { navBar = new javax.swing.JToolBar(); backBtn = new javax.swing.JButton(); urlBox = new javax.swing.JTextField(); + buttonBar = new javax.swing.JToolBar(); goBtn = new javax.swing.JButton(); + sepBar = new javax.swing.JToolBar.Separator(); + homeBtn = new javax.swing.JButton(); browserBox = new javax.swing.JPanel(); setClosable(true); @@ -415,10 +424,11 @@ public class WebBrowser extends javax.swing.JInternalFrame { navBar.setLayout(new java.awt.BorderLayout()); backBtn.setFont(Main.ubuntuRegular.deriveFont(16.0f)); - backBtn.setText("<"); + backBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/arrow-left.png"))); // NOI18N + backBtn.setToolTipText("Go back a page"); backBtn.setFocusable(false); backBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - backBtn.setMaximumSize(new java.awt.Dimension(30, 21)); + backBtn.setMaximumSize(new java.awt.Dimension(50, 50)); backBtn.setMinimumSize(new java.awt.Dimension(30, 21)); backBtn.setPreferredSize(new java.awt.Dimension(30, 21)); backBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); @@ -442,21 +452,45 @@ public class WebBrowser extends javax.swing.JInternalFrame { navBar.add(urlBox); */ - goBtn.setText("Go"); - goBtn.setFocusable(false); + buttonBar.setFloatable(false); + buttonBar.setRollover(true); + buttonBar.setBorderPainted(false); + navBar.add(buttonBar, BorderLayout.EAST); + + goBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/goarrow.png"))); // NOI18N + goBtn.setToolTipText("Navigate"); goBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - goBtn.setMaximumSize(new java.awt.Dimension(30, 21)); + goBtn.setMaximumSize(new java.awt.Dimension(50, 50)); goBtn.setMinimumSize(new java.awt.Dimension(30, 21)); - goBtn.setPreferredSize(new java.awt.Dimension(30, 21)); + goBtn.setPreferredSize(new java.awt.Dimension(30, 30)); goBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - navBar.add(goBtn, java.awt.BorderLayout.EAST); + buttonBar.add(goBtn); goBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { goBtnActionPerformed(evt); } }); /* - navBar.add(goBtn); + buttonBar.add(goBtn); + */ + buttonBar.add(sepBar); + + homeBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/home.png"))); // NOI18N + homeBtn.setToolTipText("Go to homepage"); + homeBtn.setFocusable(false); + homeBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + homeBtn.setMaximumSize(new java.awt.Dimension(50, 50)); + homeBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + homeBtn.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + homeBtnActionPerformed(evt); + } + }); + buttonBar.add(homeBtn); + + /* + + navBar.add(buttonBar); */ getContentPane().add(navBar, java.awt.BorderLayout.PAGE_START); @@ -511,6 +545,10 @@ public class WebBrowser extends javax.swing.JInternalFrame { }); }//GEN-LAST:event_backBtnActionPerformed + private void homeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_homeBtnActionPerformed + loadURL("about:home"); + }//GEN-LAST:event_homeBtnActionPerformed + private void resizeAll() { Platform.runLater(new Runnable() { @Override @@ -525,8 +563,11 @@ public class WebBrowser extends javax.swing.JInternalFrame { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton backBtn; private javax.swing.JPanel browserBox; + public javax.swing.JToolBar buttonBar; private javax.swing.JButton goBtn; + private javax.swing.JButton homeBtn; private javax.swing.JToolBar navBar; + private javax.swing.JToolBar.Separator sepBar; private javax.swing.JTextField urlBox; // End of variables declaration//GEN-END:variables } diff --git a/src/net/apocalypselabs/symat/icons/arrow-left.png b/src/net/apocalypselabs/symat/icons/arrow-left.png new file mode 100644 index 0000000000000000000000000000000000000000..d8372ad9dbb39628ce4f82bc397d1e36f27217b0 GIT binary patch literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4%caKYZ?lYt`FJzX3_ zJUZWAGW26|lxTaHKDFf-a{){KLER3AOh?z8uQFaeC2f4pneJx|S7@y8=;2h$*kmG6 zno@W{apH^VKA+E@`&~CP^55ou&9_2zO_psIUcBocv;NE~P3DtzIVAn!;fK3#3TKzi z4m!Mf`!maTf&WB5r=I=ae@on|t&?;wRpUzS9CBU&OyA z&t|FQV0X=*@K9=Pg59y$gEKAH8Fc4PUikR4Y0MF(Iwebg-JOxjmcF_#*_s@^95rS> lve^0{G{`ko{Db{0RW0j4^;>V^4+6c&;OXk;vd$@?2>@M-`Ydi@C&5Ya z1$-PA*E@8w>Qbw1BgBgr5&R$!PLlt3l5@gcx2Akn;4&8YL^}(EA-3ORjhEPikCFS5 zqj?VFb4+4Xz}(>$`>0(t+7kw-9mT%T!6Y`*_di+2j5S)Z27?p^TP#Dc zP!}bESd6BjV5kNa^iVnhYWiIR7@>8wOVR7gDk2~B(;w_~G3jkib0ubiFxFx<`xt{kVvNXRy-Z=mZ; z2luXai99(;jbLOC(YCMFC&Xr$4DO;nF_Dz0$p#YD^)OArpq_+lYM8ZvJa9+MgNS^0lG)Af3#jI z4Rm8aW)PcnqSh=Rn)-J_%PO-E*TR{9h-h!@gznS`SusFQix5CNhMo9-)SG3WB%`DD{pL$`O?#lJ7hByytzt`<;(}j6BANte-^%kFl>} z0aLjDt(jeP@qy#WweX307O7mI@g!>4!e!)+FoTIfbE<$Rk% z6H7S6v*aW-l(2)hA|h#6iH0xO#JS{O_s0d+@q|~b6>YvRxy&|JeP3i+w4$aRoV_9f zXJ~}GPEPY)bfUHq+<_=d-bcMa^Ip`0^J8ezrszFG_!g(J-jIxGKe}0Ni{b_cv7S#6 zNJZY5{t5B~hMDoq+ENZ_8jF4V2VBLvDtYBSG;ueCp?{1Lz5o*APUbF#g4X~5002ov JPDHLkV1h6>p