[Pixelle-commit] SF.net SVN: pixelle:[173] trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs /Pixe
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-11-14 05:18:03
|
Revision: 173
http://pixelle.svn.sourceforge.net/pixelle/?rev=173&view=rev
Author: dbrosius
Date: 2008-11-14 05:17:58 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
save the current algorithm
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-11-14 04:51:08 UTC (rev 172)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-11-14 05:17:58 UTC (rev 173)
@@ -21,6 +21,8 @@
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.GridLayout;
+import java.awt.Menu;
+import java.awt.MenuItem;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@@ -40,6 +42,7 @@
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JTextField;
+import javax.swing.MenuElement;
import com.mebigfatguy.pixelle.AlgorithmArchiver;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -52,6 +55,7 @@
private static final long serialVersionUID = -420573137466431577L;
private static final int NUM_LABELS = 5;
+ private static final String CURRENT = "current_";
private final JLabel lhs[] =
{
@@ -149,6 +153,18 @@
editor[4].setText(algorithms.get(PixelleComponent.SELECTION));
}
});
+ try {
+ Map<PixelleComponent, String> algorithms = AlgorithmArchiver.getArchiver().getAlgorithm(CURRENT, CURRENT);
+ if (algorithms != null) {
+ editor[0].setText(algorithms.get(PixelleComponent.RED));
+ editor[1].setText(algorithms.get(PixelleComponent.GREEN));
+ editor[2].setText(algorithms.get(PixelleComponent.BLUE));
+ editor[3].setText(algorithms.get(PixelleComponent.TRANSPARENCY));
+ editor[4].setText(algorithms.get(PixelleComponent.SELECTION));
+ }
+ } catch (IllegalArgumentException iae) {
+ }
+
savedAlgorithms.setInvoker(selectedAlgorithm);
optionsPanel.add(savedAlgorithms);
optionsPanel.add(Box.createHorizontalGlue());
@@ -230,6 +246,11 @@
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
+ Map<PixelleComponent, String> algorithm = getAlgorithms();
+ AlgorithmArchiver archiver = AlgorithmArchiver.getArchiver();
+ archiver.addAlgorithm(CURRENT, CURRENT, algorithm);
+ archiver.save();
+
clickedOK = true;
dispose();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|