[Pixelle-commit] SF.net SVN: pixelle:[245] trunk/pixelle/src/com/mebigfatguy/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2009-02-18 06:36:11
|
Revision: 245
http://pixelle.svn.sourceforge.net/pixelle/?rev=245&view=rev
Author: dbrosius
Date: 2009-02-18 06:36:09 +0000 (Wed, 18 Feb 2009)
Log Message:
-----------
implement multiple source image transformations
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java 2009-02-18 06:35:20 UTC (rev 244)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java 2009-02-18 06:36:09 UTC (rev 245)
@@ -52,7 +52,8 @@
d.setVisible(true);
if (d.isOK()) {
ImageType imageType = d.getImageType();
- PixelleTransformer transformer = new PixelleTransformer(new PixelleImage[] {frame.getImage()}, d.getAlgorithms(imageType), imageType, d.getOutputSize());
+ PixelleImage[] srcImages = d.getSourceImages();
+ PixelleTransformer transformer = new PixelleTransformer(srcImages, d.getAlgorithms(imageType), imageType, d.getOutputSize());
PixelleImage dstImage = transformer.transform();
if (dstImage != null) {
if (frame.createNewWindow()) {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2009-02-18 06:35:20 UTC (rev 244)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2009-02-18 06:36:09 UTC (rev 245)
@@ -60,6 +60,7 @@
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleComponent;
import com.mebigfatguy.pixelle.PixelleFrame;
+import com.mebigfatguy.pixelle.PixelleImage;
import com.mebigfatguy.pixelle.utils.GuiUtils;
import com.mebigfatguy.pixelle.utils.IntegerDocument;
import com.mebigfatguy.pixelle.utils.GuiUtils.Sizing;
@@ -115,6 +116,7 @@
JButton ok;
JButton cancel;
JButton reset;
+ SourcePanel sourcePanel;
JTextField selectedRGBAlgorithm;
JPopupMenu savedRGBAlgorithms;
JTextField selectedGSAlgorithm;
@@ -154,6 +156,10 @@
return new Point(Integer.parseInt(widthField.getText()), Integer.parseInt(heightField.getText()));
}
+ public PixelleImage[] getSourceImages() {
+ return sourcePanel.getSourceImages();
+ }
+
private void initComponents() {
Container cp = getContentPane();
@@ -166,7 +172,7 @@
cp.setLayout(new BorderLayout(4, 4));
- JPanel sourcePanel = new SourcePanel();
+ sourcePanel = new SourcePanel();
cp.add(sourcePanel, BorderLayout.NORTH);
JPanel centerPanel = new JPanel();
@@ -461,13 +467,23 @@
initListeners();
}
+ public PixelleImage[] getSourceImages() {
+ int imageCount = sourceModel.getColumnCount();
+ PixelleImage[] selectedImages = new PixelleImage[imageCount];
+ for (int i = 0; i < imageCount; i++) {
+ selectedImages[i] = ((PixelleFrame)sourceModel.getValueAt(i, 1)).getImage();
+ }
+
+ return selectedImages;
+ }
+
public void initComponents() {
setLayout(new BorderLayout(4, 4));
sourceModel = new DefaultTableModel();
sourceModel.addColumn(PixelleBundle.getString(PixelleBundle.SOURCES_NUMBER));
sourceModel.addColumn(PixelleBundle.getString(PixelleBundle.SOURCES_NAME));
- sourceModel.addRow(new Object[] { Integer.valueOf(0), frame.getTitle() });
+ sourceModel.addRow(new Object[] { Integer.valueOf(0), frame });
sourceTable = new JTable(sourceModel) {
@Override
public boolean isCellEditable(int row, int column) {
@@ -513,7 +529,7 @@
PixelleFrame frame = (PixelleFrame)JOptionPane.showInputDialog(SourcePanel.this, PixelleBundle.getString(PixelleBundle.PICK_SOURCE_LABEL), PixelleBundle.getString(PixelleBundle.TITLE), JOptionPane.QUESTION_MESSAGE, null, frames.toArray(new JFrame[frames.size()]), null);
if (frame != null) {
int id = sourceTable.getRowCount();
- sourceModel.addRow(new Object[] { Integer.valueOf(id), frame.getTitle() });
+ sourceModel.addRow(new Object[] { Integer.valueOf(id), frame });
}
}
});
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|