Add ribbon interface, special debug logging class, and cascade windows button.
This commit is contained in:
parent
ae50d252bb
commit
bd71fca1fa
@ -134,6 +134,9 @@
|
||||
<Property name="frameIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/net/apocalypselabs/symat/icons/editor.png"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[125, 50]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
|
||||
|
@ -143,6 +143,7 @@ public class CodeEditor extends javax.swing.JInternalFrame {
|
||||
setResizable(true);
|
||||
setTitle("Editor");
|
||||
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/editor.png"))); // NOI18N
|
||||
setMinimumSize(new java.awt.Dimension(125, 50));
|
||||
|
||||
jSplitPane1.setDividerLocation(275);
|
||||
jSplitPane1.setDividerSize(3);
|
||||
|
46
src/net/apocalypselabs/symat/Debug.java
Normal file
46
src/net/apocalypselabs/symat/Debug.java
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* This class handles DEBUG logging, so it's easy to disable.
|
||||
*
|
||||
* @author Skylar
|
||||
*/
|
||||
public class Debug {
|
||||
// If output should be on or off
|
||||
public static final boolean DEBUG = true;
|
||||
|
||||
public static void println(Object data) {
|
||||
if (DEBUG) System.out.println(data);
|
||||
}
|
||||
|
||||
public static void printerr(Object data) {
|
||||
if (DEBUG) System.err.println(data);
|
||||
}
|
||||
}
|
@ -80,6 +80,12 @@
|
||||
<Property name="frameIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/net/apocalypselabs/symat/icons/graph.png"/>
|
||||
</Property>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[336, 406]"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[336, 406]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
|
||||
|
@ -120,6 +120,8 @@ public class Graph extends javax.swing.JInternalFrame {
|
||||
setTitle("Graph");
|
||||
setToolTipText("");
|
||||
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/graph.png"))); // NOI18N
|
||||
setMaximumSize(new java.awt.Dimension(336, 406));
|
||||
setMinimumSize(new java.awt.Dimension(336, 406));
|
||||
addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
|
||||
public void mouseDragged(java.awt.event.MouseEvent evt) {
|
||||
formMouseDragged(evt);
|
||||
|
@ -1,11 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="3"/>
|
||||
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="APP_NAME" type="code"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[600, 500]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 500]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
@ -36,7 +42,7 @@
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="tabs" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="tabs" min="-2" pref="94" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="mainPane" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
@ -44,33 +50,32 @@
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JDesktopPane" name="mainPane">
|
||||
<Container class="javax.swing.JTabbedPane" name="tabs">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="cc" green="cc" red="cc" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="selectedIndex" type="int" value="1"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="9"/>
|
||||
<AuxValue name="JavaCodeGenerator_allCodePost" type="java.lang.String" value="tabs.setEnabledAt(0, false);"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="407" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
</Container>
|
||||
<Container class="javax.swing.JTabbedPane" name="tabs">
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="jPanel4">
|
||||
<Properties>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||
<JTabbedPaneConstraints tabName="">
|
||||
<Property name="tabTitle" type="java.lang.String" value=""/>
|
||||
</JTabbedPaneConstraints>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||
<Property name="useNullLayout" type="boolean" value="true"/>
|
||||
</Layout>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||
@ -83,30 +88,28 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="shellBtn" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="editorBtn" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="graphBtn" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" pref="498" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" pref="494" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="shellBtn" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="editorBtn" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jLabel1" alignment="0" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="graphBtn" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Component id="jLabel1" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="shellBtn" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="editorBtn" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="graphBtn" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@ -196,21 +199,22 @@
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="helpBtn" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel3" pref="630" max="32767" attributes="0"/>
|
||||
<Component id="arrangeWindowsBtn" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jLabel3" pref="551" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="helpBtn" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel3" min="-2" pref="65" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="helpBtn" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel3" min="-2" pref="65" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="arrangeWindowsBtn" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
@ -244,16 +248,29 @@
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="arrangeWindowsBtn">
|
||||
<Properties>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/net/apocalypselabs/symat/help.png"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Arrange"/>
|
||||
<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="arrangeWindowsBtnActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="namemark()" type="code"/>
|
||||
</Property>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<Container class="javax.swing.JPanel" name="jPanel3">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||
<JTabbedPaneConstraints tabName="Settings">
|
||||
@ -261,8 +278,63 @@
|
||||
</JTabbedPaneConstraints>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel4" alignment="1" pref="691" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel4" min="-2" pref="65" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="namemark()" type="code"/>
|
||||
</Property>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JDesktopPane" name="mainPane">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="cc" green="cc" red="cc" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="autoscrolls" type="boolean" value="true"/>
|
||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
||||
<Color id="Default Cursor"/>
|
||||
</Property>
|
||||
<Property name="opaque" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="9"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="400" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
@ -27,12 +27,14 @@
|
||||
*/
|
||||
package net.apocalypselabs.symat;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JDesktopPane;
|
||||
import javax.swing.JInternalFrame;
|
||||
|
||||
/**
|
||||
@ -63,7 +65,7 @@ public class MainGUI extends javax.swing.JFrame {
|
||||
double version = Double.parseDouble(line);
|
||||
if (version > APP_CODE) {
|
||||
if (PrefStorage.getSetting("update-ignore").equals(APP_CODE + "|" + version)) {
|
||||
System.err.println("An update was found, but has been ignored by the user.");
|
||||
System.out.println("An update was found, but has been ignored by the user.");
|
||||
} else {
|
||||
loadFrame(new Update(version));
|
||||
}
|
||||
@ -107,8 +109,8 @@ public class MainGUI extends javax.swing.JFrame {
|
||||
private void initComponents() {
|
||||
java.awt.GridBagConstraints gridBagConstraints;
|
||||
|
||||
mainPane = new javax.swing.JDesktopPane();
|
||||
tabs = new javax.swing.JTabbedPane();
|
||||
jPanel4 = new javax.swing.JPanel();
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
shellBtn = new javax.swing.JButton();
|
||||
editorBtn = new javax.swing.JButton();
|
||||
@ -117,28 +119,24 @@ public class MainGUI extends javax.swing.JFrame {
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
helpBtn = new javax.swing.JButton();
|
||||
jLabel3 = new javax.swing.JLabel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
arrangeWindowsBtn = new javax.swing.JButton();
|
||||
jPanel3 = new javax.swing.JPanel();
|
||||
jLabel4 = new javax.swing.JLabel();
|
||||
mainPane = new javax.swing.JDesktopPane();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||
setTitle(APP_NAME);
|
||||
setMinimumSize(new java.awt.Dimension(600, 500));
|
||||
setPreferredSize(new java.awt.Dimension(700, 500));
|
||||
addComponentListener(new java.awt.event.ComponentAdapter() {
|
||||
public void componentShown(java.awt.event.ComponentEvent evt) {
|
||||
formComponentShown(evt);
|
||||
}
|
||||
});
|
||||
|
||||
mainPane.setBackground(new java.awt.Color(204, 204, 204));
|
||||
|
||||
javax.swing.GroupLayout mainPaneLayout = new javax.swing.GroupLayout(mainPane);
|
||||
mainPane.setLayout(mainPaneLayout);
|
||||
mainPaneLayout.setHorizontalGroup(
|
||||
mainPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
);
|
||||
mainPaneLayout.setVerticalGroup(
|
||||
mainPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 407, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel4.setEnabled(false);
|
||||
jPanel4.setLayout(null);
|
||||
tabs.addTab("", jPanel4);
|
||||
|
||||
shellBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/shell.png"))); // NOI18N
|
||||
shellBtn.setText("Shell");
|
||||
@ -188,25 +186,24 @@ public class MainGUI extends javax.swing.JFrame {
|
||||
jPanel1Layout.setHorizontalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(shellBtn)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(editorBtn)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(graphBtn)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 498, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 494, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel1Layout.setVerticalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(shellBtn)
|
||||
.addComponent(editorBtn))
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(graphBtn))
|
||||
.addGroup(jPanel1Layout.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(shellBtn, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(editorBtn, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(graphBtn, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
|
||||
tabs.addTab("Apps", jPanel1);
|
||||
@ -228,30 +225,77 @@ public class MainGUI extends javax.swing.JFrame {
|
||||
jLabel3.setText(namemark());
|
||||
jLabel3.setFocusable(false);
|
||||
|
||||
arrangeWindowsBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/help.png"))); // NOI18N
|
||||
arrangeWindowsBtn.setText("Arrange");
|
||||
arrangeWindowsBtn.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
||||
arrangeWindowsBtn.setFocusable(false);
|
||||
arrangeWindowsBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||
arrangeWindowsBtn.setOpaque(false);
|
||||
arrangeWindowsBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||
arrangeWindowsBtn.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
arrangeWindowsBtnActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
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(helpBtn)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 630, Short.MAX_VALUE))
|
||||
.addComponent(arrangeWindowsBtn)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 551, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(helpBtn)
|
||||
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(helpBtn)
|
||||
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(arrangeWindowsBtn)
|
||||
);
|
||||
|
||||
tabs.addTab("Tools", jPanel2);
|
||||
|
||||
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel2.setText(namemark());
|
||||
jLabel2.setFocusable(false);
|
||||
tabs.addTab("Settings", jLabel2);
|
||||
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel4.setText(namemark());
|
||||
jLabel4.setFocusable(false);
|
||||
|
||||
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
|
||||
jPanel3.setLayout(jPanel3Layout);
|
||||
jPanel3Layout.setHorizontalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 691, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel3Layout.setVerticalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
|
||||
tabs.addTab("Settings", jPanel3);
|
||||
|
||||
tabs.setSelectedIndex(1);
|
||||
|
||||
mainPane.setBackground(new java.awt.Color(204, 204, 204));
|
||||
mainPane.setAutoscrolls(true);
|
||||
mainPane.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
|
||||
mainPane.setOpaque(false);
|
||||
|
||||
javax.swing.GroupLayout mainPaneLayout = new javax.swing.GroupLayout(mainPane);
|
||||
mainPane.setLayout(mainPaneLayout);
|
||||
mainPaneLayout.setHorizontalGroup(
|
||||
mainPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
);
|
||||
mainPaneLayout.setVerticalGroup(
|
||||
mainPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 400, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
@ -263,11 +307,13 @@ public class MainGUI extends javax.swing.JFrame {
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(tabs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(tabs, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(mainPane))
|
||||
);
|
||||
|
||||
tabs.setEnabledAt(0, false);
|
||||
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
@ -295,14 +341,54 @@ public class MainGUI extends javax.swing.JFrame {
|
||||
loadFrame(h);
|
||||
}//GEN-LAST:event_helpBtnActionPerformed
|
||||
|
||||
private void arrangeWindowsBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_arrangeWindowsBtnActionPerformed
|
||||
cascade();
|
||||
}//GEN-LAST:event_arrangeWindowsBtnActionPerformed
|
||||
|
||||
/**
|
||||
* Adds the given JInternalFrame to the mainPane. Automatically does layout
|
||||
* and sets visible as well.
|
||||
*
|
||||
* @param frame
|
||||
*/
|
||||
public static void loadFrame(JInternalFrame frame) {
|
||||
int w = frame.getWidth();
|
||||
int h = frame.getHeight();
|
||||
int pw = mainPane.getWidth();
|
||||
int ph = mainPane.getHeight();
|
||||
if (frame.isResizable()) {
|
||||
if (h > ph) {
|
||||
h = ph;
|
||||
}
|
||||
if (w > pw) {
|
||||
w = pw;
|
||||
}
|
||||
frame.setSize(w, h);
|
||||
}
|
||||
mainPane.add(frame);
|
||||
frame.setLocation(
|
||||
(mainPane.getWidth() / 2) - (frame.getWidth() / 2),
|
||||
(mainPane.getHeight() / 2) - (frame.getHeight() / 2));
|
||||
(pw / 2) - (w / 2),
|
||||
(ph / 2) - (h / 2));
|
||||
if (frame.getLocation().y < 0) {
|
||||
frame.setLocation(frame.getLocation().x, 0);
|
||||
}
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
||||
public static void cascade() {
|
||||
JInternalFrame[] frames = mainPane.getAllFrames();
|
||||
int x = 12;
|
||||
int y = 24;
|
||||
Debug.println("Cascading "+frames.length+" frames...");
|
||||
for (int i = 0; i < frames.length; i++) {
|
||||
if (frames[i].isVisible()) {
|
||||
Debug.println("Frame: " + frames[i].getTitle() + ", Times: " + i + ", Xpos: " + x * i + ", Ypos: " + y * i);
|
||||
frames[i].setBounds(x * i, y * i, frames[i].getWidth(), frames[i].getHeight());
|
||||
frames[i].toFront();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
@ -341,14 +427,17 @@ public class MainGUI extends javax.swing.JFrame {
|
||||
}
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton arrangeWindowsBtn;
|
||||
private javax.swing.JButton editorBtn;
|
||||
private javax.swing.JButton graphBtn;
|
||||
private javax.swing.JButton helpBtn;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
private javax.swing.JLabel jLabel4;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private javax.swing.JPanel jPanel3;
|
||||
private javax.swing.JPanel jPanel4;
|
||||
public static javax.swing.JDesktopPane mainPane;
|
||||
private javax.swing.JButton shellBtn;
|
||||
private javax.swing.JTabbedPane tabs;
|
||||
|
Loading…
x
Reference in New Issue
Block a user