[Pixelle-commit] SF.net SVN: pixelle:[218] trunk/pixelle/src/com/mebigfatguy/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-11-22 01:59:13
|
Revision: 218
http://pixelle.svn.sourceforge.net/pixelle/?rev=218&view=rev
Author: dbrosius
Date: 2008-11-22 01:59:03 +0000 (Sat, 22 Nov 2008)
Log Message:
-----------
put in output sizing controls in the transform dialog (not hooked up yet)
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.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 2008-11-22 01:56:50 UTC (rev 217)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-11-22 01:59:03 UTC (rev 218)
@@ -89,6 +89,8 @@
public static final String INSPECTOR_TOOLTIP = "tooltip.inspector";
public static final String RGB = "label.rgb";
public static final String GRAYSCALE = "label.grayscale";
+ public static final String WIDTH ="label.width";
+ public static final String HEIGHT = "label.height";
private static ResourceBundle rb = ResourceBundle.getBundle("com/mebigfatguy/pixelle/resources/pixelle");
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-11-22 01:56:50 UTC (rev 217)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-11-22 01:59:03 UTC (rev 218)
@@ -21,6 +21,7 @@
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.GridLayout;
+import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@@ -41,6 +42,7 @@
import javax.swing.JPopupMenu;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
+import javax.swing.border.EtchedBorder;
import com.mebigfatguy.pixelle.AlgorithmArchiver;
import com.mebigfatguy.pixelle.ImageType;
@@ -48,6 +50,8 @@
import com.mebigfatguy.pixelle.PixelleComponent;
import com.mebigfatguy.pixelle.PixelleFrame;
import com.mebigfatguy.pixelle.utils.GuiUtils;
+import com.mebigfatguy.pixelle.utils.IntegerDocument;
+import com.mebigfatguy.pixelle.utils.GuiUtils.Sizing;
public class PixelleExpressionDialog extends JDialog {
@@ -105,6 +109,8 @@
JTextField selectedGSAlgorithm;
JPopupMenu savedGSAlgorithms;
JTabbedPane tabbedPane;
+ JTextField widthField;
+ JTextField heightField;
JButton save;
JButton delete;
@@ -133,6 +139,10 @@
return algorithms;
}
+ public Point getOutputSize() {
+ return new Point(Integer.parseInt(widthField.getText()), Integer.parseInt(heightField.getText()));
+ }
+
private void initComponents() {
Container cp = getContentPane();
@@ -145,33 +155,76 @@
cp.setLayout(new BorderLayout(4, 4));
+ JPanel centerPanel = new JPanel();
+ centerPanel.setLayout(new BorderLayout(4, 4));
+ cp.add(centerPanel, BorderLayout.CENTER);
+
tabbedPane = new JTabbedPane();
- cp.add(tabbedPane, BorderLayout.CENTER);
+ centerPanel.add(tabbedPane, BorderLayout.CENTER);
tabbedPane.add(PixelleBundle.getString(PixelleBundle.RGB), buildRGBPane());
tabbedPane.add(PixelleBundle.getString(PixelleBundle.GRAYSCALE), buildGrayscalePanel());
- {
- JPanel ctlPanel = new JPanel();
- ctlPanel.setLayout(new BoxLayout(ctlPanel, BoxLayout.X_AXIS));
- ctlPanel.add(Box.createHorizontalStrut(10));
- ctlPanel.add(reset);
- ctlPanel.add(Box.createHorizontalStrut(10));
- ctlPanel.add(save);
- ctlPanel.add(Box.createHorizontalStrut(10));
- ctlPanel.add(delete);
- ctlPanel.add(Box.createHorizontalGlue());
- ctlPanel.add(ok);
- ctlPanel.add(Box.createHorizontalStrut(10));
- ctlPanel.add(cancel);
- ctlPanel.add(Box.createHorizontalStrut(10));
- ctlPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
- cp.add(ctlPanel, BorderLayout.SOUTH);
- }
+ centerPanel.add(buildSizingPanel(), BorderLayout.SOUTH);
+ cp.add(buildCtrlPanel(), BorderLayout.SOUTH);
+
pack();
}
+ private JPanel buildSizingPanel() {
+ JPanel panel = new JPanel();
+ panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
+
+ JLabel wl = new JLabel(PixelleBundle.getString(PixelleBundle.WIDTH));
+ JLabel hl = new JLabel(PixelleBundle.getString(PixelleBundle.HEIGHT));
+ GuiUtils.sizeUniformly(Sizing.Both, wl, hl);
+
+ widthField = new JTextField(new IntegerDocument(), "", 6);
+ heightField = new JTextField(new IntegerDocument(), "", 6);
+ GuiUtils.sizeUniformly(Sizing.Both, widthField, heightField);
+
+ wl.setLabelFor(widthField);
+ hl.setLabelFor(heightField);
+
+ widthField.setText(String.valueOf(frame.getImage().getWidth()));
+ heightField.setText(String.valueOf(frame.getImage().getHeight()));
+
+ panel.add(Box.createHorizontalStrut(20));
+ panel.add(wl);
+ panel.add(Box.createHorizontalStrut(10));
+ panel.add(widthField);
+ panel.add(Box.createHorizontalStrut(20));
+ panel.add(hl);
+ panel.add(Box.createHorizontalStrut(10));
+ panel.add(heightField);
+ panel.add(Box.createHorizontalGlue());
+
+ panel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED),
+ BorderFactory.createEmptyBorder(5, 2, 5, 2)));
+
+ return panel;
+ }
+
+ private JPanel buildCtrlPanel() {
+ JPanel ctlPanel = new JPanel();
+ ctlPanel.setLayout(new BoxLayout(ctlPanel, BoxLayout.X_AXIS));
+ ctlPanel.add(Box.createHorizontalStrut(10));
+ ctlPanel.add(reset);
+ ctlPanel.add(Box.createHorizontalStrut(10));
+ ctlPanel.add(save);
+ ctlPanel.add(Box.createHorizontalStrut(10));
+ ctlPanel.add(delete);
+ ctlPanel.add(Box.createHorizontalGlue());
+ ctlPanel.add(ok);
+ ctlPanel.add(Box.createHorizontalStrut(10));
+ ctlPanel.add(cancel);
+ ctlPanel.add(Box.createHorizontalStrut(10));
+ ctlPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
+
+ return ctlPanel;
+ }
+
private JPanel buildRGBPane() {
JPanel rgbPanel = new JPanel();
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-11-22 01:56:50 UTC (rev 217)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-11-22 01:59:03 UTC (rev 218)
@@ -85,11 +85,14 @@
label.save_overwrite = The file "{0}" already exists, do you want to overwrite it?
-label.x = x:
-label.y = y:
-label.color = color:
+label.x = x
+label.y = y
+label.color = color
tooltip.inspector = Click in the frame's window to freeze the inspector value, and click again to unfreeze
label.rgb = RGB
-label.grayscale = Gray scale
\ No newline at end of file
+label.grayscale = Gray scale
+
+label.width = Width
+label.height = Height
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|