Add themes, display settings, needed icons
This commit is contained in:
parent
bd71fca1fa
commit
000ab2153f
@ -89,19 +89,27 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
|
|||||||
<condition property="javafx.sdk.defined">
|
<condition property="javafx.sdk.defined">
|
||||||
<and>
|
<and>
|
||||||
<isset property="javafx.sdk"/>
|
<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>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="javafx.sdk.missing+default">
|
<condition property="javafx.sdk.missing+default">
|
||||||
<and>
|
<and>
|
||||||
<equals arg1="${platform.active}" arg2="Default_JavaFX_Platform" trim="true"/>
|
<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>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="javafx.sdk.missing-default">
|
<condition property="javafx.sdk.missing-default">
|
||||||
<and>
|
<and>
|
||||||
<not><equals arg1="${platform.active}" arg2="Default_JavaFX_Platform" trim="true"/></not>
|
<not>
|
||||||
<not><isset property="javafx.sdk.defined"/></not>
|
<equals arg1="${platform.active}" arg2="Default_JavaFX_Platform" trim="true"/>
|
||||||
|
</not>
|
||||||
|
<not>
|
||||||
|
<isset property="javafx.sdk.defined"/>
|
||||||
|
</not>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
<echo message="javafx.sdk.defined = ${javafx.sdk.defined}" level="verbose"/>
|
<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">
|
<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">
|
<condition property="do.set.ant-javafx.in.fxsdk.lib">
|
||||||
<and>
|
<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"/>
|
<available file="${javafx.sdk}${file.separator}lib${file.separator}ant-javafx.jar"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</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">
|
<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">
|
<condition property="do.set.ant-javafx.in.fxsdk.tools">
|
||||||
<and>
|
<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"/>
|
<available file="${javafx.sdk}${file.separator}tools${file.separator}ant-javafx.jar"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
@ -134,7 +146,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
|
|||||||
<target name="-check-ant-javafx-in-platform-home-lib" if="platform.home">
|
<target name="-check-ant-javafx-in-platform-home-lib" if="platform.home">
|
||||||
<condition property="do.set.ant-javafx.in.platform.home.lib">
|
<condition property="do.set.ant-javafx.in.platform.home.lib">
|
||||||
<and>
|
<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"/>
|
<available file="${platform.home}${file.separator}lib${file.separator}ant-javafx.jar"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
@ -145,7 +159,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
|
|||||||
<target name="-check-ant-javafx-in-platform-home-tools" if="platform.home">
|
<target name="-check-ant-javafx-in-platform-home-tools" if="platform.home">
|
||||||
<condition property="do.set.ant-javafx.in.platform.home.tools">
|
<condition property="do.set.ant-javafx.in.platform.home.tools">
|
||||||
<and>
|
<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"/>
|
<available file="${platform.home}${file.separator}tools${file.separator}ant-javafx.jar"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
@ -156,7 +172,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
|
|||||||
<target name="-check-ant-javafx-in-probjdk-lib" unless="ant-javafx.jar.location">
|
<target name="-check-ant-javafx-in-probjdk-lib" unless="ant-javafx.jar.location">
|
||||||
<condition property="do.set.ant-javafx.in.probjdk.lib">
|
<condition property="do.set.ant-javafx.in.probjdk.lib">
|
||||||
<and>
|
<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"/>
|
<available file="${java.home}${file.separator}..${file.separator}lib${file.separator}ant-javafx.jar"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
@ -167,7 +185,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
|
|||||||
<target name="-check-ant-javafx-in-probjdk-tools" unless="ant-javafx.jar.location">
|
<target name="-check-ant-javafx-in-probjdk-tools" unless="ant-javafx.jar.location">
|
||||||
<condition property="do.set.ant-javafx.in.probjdk.tools">
|
<condition property="do.set.ant-javafx.in.probjdk.tools">
|
||||||
<and>
|
<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"/>
|
<available file="${java.home}${file.separator}..${file.separator}tools${file.separator}ant-javafx.jar"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
@ -178,7 +198,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
|
|||||||
<target name="-check-ant-javafx-in-macjdk-lib" unless="ant-javafx.jar.location">
|
<target name="-check-ant-javafx-in-macjdk-lib" unless="ant-javafx.jar.location">
|
||||||
<condition property="do.set.ant-javafx.in.macjdk.lib">
|
<condition property="do.set.ant-javafx.in.macjdk.lib">
|
||||||
<and>
|
<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"/>
|
<available file="${java.home}${file.separator}lib${file.separator}ant-javafx.jar"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
@ -190,7 +212,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
|
|||||||
<property environment="env"/>
|
<property environment="env"/>
|
||||||
<condition property="do.set.ant-javafx.in.envjdk.lib">
|
<condition property="do.set.ant-javafx.in.envjdk.lib">
|
||||||
<and>
|
<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"/>
|
<available file="${env.JAVA_HOME}${file.separator}lib${file.separator}ant-javafx.jar"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
@ -202,7 +226,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
|
|||||||
<property environment="env"/>
|
<property environment="env"/>
|
||||||
<condition property="do.set.ant-javafx.in.envjdk.tools">
|
<condition property="do.set.ant-javafx.in.envjdk.tools">
|
||||||
<and>
|
<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"/>
|
<available file="${env.JAVA_HOME}${file.separator}tools${file.separator}ant-javafx.jar"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
@ -214,7 +240,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
|
|||||||
<condition property="do.check.ant-javafx.version">
|
<condition property="do.check.ant-javafx.version">
|
||||||
<and>
|
<and>
|
||||||
<isset property="ant-javafx.jar.location"/>
|
<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>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
</target>
|
</target>
|
||||||
@ -369,13 +397,23 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
|
|||||||
<echo message="exec-error:${exec-error}" level="verbose"/>
|
<echo message="exec-error:${exec-error}" level="verbose"/>
|
||||||
<echo message="exec-result:${exec-result}" level="verbose"/>
|
<echo message="exec-result:${exec-result}" level="verbose"/>
|
||||||
<condition property="missing.Inno">
|
<condition property="missing.Inno">
|
||||||
<not><and>
|
<not>
|
||||||
|
<and>
|
||||||
<contains string="${exec-output}" substring="Inno Setup"/>
|
<contains string="${exec-output}" substring="Inno Setup"/>
|
||||||
<not><contains string="${exec-output}" substring="Inno Setup 1"/></not>
|
<not>
|
||||||
<not><contains string="${exec-output}" substring="Inno Setup 2"/></not>
|
<contains string="${exec-output}" substring="Inno Setup 1"/>
|
||||||
<not><contains string="${exec-output}" substring="Inno Setup 3"/></not>
|
</not>
|
||||||
<not><contains string="${exec-output}" substring="Inno Setup 4"/></not>
|
<not>
|
||||||
</and></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>
|
</condition>
|
||||||
</target>
|
</target>
|
||||||
<target name="-check-WiX-presence" depends="-check-native-bundling-type" if="need.WiX.presence">
|
<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-error:${exec-error}" level="verbose"/>
|
||||||
<echo message="exec-result:${exec-result}" level="verbose"/>
|
<echo message="exec-result:${exec-result}" level="verbose"/>
|
||||||
<condition property="missing.WiX">
|
<condition property="missing.WiX">
|
||||||
<not><and>
|
<not>
|
||||||
|
<and>
|
||||||
<contains string="${exec-output}" substring="Windows Installer Xml Compiler version"/>
|
<contains string="${exec-output}" substring="Windows Installer Xml Compiler version"/>
|
||||||
<not><contains string="${exec-output}" substring="Windows Installer Xml Compiler version 1"/></not>
|
<not>
|
||||||
<not><contains string="${exec-output}" substring="Windows Installer Xml Compiler version 2"/></not>
|
<contains string="${exec-output}" substring="Windows Installer Xml Compiler version 1"/>
|
||||||
</and></not>
|
</not>
|
||||||
|
<not>
|
||||||
|
<contains string="${exec-output}" substring="Windows Installer Xml Compiler version 2"/>
|
||||||
|
</not>
|
||||||
|
</and>
|
||||||
|
</not>
|
||||||
</condition>
|
</condition>
|
||||||
</target>
|
</target>
|
||||||
<target name="-check-dpkg-presence" depends="-check-native-bundling-type" if="need.dpkg.presence">
|
<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"/>
|
<arg line="-v dpkg"/>
|
||||||
</exec>
|
</exec>
|
||||||
<condition property="missing.dpkg">
|
<condition property="missing.dpkg">
|
||||||
<not><and>
|
<not>
|
||||||
|
<and>
|
||||||
<isset property="exec.which.dpkg.result"/>
|
<isset property="exec.which.dpkg.result"/>
|
||||||
<equals arg1="${exec.which.dpkg.result}" arg2="0"/>
|
<equals arg1="${exec.which.dpkg.result}" arg2="0"/>
|
||||||
<isset property="exec.which.dpkg.output"/>
|
<isset property="exec.which.dpkg.output"/>
|
||||||
<not><equals arg1="${exec.which.dpkg.output}" arg2=""/></not>
|
<not>
|
||||||
</and></not>
|
<equals arg1="${exec.which.dpkg.output}" arg2=""/>
|
||||||
|
</not>
|
||||||
|
</and>
|
||||||
|
</not>
|
||||||
</condition>
|
</condition>
|
||||||
</target>
|
</target>
|
||||||
<target name="-check-rpmbuild-presence" depends="-check-native-bundling-type" if="need.rpmbuild.presence">
|
<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"/>
|
<arg line="-v rpmbuild"/>
|
||||||
</exec>
|
</exec>
|
||||||
<condition property="missing.rpmbuild">
|
<condition property="missing.rpmbuild">
|
||||||
<not><and>
|
<not>
|
||||||
|
<and>
|
||||||
<isset property="exec.which.rpmbuild.result"/>
|
<isset property="exec.which.rpmbuild.result"/>
|
||||||
<equals arg1="${exec.which.rpmbuild.result}" arg2="0"/>
|
<equals arg1="${exec.which.rpmbuild.result}" arg2="0"/>
|
||||||
<isset property="exec.which.rpmbuild.output"/>
|
<isset property="exec.which.rpmbuild.output"/>
|
||||||
<not><equals arg1="${exec.which.rpmbuild.output}" arg2=""/></not>
|
<not>
|
||||||
</and></not>
|
<equals arg1="${exec.which.rpmbuild.output}" arg2=""/>
|
||||||
|
</not>
|
||||||
|
</and>
|
||||||
|
</not>
|
||||||
</condition>
|
</condition>
|
||||||
</target>
|
</target>
|
||||||
<target name="-check-native-packager-external-tools" depends="-check-Inno-presence, -check-WiX-presence, -check-dpkg-presence, -check-rpmbuild-presence">
|
<target name="-check-native-packager-external-tools" depends="-check-Inno-presence, -check-WiX-presence, -check-dpkg-presence, -check-rpmbuild-presence">
|
||||||
|
@ -91,14 +91,6 @@
|
|||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem6ActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem6ActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</MenuItem>
|
</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>
|
</SubComponents>
|
||||||
</Menu>
|
</Menu>
|
||||||
<Menu class="javax.swing.JMenu" name="jMenu2">
|
<Menu class="javax.swing.JMenu" name="jMenu2">
|
||||||
@ -177,15 +169,14 @@
|
|||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<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>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
|
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="dividerLocation" type="int" value="275"/>
|
<Property name="dividerLocation" type="int" value="220"/>
|
||||||
<Property name="dividerSize" type="int" value="3"/>
|
|
||||||
<Property name="orientation" type="int" value="0"/>
|
<Property name="orientation" type="int" value="0"/>
|
||||||
<Property name="resizeWeight" type="double" value="0.7"/>
|
<Property name="resizeWeight" type="double" value="0.7"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
@ -194,6 +185,7 @@
|
|||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Container class="javax.swing.JScrollPane" name="scrollPane">
|
<Container class="javax.swing.JScrollPane" name="scrollPane">
|
||||||
<Properties>
|
<Properties>
|
||||||
|
<Property name="opaque" type="boolean" value="false"/>
|
||||||
<Property name="requestFocusEnabled" type="boolean" value="false"/>
|
<Property name="requestFocusEnabled" type="boolean" value="false"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
@ -229,7 +221,7 @@
|
|||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace 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>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
@ -247,11 +239,13 @@
|
|||||||
|
|
||||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Component class="javax.swing.JTextArea" name="outputPane">
|
<Component class="javax.swing.JTextArea" name="outputBox">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="editable" type="boolean" value="false"/>
|
<Property name="editable" type="boolean" value="false"/>
|
||||||
<Property name="columns" type="int" value="20"/>
|
<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>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
package net.apocalypselabs.symat;
|
package net.apocalypselabs.symat;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
@ -36,12 +37,11 @@ import java.nio.charset.Charset;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import javax.swing.JFileChooser;
|
import javax.swing.JFileChooser;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextPane;
|
import javax.swing.JTextPane;
|
||||||
|
import javax.swing.UIDefaults;
|
||||||
import javax.swing.filechooser.FileFilter;
|
import javax.swing.filechooser.FileFilter;
|
||||||
import javax.swing.filechooser.FileNameExtensionFilter;
|
import javax.swing.filechooser.FileNameExtensionFilter;
|
||||||
import javax.swing.text.AttributeSet;
|
import javax.swing.text.AttributeSet;
|
||||||
@ -77,10 +77,24 @@ public class CodeEditor extends javax.swing.JInternalFrame {
|
|||||||
fc.addChoosableFileFilter(filter);
|
fc.addChoosableFileFilter(filter);
|
||||||
int font_size = 12;
|
int font_size = 12;
|
||||||
try {
|
try {
|
||||||
font_size = Integer.valueOf(PrefStorage.getSetting("editor-fontsize"));
|
font_size = Integer.valueOf(PrefStorage.getSetting("editfont"));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
}
|
}
|
||||||
codeBox.setFont(new Font(Font.MONOSPACED, Font.PLAIN, font_size));
|
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];
|
TabStop[] tabs = new TabStop[30];
|
||||||
for (int i = 0; i < tabs.length; i++) {
|
for (int i = 0; i < tabs.length; i++) {
|
||||||
tabs[i] = new TabStop(15 * i, TabStop.ALIGN_RIGHT, TabStop.LEAD_NONE);
|
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();
|
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.
|
* 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
|
* 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();
|
jPanel2 = new javax.swing.JPanel();
|
||||||
jLabel1 = new javax.swing.JLabel();
|
jLabel1 = new javax.swing.JLabel();
|
||||||
jScrollPane1 = new javax.swing.JScrollPane();
|
jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
outputPane = new javax.swing.JTextArea();
|
outputBox = new javax.swing.JTextArea();
|
||||||
jMenuBar1 = new javax.swing.JMenuBar();
|
jMenuBar1 = new javax.swing.JMenuBar();
|
||||||
jMenu1 = new javax.swing.JMenu();
|
jMenu1 = new javax.swing.JMenu();
|
||||||
jMenuItem1 = new javax.swing.JMenuItem();
|
jMenuItem1 = new javax.swing.JMenuItem();
|
||||||
@ -125,7 +147,6 @@ public class CodeEditor extends javax.swing.JInternalFrame {
|
|||||||
jMenuItem8 = new javax.swing.JMenuItem();
|
jMenuItem8 = new javax.swing.JMenuItem();
|
||||||
jMenu5 = new javax.swing.JMenu();
|
jMenu5 = new javax.swing.JMenu();
|
||||||
jMenuItem6 = new javax.swing.JMenuItem();
|
jMenuItem6 = new javax.swing.JMenuItem();
|
||||||
jMenuItem7 = new javax.swing.JMenuItem();
|
|
||||||
jMenu2 = new javax.swing.JMenu();
|
jMenu2 = new javax.swing.JMenu();
|
||||||
jMenuItem5 = new javax.swing.JMenuItem();
|
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
|
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/editor.png"))); // NOI18N
|
||||||
setMinimumSize(new java.awt.Dimension(125, 50));
|
setMinimumSize(new java.awt.Dimension(125, 50));
|
||||||
|
|
||||||
jSplitPane1.setDividerLocation(275);
|
jSplitPane1.setDividerLocation(220);
|
||||||
jSplitPane1.setDividerSize(3);
|
|
||||||
jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
|
jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
|
||||||
jSplitPane1.setResizeWeight(0.7);
|
jSplitPane1.setResizeWeight(0.7);
|
||||||
|
|
||||||
|
scrollPane.setOpaque(false);
|
||||||
scrollPane.setRequestFocusEnabled(false);
|
scrollPane.setRequestFocusEnabled(false);
|
||||||
jSplitPane1.setTopComponent(scrollPane);
|
jSplitPane1.setTopComponent(scrollPane);
|
||||||
|
|
||||||
jLabel1.setText("Output:");
|
jLabel1.setText("Output:");
|
||||||
|
|
||||||
outputPane.setEditable(false);
|
outputBox.setEditable(false);
|
||||||
outputPane.setColumns(20);
|
outputBox.setColumns(20);
|
||||||
outputPane.setRows(5);
|
outputBox.setLineWrap(true);
|
||||||
jScrollPane1.setViewportView(outputPane);
|
outputBox.setRows(3);
|
||||||
|
outputBox.setWrapStyleWord(true);
|
||||||
|
jScrollPane1.setViewportView(outputBox);
|
||||||
|
|
||||||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
||||||
jPanel2.setLayout(jPanel2Layout);
|
jPanel2.setLayout(jPanel2Layout);
|
||||||
@ -174,7 +197,7 @@ public class CodeEditor extends javax.swing.JInternalFrame {
|
|||||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||||
.addComponent(jLabel1)
|
.addComponent(jLabel1)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.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);
|
jSplitPane1.setRightComponent(jPanel2);
|
||||||
@ -187,7 +210,7 @@ public class CodeEditor extends javax.swing.JInternalFrame {
|
|||||||
);
|
);
|
||||||
jPanel1Layout.setVerticalGroup(
|
jPanel1Layout.setVerticalGroup(
|
||||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
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");
|
jMenu1.setText("File");
|
||||||
@ -240,14 +263,6 @@ public class CodeEditor extends javax.swing.JInternalFrame {
|
|||||||
});
|
});
|
||||||
jMenu5.add(jMenuItem6);
|
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);
|
jMenuBar1.add(jMenu5);
|
||||||
|
|
||||||
jMenu2.setText("Run");
|
jMenu2.setText("Run");
|
||||||
@ -352,31 +367,16 @@ public class CodeEditor extends javax.swing.JInternalFrame {
|
|||||||
CodeRunner cr = new CodeRunner();
|
CodeRunner cr = new CodeRunner();
|
||||||
Object result = cr.evalString(codeBox.getText());
|
Object result = cr.evalString(codeBox.getText());
|
||||||
try {
|
try {
|
||||||
outputPane.append(result.toString() + "\n");
|
outputBox.append(result.toString() + "\n");
|
||||||
} catch (NullPointerException ex) {
|
} catch (NullPointerException ex) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_jMenuItem5ActionPerformed
|
}//GEN-LAST:event_jMenuItem5ActionPerformed
|
||||||
|
|
||||||
private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
|
private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
|
||||||
outputPane.setText("");
|
outputBox.setText("");
|
||||||
}//GEN-LAST:event_jMenuItem6ActionPerformed
|
}//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
|
private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
|
||||||
CodeExport ce = new CodeExport(codeBox.getText());
|
CodeExport ce = new CodeExport(codeBox.getText());
|
||||||
MainGUI.loadFrame(ce);
|
MainGUI.loadFrame(ce);
|
||||||
@ -431,13 +431,12 @@ public class CodeEditor extends javax.swing.JInternalFrame {
|
|||||||
private javax.swing.JMenuItem jMenuItem4;
|
private javax.swing.JMenuItem jMenuItem4;
|
||||||
private javax.swing.JMenuItem jMenuItem5;
|
private javax.swing.JMenuItem jMenuItem5;
|
||||||
private javax.swing.JMenuItem jMenuItem6;
|
private javax.swing.JMenuItem jMenuItem6;
|
||||||
private javax.swing.JMenuItem jMenuItem7;
|
|
||||||
private javax.swing.JMenuItem jMenuItem8;
|
private javax.swing.JMenuItem jMenuItem8;
|
||||||
private javax.swing.JPanel jPanel1;
|
private javax.swing.JPanel jPanel1;
|
||||||
private javax.swing.JPanel jPanel2;
|
private javax.swing.JPanel jPanel2;
|
||||||
private javax.swing.JScrollPane jScrollPane1;
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
private javax.swing.JSplitPane jSplitPane1;
|
private javax.swing.JSplitPane jSplitPane1;
|
||||||
private javax.swing.JTextArea outputPane;
|
private javax.swing.JTextArea outputBox;
|
||||||
private javax.swing.JScrollPane scrollPane;
|
private javax.swing.JScrollPane scrollPane;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
@ -33,14 +33,19 @@ package net.apocalypselabs.symat;
|
|||||||
* @author Skylar
|
* @author Skylar
|
||||||
*/
|
*/
|
||||||
public class Debug {
|
public class Debug {
|
||||||
|
|
||||||
// If output should be on or off
|
// If output should be on or off
|
||||||
public static final boolean DEBUG = true;
|
public static final boolean DEBUG = true;
|
||||||
|
|
||||||
public static void println(Object data) {
|
public static void println(Object data) {
|
||||||
if (DEBUG) System.out.println(data);
|
if (DEBUG) {
|
||||||
|
System.out.println(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void printerr(Object data) {
|
public static void printerr(Object data) {
|
||||||
if (DEBUG) System.err.println(data);
|
if (DEBUG) {
|
||||||
|
System.err.println(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
210
src/net/apocalypselabs/symat/Display.form
Normal file
210
src/net/apocalypselabs/symat/Display.form
Normal file
@ -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>
|
228
src/net/apocalypselabs/symat/Display.java
Normal file
228
src/net/apocalypselabs/symat/Display.java
Normal file
@ -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
|
||||||
|
}
|
@ -39,6 +39,7 @@ import org.matheclipse.parser.client.math.MathException;
|
|||||||
* @author Skylar
|
* @author Skylar
|
||||||
*/
|
*/
|
||||||
public class Functions {
|
public class Functions {
|
||||||
|
|
||||||
EvalUtilities util = new EvalUtilities(false, true);
|
EvalUtilities util = new EvalUtilities(false, true);
|
||||||
Graph graphwin = new Graph(true);
|
Graph graphwin = new Graph(true);
|
||||||
|
|
||||||
@ -57,7 +58,6 @@ public class Functions {
|
|||||||
// TODO: enable output logging
|
// TODO: enable output logging
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Math commands
|
Math commands
|
||||||
*/
|
*/
|
||||||
@ -74,7 +74,6 @@ public class Functions {
|
|||||||
return sym(input);
|
return sym(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String replace(String function, String variable, String newvar) {
|
public String replace(String function, String variable, String newvar) {
|
||||||
return function.replaceAll(variable, newvar);
|
return function.replaceAll(variable, newvar);
|
||||||
}
|
}
|
||||||
@ -138,11 +137,9 @@ public class Functions {
|
|||||||
graphwin.drawDot(x, y);
|
graphwin.drawDot(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Other
|
Other
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public String sysinfo() {
|
public String sysinfo() {
|
||||||
String info = "==Java System Information==\n";
|
String info = "==Java System Information==\n";
|
||||||
info += "Java version: " + System.getProperty("java.version");
|
info += "Java version: " + System.getProperty("java.version");
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<Property name="iconifiable" type="boolean" value="true"/>
|
<Property name="iconifiable" type="boolean" value="true"/>
|
||||||
<Property name="maximizable" type="boolean" value="true"/>
|
<Property name="maximizable" type="boolean" value="true"/>
|
||||||
<Property name="resizable" type="boolean" value="true"/>
|
<Property name="resizable" type="boolean" value="true"/>
|
||||||
<Property name="title" type="java.lang.String" value="Help"/>
|
<Property name="title" type="java.lang.String" value="Manual"/>
|
||||||
<Property name="frameIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
<Property name="frameIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||||
<Image iconType="3" name="/net/apocalypselabs/symat/icons/help.png"/>
|
<Image iconType="3" name="/net/apocalypselabs/symat/icons/help.png"/>
|
||||||
</Property>
|
</Property>
|
||||||
@ -76,6 +76,7 @@
|
|||||||
</StringArray>
|
</StringArray>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="selectionMode" type="int" value="0"/>
|
<Property name="selectionMode" type="int" value="0"/>
|
||||||
|
<Property name="selectedIndex" type="int" value="0"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="valueChanged" listener="javax.swing.event.ListSelectionListener" parameters="javax.swing.event.ListSelectionEvent" handler="topicListValueChanged"/>
|
<EventHandler event="valueChanged" listener="javax.swing.event.ListSelectionListener" parameters="javax.swing.event.ListSelectionEvent" handler="topicListValueChanged"/>
|
||||||
|
@ -27,8 +27,10 @@
|
|||||||
*/
|
*/
|
||||||
package net.apocalypselabs.symat;
|
package net.apocalypselabs.symat;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import javax.swing.UIDefaults;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -41,6 +43,27 @@ public class Help extends javax.swing.JInternalFrame {
|
|||||||
*/
|
*/
|
||||||
public Help() {
|
public Help() {
|
||||||
initComponents();
|
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) {
|
public void loadTopic(String name) {
|
||||||
@ -56,6 +79,7 @@ public class Help extends javax.swing.JInternalFrame {
|
|||||||
}
|
}
|
||||||
topicBrowser.setText(text);
|
topicBrowser.setText(text);
|
||||||
topicBrowser.setCaretPosition(0);
|
topicBrowser.setCaretPosition(0);
|
||||||
|
setTitle("Manual (" + topicList.getSelectedValue().toString() + ")");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//JOptionPane.showInternalMessageDialog(MainGUI.mainPane,
|
//JOptionPane.showInternalMessageDialog(MainGUI.mainPane,
|
||||||
//"Error: Cannot load help topic "+name+".\n\n"+e.getMessage());
|
//"Error: Cannot load help topic "+name+".\n\n"+e.getMessage());
|
||||||
@ -83,7 +107,7 @@ public class Help extends javax.swing.JInternalFrame {
|
|||||||
setIconifiable(true);
|
setIconifiable(true);
|
||||||
setMaximizable(true);
|
setMaximizable(true);
|
||||||
setResizable(true);
|
setResizable(true);
|
||||||
setTitle("Help");
|
setTitle("Manual");
|
||||||
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/help.png"))); // NOI18N
|
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/help.png"))); // NOI18N
|
||||||
addComponentListener(new java.awt.event.ComponentAdapter() {
|
addComponentListener(new java.awt.event.ComponentAdapter() {
|
||||||
public void componentShown(java.awt.event.ComponentEvent evt) {
|
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]; }
|
public Object getElementAt(int i) { return strings[i]; }
|
||||||
});
|
});
|
||||||
topicList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
topicList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
topicList.setSelectedIndex(0);
|
||||||
topicList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
|
topicList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
|
||||||
public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
|
public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
|
||||||
topicListValueChanged(evt);
|
topicListValueChanged(evt);
|
||||||
@ -136,10 +161,10 @@ public class Help extends javax.swing.JInternalFrame {
|
|||||||
}//GEN-LAST:event_topicListValueChanged
|
}//GEN-LAST:event_topicListValueChanged
|
||||||
|
|
||||||
private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
|
private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
|
||||||
|
topicList.setSelectedIndex(0);
|
||||||
loadTopic("welcome");
|
loadTopic("welcome");
|
||||||
}//GEN-LAST:event_formComponentShown
|
}//GEN-LAST:event_formComponentShown
|
||||||
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JScrollPane jScrollPane1;
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
private javax.swing.JScrollPane jScrollPane2;
|
private javax.swing.JScrollPane jScrollPane2;
|
||||||
|
@ -1,27 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JInternalFrameFormInfo">
|
<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>
|
<Properties>
|
||||||
<Property name="closable" type="boolean" value="true"/>
|
<Property name="closable" type="boolean" value="true"/>
|
||||||
<Property name="iconifiable" type="boolean" value="true"/>
|
<Property name="iconifiable" type="boolean" value="true"/>
|
||||||
@ -33,7 +12,6 @@
|
|||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<SyntheticProperties>
|
<SyntheticProperties>
|
||||||
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
|
|
||||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
</SyntheticProperties>
|
</SyntheticProperties>
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
@ -55,22 +33,22 @@
|
|||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace 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"/>
|
<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>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Component id="jScrollPane1" pref="231" max="32767" attributes="0"/>
|
<Component id="jScrollPane1" pref="256" max="32767" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" 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">
|
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
|
||||||
<Component id="jLabel1" alignment="0" max="32767" 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>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace min="2" pref="2" max="-2" attributes="0"/>
|
<EmptySpace min="2" pref="2" max="-2" attributes="0"/>
|
||||||
@ -86,7 +64,7 @@
|
|||||||
|
|
||||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Component class="javax.swing.JTextArea" name="jTextArea1">
|
<Component class="javax.swing.JTextArea" name="mainBox">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="editable" type="boolean" value="false"/>
|
<Property name="editable" type="boolean" value="false"/>
|
||||||
<Property name="columns" type="int" value="20"/>
|
<Property name="columns" type="int" value="20"/>
|
||||||
@ -97,22 +75,22 @@
|
|||||||
<Property name="tabSize" type="int" value="4"/>
|
<Property name="tabSize" type="int" value="4"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="DefaultCaret caret = (DefaultCaret)jTextArea1.getCaret();
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);"/>
|
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="DefaultCaret caret = (DefaultCaret)mainBox.getCaret();
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);"/>
|
||||||
</AuxValues>
|
</AuxValues>
|
||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
<Component class="javax.swing.JTextField" name="jTextField1">
|
<Component class="javax.swing.JTextField" name="inputBox">
|
||||||
<Events>
|
<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>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="jButton1">
|
<Component class="javax.swing.JButton" name="runBtn">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Run"/>
|
<Property name="text" type="java.lang.String" value="Run"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<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>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
@ -27,8 +27,8 @@
|
|||||||
*/
|
*/
|
||||||
package net.apocalypselabs.symat;
|
package net.apocalypselabs.symat;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import javax.swing.text.DefaultCaret;
|
import javax.swing.text.DefaultCaret;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,6 +38,7 @@ import javax.swing.text.DefaultCaret;
|
|||||||
public class Interpreter extends javax.swing.JInternalFrame {
|
public class Interpreter extends javax.swing.JInternalFrame {
|
||||||
|
|
||||||
private final CodeRunner cr = new CodeRunner();
|
private final CodeRunner cr = new CodeRunner();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new form Interpreter
|
* Creates new form Interpreter
|
||||||
*/
|
*/
|
||||||
@ -45,13 +46,28 @@ public class Interpreter extends javax.swing.JInternalFrame {
|
|||||||
initComponents();
|
initComponents();
|
||||||
int font_size = 12;
|
int font_size = 12;
|
||||||
try {
|
try {
|
||||||
font_size = Integer.valueOf(PrefStorage.getSetting("shell-fontsize"));
|
font_size = Integer.valueOf(PrefStorage.getSetting("editfont"));
|
||||||
} catch (Exception ex) { }
|
} catch (Exception ex) {
|
||||||
jTextArea1.setFont(new Font(Font.MONOSPACED, Font.PLAIN, font_size));
|
}
|
||||||
jTextArea1.setLineWrap(true);
|
mainBox.setFont(new Font(Font.MONOSPACED, Font.PLAIN, font_size));
|
||||||
jTextArea1.setWrapStyleWord(true);
|
inputBox.setFont(new Font(Font.MONOSPACED, Font.PLAIN, font_size));
|
||||||
jTextArea1.setText(">>");
|
if (PrefStorage.getSetting("theme").equals("dark")) {
|
||||||
jTextField1.requestFocus();
|
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() {
|
private void initComponents() {
|
||||||
|
|
||||||
jScrollPane1 = new javax.swing.JScrollPane();
|
jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
jTextArea1 = new javax.swing.JTextArea();
|
mainBox = new javax.swing.JTextArea();
|
||||||
jTextField1 = new javax.swing.JTextField();
|
inputBox = new javax.swing.JTextField();
|
||||||
jButton1 = new javax.swing.JButton();
|
runBtn = new javax.swing.JButton();
|
||||||
jLabel1 = new javax.swing.JLabel();
|
jLabel1 = new javax.swing.JLabel();
|
||||||
jMenuBar1 = new javax.swing.JMenuBar();
|
|
||||||
jMenu2 = new javax.swing.JMenu();
|
|
||||||
jMenuItem1 = new javax.swing.JMenuItem();
|
|
||||||
|
|
||||||
setClosable(true);
|
setClosable(true);
|
||||||
setIconifiable(true);
|
setIconifiable(true);
|
||||||
@ -79,45 +92,31 @@ public class Interpreter extends javax.swing.JInternalFrame {
|
|||||||
setTitle("Shell");
|
setTitle("Shell");
|
||||||
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/shell.png"))); // NOI18N
|
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/shell.png"))); // NOI18N
|
||||||
|
|
||||||
jTextArea1.setEditable(false);
|
mainBox.setEditable(false);
|
||||||
jTextArea1.setColumns(20);
|
mainBox.setColumns(20);
|
||||||
jTextArea1.setFont(new java.awt.Font("Courier New", 0, 15)); // NOI18N
|
mainBox.setFont(new java.awt.Font("Courier New", 0, 15)); // NOI18N
|
||||||
jTextArea1.setRows(5);
|
mainBox.setRows(5);
|
||||||
jTextArea1.setTabSize(4);
|
mainBox.setTabSize(4);
|
||||||
DefaultCaret caret = (DefaultCaret)jTextArea1.getCaret();
|
DefaultCaret caret = (DefaultCaret)mainBox.getCaret();
|
||||||
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
|
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) {
|
public void keyTyped(java.awt.event.KeyEvent evt) {
|
||||||
jTextField1KeyTyped(evt);
|
inputBoxKeyTyped(evt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
jButton1.setText("Run");
|
runBtn.setText("Run");
|
||||||
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
runBtn.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
jButton1ActionPerformed(evt);
|
runBtnActionPerformed(evt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||||
jLabel1.setText(">>");
|
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());
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
getContentPane().setLayout(layout);
|
getContentPane().setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
@ -126,71 +125,53 @@ public class Interpreter extends javax.swing.JInternalFrame {
|
|||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(jLabel1)
|
.addComponent(jLabel1)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(jTextField1)
|
.addComponent(inputBox)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(jButton1))
|
.addComponent(runBtn))
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE)
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.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)
|
.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(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))
|
.addGap(2, 2, 2))
|
||||||
);
|
);
|
||||||
|
|
||||||
pack();
|
pack();
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </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();
|
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') {
|
if (evt.getKeyChar() == '\n') {
|
||||||
doRunCode();
|
doRunCode();
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_jTextField1KeyTyped
|
}//GEN-LAST:event_inputBoxKeyTyped
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
private void doRunCode() {
|
private void doRunCode() {
|
||||||
String code = jTextField1.getText();
|
String code = inputBox.getText();
|
||||||
jTextArea1.append(" "+code+"\n");
|
mainBox.append(" " + code + "\n");
|
||||||
try {
|
try {
|
||||||
jTextArea1.append(cr.evalString(code).toString()+"\n");
|
mainBox.append(cr.evalString(code).toString() + "\n");
|
||||||
} catch (NullPointerException ex) {
|
} catch (NullPointerException ex) {
|
||||||
|
|
||||||
}
|
}
|
||||||
jTextArea1.append(">>");
|
mainBox.append(">>");
|
||||||
jTextField1.setText("");
|
inputBox.setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// 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.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.JScrollPane jScrollPane1;
|
||||||
private javax.swing.JTextArea jTextArea1;
|
private javax.swing.JTextArea mainBox;
|
||||||
private javax.swing.JTextField jTextField1;
|
private javax.swing.JButton runBtn;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
<Connection code="APP_NAME" type="code"/>
|
<Connection code="APP_NAME" type="code"/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
<Dimension value="[600, 500]"/>
|
<Dimension value="[300, 400]"/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
<Dimension value="[700, 500]"/>
|
<Dimension value="[700, 575]"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<SyntheticProperties>
|
<SyntheticProperties>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
<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>
|
</AuxValues>
|
||||||
|
|
||||||
<Layout>
|
<Layout>
|
||||||
@ -52,7 +52,11 @@
|
|||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Container class="javax.swing.JTabbedPane" name="tabs">
|
<Container class="javax.swing.JTabbedPane" name="tabs">
|
||||||
<Properties>
|
<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="selectedIndex" type="int" value="1"/>
|
||||||
|
<Property name="opaque" type="boolean" value="true"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
<AuxValue name="JavaCodeGenerator_allCodePost" type="java.lang.String" value="tabs.setEnabledAt(0, false);"/>
|
<AuxValue name="JavaCodeGenerator_allCodePost" type="java.lang.String" value="tabs.setEnabledAt(0, false);"/>
|
||||||
@ -62,12 +66,15 @@
|
|||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Container class="javax.swing.JPanel" name="jPanel4">
|
<Container class="javax.swing.JPanel" name="jPanel4">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="enabled" type="boolean" value="false"/>
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Constraints>
|
<Constraints>
|
||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||||
<JTabbedPaneConstraints tabName="">
|
<JTabbedPaneConstraints tabName="">
|
||||||
<Property name="tabTitle" type="java.lang.String" value=""/>
|
<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>
|
</JTabbedPaneConstraints>
|
||||||
</Constraint>
|
</Constraint>
|
||||||
</Constraints>
|
</Constraints>
|
||||||
@ -77,6 +84,9 @@
|
|||||||
</Layout>
|
</Layout>
|
||||||
</Container>
|
</Container>
|
||||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="opaque" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
<Constraints>
|
<Constraints>
|
||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||||
<JTabbedPaneConstraints tabName="Apps">
|
<JTabbedPaneConstraints tabName="Apps">
|
||||||
@ -96,7 +106,7 @@
|
|||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="graphBtn" min="-2" max="-2" attributes="0"/>
|
<Component id="graphBtn" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace 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>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
@ -187,6 +197,9 @@
|
|||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
<Container class="javax.swing.JPanel" name="jPanel2">
|
<Container class="javax.swing.JPanel" name="jPanel2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="opaque" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
<Constraints>
|
<Constraints>
|
||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||||
<JTabbedPaneConstraints tabName="Tools">
|
<JTabbedPaneConstraints tabName="Tools">
|
||||||
@ -204,7 +217,7 @@
|
|||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="arrangeWindowsBtn" min="-2" max="-2" attributes="0"/>
|
<Component id="arrangeWindowsBtn" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace type="unrelated" 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>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
@ -224,7 +237,7 @@
|
|||||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
<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/help.png"/>
|
||||||
</Property>
|
</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">
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||||||
<EmptyBorder bottom="5" left="5" right="5" top="5"/>
|
<EmptyBorder bottom="5" left="5" right="5" top="5"/>
|
||||||
@ -251,9 +264,9 @@
|
|||||||
<Component class="javax.swing.JButton" name="arrangeWindowsBtn">
|
<Component class="javax.swing.JButton" name="arrangeWindowsBtn">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
<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>
|
||||||
<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">
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||||||
<EmptyBorder bottom="5" left="5" right="5" top="5"/>
|
<EmptyBorder bottom="5" left="5" right="5" top="5"/>
|
||||||
@ -271,6 +284,9 @@
|
|||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
<Container class="javax.swing.JPanel" name="jPanel3">
|
<Container class="javax.swing.JPanel" name="jPanel3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="opaque" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
<Constraints>
|
<Constraints>
|
||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||||
<JTabbedPaneConstraints tabName="Settings">
|
<JTabbedPaneConstraints tabName="Settings">
|
||||||
@ -282,15 +298,18 @@
|
|||||||
<Layout>
|
<Layout>
|
||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="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>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<Component id="jLabel4" min="-2" pref="65" max="-2" attributes="0"/>
|
<Component id="jLabel4" min="-2" pref="65" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
<Component id="displaySettingsBtn" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
@ -304,6 +323,26 @@
|
|||||||
<Property name="focusable" type="boolean" value="false"/>
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</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>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
@ -320,6 +359,7 @@
|
|||||||
<Property name="opaque" type="boolean" value="false"/>
|
<Property name="opaque" type="boolean" value="false"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="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());
 }
}
"/>
|
||||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="9"/>
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="9"/>
|
||||||
</AuxValues>
|
</AuxValues>
|
||||||
|
|
||||||
@ -331,7 +371,7 @@
|
|||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<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>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
@ -27,14 +27,16 @@
|
|||||||
*/
|
*/
|
||||||
package net.apocalypselabs.symat;
|
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.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JDesktopPane;
|
|
||||||
import javax.swing.JInternalFrame;
|
import javax.swing.JInternalFrame;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -85,6 +87,19 @@ public class MainGUI extends javax.swing.JFrame {
|
|||||||
ed.openFileFromString(argfile);
|
ed.openFileFromString(argfile);
|
||||||
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() {
|
private static String namemark() {
|
||||||
@ -122,21 +137,39 @@ public class MainGUI extends javax.swing.JFrame {
|
|||||||
arrangeWindowsBtn = new javax.swing.JButton();
|
arrangeWindowsBtn = new javax.swing.JButton();
|
||||||
jPanel3 = new javax.swing.JPanel();
|
jPanel3 = new javax.swing.JPanel();
|
||||||
jLabel4 = new javax.swing.JLabel();
|
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);
|
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||||
setTitle(APP_NAME);
|
setTitle(APP_NAME);
|
||||||
setMinimumSize(new java.awt.Dimension(600, 500));
|
setMinimumSize(new java.awt.Dimension(300, 400));
|
||||||
setPreferredSize(new java.awt.Dimension(700, 500));
|
setPreferredSize(new java.awt.Dimension(700, 575));
|
||||||
addComponentListener(new java.awt.event.ComponentAdapter() {
|
addComponentListener(new java.awt.event.ComponentAdapter() {
|
||||||
public void componentShown(java.awt.event.ComponentEvent evt) {
|
public void componentShown(java.awt.event.ComponentEvent evt) {
|
||||||
formComponentShown(evt);
|
formComponentShown(evt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
jPanel4.setEnabled(false);
|
tabs.setBackground(new Color(240,240,240));
|
||||||
|
tabs.setOpaque(true);
|
||||||
|
|
||||||
|
jPanel4.setFocusable(false);
|
||||||
jPanel4.setLayout(null);
|
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.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/shell.png"))); // NOI18N
|
||||||
shellBtn.setText("Shell");
|
shellBtn.setText("Shell");
|
||||||
@ -193,7 +226,7 @@ public class MainGUI extends javax.swing.JFrame {
|
|||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(graphBtn)
|
.addComponent(graphBtn)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.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.setVerticalGroup(
|
||||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
@ -208,8 +241,10 @@ public class MainGUI extends javax.swing.JFrame {
|
|||||||
|
|
||||||
tabs.addTab("Apps", jPanel1);
|
tabs.addTab("Apps", jPanel1);
|
||||||
|
|
||||||
|
jPanel2.setOpaque(false);
|
||||||
|
|
||||||
helpBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/help.png"))); // NOI18N
|
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.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
||||||
helpBtn.setFocusable(false);
|
helpBtn.setFocusable(false);
|
||||||
helpBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
helpBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||||
@ -225,8 +260,8 @@ public class MainGUI extends javax.swing.JFrame {
|
|||||||
jLabel3.setText(namemark());
|
jLabel3.setText(namemark());
|
||||||
jLabel3.setFocusable(false);
|
jLabel3.setFocusable(false);
|
||||||
|
|
||||||
arrangeWindowsBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/help.png"))); // NOI18N
|
arrangeWindowsBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/cascade.png"))); // NOI18N
|
||||||
arrangeWindowsBtn.setText("Arrange");
|
arrangeWindowsBtn.setText("Cascade");
|
||||||
arrangeWindowsBtn.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
arrangeWindowsBtn.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
||||||
arrangeWindowsBtn.setFocusable(false);
|
arrangeWindowsBtn.setFocusable(false);
|
||||||
arrangeWindowsBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
arrangeWindowsBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||||
@ -248,7 +283,7 @@ public class MainGUI extends javax.swing.JFrame {
|
|||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(arrangeWindowsBtn)
|
.addComponent(arrangeWindowsBtn)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
.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.setVerticalGroup(
|
||||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
@ -260,21 +295,39 @@ public class MainGUI extends javax.swing.JFrame {
|
|||||||
|
|
||||||
tabs.addTab("Tools", jPanel2);
|
tabs.addTab("Tools", jPanel2);
|
||||||
|
|
||||||
|
jPanel3.setOpaque(false);
|
||||||
|
|
||||||
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||||
jLabel4.setText(namemark());
|
jLabel4.setText(namemark());
|
||||||
jLabel4.setFocusable(false);
|
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);
|
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
|
||||||
jPanel3.setLayout(jPanel3Layout);
|
jPanel3.setLayout(jPanel3Layout);
|
||||||
jPanel3Layout.setHorizontalGroup(
|
jPanel3Layout.setHorizontalGroup(
|
||||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
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.setVerticalGroup(
|
||||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
|
||||||
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addGap(0, 0, 0))
|
.addComponent(displaySettingsBtn)
|
||||||
);
|
);
|
||||||
|
|
||||||
tabs.addTab("Settings", jPanel3);
|
tabs.addTab("Settings", jPanel3);
|
||||||
@ -294,7 +347,7 @@ public class MainGUI extends javax.swing.JFrame {
|
|||||||
);
|
);
|
||||||
mainPaneLayout.setVerticalGroup(
|
mainPaneLayout.setVerticalGroup(
|
||||||
mainPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
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());
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
@ -345,6 +398,11 @@ public class MainGUI extends javax.swing.JFrame {
|
|||||||
cascade();
|
cascade();
|
||||||
}//GEN-LAST:event_arrangeWindowsBtnActionPerformed
|
}//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
|
* Adds the given JInternalFrame to the mainPane. Automatically does layout
|
||||||
* and sets visible as well.
|
* and sets visible as well.
|
||||||
@ -373,6 +431,7 @@ public class MainGUI extends javax.swing.JFrame {
|
|||||||
frame.setLocation(frame.getLocation().x, 0);
|
frame.setLocation(frame.getLocation().x, 0);
|
||||||
}
|
}
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
|
//updateDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void cascade() {
|
public static void cascade() {
|
||||||
@ -427,19 +486,20 @@ public class MainGUI extends javax.swing.JFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JButton arrangeWindowsBtn;
|
public static javax.swing.JButton arrangeWindowsBtn;
|
||||||
private javax.swing.JButton editorBtn;
|
public static javax.swing.JButton displaySettingsBtn;
|
||||||
private javax.swing.JButton graphBtn;
|
public static javax.swing.JButton editorBtn;
|
||||||
private javax.swing.JButton helpBtn;
|
public static javax.swing.JButton graphBtn;
|
||||||
private javax.swing.JLabel jLabel1;
|
public static javax.swing.JButton helpBtn;
|
||||||
private javax.swing.JLabel jLabel3;
|
public static javax.swing.JLabel jLabel1;
|
||||||
private javax.swing.JLabel jLabel4;
|
public static javax.swing.JLabel jLabel3;
|
||||||
private javax.swing.JPanel jPanel1;
|
public static javax.swing.JLabel jLabel4;
|
||||||
private javax.swing.JPanel jPanel2;
|
public static javax.swing.JPanel jPanel1;
|
||||||
private javax.swing.JPanel jPanel3;
|
public static javax.swing.JPanel jPanel2;
|
||||||
private javax.swing.JPanel jPanel4;
|
public static javax.swing.JPanel jPanel3;
|
||||||
|
public static javax.swing.JPanel jPanel4;
|
||||||
public static javax.swing.JDesktopPane mainPane;
|
public static javax.swing.JDesktopPane mainPane;
|
||||||
private javax.swing.JButton shellBtn;
|
public static javax.swing.JButton shellBtn;
|
||||||
private javax.swing.JTabbedPane tabs;
|
public static javax.swing.JTabbedPane tabs;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,13 @@ public class PrefStorage {
|
|||||||
prefs.put(key, value);
|
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) {
|
public static String getSetting(String key) {
|
||||||
return prefs.get(key, "");
|
return prefs.get(key, "");
|
||||||
}
|
}
|
||||||
@ -50,8 +57,7 @@ public class PrefStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// xkcd 221 compliance.
|
// xkcd 221 compliance.
|
||||||
int getRandomNumber()
|
int getRandomNumber() {
|
||||||
{
|
|
||||||
return 4; // chosen by fair dice roll.
|
return 4; // chosen by fair dice roll.
|
||||||
// guaranteed to be random.
|
// guaranteed to be random.
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,20 @@
|
|||||||
/*******************************************************************************
|
/**
|
||||||
|
* *****************************************************************************
|
||||||
* Copyright 2013 Jeremie Bresson
|
* Copyright 2013 Jeremie Bresson
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
* you may not use this file except in compliance with the License.
|
* use this file except in compliance with the License. You may obtain a copy of
|
||||||
* You may obtain a copy of the License at
|
* the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
* See the License for the specific language governing permissions and
|
* License for the specific language governing permissions and limitations under
|
||||||
* limitations under the License.
|
* the License.
|
||||||
******************************************************************************/
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
package net.apocalypselabs.symat; // Package name changed.
|
package net.apocalypselabs.symat; // Package name changed.
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
@ -23,10 +25,12 @@ import syntaxhighlight.Style;
|
|||||||
import syntaxhighlight.Theme;
|
import syntaxhighlight.Theme;
|
||||||
|
|
||||||
public class PrettifyToHtml {
|
public class PrettifyToHtml {
|
||||||
|
|
||||||
private static final String MAIN_CLASS = "prettyprint";
|
private static final String MAIN_CLASS = "prettyprint";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format the {@link ParseResult} into an HTML file.
|
* Format the {@link ParseResult} into an HTML file.
|
||||||
|
*
|
||||||
* @param content
|
* @param content
|
||||||
* @param parseResults
|
* @param parseResults
|
||||||
* @return
|
* @return
|
||||||
|
@ -43,6 +43,7 @@ public class Update extends javax.swing.JInternalFrame {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new form Update
|
* Creates new form Update
|
||||||
|
*
|
||||||
* @param latest The new version.
|
* @param latest The new version.
|
||||||
*/
|
*/
|
||||||
public Update(double latest) {
|
public Update(double latest) {
|
||||||
@ -159,7 +160,6 @@ public class Update extends javax.swing.JInternalFrame {
|
|||||||
dispose();
|
dispose();
|
||||||
}//GEN-LAST:event_jLabel5MouseClicked
|
}//GEN-LAST:event_jLabel5MouseClicked
|
||||||
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JButton jButton1;
|
private javax.swing.JButton jButton1;
|
||||||
private javax.swing.JLabel jLabel1;
|
private javax.swing.JLabel jLabel1;
|
||||||
|
BIN
src/net/apocalypselabs/symat/cascade.png
Normal file
BIN
src/net/apocalypselabs/symat/cascade.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 920 B |
BIN
src/net/apocalypselabs/symat/display.png
Normal file
BIN
src/net/apocalypselabs/symat/display.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
src/net/apocalypselabs/symat/icon16.png
Normal file
BIN
src/net/apocalypselabs/symat/icon16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 488 B |
BIN
src/net/apocalypselabs/symat/icons/settings.png
Normal file
BIN
src/net/apocalypselabs/symat/icons/settings.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 705 B |
Loading…
x
Reference in New Issue
Block a user