[Pixelle-commit] SF.net SVN: pixelle: [48] trunk/pixelle/src/com/mebigfatguy/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-06-21 17:18:00
|
Revision: 48
http://pixelle.svn.sourceforge.net/pixelle/?rev=48&view=rev
Author: dbrosius
Date: 2008-06-21 10:16:04 -0700 (Sat, 21 Jun 2008)
Log Message:
-----------
add some implementation to the options dialog
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-06-21 16:50:26 UTC (rev 47)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-06-21 17:16:04 UTC (rev 48)
@@ -57,6 +57,11 @@
public static final String BLUE_LABEL = "label.blue";
public static final String TRANSPARENCY_LABEL = "label.transparency";
public static final String SELECTION_LABEL = "label.selection";
+ public static final String PIXEL_OPTIONS = "title.pixel_options";
+ public static final String OUT_OF_BOUNDS_PIXELS = "title.out_of_bounds_pixels";
+ public static final String STATIC_COLOR = "label.color";
+ public static final String BORDER_COLOR = "label.border_color";
+ public static final String WRAPPED_COLOR = "label.wrapped_color";
private static ResourceBundle rb = ResourceBundle.getBundle("com/mebigfatguy/pixelle/pixelle");
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java 2008-06-21 16:50:26 UTC (rev 47)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java 2008-06-21 17:16:04 UTC (rev 48)
@@ -42,5 +42,8 @@
d.setLocationRelativeTo(frame);
d.setModal(true);
d.setVisible(true);
+ if (d.isOK()) {
+
+ }
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-21 16:50:26 UTC (rev 47)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-21 17:16:04 UTC (rev 48)
@@ -18,13 +18,107 @@
*/
package com.mebigfatguy.pixelle.dialogs;
+import java.awt.Container;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
import javax.swing.JDialog;
+import javax.swing.JPanel;
+import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
+import com.mebigfatguy.pixelle.utils.GuiUtils;
public class PixelleOptionsDialog extends JDialog {
+ private JCheckBox colorBox = new JCheckBox(PixelleBundle.getString(PixelleBundle.STATIC_COLOR));
+ private JCheckBox borderColorBox = new JCheckBox(PixelleBundle.getString(PixelleBundle.BORDER_COLOR));
+ private JCheckBox wrappedColorBox = new JCheckBox(PixelleBundle.getString(PixelleBundle.WRAPPED_COLOR));
+ private JButton ok = new JButton(PixelleBundle.getString(PixelleBundle.OK));
+ private JButton cancel = new JButton(PixelleBundle.getString(PixelleBundle.CANCEL));
+ private boolean okClicked = false;
+
public PixelleOptionsDialog(PixelleFrame owner) {
+ super(owner, PixelleBundle.getString(PixelleBundle.PIXEL_OPTIONS));
+ initComponents();
+ initListeners();
+ pack();
+ }
+
+ public boolean isOK() {
+ return okClicked;
+ }
+
+ private void initComponents() {
+ Container cp = getContentPane();
+ cp.setLayout(new BoxLayout(cp, BoxLayout.Y_AXIS));
+ {
+ JPanel p = new JPanel();
+ p.setLayout(new GridLayout(3, 1));
+ p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), PixelleBundle.getString(PixelleBundle.OUT_OF_BOUNDS_PIXELS)));
+
+ GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, colorBox, borderColorBox, wrappedColorBox);
+
+ p.add(colorBox);
+ p.add(borderColorBox);
+ p.add(wrappedColorBox);
+
+ ButtonGroup g = new ButtonGroup();
+ g.add(colorBox);
+ g.add(borderColorBox);
+ g.add(wrappedColorBox);
+
+ borderColorBox.setSelected(true);
+
+ cp.add(p);
+ }
+
+ cp.add(Box.createVerticalGlue());
+
+ {
+ JPanel p = new JPanel();
+ p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
+ p.setBorder(BorderFactory.createEmptyBorder(4, 10, 4, 10));
+ p.add(Box.createHorizontalGlue());
+
+ GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, ok, cancel);
+ p.add(ok);
+ p.add(Box.createHorizontalStrut(10));
+ p.add(cancel);
+ p.add(Box.createHorizontalGlue());
+ cp.add(p);
+ }
}
+
+ private void initListeners() {
+ ok.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent ae) {
+ okClicked = true;
+ dispose();
+ }
+ });
+
+ cancel.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent ae) {
+ dispose();
+ }
+ });
+
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent we) {
+ dispose();
+ }
+ });
+ }
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties 2008-06-21 16:50:26 UTC (rev 47)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties 2008-06-21 17:16:04 UTC (rev 48)
@@ -57,4 +57,10 @@
label.green = (Green)
label.blue = (Blue)
label.transparency = (Transparency)
-label.selection = (Selection)
\ No newline at end of file
+label.selection = (Selection)
+
+title.pixel_options = Pixel Options
+title.out_of_bounds_pixels = For out of Bounds Pixels use:
+label.color = Color
+label.border_color = Closest border color
+label.wrapped_color = Wrapped color
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|