[Pixelle-commit] SF.net SVN: pixelle:[238] trunk/pixelle/src/com/mebigfatguy/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2009-02-17 06:10:08
|
Revision: 238
http://pixelle.svn.sourceforge.net/pixelle/?rev=238&view=rev
Author: dbrosius
Date: 2009-02-17 06:10:05 +0000 (Tue, 17 Feb 2009)
Log Message:
-----------
start stubbing in picking multiple input sources for the transformation dialog
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:03:24 UTC (rev 237)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-02-17 06:10:05 UTC (rev 238)
@@ -91,6 +91,10 @@
public static final String GRAYSCALE = "label.grayscale";
public static final String WIDTH ="label.width";
public static final String HEIGHT = "label.height";
+ 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";
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:03:24 UTC (rev 237)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2009-02-17 06:10:05 UTC (rev 238)
@@ -296,6 +296,17 @@
}
}
+ @Override
+ public String getTitle() {
+ String title;
+ if (imageFile == null)
+ title = PixelleBundle.getString(PixelleBundle.UNTITLED);
+ else
+ title = imageFile.getName();
+
+ return title;
+ }
+
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:03:24 UTC (rev 237)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2009-02-17 06:10:05 UTC (rev 238)
@@ -20,6 +20,7 @@
import java.awt.BorderLayout;
import java.awt.Container;
+import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Point;
import java.awt.event.ActionEvent;
@@ -33,6 +34,8 @@
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
@@ -41,9 +44,14 @@
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
+import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
+import javax.swing.JTable;
import javax.swing.JTextField;
-import javax.swing.border.EtchedBorder;
+import javax.swing.ListSelectionModel;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableColumn;
+import javax.swing.table.TableColumnModel;
import com.mebigfatguy.pixelle.AlgorithmArchiver;
import com.mebigfatguy.pixelle.ImageType;
@@ -156,10 +164,15 @@
cp.setLayout(new BorderLayout(4, 4));
+ JPanel sourcePanel = new SourcePanel();
+ cp.add(sourcePanel, BorderLayout.NORTH);
+
JPanel centerPanel = new JPanel();
centerPanel.setLayout(new BorderLayout(4, 4));
cp.add(centerPanel, BorderLayout.CENTER);
+ centerPanel.setBorder(BorderFactory.createTitledBorder(PixelleBundle.getString(PixelleBundle.PIXEL_ALGORITHMS)));
+
tabbedPane = new JTabbedPane();
centerPanel.add(tabbedPane, BorderLayout.CENTER);
@@ -176,6 +189,7 @@
private JPanel buildSizingPanel() {
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
+ panel.setBorder(BorderFactory.createTitledBorder(PixelleBundle.getString(PixelleBundle.OUTPUT_PROPERTIES)));
JLabel wl = new JLabel(PixelleBundle.getString(PixelleBundle.WIDTH));
JLabel hl = new JLabel(PixelleBundle.getString(PixelleBundle.HEIGHT));
@@ -201,9 +215,6 @@
panel.add(heightField);
panel.add(Box.createHorizontalGlue());
- panel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED),
- BorderFactory.createEmptyBorder(5, 2, 5, 2)));
-
return panel;
}
@@ -433,4 +444,68 @@
});
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
+
+ class SourcePanel extends JPanel
+ {
+ private static final String PLUS_ICON = "/com/mebigfatguy/pixelle/resources/plus.png";
+ private static final String MINUS_ICON = "/com/mebigfatguy/pixelle/resources/minus.png";
+ JTable sourceTable;
+ DefaultTableModel sourceModel;
+ JButton addButton;
+ JButton removeButton;
+
+ public SourcePanel() {
+ initComponents();
+ initListeners();
+ }
+
+ 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() });
+ sourceTable = new JTable(sourceModel) {
+ @Override
+ public boolean isCellEditable(int row, int column) {
+ return false;
+ }
+ };
+ ListSelectionModel selectionModel = sourceTable.getSelectionModel();
+ selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+
+ TableColumnModel columnModel = sourceTable.getColumnModel();
+ TableColumn column = columnModel.getColumn(0);
+ column.setMaxWidth(50);
+ JScrollPane scroller = new JScrollPane(sourceTable);
+ Dimension d = scroller.getPreferredSize();
+ d.setSize(d.width, sourceTable.getRowHeight() * 5);
+ scroller.setMaximumSize(d);
+ scroller.setPreferredSize(d);
+ add(scroller, BorderLayout.CENTER);
+
+ JPanel ctlPanel = new JPanel();
+ ctlPanel.setLayout(new BoxLayout(ctlPanel, BoxLayout.Y_AXIS));
+ Icon plus = new ImageIcon(SourcePanel.class.getResource(PLUS_ICON));
+ Icon minus = new ImageIcon(SourcePanel.class.getResource(MINUS_ICON));
+ addButton = new JButton(plus);
+ removeButton = new JButton(minus);
+ d = new Dimension(plus.getIconWidth(), plus.getIconHeight());
+ addButton.setPreferredSize(d);
+ removeButton.setPreferredSize(d);
+ ctlPanel.add(Box.createVerticalGlue());
+ ctlPanel.add(addButton);
+ ctlPanel.add(Box.createVerticalStrut(10));
+ ctlPanel.add(removeButton);
+ ctlPanel.add(Box.createVerticalGlue());
+ add(ctlPanel, BorderLayout.EAST);
+
+ setBorder(BorderFactory.createTitledBorder(PixelleBundle.getString(PixelleBundle.SOURCES_LABEL)));
+ }
+
+ public void initListeners() {
+
+ }
+ }
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-02-17 06:03:24 UTC (rev 237)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-02-17 06:10:05 UTC (rev 238)
@@ -1,5 +1,5 @@
# * pixelle - Graphics algorithmic editor
-# * Copyright (C) 2008 Dave Brosius
+# * Copyright (C) 2008-2009 Dave Brosius
# *
# * This library is free software; you can redistribute it and/or
# * modify it under the terms of the GNU Lesser General Public
@@ -95,4 +95,10 @@
label.grayscale = Gray scale
label.width = Width
-label.height = Height
\ No newline at end of file
+label.height = Height
+
+label.sources = Transformation Input Sources
+label.inputnumber = Index
+label.inputname = Input Source Name
+
+label.outputproperties = Output Properties
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|