Add themes, display settings, needed icons

master
skylarmt 10 years ago
parent bd71fca1fa
commit 000ab2153f

@ -90,30 +90,30 @@ unless:
nbproject/build-impl.xml file.
-->
<target name="-unjar-and-copy-lib-jars">
<unjar dest="${build.classes.dir}">
<fileset dir="dist/lib">
<include name="**/*.jar"/>
</fileset>
<patternset>
<exclude name="META-INF/**"/>
<exclude name="/*"/>
</patternset>
</unjar>
</target>
<target depends="init,compile,jar,-pre-pre-jar,-pre-jar,-unjar-and-copy-lib-jars" name="fat-jar">
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
<jar destfile="${dist.jar}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
<echo>To run this application from the command line without Ant, try (HAXX):</echo>
<property location="${dist.jar}" name="dist.jar.resolved"/>
<echo>java -jar "${dist.jar.resolved}"</echo>
</target>
<target depends="clean,fat-jar" name="clean-and-fat-jar"/>
<target name="-unjar-and-copy-lib-jars">
<unjar dest="${build.classes.dir}">
<fileset dir="dist/lib">
<include name="**/*.jar"/>
</fileset>
<patternset>
<exclude name="META-INF/**"/>
<exclude name="/*"/>
</patternset>
</unjar>
</target>
<target depends="init,compile,jar,-pre-pre-jar,-pre-jar,-unjar-and-copy-lib-jars" name="fat-jar">
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
<jar destfile="${dist.jar}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
<echo>To run this application from the command line without Ant, try (HAXX):</echo>
<property location="${dist.jar}" name="dist.jar.resolved"/>
<echo>java -jar "${dist.jar.resolved}"</echo>
</target>
<target depends="clean,fat-jar" name="clean-and-fat-jar"/>
</project>

@ -18,7 +18,7 @@ is divided into following sections:
- applet
- cleanup
-->
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="SyMAT-impl">
<import file="build-native.xml"/>
<fail message="Please build using Ant 1.8.0 or higher.">
@ -30,10 +30,10 @@ is divided into following sections:
</fail>
<target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
<!--
======================
INITIALIZATION SECTION
======================
-->
======================
INITIALIZATION SECTION
======================
-->
<target name="-pre-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
@ -694,8 +694,8 @@ is divided into following sections:
</target>
<target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
<!--
pre NB7.2 profiling section; consider it deprecated
-->
pre NB7.2 profiling section; consider it deprecated
-->
<target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
<target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
<!-- Empty placeholder for easier customization. -->
@ -742,8 +742,8 @@ is divided into following sections:
<fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
</target>
<!--
end of pre NB7.2 profiling section
-->
end of pre NB7.2 profiling section
-->
<target depends="-init-debug-args" name="-init-macrodef-nbjpda">
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute default="${main.class}" name="name"/>
@ -903,10 +903,10 @@ is divided into following sections:
</target>
<target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
<!--
===================
COMPILATION SECTION
===================
-->
===================
COMPILATION SECTION
===================
-->
<target name="-deps-jar-init" unless="built-jar.properties">
<property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
<delete file="${built-jar.properties}" quiet="true"/>
@ -977,10 +977,10 @@ is divided into following sections:
</target>
<target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
<!--
====================
JAR BUILDING SECTION
====================
-->
====================
JAR BUILDING SECTION
====================
-->
<target depends="init" name="-pre-pre-jar">
<dirname file="${dist.jar}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
@ -1051,10 +1051,10 @@ is divided into following sections:
<target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
<target depends="init,compile,-pre-jar,-do-jar,-post-jar" description="Build JAR." name="jar"/>
<!--
=================
EXECUTION SECTION
=================
-->
=================
EXECUTION SECTION
=================
-->
<target depends="init,compile" description="Run a main class." name="run">
<j2seproject1:java>
<customize>
@ -1074,10 +1074,10 @@ is divided into following sections:
<j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
</target>
<!--
=================
DEBUGGING SECTION
=================
-->
=================
DEBUGGING SECTION
=================
-->
<target depends="init" if="netbeans.home" name="-debug-start-debugger">
<j2seproject1:nbjpdastart name="${debug.class}"/>
</target>
@ -1115,13 +1115,13 @@ is divided into following sections:
</target>
<target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
<!--
=================
PROFILING SECTION
=================
-->
=================
PROFILING SECTION
=================
-->
<!--
pre NB7.2 profiler integration
-->
pre NB7.2 profiler integration
-->
<target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
<fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
<nbprofiledirect>
@ -1178,8 +1178,8 @@ is divided into following sections:
</junit>
</target>
<!--
end of pre NB72 profiling section
-->
end of pre NB72 profiling section
-->
<target if="netbeans.home" name="-profile-check">
<condition property="profiler.configured">
<or>
@ -1214,10 +1214,10 @@ is divided into following sections:
<antcall target="run-applet"/>
</target>
<!--
===============
JAVADOC SECTION
===============
-->
===============
JAVADOC SECTION
===============
-->
<target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
@ -1258,10 +1258,10 @@ is divided into following sections:
</target>
<target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
<!--
=========================
TEST COMPILATION SECTION
=========================
-->
=========================
TEST COMPILATION SECTION
=========================
-->
<target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
<mkdir dir="${build.test.classes.dir}"/>
</target>
@ -1301,10 +1301,10 @@ is divided into following sections:
</target>
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
<!--
=======================
TEST EXECUTION SECTION
=======================
-->
=======================
TEST EXECUTION SECTION
=======================
-->
<target depends="init" if="have.tests" name="-pre-test-run">
<mkdir dir="${build.test.results.dir}"/>
</target>
@ -1338,10 +1338,10 @@ is divided into following sections:
</target>
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
<!--
=======================
TEST DEBUGGING SECTION
=======================
-->
=======================
TEST DEBUGGING SECTION
=======================
-->
<target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
<fail unless="test.class">Must select one file in the IDE or set test.class</fail>
<j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
@ -1361,10 +1361,10 @@ is divided into following sections:
</target>
<target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
<!--
=========================
APPLET EXECUTION SECTION
=========================
-->
=========================
APPLET EXECUTION SECTION
=========================
-->
<target depends="init,compile-single" name="run-applet">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<j2seproject1:java classname="sun.applet.AppletViewer">
@ -1374,10 +1374,10 @@ is divided into following sections:
</j2seproject1:java>
</target>
<!--
=========================
APPLET DEBUGGING SECTION
=========================
-->
=========================
APPLET DEBUGGING SECTION
=========================
-->
<target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<j2seproject3:debug classname="sun.applet.AppletViewer">
@ -1388,10 +1388,10 @@ is divided into following sections:
</target>
<target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
<!--
===============
CLEANUP SECTION
===============
-->
===============
CLEANUP SECTION
===============
-->
<target name="-deps-clean-init" unless="built-clean.properties">
<property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
<delete file="${built-clean.properties}" quiet="true"/>

