[Pixelle-commit] SF.net SVN: pixelle:[240] trunk/pixelle/src/com/mebigfatguy/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2009-02-18 06:16:59
|
Revision: 240
http://pixelle.svn.sourceforge.net/pixelle/?rev=240&view=rev
Author: dbrosius
Date: 2009-02-18 06:16:56 +0000 (Wed, 18 Feb 2009)
Log Message:
-----------
Hook up add remove controls
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-02-17 06:14:27 UTC (rev 239)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-02-18 06:16:56 UTC (rev 240)
@@ -94,7 +94,8 @@
public static final String SOURCES_LABEL = "label.sources";
public static final String SOURCES_NUMBER = "label.inputnumber";
public static final String SOURCES_NAME = "label.inputname";
- public static final String OUTPUT_PROPERTIES = "label.outputproperties";
+ public static final String OUTPUT_PROPERTIES = "label.output_properties";
+ public static final String PICK_SOURCE_LABEL = "label.pick_source";
private static ResourceBundle rb = ResourceBundle.getBundle("com/mebigfatguy/pixelle/resources/pixelle");
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2009-02-17 06:14:27 UTC (rev 239)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2009-02-18 06:16:56 UTC (rev 240)
@@ -310,6 +310,11 @@
return title + " [" + pixelleFrameId + "]";
}
+ @Override
+ public String toString() {
+ return getTitle();
+ }
+
public class ImagePanel extends JPanel {
private static final long serialVersionUID = 1004811680136095184L;
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2009-02-17 06:14:27 UTC (rev 239)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2009-02-18 06:16:56 UTC (rev 240)
@@ -42,6 +42,7 @@
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
@@ -54,6 +55,7 @@
import javax.swing.table.TableColumnModel;
import com.mebigfatguy.pixelle.AlgorithmArchiver;
+import com.mebigfatguy.pixelle.FrameMgr;
import com.mebigfatguy.pixelle.ImageType;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleComponent;
@@ -505,7 +507,27 @@
}
public void initListeners() {
+ addButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent ae) {
+ Set<JFrame> frames = FrameMgr.getInstance().getFrames();
+ 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);
+ int id = sourceTable.getRowCount();
+ sourceModel.addRow(new Object[] { id, frame.getTitle() });
+ }
+ });
+ removeButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent ae) {
+ int[] selRows = sourceTable.getSelectedRows();
+ for (int i = selRows.length - 1; i >= 0; i--) {
+ sourceModel.removeRow(selRows[i]);
+ }
+ int numRows = sourceTable.getRowCount();
+ for (int i = 0; i < numRows; i++) {
+ sourceModel.setValueAt(String.valueOf(i), i, 0);
+ }
+ }
+ });
}
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-02-17 06:14:27 UTC (rev 239)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-02-18 06:16:56 UTC (rev 240)
@@ -101,4 +101,5 @@
label.inputnumber = Index
label.inputname = Input Source Name
-label.outputproperties = Output Properties
\ No newline at end of file
+label.output_properties = Output Properties
+label.pick_source = Select the input source window to use in the transformation
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|