Add icon to export window

This commit is contained in:
skylarmt 2015-01-13 16:50:20 -07:00
parent 4d7ec26a3f
commit 8d321b9e28
4 changed files with 33 additions and 27 deletions

View File

@ -7,6 +7,10 @@
<Property name="maximizable" type="boolean" value="true"/> <Property name="maximizable" type="boolean" value="true"/>
<Property name="resizable" type="boolean" value="true"/> <Property name="resizable" type="boolean" value="true"/>
<Property name="title" type="java.lang.String" value="Export Code"/> <Property name="title" type="java.lang.String" value="Export Code"/>
<Property name="frameIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/icons/export.png"/>
</Property>
<Property name="icon" type="boolean" value="true"/>
</Properties> </Properties>
<SyntheticProperties> <SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/> <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
@ -33,10 +37,10 @@
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Component id="jScrollPane1" pref="286" max="32767" attributes="0"/> <Component id="jScrollPane1" pref="268" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/> <EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/> <Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/> <EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -68,7 +72,7 @@
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/> <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="titleBox" min="-2" pref="154" max="-2" attributes="0"/> <Component id="titleBox" pref="154" max="32767" attributes="0"/>
</Group> </Group>
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
@ -89,18 +93,18 @@
<EmptySpace max="32767" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/> <Component id="jButton1" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<Component id="jScrollPane2" min="-2" pref="239" max="-2" attributes="0"/> <Component id="jScrollPane2" pref="239" max="32767" attributes="0"/>
</Group> </Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/> <EmptySpace min="5" pref="5" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel2" min="-2" max="-2" attributes="0"/> <Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0"> <Group type="102" attributes="0">
@ -127,7 +131,7 @@
</Group> </Group>
</Group> </Group>
</Group> </Group>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -192,7 +196,7 @@
<Properties> <Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Export as:"/> <TitledBorder title="Export to:"/>
</Border> </Border>
</Property> </Property>
</Properties> </Properties>
@ -213,10 +217,10 @@
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="exHtml" min="-2" max="-2" attributes="0"/> <Component id="exHtml" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="exPdf" min="-2" max="-2" attributes="0"/> <Component id="exPdf" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="13" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>

View File

@ -166,6 +166,7 @@ public class CodeExport extends javax.swing.JInternalFrame {
setMaximizable(true); setMaximizable(true);
setResizable(true); setResizable(true);
setTitle("Export Code"); setTitle("Export Code");
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/export.png"))); // NOI18N
previewPane.setEditable(false); previewPane.setEditable(false);
previewPane.setContentType("text/html"); // NOI18N previewPane.setContentType("text/html"); // NOI18N
@ -195,7 +196,7 @@ public class CodeExport extends javax.swing.JInternalFrame {
} }
}); });
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Export as:")); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Export to:"));
exHtml.setText("HTML"); exHtml.setText("HTML");
exHtml.addActionListener(new java.awt.event.ActionListener() { exHtml.addActionListener(new java.awt.event.ActionListener() {
@ -225,10 +226,10 @@ public class CodeExport extends javax.swing.JInternalFrame {
jPanel2Layout.setVerticalGroup( jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(exHtml) .addComponent(exHtml)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(exPdf) .addComponent(exPdf))
.addGap(0, 13, Short.MAX_VALUE))
); );
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
@ -241,7 +242,7 @@ public class CodeExport extends javax.swing.JInternalFrame {
.addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1) .addComponent(jLabel1)
.addGap(18, 18, 18) .addGap(18, 18, 18)
.addComponent(titleBox, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(titleBox, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2) .addComponent(jLabel2)
@ -256,10 +257,10 @@ public class CodeExport extends javax.swing.JInternalFrame {
.addComponent(jLabel4) .addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton1)) .addComponent(jButton1))
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 239, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())
); );
jPanel1Layout.setVerticalGroup( jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -284,7 +285,7 @@ public class CodeExport extends javax.swing.JInternalFrame {
.addComponent(dateBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(dateBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3))) .addComponent(jLabel3)))
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(0, 0, 0)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
); );
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
@ -297,10 +298,10 @@ public class CodeExport extends javax.swing.JInternalFrame {
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 286, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
.addGap(4, 4, 4) .addGap(4, 4, 4)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)) .addGap(10, 10, 10))
); );
pack(); pack();

View File

@ -1,7 +1,7 @@
/* /*
* Apocalypse Laboratories * Apocalypse Laboratories
* Open Source License * Open Source License
* *
* Source code can be used for any purpose, as long as: * Source code can be used for any purpose, as long as:
* - Compiled binaries are rebranded and trademarks are not * - Compiled binaries are rebranded and trademarks are not
* visible by the end user at any time, except to give * visible by the end user at any time, except to give
@ -14,7 +14,7 @@
* - and you provide your modified source code for download, * - and you provide your modified source code for download,
* under the terms of the GNU LGPL v3 or a comparable * under the terms of the GNU LGPL v3 or a comparable
* license. * license.
* *
* Compiled binaries cannot be redistributed or mirrored, * Compiled binaries cannot be redistributed or mirrored,
* unless: * unless:
* - You have written permission from Apocalypse Laboratories; * - You have written permission from Apocalypse Laboratories;
@ -22,7 +22,7 @@
* not even behind a paywall or other blocking mechanism; * not even behind a paywall or other blocking mechanism;
* - or you have received a multi-computer license, in which * - or you have received a multi-computer license, in which
* case you should take measures to prevent unauthorized * case you should take measures to prevent unauthorized
* downloads, such as preventing download access from the * downloads, such as preventing download access from the
* Internet. * Internet.
*/ */
package net.apocalypselabs.symat; package net.apocalypselabs.symat;
@ -94,15 +94,16 @@ public class FileUtils {
/** /**
* Get an MD5 hash. * Get an MD5 hash.
* *
* http://stackoverflow.com/a/6565597/2534036 * http://stackoverflow.com/a/6565597/2534036
*
* @param md5 the text to hash. * @param md5 the text to hash.
* @return * @return
*/ */
public static String MD5(String md5) { public static String MD5(String md5) {
try { try {
java.security.MessageDigest md = java.security.MessageDigest md
java.security.MessageDigest.getInstance("MD5"); = java.security.MessageDigest.getInstance("MD5");
byte[] array = md.digest(md5.getBytes()); byte[] array = md.digest(md5.getBytes());
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
for (int i = 0; i < array.length; ++i) { for (int i = 0; i < array.length; ++i) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B