@ -67,7 +67,7 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<echo message="running.on.mac = ${running.on.mac}" level="verbose"/>
<echo message="running.on.unix = ${running.on.unix}" level="verbose"/>
<echo message="running.on.windows = ${running.on.windows}" level="verbose"/>
</target>
</target>
<!-- Check availability of JavaFX SDK deployment support (ant-javafx.jar) -->
@ -89,19 +89,27 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<condition property="javafx.sdk.defined">
<and>
<isset property="javafx.sdk"/>
<not><contains string="${javafx.sdk}" substring="$${platform" casesensitive="false"/></not>
<not>
<contains string="${javafx.sdk}" substring="$${platform" casesensitive="false"/>
</not>
</and>
</condition>
<condition property="javafx.sdk.missing+default">
<and>
<equals arg1="${platform.active}" arg2="Default_JavaFX_Platform" trim="true"/>
<not><isset property="javafx.sdk.defined"/></not>
<not>
<isset property="javafx.sdk.defined"/>
</not>
</and>
</condition>
<condition property="javafx.sdk.missing-default">
<and>
<not><equals arg1="${platform.active}" arg2="Default_JavaFX_Platform" trim="true"/></not>
<not><isset property="javafx.sdk.defined"/></not>
<not>
<equals arg1="${platform.active}" arg2="Default_JavaFX_Platform" trim="true"/>
</not>
<not>
<isset property="javafx.sdk.defined"/>
</not>
</and>
</condition>
<echo message="javafx.sdk.defined = ${javafx.sdk.defined}" level="verbose"/>
@ -112,7 +120,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<target name="-check-ant-javafx-in-fxsdk-lib" depends="-check-property-javafx.sdk" if="javafx.sdk.defined">
<condition property="do.set.ant-javafx.in.fxsdk.lib">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<not>
<isset property="ant-javafx.jar.location"/>
</not>
<available file="${javafx.sdk}${file.separator}lib${file.separator}ant-javafx.jar"/>
</and>
</condition>
@ -123,7 +133,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<target name="-check-ant-javafx-in-fxsdk-tools" depends="-check-property-javafx.sdk" if="javafx.sdk.defined">
<condition property="do.set.ant-javafx.in.fxsdk.tools">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<not>
<isset property="ant-javafx.jar.location"/>
</not>
<available file="${javafx.sdk}${file.separator}tools${file.separator}ant-javafx.jar"/>
</and>
</condition>
@ -134,7 +146,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<target name="-check-ant-javafx-in-platform-home-lib" if="platform.home">
<condition property="do.set.ant-javafx.in.platform.home.lib">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<not>
<isset property="ant-javafx.jar.location"/>
</not>
<available file="${platform.home}${file.separator}lib${file.separator}ant-javafx.jar"/>
</and>
</condition>
@ -145,7 +159,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<target name="-check-ant-javafx-in-platform-home-tools" if="platform.home">
<condition property="do.set.ant-javafx.in.platform.home.tools">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<not>
<isset property="ant-javafx.jar.location"/>
</not>
<available file="${platform.home}${file.separator}tools${file.separator}ant-javafx.jar"/>
</and>
</condition>
@ -156,7 +172,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<target name="-check-ant-javafx-in-probjdk-lib" unless="ant-javafx.jar.location">
<condition property="do.set.ant-javafx.in.probjdk.lib">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<not>
<isset property="ant-javafx.jar.location"/>
</not>
<available file="${java.home}${file.separator}..${file.separator}lib${file.separator}ant-javafx.jar"/>
</and>
</condition>
@ -167,7 +185,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<target name="-check-ant-javafx-in-probjdk-tools" unless="ant-javafx.jar.location">
<condition property="do.set.ant-javafx.in.probjdk.tools">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<not>
<isset property="ant-javafx.jar.location"/>
</not>
<available file="${java.home}${file.separator}..${file.separator}tools${file.separator}ant-javafx.jar"/>
</and>
</condition>
@ -178,7 +198,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<target name="-check-ant-javafx-in-macjdk-lib" unless="ant-javafx.jar.location">
<condition property="do.set.ant-javafx.in.macjdk.lib">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<not>
<isset property="ant-javafx.jar.location"/>
</not>
<available file="${java.home}${file.separator}lib${file.separator}ant-javafx.jar"/>
</and>
</condition>
@ -190,7 +212,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<property environment="env"/>
<condition property="do.set.ant-javafx.in.envjdk.lib">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<not>
<isset property="ant-javafx.jar.location"/>
</not>
<available file="${env.JAVA_HOME}${file.separator}lib${file.separator}ant-javafx.jar"/>
</and>
</condition>
@ -202,7 +226,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<property environment="env"/>
<condition property="do.set.ant-javafx.in.envjdk.tools">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<not>
<isset property="ant-javafx.jar.location"/>
</not>
<available file="${env.JAVA_HOME}${file.separator}tools${file.separator}ant-javafx.jar"/>
</and>
</condition>
@ -214,7 +240,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<condition property="do.check.ant-javafx.version">
<and>
<isset property="ant-javafx.jar.location"/>
<not><isset property="ant-javafx-version-already-checked-in-jfximpl"/></not>
<not>
<isset property="ant-javafx-version-already-checked-in-jfximpl"/>
</not>
</and>
</condition>
</target>
@ -230,8 +258,8 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<echo message="ant-javafx.jar.location = ${ant-javafx.jar.location}" level="verbose"/>
<echo message="javafx.ant.classpath = ${javafx.ant.classpath}" level="verbose"/>
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath="${javafx.ant.classpath}"/>
uri="javafx:com.sun.javafx.tools.ant"
classpath="${javafx.ant.classpath}"/>
<condition property="have-fx-ant-init">
<typefound name="javafx:com.sun.javafx.tools.ant:init-ant"/>
</condition>
@ -369,13 +397,23 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<echo message="exec-error:${exec-error}" level="verbose"/>
<echo message="exec-result:${exec-result}" level="verbose"/>
<condition property="missing.Inno">
<not><and>
<contains string="${exec-output}" substring="Inno Setup"/>
<not><contains string="${exec-output}" substring="Inno Setup 1"/></not>
<not><contains string="${exec-output}" substring="Inno Setup 2"/></not>
<not><contains string="${exec-output}" substring="Inno Setup 3"/></not>
<not><contains string="${exec-output}" substring="Inno Setup 4"/></not>
</and></not>
<not>
<and>
<contains string="${exec-output}" substring="Inno Setup"/>
<not>
<contains string="${exec-output}" substring="Inno Setup 1"/>
</not>
<not>
<contains string="${exec-output}" substring="Inno Setup 2"/>
</not>
<not>
<contains string="${exec-output}" substring="Inno Setup 3"/>
</not>
<not>
<contains string="${exec-output}" substring="Inno Setup 4"/>
</not>
</and>
</not>
</condition>
</target>
<target name="-check-WiX-presence" depends="-check-native-bundling-type" if="need.WiX.presence">
@ -389,11 +427,17 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<echo message="exec-error:${exec-error}" level="verbose"/>
<echo message="exec-result:${exec-result}" level="verbose"/>
<condition property="missing.WiX">
<not><and>
<contains string="${exec-output}" substring="Windows Installer Xml Compiler version"/>
<not><contains string="${exec-output}" substring="Windows Installer Xml Compiler version 1"/></not>
<not><contains string="${exec-output}" substring="Windows Installer Xml Compiler version 2"/></not>
</and></not>
<not>
<and>
<contains string="${exec-output}" substring="Windows Installer Xml Compiler version"/>
<not>
<contains string="${exec-output}" substring="Windows Installer Xml Compiler version 1"/>
</not>
<not>
<contains string="${exec-output}" substring="Windows Installer Xml Compiler version 2"/>
</not>
</and>
</not>
</condition>
</target>
<target name="-check-dpkg-presence" depends="-check-native-bundling-type" if="need.dpkg.presence">
@ -403,12 +447,16 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<arg line="-v dpkg"/>
</exec>
<condition property="missing.dpkg">
<not><and>
<isset property="exec.which.dpkg.result"/>
<equals arg1="${exec.which.dpkg.result}" arg2="0"/>
<isset property="exec.which.dpkg.output"/>
<not><equals arg1="${exec.which.dpkg.output}" arg2=""/></not>
</and></not>
<not>
<and>
<isset property="exec.which.dpkg.result"/>
<equals arg1="${exec.which.dpkg.result}" arg2="0"/>
<isset property="exec.which.dpkg.output"/>
<not>
<equals arg1="${exec.which.dpkg.output}" arg2=""/>
</not>
</and>
</not>
</condition>
</target>
<target name="-check-rpmbuild-presence" depends="-check-native-bundling-type" if="need.rpmbuild.presence">
@ -418,12 +466,16 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<arg line="-v rpmbuild"/>
</exec>
<condition property="missing.rpmbuild">
<not><and>
<isset property="exec.which.rpmbuild.result"/>
<equals arg1="${exec.which.rpmbuild.result}" arg2="0"/>
<isset property="exec.which.rpmbuild.output"/>
<not><equals arg1="${exec.which.rpmbuild.output}" arg2=""/></not>
</and></not>
<not>
<and>
<isset property="exec.which.rpmbuild.result"/>
<equals arg1="${exec.which.rpmbuild.result}" arg2="0"/>
<isset property="exec.which.rpmbuild.output"/>
<not>
<equals arg1="${exec.which.rpmbuild.output}" arg2=""/>
</not>
</and>
</not>
</condition>
</target>
<target name="-check-native-packager-external-tools" depends="-check-Inno-presence, -check-WiX-presence, -check-dpkg-presence, -check-rpmbuild-presence">
@ -462,11 +514,11 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
<map from="${basedir}${file.separator}${dist.jar}" to=""/>
<scriptmapper language="javascript">
self.addMappedName(
(source.indexOf("jfxrt.jar") >= 0) ||
(source.indexOf("deploy.jar") >= 0) ||
(source.indexOf("javaws.jar") >= 0) ||
(source.indexOf("plugin.jar") >= 0)
? "" : source
(source.indexOf("jfxrt.jar") >= 0) ||
(source.indexOf("deploy.jar") >= 0) ||
(source.indexOf("javaws.jar") >= 0) ||
(source.indexOf("plugin.jar") >= 0)
? "" : source
);
</scriptmapper>
</pathconvert>

