[Pixelle-commit] SF.net SVN: pixelle:[272] trunk/pixelle/src/com/mebigfatguy/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2009-07-18 03:59:09
|
Revision: 272
http://pixelle.svn.sourceforge.net/pixelle/?rev=272&view=rev
Author: dbrosius
Date: 2009-07-18 03:59:06 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
stub in a shortcuts menu
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-07-18 03:35:07 UTC (rev 271)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-07-18 03:59:06 UTC (rev 272)
@@ -101,7 +101,8 @@
public static final String SOURCES_NAME = "label.inputname";
public static final String OUTPUT_PROPERTIES = "label.output_properties";
public static final String PICK_SOURCE_LABEL = "label.pick_source";
-
+ public static final String SHORTCUTS = "label.shortcuts";
+
private static ResourceBundle rb = ResourceBundle.getBundle("com/mebigfatguy/pixelle/resources/pixelle");
private PixelleBundle()
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 03:35:07 UTC (rev 271)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 03:59:06 UTC (rev 272)
@@ -24,13 +24,19 @@
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JEditorPane;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -48,6 +54,8 @@
private JButton ok;
private JButton cancel;
private String origValue;
+ private JLabel shortcutTrigger;
+ private JPopupMenu shortcuts;
private boolean isOK = false;
public AlgorithmEditor(PixelleComponent component, Point pt, Dimension dim, String value) {
@@ -81,8 +89,18 @@
cancel = new JButton(PixelleBundle.getString(PixelleBundle.CANCEL));
GuiUtils.sizeUniformly(Sizing.Both, ok, cancel);
+ shortcutTrigger = new JLabel(PixelleBundle.getString(PixelleBundle.SHORTCUTS));
+ shortcutTrigger.setBorder(BorderFactory.createEtchedBorder());
+ shortcutTrigger.setEnabled(true);
+ shortcutTrigger.setOpaque(true);
+
+ shortcuts = buildShortCutsMenu();
+
JPanel p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
+ p.add(Box.createHorizontalStrut(20));
+ p.add(shortcutTrigger);
+ p.add(Box.createHorizontalStrut(10));
p.add(Box.createHorizontalGlue());
p.add(ok);
p.add(Box.createHorizontalStrut(10));
@@ -107,9 +125,36 @@
dispose();
}
});
+
+ shortcutTrigger.addMouseListener(new MouseAdapter() {
+ public void mousePressed(MouseEvent e) {
+ maybeShowPopup(e);
+ }
+
+ public void mouseReleased(MouseEvent e) {
+ maybeShowPopup(e);
+ }
+
+ private void maybeShowPopup(MouseEvent e) {
+ if (e.isPopupTrigger()) {
+ shortcuts.show(e.getComponent(), e.getX(), e.getY());
+ }
+ }
+
+
+ });
}
public String getText() {
return algo.getText();
}
+
+ private JPopupMenu buildShortCutsMenu()
+ {
+ JPopupMenu menu = new JPopupMenu(PixelleBundle.getString(PixelleBundle.SHORTCUTS));
+
+ menu.add(new JMenu("Positions"));
+
+ return menu;
+ }
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-07-18 03:35:07 UTC (rev 271)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-07-18 03:59:06 UTC (rev 272)
@@ -109,4 +109,5 @@
label.inputname = Input Source Name
label.output_properties = Output Properties
-label.pick_source = Select the input source window to use in the transformation
\ No newline at end of file
+label.pick_source = Select the input source window to use in the transformation
+label.shortcuts = ShortCuts
\ No newline at end of file
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties 2009-07-18 03:35:07 UTC (rev 271)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties 2009-07-18 03:59:06 UTC (rev 272)
@@ -109,4 +109,5 @@
label.inputname = Input Source Name
label.output_properties = Output-Eigenschaften
-label.pick_source = W\xE4hlen Sie die Eingangsquelle Fenster zur Verwendung in der Transformation
\ No newline at end of file
+label.pick_source = W\xE4hlen Sie die Eingangsquelle Fenster zur Verwendung in der Transformation
+label.shortcuts = Schnellzugriffe
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|