[Pixelle-commit] SF.net SVN: pixelle:[279] trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs /Algor
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2009-07-18 19:24:35
|
Revision: 279
http://pixelle.svn.sourceforge.net/pixelle/?rev=279&view=rev
Author: dbrosius
Date: 2009-07-18 19:24:34 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
add operators to the menu
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 19:12:30 UTC (rev 278)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 19:24:34 UTC (rev 279)
@@ -178,6 +178,39 @@
posMenu.add(centerYItem);
shortcuts.add(posMenu);
+ JMenu operatorMenu = new JMenu(PixelleBundle.getString(PixelleBundle.OPERATORS));
+ JMenuItem andItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.AND));
+ JMenuItem orItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.OR));
+ JMenuItem trinaryItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.TRINARY));
+ JMenuItem equalsItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.EQUALS));
+ JMenuItem notEqualsItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.NOTEQUALS));
+ JMenuItem lessThanOrEqualsItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.LESS_THAN_OR_EQUALS));
+ JMenuItem greaterThanOrEqualsItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.GREATER_THAN_OR_QEUALS));
+ JMenuItem lessThanItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.LESS_THAN));
+ JMenuItem greaterThanItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.GREATER_THAN));
+ JMenuItem multiplyItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.MULTIPLY));
+ JMenuItem divideItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.DIVIDE));
+ JMenuItem addItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.ADD));
+ JMenuItem subtractItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.SUBTRACT));
+ JMenuItem notItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.NOT));
+
+ operatorMenu.add(andItem);
+ operatorMenu.add(orItem);
+ operatorMenu.add(trinaryItem);
+ operatorMenu.add(equalsItem);
+ operatorMenu.add(notEqualsItem);
+ operatorMenu.add(lessThanOrEqualsItem);
+ operatorMenu.add(greaterThanOrEqualsItem);
+ operatorMenu.add(lessThanItem);
+ operatorMenu.add(greaterThanItem);
+ operatorMenu.add(multiplyItem);
+ operatorMenu.add(divideItem);
+ operatorMenu.add(addItem);
+ operatorMenu.add(subtractItem);
+ operatorMenu.add(notItem);
+
+ shortcuts.add(operatorMenu);
+
addSimpleShortCutListener(redSpecItem, "p[x,y].r");
addSimpleShortCutListener(greenSpecItem, "p[x,y].g");
addSimpleShortCutListener(blueSpecItem, "p[x,y].b");
@@ -191,6 +224,21 @@
addSimpleShortCutListener(bottomItem, "height");
addSimpleShortCutListener(centerXItem, "(width/2)");
addSimpleShortCutListener(centerYItem, "(height/2)");
+
+ addSimpleShortCutListener(andItem, " && ");
+ addSimpleShortCutListener(orItem, " || ");
+ addSimpleShortCutListener(trinaryItem, " ? ");
+ addSimpleShortCutListener(equalsItem, " == ");
+ addSimpleShortCutListener(notEqualsItem, " != ");
+ addSimpleShortCutListener(lessThanOrEqualsItem, " <= ");
+ addSimpleShortCutListener(greaterThanOrEqualsItem, " >= ");
+ addSimpleShortCutListener(lessThanItem, " < ");
+ addSimpleShortCutListener(greaterThanItem, " > ");
+ addSimpleShortCutListener(multiplyItem, " * ");
+ addSimpleShortCutListener(divideItem, " / ");
+ addSimpleShortCutListener(addItem, " + ");
+ addSimpleShortCutListener(subtractItem, " - ");
+ addSimpleShortCutListener(notItem, " !");
}
private void addSimpleShortCutListener(JMenuItem mi, final String sc) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|