Fix null pointer Editor bug, allow longer task descriptions

master
skylarmt 9 years ago
parent ac497ec61d
commit 74af279f0a

@ -636,6 +636,13 @@ public class Editor extends javax.swing.JInternalFrame {
@Override
public void run() {
if (filedata == null && codeBox.getText().contains("//include ")) {
JOptionPane.showInternalMessageDialog(Main.mainPane,
"You must save this file before using file includes!",
"Save Required",
JOptionPane.WARNING_MESSAGE);
return;
}
setRunning(true);
execCode(lang);
setRunning(false);

@ -630,6 +630,7 @@ public class Functions {
info += "Java version: " + System.getProperty("java.version");
info += "\nJava vendor: " + System.getProperty("java.vendor");
info += "\nJava home: " + System.getProperty("java.home");
return info;
}

@ -26,12 +26,12 @@
<Group type="102" attributes="0">
<Component id="statusLabel" min="-2" pref="16" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="taskName" pref="258" max="32767" attributes="0"/>
<Component id="taskName" pref="136" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="menuBtn" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="taskDesc" max="32767" attributes="0"/>
<Component id="percentDone" alignment="0" max="32767" attributes="0"/>
<Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
@ -45,7 +45,7 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="percentDone" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="taskDesc" pref="47" max="32767" attributes="0"/>
<Component id="jScrollPane1" pref="72" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
@ -61,15 +61,6 @@
<Property name="text" type="java.lang.String" value="Unnamed task"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="taskDesc">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="net.apocalypselabs.symat.Main.ubuntuRegular.deriveFont(12.0F)" type="code"/>
</Property>
<Property name="text" type="java.lang.String" value="No description"/>
<Property name="verticalAlignment" type="int" value="1"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="menuBtn">
<Properties>
<Property name="text" type="java.lang.String" value="Menu"/>
@ -90,5 +81,26 @@
<Property name="stringPainted" type="boolean" value="true"/>
</Properties>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="taskDesc">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="1"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="net.apocalypselabs.symat.Main.ubuntuRegular.deriveFont(12.0F)" type="code"/>
</Property>
<Property name="lineWrap" type="boolean" value="true"/>
<Property name="rows" type="int" value="1"/>
<Property name="wrapStyleWord" type="boolean" value="true"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>

@ -109,10 +109,11 @@ public class Task extends javax.swing.JPanel {
private void initComponents() {
taskName = new javax.swing.JLabel();
taskDesc = new javax.swing.JLabel();
menuBtn = new javax.swing.JButton();
statusLabel = new javax.swing.JLabel();
percentDone = new javax.swing.JProgressBar();
jScrollPane1 = new javax.swing.JScrollPane();
taskDesc = new javax.swing.JTextArea();
setBorder(javax.swing.BorderFactory.createEtchedBorder());
@ -120,10 +121,6 @@ public class Task extends javax.swing.JPanel {
taskName.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
taskName.setText("Unnamed task");
taskDesc.setFont(net.apocalypselabs.symat.Main.ubuntuRegular.deriveFont(12.0F));
taskDesc.setText("No description");
taskDesc.setVerticalAlignment(javax.swing.SwingConstants.TOP);
menuBtn.setText("Menu");
menuBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
@ -135,6 +132,14 @@ public class Task extends javax.swing.JPanel {
percentDone.setStringPainted(true);
taskDesc.setEditable(false);
taskDesc.setColumns(1);
taskDesc.setFont(net.apocalypselabs.symat.Main.ubuntuRegular.deriveFont(12.0F));
taskDesc.setLineWrap(true);
taskDesc.setRows(1);
taskDesc.setWrapStyleWord(true);
jScrollPane1.setViewportView(taskDesc);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
@ -142,11 +147,11 @@ public class Task extends javax.swing.JPanel {
.addGroup(layout.createSequentialGroup()
.addComponent(statusLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(taskName, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)
.addComponent(taskName, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(menuBtn))
.addComponent(taskDesc, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(percentDone, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane1)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -158,7 +163,7 @@ public class Task extends javax.swing.JPanel {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(percentDone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(taskDesc, javax.swing.GroupLayout.DEFAULT_SIZE, 47, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE)
.addGap(0, 0, 0))
);
}// </editor-fold>//GEN-END:initComponents
@ -177,10 +182,11 @@ public class Task extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JButton menuBtn;
private javax.swing.JProgressBar percentDone;
private javax.swing.JLabel statusLabel;
private javax.swing.JLabel taskDesc;
private javax.swing.JTextArea taskDesc;
private javax.swing.JLabel taskName;
// End of variables declaration//GEN-END:variables
}

Loading…
Cancel
Save