Fix null pointer Editor bug, allow longer task descriptions
This commit is contained in:
parent
ac497ec61d
commit
74af279f0a
@ -636,6 +636,13 @@ public class Editor extends javax.swing.JInternalFrame {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
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);
|
setRunning(true);
|
||||||
execCode(lang);
|
execCode(lang);
|
||||||
setRunning(false);
|
setRunning(false);
|
||||||
|
@ -630,6 +630,7 @@ public class Functions {
|
|||||||
info += "Java version: " + System.getProperty("java.version");
|
info += "Java version: " + System.getProperty("java.version");
|
||||||
info += "\nJava vendor: " + System.getProperty("java.vendor");
|
info += "\nJava vendor: " + System.getProperty("java.vendor");
|
||||||
info += "\nJava home: " + System.getProperty("java.home");
|
info += "\nJava home: " + System.getProperty("java.home");
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,12 +26,12 @@
|
|||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<Component id="statusLabel" min="-2" pref="16" max="-2" attributes="0"/>
|
<Component id="statusLabel" min="-2" pref="16" max="-2" attributes="0"/>
|
||||||
<EmptySpace 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"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="menuBtn" min="-2" max="-2" attributes="0"/>
|
<Component id="menuBtn" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<Component id="taskDesc" max="32767" attributes="0"/>
|
|
||||||
<Component id="percentDone" alignment="0" max="32767" attributes="0"/>
|
<Component id="percentDone" alignment="0" max="32767" attributes="0"/>
|
||||||
|
<Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
@ -45,7 +45,7 @@
|
|||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="percentDone" min="-2" max="-2" attributes="0"/>
|
<Component id="percentDone" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace 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"/>
|
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
@ -61,15 +61,6 @@
|
|||||||
<Property name="text" type="java.lang.String" value="Unnamed task"/>
|
<Property name="text" type="java.lang.String" value="Unnamed task"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</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">
|
<Component class="javax.swing.JButton" name="menuBtn">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Menu"/>
|
<Property name="text" type="java.lang.String" value="Menu"/>
|
||||||
@ -90,5 +81,26 @@
|
|||||||
<Property name="stringPainted" type="boolean" value="true"/>
|
<Property name="stringPainted" type="boolean" value="true"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</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>
|
</SubComponents>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -109,10 +109,11 @@ public class Task extends javax.swing.JPanel {
|
|||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
|
||||||
taskName = new javax.swing.JLabel();
|
taskName = new javax.swing.JLabel();
|
||||||
taskDesc = new javax.swing.JLabel();
|
|
||||||
menuBtn = new javax.swing.JButton();
|
menuBtn = new javax.swing.JButton();
|
||||||
statusLabel = new javax.swing.JLabel();
|
statusLabel = new javax.swing.JLabel();
|
||||||
percentDone = new javax.swing.JProgressBar();
|
percentDone = new javax.swing.JProgressBar();
|
||||||
|
jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
|
taskDesc = new javax.swing.JTextArea();
|
||||||
|
|
||||||
setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||||
|
|
||||||
@ -120,10 +121,6 @@ public class Task extends javax.swing.JPanel {
|
|||||||
taskName.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
taskName.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||||
taskName.setText("Unnamed task");
|
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.setText("Menu");
|
||||||
menuBtn.addActionListener(new java.awt.event.ActionListener() {
|
menuBtn.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
@ -135,6 +132,14 @@ public class Task extends javax.swing.JPanel {
|
|||||||
|
|
||||||
percentDone.setStringPainted(true);
|
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);
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||||
this.setLayout(layout);
|
this.setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
@ -142,11 +147,11 @@ public class Task extends javax.swing.JPanel {
|
|||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(statusLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(statusLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.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)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(menuBtn))
|
.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(percentDone, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addComponent(jScrollPane1)
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
@ -158,7 +163,7 @@ public class Task extends javax.swing.JPanel {
|
|||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(percentDone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(percentDone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.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))
|
.addGap(0, 0, 0))
|
||||||
);
|
);
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
@ -177,10 +182,11 @@ public class Task extends javax.swing.JPanel {
|
|||||||
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
private javax.swing.JButton menuBtn;
|
private javax.swing.JButton menuBtn;
|
||||||
private javax.swing.JProgressBar percentDone;
|
private javax.swing.JProgressBar percentDone;
|
||||||
private javax.swing.JLabel statusLabel;
|
private javax.swing.JLabel statusLabel;
|
||||||
private javax.swing.JLabel taskDesc;
|
private javax.swing.JTextArea taskDesc;
|
||||||
private javax.swing.JLabel taskName;
|
private javax.swing.JLabel taskName;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user