@ -91,14 +91,6 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem6ActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem7">
<Properties>
<Property name="text" type="java.lang.String" value="Font size..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem7ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMenu2">
@ -177,15 +169,14 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jSplitPane1" alignment="0" pref="347" max="32767" attributes="0"/>
<Component id="jSplitPane1" alignment="0" pref="319" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
<Properties>
<Property name="dividerLocation" type="int" value="275"/>
<Property name="dividerSize" type="int" value="3"/>
<Property name="dividerLocation" type="int" value="220"/>
<Property name="orientation" type="int" value="0"/>
<Property name="resizeWeight" type="double" value="0.7"/>
</Properties>
@ -194,6 +185,7 @@
<SubComponents>
<Container class="javax.swing.JScrollPane" name="scrollPane">
<Properties>
<Property name="opaque" type="boolean" value="false"/>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<AuxValues>
@ -229,7 +221,7 @@
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="55" max="32767" attributes="0"/>
<Component id="jScrollPane1" pref="73" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -247,11 +239,13 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="outputPane">
<Component class="javax.swing.JTextArea" name="outputBox">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="5"/>
<Property name="lineWrap" type="boolean" value="true"/>
<Property name="rows" type="int" value="3"/>
<Property name="wrapStyleWord" type="boolean" value="true"/>
</Properties>
</Component>
</SubComponents>

