[Imagetools-commit] SF.net SVN: imagetools:[22] trunk/imagetools/src/net/codebuilders/desktop/ imag
Status: Beta
Brought to you by:
cmarcum
From: <cm...@us...> - 2009-04-18 17:05:46
|
Revision: 22 http://imagetools.svn.sourceforge.net/imagetools/?rev=22&view=rev Author: cmarcum Date: 2009-04-18 17:05:40 +0000 (Sat, 18 Apr 2009) Log Message: ----------- Added properties and variables for custom message icons Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-04-18 16:06:28 UTC (rev 21) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-04-18 17:05:40 UTC (rev 22) @@ -192,9 +192,10 @@ } }); + errorIcon = resourceMap.getIcon("message.error.icon"); + infoIcon = resourceMap.getIcon("message.info.icon"); + warningIcon = resourceMap.getIcon("message.warning.icon"); - - } // end constructor @Action @@ -789,8 +790,9 @@ * @param message the message to be presented */ public static void showError(String message) { + JOptionPane.showMessageDialog(null, message, "Image Tools", - JOptionPane.ERROR_MESSAGE); + JOptionPane.ERROR_MESSAGE, errorIcon); } /** @@ -800,9 +802,19 @@ */ public static void showInfo(String message) { JOptionPane.showMessageDialog(null, message, "Image Tools", - JOptionPane.INFORMATION_MESSAGE); + JOptionPane.INFORMATION_MESSAGE, infoIcon); } + /** + * Present an information message via a dialog box. + * + * @param message the message to be presented + */ + public static void showWarning(String message) { + JOptionPane.showMessageDialog(null, message, "Image Tools", + JOptionPane.WARNING_MESSAGE); + } + @Action public void showUsingBox() { if (usingBox == null) { @@ -1277,10 +1289,16 @@ private javax.swing.JButton undoButton; private javax.swing.JMenuItem usingMenuItem; // End of variables declaration//GEN-END:variables + + // more variables + private static Icon errorIcon; + private static Icon infoIcon; + private static Icon warningIcon; private final Timer messageTimer; private final Timer busyIconTimer; private final Icon idleIcon; private final Icon[] busyIcons = new Icon[15]; + private int busyIconIndex = 0; private JDialog aboutBox; private JDialog usingBox; @@ -1291,4 +1309,5 @@ private final JFileChooser imageChooser; // added to test new events 2009-03-20 private ImageToolsModel itModel; + } Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties 2009-04-18 16:06:28 UTC (rev 21) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties 2009-04-18 17:05:40 UTC (rev 22) @@ -124,3 +124,9 @@ showAboutBox.Action.largeIcon=/net/codebuilders/desktop/imagetools/resources/help24.png showAboutBox.Action.smallIcon=/net/codebuilders/desktop/imagetools/resources/help16.png showAboutBox.Action.icon=/net/codebuilders/desktop/imagetools/resources/help16.png +#error icon for showError +message.error.icon=/net/codebuilders/desktop/imagetools/resources/messagebox_critical24.png +#error icon for showInfo +message.info.icon=/net/codebuilders/desktop/imagetools/resources/messagebox_info24.png +#error icon for showWarning +message.warning.icon=/net/codebuilders/desktop/imagetools/resources/messagebox_warning24.png This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |