Move ribbon icons into own package

master
skylarmt 10 years ago
parent e365efa3a7
commit 48509cf537

@ -87,10 +87,9 @@ public class CodeRunner {
this(lang);
isShell = shell;
}
/**
* Inits the Python engine.
*
* @param fakeInit Set it to true.
*/
public CodeRunner(boolean fakeInit) {

@ -34,23 +34,25 @@
<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="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" 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 type="102" alignment="0" attributes="0">
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -61,13 +63,14 @@
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="jPanel1" max="32767" attributes="0"/>
<Component id="jPanel2" max="32767" attributes="0"/>
<Component id="jPanel3" max="32767" attributes="0"/>
</Group>
<EmptySpace pref="29" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="21" 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>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace pref="15" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -207,5 +210,42 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelBtnActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JPanel" name="jPanel3">
<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="Editor"/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="advOptionsBox" min="-2" max="-2" attributes="0"/>
<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"/>
<Component id="advOptionsBox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JCheckBox" name="advOptionsBox">
<Properties>
<Property name="text" type="java.lang.String" value="Advanced Options"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>

@ -60,6 +60,8 @@ public class Display extends javax.swing.JInternalFrame {
jLabel1 = new javax.swing.JLabel();
saveBtn = new javax.swing.JButton();
cancelBtn = new javax.swing.JButton();
jPanel3 = new javax.swing.JPanel();
advOptionsBox = new javax.swing.JCheckBox();
setClosable(true);
setIconifiable(true);
@ -145,24 +147,47 @@ public class Display extends javax.swing.JInternalFrame {
}
});
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Editor"));
advOptionsBox.setText("Advanced Options");
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(advOptionsBox)
.addContainerGap())
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(advOptionsBox)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
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)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 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(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(saveBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -170,12 +195,13 @@ public class Display extends javax.swing.JInternalFrame {
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 29, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(21, 21, 21)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(saveBtn)
.addComponent(cancelBtn))
.addContainerGap())
.addContainerGap(15, Short.MAX_VALUE))
);
pack();
@ -200,9 +226,9 @@ public class Display extends javax.swing.JInternalFrame {
themeDark.setSelected(false);
}
}
// if (PrefStorage.isset("advancedcontrols")) {
// advOptionsBox.setSelected(true);
// }
if (PrefStorage.isset("advancedcontrols")) {
advOptionsBox.setSelected(true);
}
}//GEN-LAST:event_formComponentShown
private void saveBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveBtnActionPerformed
@ -212,28 +238,30 @@ public class Display extends javax.swing.JInternalFrame {
} else {
PrefStorage.saveSetting("theme", "light");
}
// if (advOptionsBox.isSelected()) {
// PrefStorage.saveSetting("advancedcontrols", "true");
// } else {
// PrefStorage.unset("advancedcontrols");
// }
if (advOptionsBox.isSelected()) {
PrefStorage.saveSetting("advancedcontrols", "true");
} else {
PrefStorage.unset("advancedcontrols");
}
if (!PrefStorage.save()) {
// Something dun goofed...
JOptionPane.showInternalMessageDialog(this,
JOptionPane.showInternalMessageDialog(this,
"Error: Problem occured while saving settings. "
+ "This error is outside the control of "
+ "the application.");
+ "This error is outside the control of "
+ "the application.");
}
MainGUI.updateDisplay();
dispose();
}//GEN-LAST:event_saveBtnActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JCheckBox advOptionsBox;
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.JPanel jPanel3;
private javax.swing.JButton saveBtn;
private javax.swing.JRadioButton themeDark;
private javax.swing.ButtonGroup themeGroup;

