Fix graph window resize glitch for good, update internal help, tidy code

This commit is contained in:
skylarmt 2014-12-18 00:44:29 -07:00
parent 1899132535
commit 15c8a3276b
5 changed files with 20 additions and 39 deletions

View File

@ -81,10 +81,13 @@
<Image iconType="3" name="/net/apocalypselabs/symat/icons/graph.png"/> <Image iconType="3" name="/net/apocalypselabs/symat/icons/graph.png"/>
</Property> </Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[336, 406]"/> <Dimension value="[326, 402]"/>
</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="[336, 406]"/> <Dimension value="[326, 402]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[326, 402]"/>
</Property> </Property>
</Properties> </Properties>
<SyntheticProperties> <SyntheticProperties>
@ -92,9 +95,6 @@
<SyntheticProperty name="formSizePolicy" type="int" value="1"/> <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
</SyntheticProperties> </SyntheticProperties>
<Events> <Events>
<EventHandler event="mouseDragged" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="formMouseDragged"/>
<EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="formMouseMoved"/>
<EventHandler event="componentMoved" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentMoved"/>
<EventHandler event="componentShown" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentShown"/> <EventHandler event="componentShown" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentShown"/>
</Events> </Events>
<AuxValues> <AuxValues>
@ -124,7 +124,7 @@
</Group> </Group>
<Component id="gLbl" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="gLbl" alignment="0" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -139,7 +139,7 @@
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>

View File

@ -120,20 +120,10 @@ public class Graph extends javax.swing.JInternalFrame {
setTitle("Graph"); setTitle("Graph");
setToolTipText(""); setToolTipText("");
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/graph.png"))); // NOI18N setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/graph.png"))); // NOI18N
setMaximumSize(new java.awt.Dimension(336, 406)); setMaximumSize(new java.awt.Dimension(326, 402));
setMinimumSize(new java.awt.Dimension(336, 406)); setMinimumSize(new java.awt.Dimension(326, 402));
addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { setPreferredSize(new java.awt.Dimension(326, 402));
public void mouseDragged(java.awt.event.MouseEvent evt) {
formMouseDragged(evt);
}
public void mouseMoved(java.awt.event.MouseEvent evt) {
formMouseMoved(evt);
}
});
addComponentListener(new java.awt.event.ComponentAdapter() { addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentMoved(java.awt.event.ComponentEvent evt) {
formComponentMoved(evt);
}
public void componentShown(java.awt.event.ComponentEvent evt) { public void componentShown(java.awt.event.ComponentEvent evt) {
formComponentShown(evt); formComponentShown(evt);
} }
@ -226,7 +216,7 @@ public class Graph extends javax.swing.JInternalFrame {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton1)) .addComponent(jButton1))
.addComponent(gLbl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(gLbl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap()) .addGap(0, 0, 0))
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -238,7 +228,7 @@ public class Graph extends javax.swing.JInternalFrame {
.addComponent(inBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(inBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1) .addComponent(jLabel1)
.addComponent(jButton1)) .addComponent(jButton1))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())
); );
pack(); pack();
@ -335,18 +325,6 @@ public class Graph extends javax.swing.JInternalFrame {
} }
}//GEN-LAST:event_inBoxKeyTyped }//GEN-LAST:event_inBoxKeyTyped
private void formComponentMoved(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentMoved
}//GEN-LAST:event_formComponentMoved
private void formMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseMoved
// TODO add your handling code here:
}//GEN-LAST:event_formMouseMoved
private void formMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseDragged
}//GEN-LAST:event_formMouseDragged
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
gpnl = new BufferedImage(300, 300, BufferedImage.TYPE_INT_ARGB); gpnl = new BufferedImage(300, 300, BufferedImage.TYPE_INT_ARGB);
gg = gpnl.getGraphics(); gg = gpnl.getGraphics();

View File

@ -125,8 +125,11 @@
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Courier New" size="15" style="0"/> <Font name="Courier New" size="15" style="0"/>
</Property> </Property>
<Property name="lineWrap" type="boolean" value="true"/>
<Property name="rows" type="int" value="5"/> <Property name="rows" type="int" value="5"/>
<Property name="tabSize" type="int" value="4"/> <Property name="tabSize" type="int" value="4"/>
<Property name="toolTipText" type="java.lang.String" value=""/>
<Property name="wrapStyleWord" type="boolean" value="true"/>
</Properties> </Properties>
<AuxValues> <AuxValues>
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="DefaultCaret caret = (DefaultCaret)mainBox.getCaret();&#xd;&#xa;caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);"/> <AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="DefaultCaret caret = (DefaultCaret)mainBox.getCaret();&#xd;&#xa;caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);"/>

View File

@ -90,8 +90,6 @@ public class Interpreter extends javax.swing.JInternalFrame {
} }
// Misc. setup // Misc. setup
mainBox.setLineWrap(true);
mainBox.setWrapStyleWord(true);
mainBox.setText(">>"); mainBox.setText(">>");
inputBox.requestFocus(); inputBox.requestFocus();
} }
@ -132,8 +130,11 @@ public class Interpreter extends javax.swing.JInternalFrame {
mainBox.setEditable(false); mainBox.setEditable(false);
mainBox.setColumns(20); mainBox.setColumns(20);
mainBox.setFont(new java.awt.Font("Courier New", 0, 15)); // NOI18N mainBox.setFont(new java.awt.Font("Courier New", 0, 15)); // NOI18N
mainBox.setLineWrap(true);
mainBox.setRows(5); mainBox.setRows(5);
mainBox.setTabSize(4); mainBox.setTabSize(4);
mainBox.setToolTipText("");
mainBox.setWrapStyleWord(true);
DefaultCaret caret = (DefaultCaret)mainBox.getCaret(); DefaultCaret caret = (DefaultCaret)mainBox.getCaret();
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
jScrollPane1.setViewportView(mainBox); jScrollPane1.setViewportView(mainBox);
@ -229,7 +230,6 @@ public class Interpreter extends javax.swing.JInternalFrame {
private void inputBoxKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_inputBoxKeyTyped private void inputBoxKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_inputBoxKeyTyped
if (evt.getKeyChar() == '\n') { if (evt.getKeyChar() == '\n') {
doRunCode(); doRunCode();
return;
} }
}//GEN-LAST:event_inputBoxKeyTyped }//GEN-LAST:event_inputBoxKeyTyped

View File

@ -5,8 +5,8 @@
<body> <body>
<h1>Welcome to SyMAT!</h1> <h1>Welcome to SyMAT!</h1>
<p>SyMAT is a Java-based algebra and calculus system. <p>SyMAT is a Java-based algebra and calculus system.
Scripts and commands are in JavaScript.</p> Scripts and commands can be written in JavaScript or Python.</p>
<p><b>Copyright:</b><br> <p><b>Copyright:</b><br>
SyMAT is copyright &copy; 2014 Apocalypse Laboratories.</p> SyMAT is copyright &copy; 2014 Apocalypse Laboratories. See Licenses for more information.</p>
</body> </body>
</html> </html>