Change Pads "save" button to "download", no longer open save box on click
This commit is contained in:
parent
077a6281c6
commit
4959d53c85
@ -54,7 +54,6 @@ import java.awt.Graphics;
|
|||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.awt.event.KeyEvent;
|
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
@ -126,7 +125,7 @@ public class Main extends JRibbonFrame {
|
|||||||
public static boolean skipEditor = false; // Skip editor init on start?
|
public static boolean skipEditor = false; // Skip editor init on start?
|
||||||
|
|
||||||
private static boolean recentItemsMinimized = false;
|
private static boolean recentItemsMinimized = false;
|
||||||
|
|
||||||
public static boolean updateAvailable = false; // Update available?
|
public static boolean updateAvailable = false; // Update available?
|
||||||
public static String updateString = "";
|
public static String updateString = "";
|
||||||
|
|
||||||
@ -139,7 +138,7 @@ public class Main extends JRibbonFrame {
|
|||||||
* The http server that handles opening other instances.
|
* The http server that handles opening other instances.
|
||||||
*/
|
*/
|
||||||
public static SingleInstanceServer sisrv;
|
public static SingleInstanceServer sisrv;
|
||||||
|
|
||||||
public static Main maingui;
|
public static Main maingui;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -197,7 +196,7 @@ public class Main extends JRibbonFrame {
|
|||||||
licValid = true;
|
licValid = true;
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -240,7 +239,7 @@ public class Main extends JRibbonFrame {
|
|||||||
setExtendedState(MAXIMIZED_BOTH);
|
setExtendedState(MAXIMIZED_BOTH);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PrefStorage.getSetting("showrecent", "").equals("")) {
|
if (!PrefStorage.getSetting("showrecent", "").equals("")) {
|
||||||
recentItemsPanel.setVisible(false);
|
recentItemsPanel.setVisible(false);
|
||||||
}
|
}
|
||||||
@ -258,7 +257,7 @@ public class Main extends JRibbonFrame {
|
|||||||
JRibbonBand appsband = new JRibbonBand("Apps", null);
|
JRibbonBand appsband = new JRibbonBand("Apps", null);
|
||||||
JRibbonBand webband = new JRibbonBand("Community", null);
|
JRibbonBand webband = new JRibbonBand("Community", null);
|
||||||
JRibbonBand collabband = new JRibbonBand("Team", null);
|
JRibbonBand collabband = new JRibbonBand("Team", null);
|
||||||
|
|
||||||
RibbonApplicationMenuEntryPrimary helpbtn
|
RibbonApplicationMenuEntryPrimary helpbtn
|
||||||
= new RibbonApplicationMenuEntryPrimary(
|
= new RibbonApplicationMenuEntryPrimary(
|
||||||
getRibbonIcon("help"),
|
getRibbonIcon("help"),
|
||||||
@ -332,7 +331,7 @@ public class Main extends JRibbonFrame {
|
|||||||
loadFrame(new Settings());
|
loadFrame(new Settings());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
RibbonApplicationMenu menu = new RibbonApplicationMenu();
|
RibbonApplicationMenu menu = new RibbonApplicationMenu();
|
||||||
menu.addMenuEntry(newbtn);
|
menu.addMenuEntry(newbtn);
|
||||||
menu.addMenuSeparator();
|
menu.addMenuSeparator();
|
||||||
@ -341,7 +340,7 @@ public class Main extends JRibbonFrame {
|
|||||||
menu.addMenuSeparator();
|
menu.addMenuSeparator();
|
||||||
menu.addMenuEntry(exitbtn);
|
menu.addMenuEntry(exitbtn);
|
||||||
menu.addFooterEntry(displaybtn);
|
menu.addFooterEntry(displaybtn);
|
||||||
|
|
||||||
shellbtn.addActionListener(new ActionListener() {
|
shellbtn.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent evt) {
|
public void actionPerformed(ActionEvent evt) {
|
||||||
@ -388,7 +387,7 @@ public class Main extends JRibbonFrame {
|
|||||||
loadFrame(new Pads());
|
loadFrame(new Pads());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
shellbtn.setPopupKeyTip("Open a window "
|
shellbtn.setPopupKeyTip("Open a window "
|
||||||
+ "for running interactive commands.");
|
+ "for running interactive commands.");
|
||||||
editorbtn.setPopupKeyTip("Write and run multiple-line scripts.");
|
editorbtn.setPopupKeyTip("Write and run multiple-line scripts.");
|
||||||
@ -397,18 +396,18 @@ public class Main extends JRibbonFrame {
|
|||||||
wikibtn.setPopupKeyTip("View online documentation and tutorials.");
|
wikibtn.setPopupKeyTip("View online documentation and tutorials.");
|
||||||
forumbtn.setPopupKeyTip("Discuss and share with the SyMAT community.");
|
forumbtn.setPopupKeyTip("Discuss and share with the SyMAT community.");
|
||||||
padsbtn.setPopupKeyTip("Collaborate over the Internet on projects.");
|
padsbtn.setPopupKeyTip("Collaborate over the Internet on projects.");
|
||||||
|
|
||||||
coreband.addCommandButton(shellbtn, RibbonElementPriority.TOP);
|
coreband.addCommandButton(shellbtn, RibbonElementPriority.TOP);
|
||||||
coreband.addCommandButton(editorbtn, RibbonElementPriority.TOP);
|
coreband.addCommandButton(editorbtn, RibbonElementPriority.TOP);
|
||||||
|
|
||||||
appsband.addCommandButton(graphbtn, RibbonElementPriority.MEDIUM);
|
appsband.addCommandButton(graphbtn, RibbonElementPriority.MEDIUM);
|
||||||
appsband.addCommandButton(notepadbtn, RibbonElementPriority.MEDIUM);
|
appsband.addCommandButton(notepadbtn, RibbonElementPriority.MEDIUM);
|
||||||
|
|
||||||
webband.addCommandButton(wikibtn, RibbonElementPriority.LOW);
|
webband.addCommandButton(wikibtn, RibbonElementPriority.LOW);
|
||||||
webband.addCommandButton(forumbtn, RibbonElementPriority.LOW);
|
webband.addCommandButton(forumbtn, RibbonElementPriority.LOW);
|
||||||
|
|
||||||
collabband.addCommandButton(padsbtn, RibbonElementPriority.MEDIUM);
|
collabband.addCommandButton(padsbtn, RibbonElementPriority.MEDIUM);
|
||||||
|
|
||||||
coreband.setResizePolicies((List) Arrays.asList(
|
coreband.setResizePolicies((List) Arrays.asList(
|
||||||
new CoreRibbonResizePolicies.None(coreband.getControlPanel()),
|
new CoreRibbonResizePolicies.None(coreband.getControlPanel()),
|
||||||
new IconRibbonBandResizePolicy(coreband.getControlPanel())));
|
new IconRibbonBandResizePolicy(coreband.getControlPanel())));
|
||||||
@ -421,22 +420,22 @@ public class Main extends JRibbonFrame {
|
|||||||
collabband.setResizePolicies((List) Arrays.asList(
|
collabband.setResizePolicies((List) Arrays.asList(
|
||||||
new CoreRibbonResizePolicies.None(appsband.getControlPanel()),
|
new CoreRibbonResizePolicies.None(appsband.getControlPanel()),
|
||||||
new IconRibbonBandResizePolicy(appsband.getControlPanel())));
|
new IconRibbonBandResizePolicy(appsband.getControlPanel())));
|
||||||
|
|
||||||
RibbonTask hometask = new RibbonTask("Home", coreband, appsband);
|
RibbonTask hometask = new RibbonTask("Home", coreband, appsband);
|
||||||
RibbonTask webtask = new RibbonTask("Web", webband, collabband);
|
RibbonTask webtask = new RibbonTask("Web", webband, collabband);
|
||||||
|
|
||||||
ribbon.setApplicationMenu(menu);
|
ribbon.setApplicationMenu(menu);
|
||||||
|
|
||||||
ribbon.addTask(hometask);
|
ribbon.addTask(hometask);
|
||||||
ribbon.addTask(webtask);
|
ribbon.addTask(webtask);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResizableIcon getRibbonIcon(String name) {
|
public static ResizableIcon getRibbonIcon(String name) {
|
||||||
return ImageWrapperResizableIcon.getIcon(
|
return ImageWrapperResizableIcon.getIcon(
|
||||||
Main.class.getResource("images/" + name + ".png"),
|
Main.class.getResource("images/" + name + ".png"),
|
||||||
new Dimension(100, 76));
|
new Dimension(100, 76));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResizableIcon getTinyRibbonIcon(String name) {
|
public static ResizableIcon getTinyRibbonIcon(String name) {
|
||||||
int d = 32;
|
int d = 32;
|
||||||
if (name.endsWith("icon")) {
|
if (name.endsWith("icon")) {
|
||||||
@ -446,7 +445,7 @@ public class Main extends JRibbonFrame {
|
|||||||
Main.class.getResource("icons/" + name + ".png"),
|
Main.class.getResource("icons/" + name + ".png"),
|
||||||
new Dimension(d, d));
|
new Dimension(d, d));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void licenseRestrict(boolean restricted) {
|
public static void licenseRestrict(boolean restricted) {
|
||||||
graphbtn.setEnabled(!restricted);
|
graphbtn.setEnabled(!restricted);
|
||||||
padsbtn.setEnabled(!restricted);
|
padsbtn.setEnabled(!restricted);
|
||||||
@ -467,7 +466,7 @@ public class Main extends JRibbonFrame {
|
|||||||
mainPane.paintImmediately(0, 0,
|
mainPane.paintImmediately(0, 0,
|
||||||
mainPane.getWidth(), mainPane.getHeight());
|
mainPane.getWidth(), mainPane.getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadRecentFiles() {
|
public static void loadRecentFiles() {
|
||||||
String files = PrefStorage.getSetting("recentfiles");
|
String files = PrefStorage.getSetting("recentfiles");
|
||||||
if (files.equals("")) {
|
if (files.equals("")) {
|
||||||
@ -492,7 +491,7 @@ public class Main extends JRibbonFrame {
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
recentFileList.setListData(items);
|
recentFileList.setListData(items);
|
||||||
|
|
||||||
// Re-save list to remove bad entries
|
// Re-save list to remove bad entries
|
||||||
@ -502,7 +501,7 @@ public class Main extends JRibbonFrame {
|
|||||||
}
|
}
|
||||||
PrefStorage.saveSetting("recentfiles", list);
|
PrefStorage.saveSetting("recentfiles", list);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addRecentFile(String file) {
|
public static void addRecentFile(String file) {
|
||||||
file = (new File(file)).getAbsolutePath();
|
file = (new File(file)).getAbsolutePath();
|
||||||
String files = PrefStorage.getSetting("recentfiles");
|
String files = PrefStorage.getSetting("recentfiles");
|
||||||
@ -806,7 +805,7 @@ public class Main extends JRibbonFrame {
|
|||||||
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
|
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
|
||||||
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
|
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
|
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
|
||||||
if ("Nimbus".equals(info.getName())) {
|
if ("Nimbus".equals(info.getName())) {
|
||||||
@ -862,16 +861,16 @@ public class Main extends JRibbonFrame {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SingleInstanceClient sicli = new SingleInstanceClient(argfile);
|
SingleInstanceClient sicli = new SingleInstanceClient(argfile);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
new SingleInstanceServer().start();
|
new SingleInstanceServer().start();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Debug.printerr("Cannot start instance listener:\n\n");
|
Debug.printerr("Cannot start instance listener:\n\n");
|
||||||
Debug.stacktrace(ex);
|
Debug.stacktrace(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
Platform.setImplicitExit(false);
|
Platform.setImplicitExit(false);
|
||||||
|
|
||||||
/* Create and display the form */
|
/* Create and display the form */
|
||||||
@ -879,7 +878,7 @@ public class Main extends JRibbonFrame {
|
|||||||
new SplashScreen().setVisible(true);
|
new SplashScreen().setVisible(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JCommandButton shellbtn
|
public static JCommandButton shellbtn
|
||||||
= new JCommandButton("Shell", getRibbonIcon("shell"));
|
= new JCommandButton("Shell", getRibbonIcon("shell"));
|
||||||
public static JCommandButton editorbtn
|
public static JCommandButton editorbtn
|
||||||
|
@ -156,7 +156,7 @@
|
|||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="saveBtn">
|
<Component class="javax.swing.JButton" name="saveBtn">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Save"/>
|
<Property name="text" type="java.lang.String" value="Download"/>
|
||||||
<Property name="toolTipText" type="java.lang.String" value="Save pad locally"/>
|
<Property name="toolTipText" type="java.lang.String" value="Save pad locally"/>
|
||||||
<Property name="enabled" type="boolean" value="false"/>
|
<Property name="enabled" type="boolean" value="false"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
@ -351,7 +351,7 @@ public class Pads extends javax.swing.JInternalFrame {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
saveBtn.setText("Save");
|
saveBtn.setText("Download");
|
||||||
saveBtn.setToolTipText("Save pad locally");
|
saveBtn.setToolTipText("Save pad locally");
|
||||||
saveBtn.setEnabled(false);
|
saveBtn.setEnabled(false);
|
||||||
saveBtn.addActionListener(new java.awt.event.ActionListener() {
|
saveBtn.addActionListener(new java.awt.event.ActionListener() {
|
||||||
@ -484,7 +484,7 @@ public class Pads extends javax.swing.JInternalFrame {
|
|||||||
}//GEN-LAST:event_purgeBtnActionPerformed
|
}//GEN-LAST:event_purgeBtnActionPerformed
|
||||||
|
|
||||||
private void saveBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveBtnActionPerformed
|
private void saveBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveBtnActionPerformed
|
||||||
Main.loadFrame(new Editor(getPad(getSelectedPad()), true));
|
Main.loadFrame(new Editor(getPad(getSelectedPad()), false));
|
||||||
updateList();
|
updateList();
|
||||||
}//GEN-LAST:event_saveBtnActionPerformed
|
}//GEN-LAST:event_saveBtnActionPerformed
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user