Add icons and home button to Web Browser, add Clear Output button to Pad Editor.

master
Skylar Ittner 8 years ago
parent a2a870dad2
commit d4cda53940

@ -85,7 +85,7 @@
<Dimension value="[300, 300]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[480, 400]"/>
<Dimension value="[550, 391]"/>
</Property>
</Properties>
<SyntheticProperties>
@ -107,16 +107,19 @@
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-112,0,0,1,-32"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-121,0,0,2,38"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
<Properties>
<Property name="dividerLocation" type="int" value="260"/>
<Property name="dividerLocation" type="int" value="200"/>
<Property name="orientation" type="int" value="0"/>
<Property name="resizeWeight" type="double" value="0.7"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[550, 375]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
@ -143,23 +146,66 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
</Container>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Container class="javax.swing.JPanel" name="jPanel1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="right"/>
<JSplitPaneConstraints position="bottom"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="437" max="32767" attributes="0"/>
<Component id="clearBtn" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="clearBtn" alignment="0" min="-2" pref="18" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="100" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JTextArea" name="outputBox">
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="outputBox">
<Properties>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="1"/>
<Property name="tabSize" type="int" value="4"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="clearBtn">
<Properties>
<Property name="text" type="java.lang.String" value="Clear"/>
<Property name="toolTipText" type="java.lang.String" value=""/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="clearBtnActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="1"/>
<Property name="tabSize" type="int" value="4"/>
<Property name="text" type="java.lang.String" value="Output:"/>
</Properties>
</Component>
</SubComponents>

@ -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;

@ -61,11 +61,14 @@
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="Main.ubuntuRegular.deriveFont(16.0f)" type="code"/>
</Property>
<Property name="text" type="java.lang.String" value="&lt;"/>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/icons/arrow-left.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Go back a page"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 21]"/>
<Dimension value="[50, 50]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 21]"/>
@ -93,31 +96,69 @@
<AuxValue name="JavaCodeGenerator_ListenersCodePost" type="java.lang.String" value="navBar.add(urlBox, java.awt.BorderLayout.CENTER);&#xa;/*"/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="goBtn">
<Container class="javax.swing.JToolBar" name="buttonBar">
<Properties>
<Property name="text" type="java.lang.String" value="Go"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 21]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 21]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 21]"/>
</Property>
<Property name="verticalTextPosition" type="int" value="3"/>
<Property name="floatable" type="boolean" value="false"/>
<Property name="rollover" type="boolean" value="true"/>
<Property name="borderPainted" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="goBtnActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_AddingCodePost" type="java.lang.String" value="*/"/>
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="navBar.add(goBtn, java.awt.BorderLayout.EAST);"/>
<AuxValue name="JavaCodeGenerator_ListenersCodePost" type="java.lang.String" value="/*"/>
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="navBar.add(buttonBar, BorderLayout.EAST);"/>
<AuxValue name="JavaCodeGenerator_LayoutCodePost" type="java.lang.String" value="/*"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
</AuxValues>
</Component>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
<SubComponents>
<Component class="javax.swing.JButton" name="goBtn">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/icons/goarrow.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Navigate"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 50]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 21]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 30]"/>
</Property>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="goBtnActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_AddingCodePost" type="java.lang.String" value="*/"/>
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="buttonBar.add(goBtn);"/>
<AuxValue name="JavaCodeGenerator_ListenersCodePost" type="java.lang.String" value="/*"/>
</AuxValues>
</Component>
<Component class="javax.swing.JToolBar$Separator" name="sepBar">
</Component>
<Component class="javax.swing.JButton" name="homeBtn">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/icons/home.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Go to homepage"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 50]"/>
</Property>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="homeBtnActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="browserBox">

@ -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
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Loading…
Cancel
Save