@ -27,6 +27,7 @@
*/
package net.apocalypselabs.symat;
import java.awt.Color;
import java.awt.Font;
import java.io.File;
import java.io.FileOutputStream;
@ -36,12 +37,11 @@ import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.UIDefaults;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.text.AttributeSet;
@ -77,10 +77,24 @@ public class CodeEditor extends javax.swing.JInternalFrame {
fc.addChoosableFileFilter(filter);
int font_size = 12;
try {
font_size = Integer.valueOf(PrefStorage.getSetting("editor-fontsize"));
font_size = Integer.valueOf(PrefStorage.getSetting("editfont"));
} catch (Exception ex) {
}
codeBox.setFont(new Font(Font.MONOSPACED, Font.PLAIN, font_size));
outputBox.setFont(new Font(Font.MONOSPACED, Font.PLAIN, font_size));
if (PrefStorage.getSetting("theme").equals("dark")) {
setBackgroundOfEditor(Color.BLACK);
codeBox.setForeground(Color.WHITE);
outputBox.setBackground(Color.BLACK);
outputBox.setForeground(Color.WHITE);
setBackground(Color.DARK_GRAY);
} else {
setBackgroundOfEditor(Color.WHITE);
codeBox.setForeground(Color.BLACK);
outputBox.setBackground(Color.WHITE);
outputBox.setForeground(Color.BLACK);
setBackground(Color.LIGHT_GRAY);
}
TabStop[] tabs = new TabStop[30];
for (int i = 0; i < tabs.length; i++) {
tabs[i] = new TabStop(15 * i, TabStop.ALIGN_RIGHT, TabStop.LEAD_NONE);
@ -97,6 +111,14 @@ public class CodeEditor extends javax.swing.JInternalFrame {
codeBox.requestFocus();
}
private void setBackgroundOfEditor(Color c) {
UIDefaults defaults = new UIDefaults();
defaults.put("TextPane[Enabled].backgroundPainter", c);
codeBox.putClientProperty("Nimbus.Overrides", defaults);
codeBox.putClientProperty("Nimbus.Overrides.InheritDefaults", true);
codeBox.setBackground(c);
}
/**
* 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
@ -116,7 +138,7 @@ public class CodeEditor extends javax.swing.JInternalFrame {
jPanel2 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
outputPane = new javax.swing.JTextArea();
outputBox = new javax.swing.JTextArea();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
@ -125,7 +147,6 @@ public class CodeEditor extends javax.swing.JInternalFrame {
jMenuItem8 = new javax.swing.JMenuItem();
jMenu5 = new javax.swing.JMenu();
jMenuItem6 = new javax.swing.JMenuItem();
jMenuItem7 = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenuItem5 = new javax.swing.JMenuItem();
@ -145,20 +166,22 @@ public class CodeEditor extends javax.swing.JInternalFrame {
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/editor.png"))); // NOI18N
setMinimumSize(new java.awt.Dimension(125, 50));
jSplitPane1.setDividerLocation(275);
jSplitPane1.setDividerSize(3);
jSplitPane1.setDividerLocation(220);
jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
jSplitPane1.setResizeWeight(0.7);
scrollPane.setOpaque(false);
scrollPane.setRequestFocusEnabled(false);
jSplitPane1.setTopComponent(scrollPane);
jLabel1.setText("Output:");
outputPane.setEditable(false);
outputPane.setColumns(20);
outputPane.setRows(5);
jScrollPane1.setViewportView(outputPane);
outputBox.setEditable(false);
outputBox.setColumns(20);
outputBox.setLineWrap(true);
outputBox.setRows(3);
outputBox.setWrapStyleWord(true);
jScrollPane1.setViewportView(outputBox);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
@ -174,7 +197,7 @@ public class CodeEditor extends javax.swing.JInternalFrame {
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 55, Short.MAX_VALUE))
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 73, Short.MAX_VALUE))
);
jSplitPane1.setRightComponent(jPanel2);
@ -187,7 +210,7 @@ public class CodeEditor extends javax.swing.JInternalFrame {
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)
.addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
);
jMenu1.setText("File");
@ -240,14 +263,6 @@ public class CodeEditor extends javax.swing.JInternalFrame {
});
jMenu5.add(jMenuItem6);
jMenuItem7.setText("Font size...");
jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem7ActionPerformed(evt);
}
});
jMenu5.add(jMenuItem7);
jMenuBar1.add(jMenu5);
jMenu2.setText("Run");
@ -352,31 +367,16 @@ public class CodeEditor extends javax.swing.JInternalFrame {
CodeRunner cr = new CodeRunner();
Object result = cr.evalString(codeBox.getText());
try {
outputPane.append(result.toString() + "\n");
outputBox.append(result.toString() + "\n");
} catch (NullPointerException ex) {
}
}//GEN-LAST:event_jMenuItem5ActionPerformed
private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
outputPane.setText("");
outputBox.setText("");
}//GEN-LAST:event_jMenuItem6ActionPerformed
private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
try {
int size = Integer.parseInt(JOptionPane.showInternalInputDialog(this,
"New font size (8-36):",
"Font Size",
JOptionPane.QUESTION_MESSAGE));
if (size >= 8 && size <= 36) {
codeBox.setFont(new Font(Font.MONOSPACED, Font.PLAIN, size));
PrefStorage.saveSetting("editor-fontsize", size + "");
}
} catch (Exception ex) {
}
}//GEN-LAST:event_jMenuItem7ActionPerformed
private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
CodeExport ce = new CodeExport(codeBox.getText());
MainGUI.loadFrame(ce);
@ -431,13 +431,12 @@ public class CodeEditor extends javax.swing.JInternalFrame {
private javax.swing.JMenuItem jMenuItem4;
private javax.swing.JMenuItem jMenuItem5;
private javax.swing.JMenuItem jMenuItem6;
private javax.swing.JMenuItem jMenuItem7;
private javax.swing.JMenuItem jMenuItem8;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JSplitPane jSplitPane1;
private javax.swing.JTextArea outputPane;
private javax.swing.JTextArea outputBox;
private javax.swing.JScrollPane scrollPane;
// End of variables declaration//GEN-END:variables
}

@ -29,18 +29,23 @@ package net.apocalypselabs.symat;
/**
* This class handles DEBUG logging, so it's easy to disable.
*
*
* @author Skylar
*/
public class Debug {
// If output should be on or off
public static final boolean DEBUG = true;
public static void println(Object data) {
if (DEBUG) System.out.println(data);
if (DEBUG) {
System.out.println(data);
}
}
public static void printerr(Object data) {
if (DEBUG) System.err.println(data);
if (DEBUG) {
System.err.println(data);
}
}
}

@ -0,0 +1,210 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JInternalFrameFormInfo">
<NonVisualComponents>
<Component class="javax.swing.ButtonGroup" name="themeGroup">
</Component>
</NonVisualComponents>
<Properties>
<Property name="closable" type="boolean" value="true"/>
<Property name="iconifiable" type="boolean" value="true"/>
<Property name="title" type="java.lang.String" value="Display Settings"/>
<Property name="frameIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/icons/settings.png"/>
</Property>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
</SyntheticProperties>
<Events>
<EventHandler event="componentShown" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentShown"/>
</Events>
<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">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel2" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="cancelBtn" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="saveBtn" min="-2" pref="81" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="42" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="saveBtn" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="cancelBtn" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Theme"/>
</Border>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Change the UI theme."/>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="themeLight" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="themeDark" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<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">
<EmptySpace max="-2" attributes="0"/>
<Component id="themeLight" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="themeDark" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="51" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JRadioButton" name="themeLight">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="themeGroup"/>
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Light"/>
</Properties>
</Component>
<Component class="javax.swing.JRadioButton" name="themeDark">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="themeGroup"/>
</Property>
<Property name="text" type="java.lang.String" value="Dark"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel2">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Font"/>
</Border>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Change the default font for the editor and shell."/>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="fontSizeBox" min="-2" pref="68" max="-2" attributes="0"/>
<EmptySpace pref="125" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="fontSizeBox" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JComboBox" name="fontSizeBox">
<Properties>
<Property name="editable" type="boolean" value="true"/>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="11">
<StringItem index="0" value="8"/>
<StringItem index="1" value="9"/>
<StringItem index="2" value="10"/>
<StringItem index="3" value="11"/>
<StringItem index="4" value="12"/>
<StringItem index="5" value="14"/>
<StringItem index="6" value="16"/>
<StringItem index="7" value="18"/>
<StringItem index="8" value="20"/>
<StringItem index="9" value="22"/>
<StringItem index="10" value="24"/>
</StringArray>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Font Size (pt): "/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="saveBtn">
<Properties>
<Property name="text" type="java.lang.String" value="Save"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="saveBtnActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="cancelBtn">
<Properties>
<Property name="text" type="java.lang.String" value="Cancel"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelBtnActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>

@ -0,0 +1,228 @@
/*
* Apocalypse Laboratories
* Open Source License
*
* Source code can be used for any purpose, as long as:
* - Compiled binaries are rebranded and trademarks are not
* visible by the end user at any time, except to give
* credit to Apocalypse Laboratories, such as by showing
* "Based on <product> by Apocalypse Laboratories" or a
* similar notice;
* - You do not use the code for evil;
* - Rebranded compiled applications have significant
* differences in functionality;
* - and you provide your modified source code for download,
* under the terms of the GNU LGPL v3 or a comparable
* license.
*
* Compiled binaries cannot be redistributed or mirrored,
* unless:
* - You have written permission from Apocalypse Laboratories;
* - Downloads are not available from Apocalypse Laboratories,
* not even behind a paywall or other blocking mechanism;
* - or you have received a multi-computer license, in which
* case you should take measures to prevent unauthorized
* downloads, such as preventing download access from the
* Internet.
*/
package net.apocalypselabs.symat;
/**
*
* @author Skylar
*/
public class Display extends javax.swing.JInternalFrame {
/**
* Creates new form Display
*/
public Display() {
initComponents();
}
/**
* 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() {
themeGroup = new javax.swing.ButtonGroup();
jPanel1 = new javax.swing.JPanel();
themeLight = new javax.swing.JRadioButton();
themeDark = new javax.swing.JRadioButton();
jPanel2 = new javax.swing.JPanel();
fontSizeBox = new javax.swing.JComboBox();
jLabel1 = new javax.swing.JLabel();
saveBtn = new javax.swing.JButton();
cancelBtn = new javax.swing.JButton();
setClosable(true);
setIconifiable(true);
setTitle("Display Settings");
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/settings.png"))); // NOI18N
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent evt) {
formComponentShown(evt);
}
});
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Theme"));
jPanel1.setToolTipText("Change the UI theme.");
themeGroup.add(themeLight);
themeLight.setSelected(true);
themeLight.setText("Light");
themeGroup.add(themeDark);
themeDark.setText("Dark");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(themeLight)
.addComponent(themeDark))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(themeLight)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(themeDark)
.addContainerGap(51, Short.MAX_VALUE))
);
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Font"));
jPanel2.setToolTipText("Change the default font for the editor and shell.");
fontSizeBox.setEditable(true);
fontSizeBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "8", "9", "10", "11", "12", "14", "16", "18", "20", "22", "24" }));
jLabel1.setText("Font Size (pt): ");
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(fontSizeBox, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(125, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(fontSizeBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
saveBtn.setText("Save");
saveBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveBtnActionPerformed(evt);
}
});
cancelBtn.setText("Cancel");
cancelBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancelBtnActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(cancelBtn)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(saveBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(42, 42, 42)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(saveBtn)
.addComponent(cancelBtn)))
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void cancelBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelBtnActionPerformed
dispose();
}//GEN-LAST:event_cancelBtnActionPerformed
private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
if (PrefStorage.isset("editfont")) {
fontSizeBox.setSelectedItem(PrefStorage.getSetting("editfont"));
}
if (PrefStorage.isset("theme")) {
switch (PrefStorage.getSetting("theme")) {
case "light":
themeLight.setSelected(true);
themeDark.setSelected(false);
break;
case "dark":
themeLight.setSelected(false);
themeDark.setSelected(true);
break;
default:
themeLight.setSelected(true);
themeDark.setSelected(false);
}
}
}//GEN-LAST:event_formComponentShown
private void saveBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveBtnActionPerformed
PrefStorage.saveSetting("editfont", fontSizeBox.getSelectedItem().toString());
if (themeDark.isSelected()) {
PrefStorage.saveSetting("theme", "dark");
} else {
PrefStorage.saveSetting("theme", "light");
}
MainGUI.updateDisplay();
dispose();
}//GEN-LAST:event_saveBtnActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton cancelBtn;
private javax.swing.JComboBox fontSizeBox;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JButton saveBtn;
private javax.swing.JRadioButton themeDark;
private javax.swing.ButtonGroup themeGroup;
private javax.swing.JRadioButton themeLight;
// End of variables declaration//GEN-END:variables
}

@ -33,127 +33,124 @@ import org.matheclipse.parser.client.math.MathException;
/**
* These functions are accessible from JavaScript.
*
*
* There are a lot of aliases in here too.
*
*
* @author Skylar
*/
public class Functions {
EvalUtilities util = new EvalUtilities(false, true);
Graph graphwin = new Graph(true);
/*
Useful interactions
*/
Useful interactions
*/
public void notify(Object message) {
JOptionPane.showInternalMessageDialog(MainGUI.mainPane, message.toString());
}
public String ask(String question) {
return JOptionPane.showInternalInputDialog(MainGUI.mainPane, question);
}
public void write(String content) {
// TODO: enable output logging
}
/*
Math commands
*/
Math commands
*/
public String d(String function, String idv) {
return util.evaluate("diff("+function+","+idv+")").toString();
return util.evaluate("diff(" + function + "," + idv + ")").toString();
}
public String sym(String input) {
return util.evaluate(input).toString();
}
// Shortcut for non-JS math evaluation.
public String $(String input) {
return sym(input);
}
public String replace(String function, String variable, String newvar) {
return function.replaceAll(variable, newvar);
}
public double subs(String function, String variable, String newvar) {
return numof(function.replaceAll(variable, newvar));
}
public double numof(String f) {
try {
return Double.parseDouble(util.evaluate("N("+f+")").toString());
return Double.parseDouble(util.evaluate("N(" + f + ")").toString());
} catch (MathException | NumberFormatException ex) {
return 0.0;
}
}
/*
Graphing interfaces
*/
Graphing interfaces
*/
public void plot(String function) {
graphwin.setVisible(true);
graphwin.graphFunction(function);
}
public void ezplot(String f) {
plot(f);
}
public void graph(String f) {
plot(f);
}
public void plotname(String t) {
graphwin.setVisible(true);
graphwin.setWindowTitle(t);
}
public String plotname() {
return graphwin.getTitle();
}
public void plotclr() {
graphwin.clearDraw();
}
public void clearplot() {
plotclr();
}
public void plotclear() {
plotclr();
}
public void plotscale(int level) {
graphwin.setVisible(true);
graphwin.setZoom(level);
}
public void drawdot(double x, double y) {
graphwin.setVisible(true);
graphwin.drawDot(x, y);
}
/*
Other
*/
Other
*/
public String sysinfo() {
String info = "==Java System Information==\n";
info += "Java version: "+System.getProperty("java.version");
info += "\nJava vendor: "+System.getProperty("java.vendor");
info += "\nJava home: "+System.getProperty("java.home");
info += "Java version: " + System.getProperty("java.version");
info += "\nJava vendor: " + System.getProperty("java.vendor");
info += "\nJava home: " + System.getProperty("java.home");
return info;
}
/*
Constructor.
*/
Constructor.
*/
public Functions() {
MainGUI.mainPane.add(graphwin);
}

@ -384,7 +384,7 @@ public class Graph extends javax.swing.JInternalFrame {
private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
try {
int size = Integer.parseInt(JOptionPane.showInternalInputDialog(this,
int size = Integer.parseInt(JOptionPane.showInternalInputDialog(this,
"Graph scale, -1 to 3 (-1 least detail, 3 most detail):",
"Scale",
JOptionPane.QUESTION_MESSAGE));

@ -6,7 +6,7 @@
<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="Help"/>
<Property name="title" type="java.lang.String" value="Manual"/>
<Property name="frameIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/icons/help.png"/>
</Property>
@ -76,6 +76,7 @@
</StringArray>
</Property>
<Property name="selectionMode" type="int" value="0"/>
<Property name="selectedIndex" type="int" value="0"/>
</Properties>
<Events>
<EventHandler event="valueChanged" listener="javax.swing.event.ListSelectionListener" parameters="javax.swing.event.ListSelectionEvent" handler="topicListValueChanged"/>

@ -27,8 +27,10 @@
*/
package net.apocalypselabs.symat;
import java.awt.Color;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import javax.swing.UIDefaults;
/**
*
@ -41,6 +43,27 @@ public class Help extends javax.swing.JInternalFrame {
*/
public Help() {
initComponents();
if (PrefStorage.getSetting("theme").equals("dark")) {
setBackgroundOfBrowser(Color.BLACK);
setBackgroundOfBrowser(Color.WHITE);
topicList.setBackground(Color.BLACK);
topicList.setForeground(Color.WHITE);
setBackground(Color.DARK_GRAY);
} else {
setBackgroundOfBrowser(Color.WHITE);
setBackgroundOfBrowser(Color.BLACK);
topicList.setBackground(Color.WHITE);
topicList.setForeground(Color.BLACK);
setBackground(Color.LIGHT_GRAY);
}
}
private void setBackgroundOfBrowser(Color c) {
UIDefaults defaults = new UIDefaults();
defaults.put("EditorPane.backgroundPainter", c);
topicBrowser.putClientProperty("Nimbus.Overrides", defaults);
topicBrowser.putClientProperty("Nimbus.Overrides.InheritDefaults", true);
topicBrowser.setBackground(c);
}
public void loadTopic(String name) {
@ -49,18 +72,19 @@ public class Help extends javax.swing.JInternalFrame {
BufferedReader reader = new BufferedReader(
new InputStreamReader(
CodeRunner.class
.getResourceAsStream("help/"+name+".html")));
.getResourceAsStream("help/" + name + ".html")));
String line;
while ((line = reader.readLine()) != null) {
text += line;
}
topicBrowser.setText(text);
topicBrowser.setCaretPosition(0);
setTitle("Manual (" + topicList.getSelectedValue().toString() + ")");
} catch (Exception e) {
//JOptionPane.showInternalMessageDialog(MainGUI.mainPane,
//"Error: Cannot load help topic "+name+".\n\n"+e.getMessage());
topicBrowser.setText("<html><head></head><body><p><b>Error:</b><br>Cannot get help topic \""
+name+"\".<br>("+e.getMessage()+")</p></body></html>");
+ name + "\".<br>(" + e.getMessage() + ")</p></body></html>");
}
}
@ -83,7 +107,7 @@ public class Help extends javax.swing.JInternalFrame {
setIconifiable(true);
setMaximizable(true);
setResizable(true);
setTitle("Help");
setTitle("Manual");
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/help.png"))); // NOI18N
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent evt) {
@ -101,6 +125,7 @@ public class Help extends javax.swing.JInternalFrame {
public Object getElementAt(int i) { return strings[i]; }
});
topicList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
topicList.setSelectedIndex(0);
topicList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
topicListValueChanged(evt);
@ -136,10 +161,10 @@ public class Help extends javax.swing.JInternalFrame {
}//GEN-LAST:event_topicListValueChanged
private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
topicList.setSelectedIndex(0);
loadTopic("welcome");
}//GEN-LAST:event_formComponentShown
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;

@ -1,27 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JInternalFrameFormInfo">
<NonVisualComponents>
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
<SubComponents>
<Menu class="javax.swing.JMenu" name="jMenu2">
<Properties>
<Property name="text" type="java.lang.String" value="Edit"/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem1">
<Properties>
<Property name="text" type="java.lang.String" value="Font size..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem1ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
</SubComponents>
</Menu>
</NonVisualComponents>
<Properties>
<Property name="closable" type="boolean" value="true"/>
<Property name="iconifiable" type="boolean" value="true"/>
@ -33,7 +12,6 @@
</Property>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
</SyntheticProperties>
<AuxValues>
@ -55,22 +33,22 @@
<Group type="102" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jTextField1" max="32767" attributes="0"/>
<Component id="inputBox" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<Component id="runBtn" 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="jScrollPane1" pref="231" max="32767" attributes="0"/>
<Component id="jScrollPane1" pref="256" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jButton1" min="-2" pref="26" max="-2" attributes="0"/>
<Component id="runBtn" min="-2" pref="26" max="-2" attributes="0"/>
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
<Component id="jLabel1" alignment="0" max="32767" attributes="0"/>
<Component id="jTextField1" alignment="0" max="32767" attributes="0"/>
<Component id="inputBox" alignment="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace min="2" pref="2" max="-2" attributes="0"/>
@ -86,7 +64,7 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="jTextArea1">
<Component class="javax.swing.JTextArea" name="mainBox">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="20"/>
@ -97,22 +75,22 @@
<Property name="tabSize" type="int" value="4"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="DefaultCaret caret = (DefaultCaret)jTextArea1.getCaret();&#xd;&#xa;caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);"/>
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="DefaultCaret caret = (DefaultCaret)mainBox.getCaret();&#xd;&#xa;caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);"/>
</AuxValues>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JTextField" name="jTextField1">
<Component class="javax.swing.JTextField" name="inputBox">
<Events>
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="jTextField1KeyTyped"/>
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="inputBoxKeyTyped"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jButton1">
<Component class="javax.swing.JButton" name="runBtn">
<Properties>
<Property name="text" type="java.lang.String" value="Run"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="runBtnActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">

@ -1,7 +1,7 @@
/*
/*
* Apocalypse Laboratories
* Open Source License
*
*
* Source code can be used for any purpose, as long as:
* - Compiled binaries are rebranded and trademarks are not
* visible by the end user at any time, except to give
@ -14,7 +14,7 @@
* - and you provide your modified source code for download,
* under the terms of the GNU LGPL v3 or a comparable
* license.
*
*
* Compiled binaries cannot be redistributed or mirrored,
* unless:
* - You have written permission from Apocalypse Laboratories;
@ -22,13 +22,13 @@
* not even behind a paywall or other blocking mechanism;
* - or you have received a multi-computer license, in which
* 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.
*/
package net.apocalypselabs.symat;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JOptionPane;
import javax.swing.text.DefaultCaret;
/**
@ -38,6 +38,7 @@ import javax.swing.text.DefaultCaret;
public class Interpreter extends javax.swing.JInternalFrame {
private final CodeRunner cr = new CodeRunner();
/**
* Creates new form Interpreter
*/
@ -45,13 +46,28 @@ public class Interpreter extends javax.swing.JInternalFrame {
initComponents();
int font_size = 12;
try {
font_size = Integer.valueOf(PrefStorage.getSetting("shell-fontsize"));
} catch (Exception ex) { }
jTextArea1.setFont(new Font(Font.MONOSPACED, Font.PLAIN, font_size));
jTextArea1.setLineWrap(true);
jTextArea1.setWrapStyleWord(true);
jTextArea1.setText(">>");
jTextField1.requestFocus();
font_size = Integer.valueOf(PrefStorage.getSetting("editfont"));
} catch (Exception ex) {
}
mainBox.setFont(new Font(Font.MONOSPACED, Font.PLAIN, font_size));
inputBox.setFont(new Font(Font.MONOSPACED, Font.PLAIN, font_size));
if (PrefStorage.getSetting("theme").equals("dark")) {
mainBox.setBackground(Color.BLACK);
mainBox.setForeground(Color.WHITE);
inputBox.setBackground(Color.BLACK);
inputBox.setForeground(Color.WHITE);
setBackground(Color.DARK_GRAY);
} else {
mainBox.setBackground(Color.WHITE);
mainBox.setForeground(Color.BLACK);
inputBox.setBackground(Color.WHITE);
inputBox.setForeground(Color.BLACK);
setBackground(Color.LIGHT_GRAY);
}
mainBox.setLineWrap(true);
mainBox.setWrapStyleWord(true);
mainBox.setText(">>");
inputBox.requestFocus();
}
/**
@ -64,13 +80,10 @@ public class Interpreter extends javax.swing.JInternalFrame {
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jTextField1 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
mainBox = new javax.swing.JTextArea();
inputBox = new javax.swing.JTextField();
runBtn = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu2 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
setClosable(true);
setIconifiable(true);
@ -79,45 +92,31 @@ public class Interpreter extends javax.swing.JInternalFrame {
setTitle("Shell");
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/shell.png"))); // NOI18N
jTextArea1.setEditable(false);
jTextArea1.setColumns(20);
jTextArea1.setFont(new java.awt.Font("Courier New", 0, 15)); // NOI18N
jTextArea1.setRows(5);
jTextArea1.setTabSize(4);
DefaultCaret caret = (DefaultCaret)jTextArea1.getCaret();
mainBox.setEditable(false);
mainBox.setColumns(20);
mainBox.setFont(new java.awt.Font("Courier New", 0, 15)); // NOI18N
mainBox.setRows(5);
mainBox.setTabSize(4);
DefaultCaret caret = (DefaultCaret)mainBox.getCaret();
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
jScrollPane1.setViewportView(jTextArea1);
jScrollPane1.setViewportView(mainBox);
jTextField1.addKeyListener(new java.awt.event.KeyAdapter() {
inputBox.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
jTextField1KeyTyped(evt);
inputBoxKeyTyped(evt);
}
});
jButton1.setText("Run");
jButton1.addActionListener(new java.awt.event.ActionListener() {
runBtn.setText("Run");
runBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
runBtnActionPerformed(evt);
}
});
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText(">>");
jMenu2.setText("Edit");
jMenuItem1.setText("Font size...");
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem1);
jMenuBar1.add(jMenu2);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
@ -126,71 +125,53 @@ public class Interpreter extends javax.swing.JInternalFrame {
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField1)
.addComponent(inputBox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton1))
.addComponent(runBtn))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(runBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING)))
.addComponent(inputBox, javax.swing.GroupLayout.Alignment.LEADING)))
.addGap(2, 2, 2))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
private void runBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_runBtnActionPerformed
doRunCode();
}//GEN-LAST:event_jButton1ActionPerformed
}//GEN-LAST:event_runBtnActionPerformed
private void jTextField1KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyTyped
private void inputBoxKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_inputBoxKeyTyped
if (evt.getKeyChar() == '\n') {
doRunCode();
}
}//GEN-LAST:event_jTextField1KeyTyped
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
try {
int size = Integer.parseInt(JOptionPane.showInternalInputDialog(this,
"New font size (8-36):",
"Font Size",
JOptionPane.QUESTION_MESSAGE));
if (size >= 8 && size <= 36) {
jTextArea1.setFont(new Font(Font.MONOSPACED, Font.PLAIN, size));
PrefStorage.saveSetting("shell-fontsize", size+"");
}
} catch (Exception ex) {
}
}//GEN-LAST:event_jMenuItem1ActionPerformed
}//GEN-LAST:event_inputBoxKeyTyped
private void doRunCode() {
String code = jTextField1.getText();
jTextArea1.append(" "+code+"\n");
String code = inputBox.getText();
mainBox.append(" " + code + "\n");
try {
jTextArea1.append(cr.evalString(code).toString()+"\n");
mainBox.append(cr.evalString(code).toString() + "\n");
} catch (NullPointerException ex) {
}
jTextArea1.append(">>");
jTextField1.setText("");
mainBox.append(">>");
inputBox.setText("");
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JTextField inputBox;
private javax.swing.JLabel jLabel1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextArea mainBox;
private javax.swing.JButton runBtn;
// End of variables declaration//GEN-END:variables
}

@ -7,10 +7,10 @@
<Connection code="APP_NAME" type="code"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[600, 500]"/>
<Dimension value="[300, 400]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[700, 500]"/>
<Dimension value="[700, 575]"/>
</Property>
</Properties>
<SyntheticProperties>
@ -29,7 +29,7 @@
<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"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="9"/>
</AuxValues>
<Layout>
@ -52,7 +52,11 @@
<SubComponents>
<Container class="javax.swing.JTabbedPane" name="tabs">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="new Color(240,240,240)" type="code"/>
</Property>
<Property name="selectedIndex" type="int" value="1"/>
<Property name="opaque" type="boolean" value="true"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_allCodePost" type="java.lang.String" value="tabs.setEnabledAt(0, false);"/>
@ -62,12 +66,15 @@
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel4">
<Properties>
<Property name="enabled" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="">
<Property name="tabTitle" type="java.lang.String" value=""/>
<Property name="tabIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/icon16.png"/>
</Property>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
@ -77,6 +84,9 @@
</Layout>
</Container>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Apps">
@ -96,7 +106,7 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="graphBtn" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" pref="494" max="32767" attributes="0"/>
<Component id="jLabel1" pref="498" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -187,6 +197,9 @@
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel2">
<Properties>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Tools">
@ -204,7 +217,7 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="arrangeWindowsBtn" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel3" pref="551" max="32767" attributes="0"/>
<Component id="jLabel3" pref="555" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -224,7 +237,7 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/help.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Help"/>
<Property name="text" type="java.lang.String" value="Manual"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
<EmptyBorder bottom="5" left="5" right="5" top="5"/>
@ -251,9 +264,9 @@
<Component class="javax.swing.JButton" name="arrangeWindowsBtn">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/help.png"/>
<Image iconType="3" name="/net/apocalypselabs/symat/cascade.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Arrange"/>
<Property name="text" type="java.lang.String" value="Cascade"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
<EmptyBorder bottom="5" left="5" right="5" top="5"/>
@ -271,6 +284,9 @@
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel3">
<Properties>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Settings">
@ -282,15 +298,18 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel4" alignment="1" pref="691" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="displaySettingsBtn" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="54" max="32767" attributes="0"/>
<Component id="jLabel4" min="-2" pref="574" 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="jLabel4" min="-2" pref="65" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
<Component id="jLabel4" min="-2" pref="65" max="-2" attributes="0"/>
<Component id="displaySettingsBtn" min="-2" max="-2" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -304,6 +323,26 @@
<Property name="focusable" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="displaySettingsBtn">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/display.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Display"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
<EmptyBorder bottom="5" left="5" right="5" top="5"/>
</Border>
</Property>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="opaque" type="boolean" value="false"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="displaySettingsBtnActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
@ -320,6 +359,7 @@
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="mainPane = new javax.swing.JDesktopPane() {&#xd;&#xa; @Override&#xd;&#xa; protected void paintComponent(Graphics g) {&#xd;&#xa; super.paintComponent(g);&#xd;&#xa; if (PrefStorage.getSetting(&quot;theme&quot;).equals(&quot;dark&quot;)) {&#xd;&#xa; g.setColor(Color.DARK_GRAY);&#xd;&#xa; } else {&#xd;&#xa; g.setColor(Color.LIGHT_GRAY);&#xd;&#xa; }&#xd;&#xa; g.fillRect(0, 0, getWidth(), getHeight());&#xd;&#xa; }&#xd;&#xa;}&#xd;&#xa;"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="9"/>
</AuxValues>
@ -331,7 +371,7 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="400" max="32767" attributes="0"/>
<EmptySpace min="0" pref="481" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>

@ -27,14 +27,16 @@
*/
package net.apocalypselabs.symat;
import java.awt.Rectangle;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.Graphics;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
/**
@ -85,6 +87,19 @@ public class MainGUI extends javax.swing.JFrame {
ed.openFileFromString(argfile);
argfile = "";
}
updateDisplay();
}
/**
* (Re)load display settings.
*/
public static void updateDisplay() {
mainPane.paintImmediately(0, 0, mainPane.getWidth(), mainPane.getHeight());
if (PrefStorage.getSetting("theme").equals("dark")) {
tabs.setBackground(Color.BLACK);
} else {
tabs.setBackground(new Color(240, 240, 240));
}
}
private static String namemark() {
@ -122,21 +137,39 @@ public class MainGUI extends javax.swing.JFrame {
arrangeWindowsBtn = new javax.swing.JButton();
jPanel3 = new javax.swing.JPanel();
jLabel4 = new javax.swing.JLabel();
mainPane = new javax.swing.JDesktopPane();
displaySettingsBtn = new javax.swing.JButton();
mainPane = mainPane = new javax.swing.JDesktopPane() {
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
if (PrefStorage.getSetting("theme").equals("dark")) {
g.setColor(Color.DARK_GRAY);
} else {
g.setColor(Color.LIGHT_GRAY);
}
g.fillRect(0, 0, getWidth(), getHeight());
}
}
;
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle(APP_NAME);
setMinimumSize(new java.awt.Dimension(600, 500));
setPreferredSize(new java.awt.Dimension(700, 500));
setMinimumSize(new java.awt.Dimension(300, 400));
setPreferredSize(new java.awt.Dimension(700, 575));
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent evt) {
formComponentShown(evt);
}
});
jPanel4.setEnabled(false);
tabs.setBackground(new Color(240,240,240));
tabs.setOpaque(true);
jPanel4.setFocusable(false);
jPanel4.setLayout(null);
tabs.addTab("", jPanel4);
tabs.addTab("", new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icon16.png")), jPanel4); // NOI18N
jPanel1.setOpaque(false);
shellBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/shell.png"))); // NOI18N
shellBtn.setText("Shell");
@ -193,7 +226,7 @@ public class MainGUI extends javax.swing.JFrame {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(graphBtn)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 494, Short.MAX_VALUE))
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 498, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -208,8 +241,10 @@ public class MainGUI extends javax.swing.JFrame {
tabs.addTab("Apps", jPanel1);
jPanel2.setOpaque(false);
helpBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/help.png"))); // NOI18N
helpBtn.setText("Help");
helpBtn.setText("Manual");
helpBtn.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
helpBtn.setFocusable(false);
helpBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -225,8 +260,8 @@ public class MainGUI extends javax.swing.JFrame {
jLabel3.setText(namemark());
jLabel3.setFocusable(false);
arrangeWindowsBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/help.png"))); // NOI18N
arrangeWindowsBtn.setText("Arrange");
arrangeWindowsBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/cascade.png"))); // NOI18N
arrangeWindowsBtn.setText("Cascade");
arrangeWindowsBtn.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
arrangeWindowsBtn.setFocusable(false);
arrangeWindowsBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -248,7 +283,7 @@ public class MainGUI extends javax.swing.JFrame {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(arrangeWindowsBtn)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 551, Short.MAX_VALUE))
.addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 555, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -260,21 +295,39 @@ public class MainGUI extends javax.swing.JFrame {
tabs.addTab("Tools", jPanel2);
jPanel3.setOpaque(false);
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel4.setText(namemark());
jLabel4.setFocusable(false);
displaySettingsBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/display.png"))); // NOI18N
displaySettingsBtn.setText("Display");
displaySettingsBtn.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
displaySettingsBtn.setFocusable(false);
displaySettingsBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
displaySettingsBtn.setOpaque(false);
displaySettingsBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
displaySettingsBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
displaySettingsBtnActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 691, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(displaySettingsBtn)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 54, Short.MAX_VALUE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 574, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0))
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(displaySettingsBtn)
);
tabs.addTab("Settings", jPanel3);
@ -294,7 +347,7 @@ public class MainGUI extends javax.swing.JFrame {
);
mainPaneLayout.setVerticalGroup(
mainPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
.addGap(0, 481, Short.MAX_VALUE)
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
@ -345,6 +398,11 @@ public class MainGUI extends javax.swing.JFrame {
cascade();
}//GEN-LAST:event_arrangeWindowsBtnActionPerformed
private void displaySettingsBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_displaySettingsBtnActionPerformed
Display d = new Display();
loadFrame(d);
}//GEN-LAST:event_displaySettingsBtnActionPerformed
/**
* Adds the given JInternalFrame to the mainPane. Automatically does layout
* and sets visible as well.
@ -373,13 +431,14 @@ public class MainGUI extends javax.swing.JFrame {
frame.setLocation(frame.getLocation().x, 0);
}
frame.setVisible(true);
//updateDisplay();
}
public static void cascade() {
JInternalFrame[] frames = mainPane.getAllFrames();
int x = 12;
int y = 24;
Debug.println("Cascading "+frames.length+" frames...");
Debug.println("Cascading " + frames.length + " frames...");
for (int i = 0; i < frames.length; i++) {
if (frames[i].isVisible()) {
Debug.println("Frame: " + frames[i].getTitle() + ", Times: " + i + ", Xpos: " + x * i + ", Ypos: " + y * i);
@ -427,19 +486,20 @@ public class MainGUI extends javax.swing.JFrame {
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton arrangeWindowsBtn;
private javax.swing.JButton editorBtn;
private javax.swing.JButton graphBtn;
private javax.swing.JButton helpBtn;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
public static javax.swing.JButton arrangeWindowsBtn;
public static javax.swing.JButton displaySettingsBtn;
public static javax.swing.JButton editorBtn;
public static javax.swing.JButton graphBtn;
public static javax.swing.JButton helpBtn;
public static javax.swing.JLabel jLabel1;
public static javax.swing.JLabel jLabel3;
public static javax.swing.JLabel jLabel4;
public static javax.swing.JPanel jPanel1;
public static javax.swing.JPanel jPanel2;
public static javax.swing.JPanel jPanel3;
public static javax.swing.JPanel jPanel4;
public static javax.swing.JDesktopPane mainPane;
private javax.swing.JButton shellBtn;
private javax.swing.JTabbedPane tabs;
public static javax.swing.JButton shellBtn;
public static javax.swing.JTabbedPane tabs;
// End of variables declaration//GEN-END:variables
}

@ -41,6 +41,13 @@ public class PrefStorage {
prefs.put(key, value);
}
public static boolean isset(String key) {
if (!getSetting(key, "NULL").equals("NULL")) {
return true;
}
return false;
}
public static String getSetting(String key) {
return prefs.get(key, "");
}
@ -50,9 +57,8 @@ public class PrefStorage {
}
// xkcd 221 compliance.
int getRandomNumber()
{
int getRandomNumber() {
return 4; // chosen by fair dice roll.
// guaranteed to be random.
// guaranteed to be random.
}
}

@ -1,18 +1,20 @@
/*******************************************************************************
/**
* *****************************************************************************
* Copyright 2013 Jeremie Bresson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
* ****************************************************************************
*/
package net.apocalypselabs.symat; // Package name changed.
import java.awt.Color;
@ -23,74 +25,76 @@ import syntaxhighlight.Style;
import syntaxhighlight.Theme;
public class PrettifyToHtml {
private static final String MAIN_CLASS = "prettyprint";
/**
* Format the {@link ParseResult} into an HTML file.
* @param content
* @param parseResults
* @return
*/
public static String toHtml(String content, List<ParseResult> parseResults) {
int endIndex = 0;
StringBuilder sb = new StringBuilder();
sb.append("<div class=\"" + MAIN_CLASS + "\">");
sb.append("<pre>");
for (ParseResult pr : parseResults) {
int startIndex = pr.getOffset();
if(startIndex > endIndex) {
sb.append(content.substring(endIndex, startIndex));
}
endIndex = startIndex + pr.getLength();
sb.append("<span class=\""+pr.getStyleKeysString()+"\">");
sb.append(content.substring(startIndex, endIndex));
sb.append("</span>");
}
if(content.length() > endIndex) {
sb.append(content.substring(endIndex, content.length()));
}
sb.append("</pre>");
sb.append("</div>");
return sb.toString();
}
private static final String MAIN_CLASS = "prettyprint";
public static String toCss(Theme theme) {
StringBuilder sb = new StringBuilder();
sb.append("." + MAIN_CLASS + " {");
sb.append("font-family:monospace; ");
appendCssColor(sb, "background-color", theme.getBackground());
sb.append("}\n");
for (Entry<String, Style> entry : theme.getStyles().entrySet()) {
sb.append("." + MAIN_CLASS + " ."+entry.getKey()+" {");
Style style = entry.getValue();
appendCssColor(sb, "background-color", style.getBackground());
appendCssColor(sb, "color", style.getColor());
appendCssText(sb, "font-weight: bold", style.isBold());
appendCssText(sb, "font-style: italic", style.isItalic());
appendCssText(sb, "text-decoration: underline", style.isUnderline());
sb.append("}\n");
}
theme.getStyles();
return sb.toString();
}
/**
* Format the {@link ParseResult} into an HTML file.
*
* @param content
* @param parseResults
* @return
*/
public static String toHtml(String content, List<ParseResult> parseResults) {
int endIndex = 0;
StringBuilder sb = new StringBuilder();
sb.append("<div class=\"" + MAIN_CLASS + "\">");
sb.append("<pre>");
for (ParseResult pr : parseResults) {
int startIndex = pr.getOffset();
if (startIndex > endIndex) {
sb.append(content.substring(endIndex, startIndex));
}
endIndex = startIndex + pr.getLength();
sb.append("<span class=\"" + pr.getStyleKeysString() + "\">");
sb.append(content.substring(startIndex, endIndex));
sb.append("</span>");
}
if (content.length() > endIndex) {
sb.append(content.substring(endIndex, content.length()));
}
sb.append("</pre>");
sb.append("</div>");
return sb.toString();
}
private static void appendCssColor(StringBuilder sb, String cssKey, Color color) {
if(color != null) {
sb.append(cssKey +": "+ encode(color) + "; ");
}
}
private final static String encode(Color color) {
String s = Integer.toHexString(color.getRGB() & 0xffffff);
if (s.length() < 6) {
s = "000000".substring(0, 6 - s.length()) + s;
}
return '#' + s;
}
private static void appendCssText(StringBuilder sb, String cssProp, boolean isSet) {
if(isSet) {
sb.append(cssProp + "; ");
}
}
public static String toCss(Theme theme) {
StringBuilder sb = new StringBuilder();
sb.append("." + MAIN_CLASS + " {");
sb.append("font-family:monospace; ");
appendCssColor(sb, "background-color", theme.getBackground());
sb.append("}\n");
for (Entry<String, Style> entry : theme.getStyles().entrySet()) {
sb.append("." + MAIN_CLASS + " ." + entry.getKey() + " {");
Style style = entry.getValue();
appendCssColor(sb, "background-color", style.getBackground());
appendCssColor(sb, "color", style.getColor());
appendCssText(sb, "font-weight: bold", style.isBold());
appendCssText(sb, "font-style: italic", style.isItalic());
appendCssText(sb, "text-decoration: underline", style.isUnderline());
sb.append("}\n");
}
theme.getStyles();
return sb.toString();
}
private static void appendCssColor(StringBuilder sb, String cssKey, Color color) {
if (color != null) {
sb.append(cssKey + ": " + encode(color) + "; ");
}
}
private final static String encode(Color color) {
String s = Integer.toHexString(color.getRGB() & 0xffffff);
if (s.length() < 6) {
s = "000000".substring(0, 6 - s.length()) + s;
}
return '#' + s;
}
private static void appendCssText(StringBuilder sb, String cssProp, boolean isSet) {
if (isSet) {
sb.append(cssProp + "; ");
}
}
}

