Update company branding

This commit is contained in:
Skylar 2015-07-23 02:26:29 -06:00
parent ceaa9be060
commit 3bbed515b0
25 changed files with 925 additions and 115 deletions

BIN
lib/commons-codec-1.9.jar Normal file

Binary file not shown.

BIN
lib/commons-logging-1.2.jar Normal file

Binary file not shown.

BIN
lib/fluent-hc-4.5.jar Normal file

Binary file not shown.

BIN
lib/httpclient-4.5.jar Normal file

Binary file not shown.

Binary file not shown.

BIN
lib/httpclient-win-4.5.jar Normal file

Binary file not shown.

BIN
lib/httpcore-4.4.1.jar Normal file

Binary file not shown.

BIN
lib/httpmime-4.5.jar Normal file

Binary file not shown.

BIN
lib/jna-4.1.0.jar Normal file

Binary file not shown.

BIN
lib/jna-platform-4.1.0.jar Normal file

Binary file not shown.

BIN
lib/ujmp-complete-0.2.5.jar Normal file

Binary file not shown.

View File

@ -35,12 +35,20 @@ endorsed.classpath=
excludes=
file.reference.autocomplete-2.5.4.jar=lib/autocomplete-2.5.4.jar
file.reference.beautyeye_lnf.jar=lib/beautyeye_lnf.jar
file.reference.commons-codec-1.9.jar=lib/commons-codec-1.9.jar
file.reference.commons-logging-1.2.jar=lib/commons-logging-1.2.jar
file.reference.flamingo-6.3.jar=lib/flamingo-6.3.jar
file.reference.htmlcleaner-2.10.jar=lib/htmlcleaner-2.10.jar
file.reference.httpclient-4.5.jar=lib/httpclient-4.5.jar
file.reference.httpclient-cache-4.5.jar=lib/httpclient-cache-4.5.jar
file.reference.httpclient-win-4.5.jar=lib/httpclient-win-4.5.jar
file.reference.httpcore-4.4.1.jar=lib/httpcore-4.4.1.jar
file.reference.httpmime-4.5.jar=lib/httpmime-4.5.jar
file.reference.iText-4.2.0-com.itextpdf.jar=lib/iText-4.2.0-com.itextpdf.jar
file.reference.JavaPrettify-1.2.1.jar=lib\\JavaPrettify-1.2.1.jar
file.reference.JGoogleAnalytics_0.4.jar=lib\\JGoogleAnalytics_0.4.jar
file.reference.jmathplot.jar=lib/jmathplot.jar
file.reference.jna-4.1.0.jar=lib/jna-4.1.0.jar
file.reference.jna-platform-4.1.0.jar=lib/jna-platform-4.1.0.jar
file.reference.js-engine.jar=lib/js-engine.jar
file.reference.js.jar=lib/js.jar
file.reference.json-simple-1.1.1.jar=lib/json-simple-1.1.1.jar
@ -51,6 +59,7 @@ file.reference.seaglasslookandfeel-0.2.jar=lib/seaglasslookandfeel-0.2.jar
file.reference.SyMAT-src=src
file.reference.symja-2014-11-01.jar=lib/symja-2014-11-01.jar
file.reference.trident-6.3.jar=lib/trident-6.3.jar
file.reference.ujmp-complete-0.2.5.jar=lib\\ujmp-complete-0.2.5.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=false
@ -72,7 +81,16 @@ javac.classpath=\
${file.reference.symja-2014-11-01.jar}:\
${file.reference.trident-6.3.jar}:\
${file.reference.JavaPrettify-1.2.1.jar}:\
${file.reference.JGoogleAnalytics_0.4.jar}
${file.reference.ujmp-complete-0.2.5.jar}:\
${file.reference.commons-codec-1.9.jar}:\
${file.reference.commons-logging-1.2.jar}:\
${file.reference.httpclient-4.5.jar}:\
${file.reference.httpclient-cache-4.5.jar}:\
${file.reference.httpclient-win-4.5.jar}:\
${file.reference.httpcore-4.4.1.jar}:\
${file.reference.httpmime-4.5.jar}:\
${file.reference.jna-4.1.0.jar}:\
${file.reference.jna-platform-4.1.0.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
@ -93,10 +111,11 @@ javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.reference.flamingo-6.3.jar=lib/flamingo-6.3-javadoc.jar
javadoc.reference.ujmp-complete-0.2.5.jar=lib\\ujmp-complete-0.2.5-javadoc.zip!/0.2.5/ujmp-core/apidocs/
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
javadoc.windowtitle=SyMAT Code Docs
jnlp.codebase.type=no.codebase
jnlp.descriptor=application
jnlp.enabled=false

View File

@ -99,7 +99,7 @@ public class Main extends JRibbonFrame {
/**
* Version name, as it should be displayed.
*/
public static final String VERSION_NAME = "2.0.1";
public static final String VERSION_NAME = "2.1";
/**
* The word "SyMAT".
@ -112,7 +112,7 @@ public class Main extends JRibbonFrame {
/**
* Version number, for updates and //needs in scripts
*/
public static final double APP_CODE = 22;
public static final double APP_CODE = 23;
/**
* Base URL for building API calls
*/

View File

@ -45,8 +45,12 @@
*/
package net.apocalypselabs.symat;
import java.util.ArrayList;
import java.util.List;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
/**
*
@ -98,6 +102,20 @@ public class PrefStorage {
prefs.clear();
}
/**
* Get all settings in a List for a Sync.
* @return List of NameValuePairs.
* @throws BackingStoreException
*/
public static List syncdump() throws BackingStoreException {
String[] keys = prefs.keys();
List<NameValuePair> nvps = new ArrayList<>();
for (String key : keys) {
nvps.add(new BasicNameValuePair(key, prefs.get(key, "")));
}
return nvps;
}
// xkcd 221 compliance.
int getRandomNumber() {
return 4; // chosen by fair dice roll.

View File

@ -110,7 +110,7 @@
<Connection code="net.apocalypselabs.symat.Main.ubuntuRegular.deriveFont(12.0F)" type="code"/>
</Property>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="text" type="java.lang.String" value="Apocalypse Laboratories"/>
<Property name="text" type="java.lang.String" value="Netsyms Technologies"/>
</Properties>
<AuxValues>
<AuxValue name="JLayeredPane.layer" type="java.lang.Integer" value="300"/>

View File

@ -96,10 +96,8 @@ public class SplashScreen extends javax.swing.JFrame {
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("SyMAT");
setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
setMaximumSize(new java.awt.Dimension(500, 400));
setMinimumSize(new java.awt.Dimension(500, 400));
setUndecorated(true);
setPreferredSize(new java.awt.Dimension(500, 400));
setResizable(false);
setType(java.awt.Window.Type.POPUP);
addComponentListener(new java.awt.event.ComponentAdapter() {
@ -132,7 +130,7 @@ public class SplashScreen extends javax.swing.JFrame {
jLabel3.setFont(net.apocalypselabs.symat.Main.ubuntuRegular.deriveFont(12.0F));
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jLabel3.setText("Apocalypse Laboratories");
jLabel3.setText("Netsyms Technologies");
jLayeredPane1.add(jLabel3);
jLabel3.setBounds(10, 370, 250, 30);
jLayeredPane1.setLayer(jLabel3, javax.swing.JLayeredPane.POPUP_LAYER);

View File

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JInternalFrameFormInfo">
<Properties>
<Property name="closable" type="boolean" value="true"/>
<Property name="iconifiable" type="boolean" value="true"/>
<Property name="maximizable" type="boolean" value="true"/>
<Property name="resizable" type="boolean" value="true"/>
<Property name="title" type="java.lang.String" value="SyMAT Sync"/>
<Property name="frameIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/icons/sync.png"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[400, 386]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[400, 386]"/>
</Property>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<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"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel1" pref="384" max="32767" attributes="0"/>
<Component id="wizPanel" alignment="1" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel1" min="-2" pref="150" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="wizPanel" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="b8" red="0" type="rgb"/>
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/images/SyncLogo.png"/>
</Property>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
<LineBorder/>
</Border>
</Property>
<Property name="opaque" type="boolean" value="true"/>
</Properties>
</Component>
<Container class="javax.swing.JPanel" name="wizPanel">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 200]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[400, 200]"/>
</Property>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
</Container>
</SubComponents>
</Form>

View File

@ -0,0 +1,123 @@
/*
* CODE LICENSE =====================
* Copyright (c) 2015, Apocalypse Laboratories
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* 4. You adhere to the Media License detailed below. If you do not, this license
* is automatically revoked and you must purge all copies of the software you
* possess, in source or binary form.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* MEDIA LICENSE ====================
* All images and other graphical files (the "graphics") included with this
* software are copyright (c) 2015 Apocalypse Laboratories. You may not distribute
* the graphics or any program, source code repository, or other digital storage
* media containing them without written permission from Apocalypse Laboratories.
* This ban on distribution only applies to publicly available systems.
* A password-protected network file share, USB drive, or other storage scheme that
* cannot be easily accessed by the public is generally allowed. If in doubt,
* contact Apocalypse Laboratories. If Apocalypse Laboratories allows or denies
* you permission, that decision is considered final and binding.
*/
package net.apocalypselabs.symat;
import java.awt.BorderLayout;
import net.apocalypselabs.symat.sync.Start;
/**
*
* @author Skylar
*/
public class SyncLogin extends javax.swing.JInternalFrame {
/**
* Creates new form SyncLogin
*/
public SyncLogin() {
initComponents();
Start st = new Start(this);
wizPanel.add(st, BorderLayout.CENTER);
st.setVisible(true);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
wizPanel = new javax.swing.JPanel();
setClosable(true);
setIconifiable(true);
setMaximizable(true);
setResizable(true);
setTitle("SyMAT Sync");
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/sync.png"))); // NOI18N
setMinimumSize(new java.awt.Dimension(400, 386));
setPreferredSize(new java.awt.Dimension(400, 386));
jLabel1.setBackground(new java.awt.Color(0, 184, 255));
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/images/SyncLogo.png"))); // NOI18N
jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel1.setOpaque(true);
wizPanel.setMinimumSize(new java.awt.Dimension(0, 200));
wizPanel.setPreferredSize(new java.awt.Dimension(400, 200));
wizPanel.setLayout(new java.awt.BorderLayout());
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
.addComponent(wizPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 0, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(wizPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel wizPanel;
// End of variables declaration//GEN-END:variables
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -0,0 +1,83 @@
/*
* CODE LICENSE =====================
* Copyright (c) 2015, Apocalypse Laboratories
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* 4. You adhere to the Media License detailed below. If you do not, this license
* is automatically revoked and you must purge all copies of the software you
* possess, in source or binary form.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* MEDIA LICENSE ====================
* All images and other graphical files (the "graphics") included with this
* software are copyright (c) 2015 Apocalypse Laboratories. You may not distribute
* the graphics or any program, source code repository, or other digital storage
* media containing them without written permission from Apocalypse Laboratories.
* This ban on distribution only applies to publicly available systems.
* A password-protected network file share, USB drive, or other storage scheme that
* cannot be easily accessed by the public is generally allowed. If in doubt,
* contact Apocalypse Laboratories. If Apocalypse Laboratories allows or denies
* you permission, that decision is considered final and binding.
*/
package net.apocalypselabs.symat.sync;
import net.apocalypselabs.symat.Debug;
import static net.apocalypselabs.symat.Main.API_URL;
import net.apocalypselabs.symat.PrefStorage;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
/**
* Perform settings sync in another thread.
*
* @author Skylar
*/
public class BackgroundSync extends Thread {
@Override
public void run() {
try {
Debug.println("Syncing profile...");
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost data = new HttpPost(API_URL + "sync.php");
data.setEntity(new UrlEncodedFormEntity(PrefStorage.syncdump()));
CloseableHttpResponse response = httpClient.execute(data);
} catch (Exception e) {
Debug.stacktrace(e);
}
}
public BackgroundSync() {
}
}

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[400, 200]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<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"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel2" alignment="0" pref="400" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="haveSyncBtn" min="-2" pref="175" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="newSyncBtn" min="-2" pref="175" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel2" min="-2" pref="50" max="-2" attributes="0"/>
<EmptySpace pref="51" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="newSyncBtn" alignment="3" min="-2" pref="50" max="-2" attributes="0"/>
<Component id="haveSyncBtn" alignment="3" min="-2" pref="50" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="49" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="net.apocalypselabs.symat.Main.ubuntuRegular.deriveFont(36.0F)" type="code"/>
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Sync"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="newSyncBtn">
<Properties>
<Property name="text" type="java.lang.String" value="Setup a new account"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="newSyncBtnActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="haveSyncBtn">
<Properties>
<Property name="text" type="java.lang.String" value="I already have Sync"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="haveSyncBtnActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>

View File

@ -0,0 +1,195 @@
/*
* CODE LICENSE =====================
* Copyright (c) 2015, Apocalypse Laboratories
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* 4. You adhere to the Media License detailed below. If you do not, this license
* is automatically revoked and you must purge all copies of the software you
* possess, in source or binary form.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* MEDIA LICENSE ====================
* All images and other graphical files (the "graphics") included with this
* software are copyright (c) 2015 Apocalypse Laboratories. You may not distribute
* the graphics or any program, source code repository, or other digital storage
* media containing them without written permission from Apocalypse Laboratories.
* This ban on distribution only applies to publicly available systems.
* A password-protected network file share, USB drive, or other storage scheme that
* cannot be easily accessed by the public is generally allowed. If in doubt,
* contact Apocalypse Laboratories. If Apocalypse Laboratories allows or denies
* you permission, that decision is considered final and binding.
*/
package net.apocalypselabs.symat.sync;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLEncoder;
import javax.swing.JInternalFrame;
import javax.swing.JOptionPane;
import net.apocalypselabs.symat.Debug;
import static net.apocalypselabs.symat.Main.API_URL;
import net.apocalypselabs.symat.PrefStorage;
/**
*
* @author Skylar
*/
public class Start extends javax.swing.JPanel {
private String email = "";
private String password = "";
private JInternalFrame parentComponent;
/**
* Creates new form Start
*/
public Start(JInternalFrame parent) {
parentComponent = parent;
initComponents();
setVisible(true);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel2 = new javax.swing.JLabel();
newSyncBtn = new javax.swing.JButton();
haveSyncBtn = new javax.swing.JButton();
setPreferredSize(new java.awt.Dimension(400, 200));
jLabel2.setFont(net.apocalypselabs.symat.Main.ubuntuRegular.deriveFont(36.0F));
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("Sync");
newSyncBtn.setText("Setup a new account");
newSyncBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
newSyncBtnActionPerformed(evt);
}
});
haveSyncBtn.setText("I already have Sync");
haveSyncBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
haveSyncBtnActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(haveSyncBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(newSyncBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 51, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(newSyncBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(haveSyncBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(49, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void haveSyncBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_haveSyncBtnActionPerformed
getLogin(UserLogin.LOGIN_MODE);
}//GEN-LAST:event_haveSyncBtnActionPerformed
private void newSyncBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newSyncBtnActionPerformed
getLogin(UserLogin.SIGNUP_MODE);
}//GEN-LAST:event_newSyncBtnActionPerformed
private void getLogin(int mode) {
UserLogin ul = new UserLogin(mode);
JOptionPane.showMessageDialog(this,
ul,
"Sync " + (mode == UserLogin.SIGNUP_MODE ? "Signup" : "Login"),
JOptionPane.PLAIN_MESSAGE);
email = ul.getEmail();
password = ul.getPassword();
try {
Debug.println("Signing in to Sync...");
URL url = new URL(API_URL
+ "sync" + (mode == UserLogin.SIGNUP_MODE ? "new" : "old")
+ ".php?"
+ "email=" + URLEncoder.encode(email, "UTF-8")
+ "&password=" + URLEncoder.encode(password, "UTF-8"));
InputStream is = url.openStream();
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String line = br.readLine();
br.close();
is.close();
if (!line.contains("OK")) {
JOptionPane.showMessageDialog(this,
line,
"Sync Error",
JOptionPane.ERROR_MESSAGE);
} else {
PrefStorage.saveSetting("syncemail", email);
PrefStorage.saveSetting("syncpassword", password);
PrefStorage.save();
new BackgroundSync().start();
JOptionPane.showMessageDialog(this,
"Account setup successful. "
+ "Your settings and plugins "
+ "will now sync in the background.",
"Sync",
JOptionPane.INFORMATION_MESSAGE);
parentComponent.dispose();
}
} catch (Exception e) {
JOptionPane.showMessageDialog(this,
"An error occurred while syncing your account.",
"Sync Error",
JOptionPane.ERROR_MESSAGE);
}
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton haveSyncBtn;
private javax.swing.JLabel jLabel2;
private javax.swing.JButton newSyncBtn;
// End of variables declaration//GEN-END:variables
}

View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<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"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="helpLbl" alignment="0" pref="299" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel2" max="32767" attributes="0"/>
<Component id="jLabel1" max="32767" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="emailBox" pref="190" max="32767" attributes="0"/>
<Component id="passwdBox" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="helpLbl" min="-2" pref="50" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="emailBox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="passwdBox" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="13" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="helpLbl">
<Properties>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Please login to your Sync account."/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="emailBox">
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Email:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="Password:"/>
</Properties>
</Component>
<Component class="javax.swing.JPasswordField" name="passwdBox">
</Component>
</SubComponents>
</Form>

View File

@ -0,0 +1,140 @@
/*
* CODE LICENSE =====================
* Copyright (c) 2015, Apocalypse Laboratories
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* 4. You adhere to the Media License detailed below. If you do not, this license
* is automatically revoked and you must purge all copies of the software you
* possess, in source or binary form.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* MEDIA LICENSE ====================
* All images and other graphical files (the "graphics") included with this
* software are copyright (c) 2015 Apocalypse Laboratories. You may not distribute
* the graphics or any program, source code repository, or other digital storage
* media containing them without written permission from Apocalypse Laboratories.
* This ban on distribution only applies to publicly available systems.
* A password-protected network file share, USB drive, or other storage scheme that
* cannot be easily accessed by the public is generally allowed. If in doubt,
* contact Apocalypse Laboratories. If Apocalypse Laboratories allows or denies
* you permission, that decision is considered final and binding.
*/
package net.apocalypselabs.symat.sync;
/**
*
* @author Skylar
*/
public class UserLogin extends javax.swing.JPanel {
public static final int LOGIN_MODE = 0;
public static final int SIGNUP_MODE = 1;
private static final String signup_help = "Sign up for a Sync acount.";
/**
* Creates new form UserLogin
* @param mode LOGIN_MODE or SIGNUP_MODE. Sets the help string.
*/
public UserLogin(int mode) {
initComponents();
if (mode == SIGNUP_MODE) {
helpLbl.setText(signup_help);
}
}
public String getEmail() {
return emailBox.getText();
}
public String getPassword() {
return new String(passwdBox.getPassword());
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
helpLbl = new javax.swing.JLabel();
emailBox = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
passwdBox = new javax.swing.JPasswordField();
helpLbl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
helpLbl.setText("Please login to your Sync account.");
jLabel1.setText("Email:");
jLabel2.setText("Password:");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(helpLbl, javax.swing.GroupLayout.DEFAULT_SIZE, 299, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(emailBox, javax.swing.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE)
.addComponent(passwdBox))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(helpLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(emailBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(passwdBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 13, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField emailBox;
private javax.swing.JLabel helpLbl;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPasswordField passwdBox;
// End of variables declaration//GEN-END:variables
}