@ -51,20 +51,20 @@ public class Interpreter extends javax.swing.JInternalFrame {
*/
public Interpreter(String useLang) {
initComponents();
// Setup code runner
lang = useLang;
if (lang.equals("default")) {
lang = PrefStorage.getSetting("shellLang", "javascript");
}
cr = new CodeRunner(lang, true);
// Set selected lang menu
if (lang.equals("python")) {
javascriptMenu.setSelected(false);
pythonMenu.setSelected(true);
}
// Set font
int font_size = 12;
try {
@ -73,7 +73,7 @@ public class Interpreter extends javax.swing.JInternalFrame {
}
mainBox.setFont(new Font(Font.MONOSPACED, Font.PLAIN, font_size));
inputBox.setFont(new Font(Font.MONOSPACED, Font.PLAIN, font_size));
// Set theme
if (PrefStorage.getSetting("theme").equals("dark")) {
mainBox.setBackground(Color.BLACK);
@ -88,7 +88,7 @@ public class Interpreter extends javax.swing.JInternalFrame {
inputBox.setForeground(Color.BLACK);
setBackground(Color.LIGHT_GRAY);
}
// Misc. setup
mainBox.setText(">>");
inputBox.requestFocus();

@ -125,7 +125,7 @@
<Component class="javax.swing.JButton" name="shellBtn">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/shell.png"/>
<Image iconType="3" name="/net/apocalypselabs/symat/images/shell.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Shell"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
@ -145,7 +145,7 @@
<Component class="javax.swing.JButton" name="editorBtn">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/editor.png"/>
<Image iconType="3" name="/net/apocalypselabs/symat/images/editor.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Editor"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
@ -165,7 +165,7 @@
<Component class="javax.swing.JButton" name="graphBtn">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/graph.png"/>
<Image iconType="3" name="/net/apocalypselabs/symat/images/graph.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Graph"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
@ -233,7 +233,7 @@
<Component class="javax.swing.JButton" name="helpBtn">
<Properties>
<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/images/help.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Manual"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
@ -262,7 +262,7 @@
<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/cascade.png"/>
<Image iconType="3" name="/net/apocalypselabs/symat/images/cascade.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Cascade"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
@ -282,7 +282,7 @@
<Component class="javax.swing.JButton" name="closeAllBtn">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/closeall.png"/>
<Image iconType="3" name="/net/apocalypselabs/symat/images/closeall.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Close All"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
@ -344,7 +344,7 @@
<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"/>
<Image iconType="3" name="/net/apocalypselabs/symat/images/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">

@ -170,7 +170,7 @@ public class MainGUI extends javax.swing.JFrame {
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/images/shell.png"))); // NOI18N
shellBtn.setText("Shell");
shellBtn.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
shellBtn.setFocusable(false);
@ -183,7 +183,7 @@ public class MainGUI extends javax.swing.JFrame {
}
});
editorBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/editor.png"))); // NOI18N
editorBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/images/editor.png"))); // NOI18N
editorBtn.setText("Editor");
editorBtn.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
editorBtn.setFocusable(false);
@ -196,7 +196,7 @@ public class MainGUI extends javax.swing.JFrame {
}
});
graphBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/graph.png"))); // NOI18N
graphBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/images/graph.png"))); // NOI18N
graphBtn.setText("Graph");
graphBtn.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
graphBtn.setFocusable(false);
@ -242,7 +242,7 @@ public class MainGUI extends javax.swing.JFrame {
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/images/help.png"))); // NOI18N
helpBtn.setText("Manual");
helpBtn.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
helpBtn.setFocusable(false);
@ -259,7 +259,7 @@ public class MainGUI extends javax.swing.JFrame {
jLabel3.setText(namemark());
jLabel3.setFocusable(false);
arrangeWindowsBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/cascade.png"))); // NOI18N
arrangeWindowsBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/images/cascade.png"))); // NOI18N
arrangeWindowsBtn.setText("Cascade");
arrangeWindowsBtn.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
arrangeWindowsBtn.setFocusable(false);
@ -272,7 +272,7 @@ public class MainGUI extends javax.swing.JFrame {
}
});
closeAllBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/closeall.png"))); // NOI18N
closeAllBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/images/closeall.png"))); // NOI18N
closeAllBtn.setText("Close All");
closeAllBtn.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
closeAllBtn.setFocusable(false);
@ -315,7 +315,7 @@ public class MainGUI extends javax.swing.JFrame {
jLabel4.setText(namemark());
jLabel4.setFocusable(false);
displaySettingsBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/display.png"))); // NOI18N
displaySettingsBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/images/display.png"))); // NOI18N
displaySettingsBtn.setText("Display");
displaySettingsBtn.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
displaySettingsBtn.setFocusable(false);
@ -494,6 +494,7 @@ public class MainGUI extends javax.swing.JFrame {
//</editor-fold>
//</editor-fold>
// Command line args
for (String arg : args) {
if (arg.equals("skippython")) {
@ -502,7 +503,7 @@ public class MainGUI extends javax.swing.JFrame {
argfile = args[0];
}
}
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
@Override

@ -45,7 +45,7 @@ public class PrefStorage {
public static boolean isset(String key) {
return !getSetting(key, "NULL").equals("NULL");
}
public static void unset(String key) {
prefs.remove(key);
}
@ -57,7 +57,7 @@ public class PrefStorage {
public static String getSetting(String key, String emptyResponse) {
return prefs.get(key, emptyResponse);
}
public static boolean save() {
try {
prefs.flush();

Before

Width:  |  Height:  |  Size: 920 B

After

Width:  |  Height:  |  Size: 920 B

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Before

Width:  |  Height:  |  Size: 972 B

After

Width:  |  Height:  |  Size: 972 B

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Loading…
Cancel
Save