@ -46,17 +46,17 @@ public class TextLineNumber extends JPanel
private final static int HEIGHT = Integer.MAX_VALUE - 1000000;
// Text component this TextTextLineNumber component is in sync with
// Text component this TextTextLineNumber component is in sync with
private JTextComponent component;
// Properties that can be changed
// Properties that can be changed
private boolean updateFont;
private int borderGap;
private Color currentLineForeground;
private float digitAlignment;
private int minimumDisplayDigits;
// Keep history information to reduce the number of times the component
// Keep history information to reduce the number of times the component
// needs to be repainted
private int lastDigits;
private int lastHeight;
@ -212,7 +212,7 @@ public class TextLineNumber extends JPanel
int lines = root.getElementCount();
int digits = Math.max(String.valueOf(lines).length(), minimumDisplayDigits);
// Update sizes when number of digits in the line number changes
// Update sizes when number of digits in the line number changes
if (lastDigits != digits) {
lastDigits = digits;
FontMetrics fontMetrics = getFontMetrics(getFont());
@ -234,12 +234,12 @@ public class TextLineNumber extends JPanel
public void paintComponent(Graphics g) {
super.paintComponent(g);
// Determine the width of the space available to draw the line number
// Determine the width of the space available to draw the line number
FontMetrics fontMetrics = component.getFontMetrics(component.getFont());
Insets insets = getInsets();
int availableWidth = getSize().width - insets.left - insets.right;
// Determine the rows to draw within the clipped bounds.
// Determine the rows to draw within the clipped bounds.
Rectangle clip = g.getClipBounds();
int rowStartOffset = component.viewToModel(new Point(0, clip.y));
int endOffset = component.viewToModel(new Point(0, clip.y + clip.height));
@ -252,7 +252,7 @@ public class TextLineNumber extends JPanel
g.setColor(getForeground());
}
// Get the line number as a string and then determine the
// Get the line number as a string and then determine the
// "X" and "Y" offsets for drawing the string.
String lineNumber = getTextLineNumber(rowStartOffset);
int stringWidth = fontMetrics.stringWidth(lineNumber);
@ -260,7 +260,7 @@ public class TextLineNumber extends JPanel
int y = getOffsetY(rowStartOffset, fontMetrics);
g.drawString(lineNumber, x, y);
// Move to the next row
// Move to the next row
rowStartOffset = Utilities.getRowEnd(component, rowStartOffset) + 1;
} catch (Exception e) {
break;
@ -318,7 +318,7 @@ public class TextLineNumber extends JPanel
int y = r.y + r.height;
int descent = 0;
// The text needs to be positioned above the bottom of the bounding
// The text needs to be positioned above the bottom of the bounding
// rectangle based on the descent of the font(s) contained on the row.
if (r.height == lineHeight) // default font is being used
{
@ -366,7 +366,7 @@ public class TextLineNumber extends JPanel
Element root = component.getDocument().getDefaultRootElement();
int currentLine = root.getElementIndex(caretPosition);
// Need to repaint so the correct line number can be highlighted
// Need to repaint so the correct line number can be highlighted
if (lastLine != currentLine) {
repaint();
lastLine = currentLine;
@ -396,7 +396,7 @@ public class TextLineNumber extends JPanel
* Therefore the lines numbers will also change.
*/
private void documentChanged() {
// View of the component has not been updated at the time
// View of the component has not been updated at the time
// the DocumentEvent is fired
SwingUtilities.invokeLater(new Runnable() {

@ -43,6 +43,7 @@ public class Update extends javax.swing.JInternalFrame {
/**
* Creates new form Update
*
* @param latest The new version.
*/
public Update(double latest) {
@ -155,11 +156,10 @@ public class Update extends javax.swing.JInternalFrame {
}//GEN-LAST:event_jButton1ActionPerformed
private void jLabel5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel5MouseClicked
PrefStorage.saveSetting("update-ignore", MainGUI.APP_CODE+"|"+latestVersion);
PrefStorage.saveSetting("update-ignore", MainGUI.APP_CODE + "|" + latestVersion);
dispose();
}//GEN-LAST:event_jLabel5MouseClicked
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 705 B

@ -1,5 +1,5 @@
.header {
}
.com {
color: green;

Loading…
Cancel
Save