[Pixelle-commit] SF.net SVN: pixelle: [130] trunk/pixelle/src/com/mebigfatguy/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-07-04 04:23:21
|
Revision: 130
http://pixelle.svn.sourceforge.net/pixelle/?rev=130&view=rev
Author: dbrosius
Date: 2008-07-03 21:23:19 -0700 (Thu, 03 Jul 2008)
Log Message:
-----------
add accelerators and default buttons
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/CloseFileAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/NewFileAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/PrintAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/QuitAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/ZoomAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/CloseFileAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/CloseFileAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/CloseFileAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -21,6 +21,7 @@
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.FrameMgr;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -33,6 +34,7 @@
public CloseFileAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.CLOSE_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('W', ActionEvent.CTRL_MASK));
frame = pf;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/NewFileAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/NewFileAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/NewFileAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -22,6 +22,7 @@
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.FrameMgr;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -36,6 +37,7 @@
public NewFileAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.NEW_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('N', ActionEvent.CTRL_MASK));
frame = pf;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -25,6 +25,7 @@
import javax.imageio.ImageIO;
import javax.swing.AbstractAction;
import javax.swing.JFileChooser;
+import javax.swing.KeyStroke;
import javax.swing.filechooser.FileFilter;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -38,6 +39,7 @@
public OpenFileAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.OPEN_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('O', ActionEvent.CTRL_MASK));
frame = pf;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -21,6 +21,7 @@
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleEvalFactory;
@@ -35,6 +36,7 @@
public OptionsAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.OPTIONS_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('O', ActionEvent.SHIFT_MASK | ActionEvent.CTRL_MASK));
frame = pf;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/PrintAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/PrintAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/PrintAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -21,6 +21,7 @@
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
@@ -31,6 +32,7 @@
public PrintAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.PRINT_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('P', ActionEvent.CTRL_MASK));
}
public void actionPerformed(ActionEvent e) {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/QuitAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/QuitAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/QuitAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -23,6 +23,7 @@
import javax.swing.AbstractAction;
import javax.swing.JFrame;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.FrameMgr;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -33,6 +34,7 @@
public QuitAction() {
super(PixelleBundle.getString(PixelleBundle.QUIT_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('Q', ActionEvent.CTRL_MASK));
}
public void actionPerformed(ActionEvent e) {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -25,6 +25,7 @@
import javax.imageio.ImageIO;
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
@@ -38,6 +39,7 @@
public SaveFileAction(PixelleFrame pf, SaveFileAsAction action) {
super(PixelleBundle.getString(PixelleBundle.SAVE_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('S', ActionEvent.CTRL_MASK));
frame = pf;
saveAsAction = action;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -28,6 +28,7 @@
import javax.swing.AbstractAction;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
+import javax.swing.KeyStroke;
import javax.swing.filechooser.FileFilter;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -41,6 +42,7 @@
public SaveFileAsAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.SAVEAS_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('A', ActionEvent.CTRL_MASK));
frame = pf;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -22,6 +22,7 @@
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
@@ -37,6 +38,7 @@
public TransformAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.TRANSFORM_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('T', ActionEvent.CTRL_MASK));
frame = pf;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -21,6 +21,7 @@
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
@@ -32,6 +33,7 @@
public TransformNewWindowAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.TRANSFORM_NEW_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('W', ActionEvent.SHIFT_MASK | ActionEvent.CTRL_MASK));
frame = pf;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/ZoomAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/ZoomAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/ZoomAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -21,6 +21,7 @@
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
@@ -34,6 +35,7 @@
public ZoomAction(PixelleFrame pf, ZoomLevel level) {
super(PixelleBundle.getString(level.getKey()));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('Z', ActionEvent.CTRL_MASK));
frame = pf;
zoom = level;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -139,6 +139,8 @@
}
private void initListeners() {
+ getRootPane().setDefaultButton(ok);
+
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
clickedOK = true;
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -204,6 +204,8 @@
}
private void initListeners() {
+ getRootPane().setDefaultButton(ok);
+
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
okClicked = true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|