pixelle-commit Mailing List for pixelle (Page 6)
Brought to you by:
dbrosius
You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(129) |
Jul
(39) |
Aug
|
Sep
|
Oct
|
Nov
(63) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(1) |
Feb
(24) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(41) |
Aug
(1) |
Sep
(7) |
Oct
|
Nov
|
Dec
(5) |
| 2010 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
(2) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <dbr...@us...> - 2008-11-20 05:57:49
|
Revision: 197
http://pixelle.svn.sourceforge.net/pixelle/?rev=197&view=rev
Author: dbrosius
Date: 2008-11-20 05:57:46 +0000 (Thu, 20 Nov 2008)
Log Message:
-----------
rename to RGBPixelleComponent
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/RGBPixelleComponent.java
Copied: trunk/pixelle/src/com/mebigfatguy/pixelle/RGBPixelleComponent.java (from rev 122, trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleComponent.java)
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/RGBPixelleComponent.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/RGBPixelleComponent.java 2008-11-20 05:57:46 UTC (rev 197)
@@ -0,0 +1,51 @@
+/*
+ * pixelle - Graphics algorithmic editor
+ * Copyright (C) 2008 Dave Brosius
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package com.mebigfatguy.pixelle;
+
+/**
+ * an enum that represents a part of a bitmap
+ */
+public enum RGBPixelleComponent {
+ /** the red component of a pixel */
+ RED('r', 0),
+ /** the green component of a pixel */
+ GREEN('g', 1),
+ /** the blue component of a pixel */
+ BLUE('b', 2),
+ /** the transparency component of a pixel */
+ TRANSPARENCY('t', 3),
+ /** the selection status of a pixel */
+ SELECTION('s', -1);
+
+ private char pixelSpec;
+ private int compOffset;
+
+ RGBPixelleComponent(char c, int offset) {
+ pixelSpec = c;
+ compOffset = offset;
+ }
+
+ public char getPixelSpec() {
+ return pixelSpec;
+ }
+
+ public int getComponentOffset() {
+ return compOffset;
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/RGBPixelleComponent.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mergeinfo
+
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-20 05:52:01
|
Revision: 196
http://pixelle.svn.sourceforge.net/pixelle/?rev=196&view=rev
Author: dbrosius
Date: 2008-11-20 05:51:53 +0000 (Thu, 20 Nov 2008)
Log Message:
-----------
an enum for what kind of image to generate
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/ImageType.java
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/ImageType.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/ImageType.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/ImageType.java 2008-11-20 05:51:53 UTC (rev 196)
@@ -0,0 +1,27 @@
+/*
+ * pixelle - Graphics algorithmic editor
+ * Copyright (C) 2008 Dave Brosius
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package com.mebigfatguy.pixelle;
+
+/**
+ * an enum that represents what type of output image to generate
+ */
+public enum ImageType {
+ RGB,
+ Grayscale
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/ImageType.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-15 16:45:20
|
Revision: 195
http://pixelle.svn.sourceforge.net/pixelle/?rev=195&view=rev
Author: dbrosius
Date: 2008-11-15 16:45:18 +0000 (Sat, 15 Nov 2008)
Log Message:
-----------
use integer colors, as that is what the tool uses
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-15 16:37:50 UTC (rev 194)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-15 16:45:18 UTC (rev 195)
@@ -69,19 +69,12 @@
EventQueue.invokeLater(new Runnable() {
public void run() {
sb.setLength(0);
- String r = Integer.toHexString(c.getRed());
- String g = Integer.toHexString(c.getGreen());
- String b = Integer.toHexString(c.getBlue());
- if (r.length() == 1)
- sb.append('0');
- sb.append(r);
- if (g.length() == 1)
- sb.append('0');
- sb.append(g);
- if (b.length() == 1)
- sb.append('0');
- sb.append(b);
- colorField.setText(sb.toString().toUpperCase());
+ sb.append(c.getRed());
+ sb.append(",");
+ sb.append(c.getGreen());
+ sb.append(",");
+ sb.append(c.getBlue());
+ colorField.setText(sb.toString());
swatchPanel.setBackground(c);
swatchPanel.repaint();
}
@@ -104,9 +97,9 @@
JLabel colorLabel = new JLabel(PixelleBundle.getString(PixelleBundle.COLOR));
GuiUtils.sizeUniformly(Sizing.Both, xLabel, yLabel, colorLabel);
- xField = new JTextField(6);
- yField = new JTextField(6);
- colorField = new JTextField(6);
+ xField = new JTextField(7);
+ yField = new JTextField(7);
+ colorField = new JTextField(7);
GuiUtils.sizeUniformly(Sizing.Both, xField, yField, colorField);
xField.setEditable(false);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-15 16:37:52
|
Revision: 194
http://pixelle.svn.sourceforge.net/pixelle/?rev=194&view=rev
Author: dbrosius
Date: 2008-11-15 16:37:50 +0000 (Sat, 15 Nov 2008)
Log Message:
-----------
make inspector more usable by allowing freezing
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/PixelInspector.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-14 23:35:48 UTC (rev 193)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-11-15 16:37:50 UTC (rev 194)
@@ -84,6 +84,7 @@
public static final String X = "label.x";
public static final String Y = "label.y";
public static final String COLOR = "label.color";
+ public static final String INSPECTOR_TOOLTIP = "tooltip.inspector";
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 2008-11-14 23:35:48 UTC (rev 193)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-15 16:37:50 UTC (rev 194)
@@ -26,6 +26,7 @@
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
+import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.awt.event.WindowAdapter;
@@ -302,13 +303,19 @@
private ZoomLevel zoom = ZoomLevel.FitToWindow;
private final int[] color = new int[4];
private Point lastPoint = new Point();
+ private boolean frozen = false;
public ImagePanel() {
+
+ initListeners();
+ }
+
+ private void initListeners() {
addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseMoved(MouseEvent e) {
- if (inspector != null) {
+ if ((inspector != null) && !frozen) {
Point p = e.getPoint();
if (!lastPoint.equals(p)) {
lastPoint = p;
@@ -327,7 +334,16 @@
}
}
});
+
+ addMouseListener(new MouseAdapter() {
+
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ frozen = !frozen;
+ }
+ });
}
+
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-14 23:35:48 UTC (rev 193)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-15 16:37:50 UTC (rev 194)
@@ -21,6 +21,7 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
+import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Point;
import java.awt.event.WindowAdapter;
@@ -50,6 +51,7 @@
public PixelInspector(PixelleFrame pf) {
frame = pf;
+ setTitle(PixelleBundle.getString(PixelleBundle.INSPECTOR_ITEM));
initComponents();
initListeners();
}
@@ -79,7 +81,7 @@
if (b.length() == 1)
sb.append('0');
sb.append(b);
- colorField.setText(sb.toString());
+ colorField.setText(sb.toString().toUpperCase());
swatchPanel.setBackground(c);
swatchPanel.repaint();
}
@@ -90,7 +92,8 @@
cp.setLayout(new BorderLayout(4, 4));
swatchPanel = new JPanel();
- swatchPanel.setSize(100, 100);
+ swatchPanel.setPreferredSize(new Dimension(50, 50));
+ swatchPanel.setToolTipText(PixelleBundle.getString(PixelleBundle.INSPECTOR_TOOLTIP));
cp.add(swatchPanel, BorderLayout.WEST);
JPanel infoPanel = new JPanel();
@@ -106,9 +109,9 @@
colorField = new JTextField(6);
GuiUtils.sizeUniformly(Sizing.Both, xField, yField, colorField);
- xField.setEnabled(false);
- yField.setEnabled(false);
- colorField.setEnabled(false);
+ xField.setEditable(false);
+ yField.setEditable(false);
+ colorField.setEditable(false);
xLabel.setLabelFor(xField);
yLabel.setLabelFor(yField);
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-11-14 23:35:48 UTC (rev 193)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-11-15 16:37:50 UTC (rev 194)
@@ -86,3 +86,6 @@
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
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 23:35:58
|
Revision: 193
http://pixelle.svn.sourceforge.net/pixelle/?rev=193&view=rev
Author: dbrosius
Date: 2008-11-14 23:35:48 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
doc the inspector
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-11-14 23:16:43 UTC (rev 192)
+++ trunk/pixelle/htdocs/index.html 2008-11-14 23:35:48 UTC (rev 193)
@@ -82,7 +82,7 @@
The number e, the base of the natural logarithms</li>
</ul>
- <p><pre>As of November 14, simple expressions should work. Some examples:
+ <p><pre>As of June 14, simple expressions should work. Some examples:
p[x,y].r = <b>(x + y) == 100 ? 255 : p[x,y].r</b>
@@ -117,9 +117,11 @@
</pre></p>
+ <p>As of November 14, a pixel inspector window has been added, which helps determine input for the transformations</p>
+
<p>Still to be done is recognition of more image types, working with multiple
input sources, creating non ABGR images, more options handling such as fractional pixels,
- a pixel inspector, a bunch of bugs, and a bunch of stuff I have yet to think about.</p>
+ a bunch of bugs, and a bunch of stuff I have yet to think about.</p>
</div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 23:16:47
|
Revision: 192
http://pixelle.svn.sourceforge.net/pixelle/?rev=192&view=rev
Author: dbrosius
Date: 2008-11-14 23:16:43 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
inspector sort of working now
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-14 23:07:22 UTC (rev 191)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-14 23:16:43 UTC (rev 192)
@@ -321,7 +321,7 @@
if ((p.x >= 0) && (p.y >= 0) && (p.x < iWidth) && (p.y < iHeight)) {
inspector.setInspectorPosition(p);
image.getSaveImage().getData().getPixel(p.x, p.y, color);
- inspector.setInspectorColor(new Color(color[3], color[2], color[1]));
+ inspector.setInspectorColor(new Color(color[0], color[1], color[2]));
}
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-14 23:07:22 UTC (rev 191)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-14 23:16:43 UTC (rev 192)
@@ -70,13 +70,13 @@
String r = Integer.toHexString(c.getRed());
String g = Integer.toHexString(c.getGreen());
String b = Integer.toHexString(c.getBlue());
- if (r.length() > 1)
+ if (r.length() == 1)
sb.append('0');
sb.append(r);
- if (g.length() > 1)
+ if (g.length() == 1)
sb.append('0');
sb.append(g);
- if (b.length() > 1)
+ if (b.length() == 1)
sb.append('0');
sb.append(b);
colorField.setText(sb.toString());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 23:07:27
|
Revision: 191
http://pixelle.svn.sourceforge.net/pixelle/?rev=191&view=rev
Author: dbrosius
Date: 2008-11-14 23:07:22 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
hook up inspector -- not working tho
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-14 22:27:04 UTC (rev 190)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-14 23:07:22 UTC (rev 191)
@@ -19,12 +19,15 @@
package com.mebigfatguy.pixelle;
import java.awt.BorderLayout;
+import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseMotionAdapter;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
@@ -293,9 +296,38 @@
}
public class ImagePanel extends JPanel {
- private static final long serialVersionUID = -1572146409734928935L;
+ private static final long serialVersionUID = 1004811680136095184L;
+
private ZoomLevel zoom = ZoomLevel.FitToWindow;
+ private final int[] color = new int[4];
+ private Point lastPoint = new Point();
+
+ public ImagePanel() {
+ addMouseMotionListener(new MouseMotionAdapter() {
+
+ @Override
+ public void mouseMoved(MouseEvent e) {
+ if (inspector != null) {
+ Point p = e.getPoint();
+ if (!lastPoint.equals(p)) {
+ lastPoint = p;
+ Dimension d = getDimension();
+ int iWidth = image.getWidth();
+ int iHeight = image.getHeight();
+ double x = (p.x * (double)iWidth / d.width) + 0.5;
+ double y = (p.y * (double)iHeight / d.height) + 0.5;
+ p = new Point((int) x, (int) y);
+ if ((p.x >= 0) && (p.y >= 0) && (p.x < iWidth) && (p.y < iHeight)) {
+ inspector.setInspectorPosition(p);
+ image.getSaveImage().getData().getPixel(p.x, p.y, color);
+ inspector.setInspectorColor(new Color(color[3], color[2], color[1]));
+ }
+ }
+ }
+ }
+ });
+ }
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-14 22:27:04 UTC (rev 190)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-14 23:07:22 UTC (rev 191)
@@ -46,6 +46,7 @@
private JTextField xField;
private JTextField yField;
private JTextField colorField;
+ private final StringBuilder sb = new StringBuilder();
public PixelInspector(PixelleFrame pf) {
frame = pf;
@@ -53,7 +54,7 @@
initListeners();
}
- public void setPosition(final Point p) {
+ public void setInspectorPosition(final Point p) {
EventQueue.invokeLater(new Runnable() {
public void run() {
xField.setText(String.valueOf(p.x));
@@ -65,6 +66,20 @@
public void setInspectorColor(final Color c) {
EventQueue.invokeLater(new Runnable() {
public void run() {
+ sb.setLength(0);
+ String r = Integer.toHexString(c.getRed());
+ String g = Integer.toHexString(c.getGreen());
+ String b = Integer.toHexString(c.getBlue());
+ if (r.length() > 1)
+ sb.append('0');
+ sb.append(r);
+ if (g.length() > 1)
+ sb.append('0');
+ sb.append(g);
+ if (b.length() > 1)
+ sb.append('0');
+ sb.append(b);
+ colorField.setText(sb.toString());
swatchPanel.setBackground(c);
swatchPanel.repaint();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 22:27:08
|
Revision: 190
http://pixelle.svn.sourceforge.net/pixelle/?rev=190&view=rev
Author: dbrosius
Date: 2008-11-14 22:27:04 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
add setPosition
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-14 22:24:32 UTC (rev 189)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-14 22:27:04 UTC (rev 190)
@@ -22,6 +22,7 @@
import java.awt.Color;
import java.awt.Container;
import java.awt.EventQueue;
+import java.awt.Point;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
@@ -52,6 +53,15 @@
initListeners();
}
+ public void setPosition(final Point p) {
+ EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ xField.setText(String.valueOf(p.x));
+ yField.setText(String.valueOf(p.y));
+ }
+ });
+ }
+
public void setInspectorColor(final Color c) {
EventQueue.invokeLater(new Runnable() {
public void run() {
@@ -76,10 +86,6 @@
JLabel colorLabel = new JLabel(PixelleBundle.getString(PixelleBundle.COLOR));
GuiUtils.sizeUniformly(Sizing.Both, xLabel, yLabel, colorLabel);
- xLabel.setAlignmentX(1);
- yLabel.setAlignmentX(1);
- colorLabel.setAlignmentX(1);
-
xField = new JTextField(6);
yField = new JTextField(6);
colorField = new JTextField(6);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 22:24:34
|
Revision: 189
http://pixelle.svn.sourceforge.net/pixelle/?rev=189&view=rev
Author: dbrosius
Date: 2008-11-14 22:24:32 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
force a size for the swatch
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-14 22:18:18 UTC (rev 188)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-14 22:24:32 UTC (rev 189)
@@ -65,6 +65,7 @@
cp.setLayout(new BorderLayout(4, 4));
swatchPanel = new JPanel();
+ swatchPanel.setSize(100, 100);
cp.add(swatchPanel, BorderLayout.WEST);
JPanel infoPanel = new JPanel();
@@ -75,6 +76,10 @@
JLabel colorLabel = new JLabel(PixelleBundle.getString(PixelleBundle.COLOR));
GuiUtils.sizeUniformly(Sizing.Both, xLabel, yLabel, colorLabel);
+ xLabel.setAlignmentX(1);
+ yLabel.setAlignmentX(1);
+ colorLabel.setAlignmentX(1);
+
xField = new JTextField(6);
yField = new JTextField(6);
colorField = new JTextField(6);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 22:18:23
|
Revision: 188
http://pixelle.svn.sourceforge.net/pixelle/?rev=188&view=rev
Author: dbrosius
Date: 2008-11-14 22:18:18 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
better positioning and event handling
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-14 22:06:56 UTC (rev 187)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-14 22:18:18 UTC (rev 188)
@@ -278,7 +278,7 @@
public final void toggleInspector() {
if (inspector == null) {
- inspector = new PixelInspector();
+ inspector = new PixelInspector(this);
inspector.setAlwaysOnTop(true);
Rectangle bounds = getBounds();
Point p = new Point(bounds.x + bounds.width - inspector.getWidth() - 20, bounds.y + 50);
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-14 22:06:56 UTC (rev 187)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-14 22:18:18 UTC (rev 188)
@@ -22,6 +22,8 @@
import java.awt.Color;
import java.awt.Container;
import java.awt.EventQueue;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
@@ -30,6 +32,7 @@
import javax.swing.JTextField;
import com.mebigfatguy.pixelle.PixelleBundle;
+import com.mebigfatguy.pixelle.PixelleFrame;
import com.mebigfatguy.pixelle.utils.GuiUtils;
import com.mebigfatguy.pixelle.utils.GuiUtils.Sizing;
@@ -37,13 +40,16 @@
private static final long serialVersionUID = 713537909520529431L;
+ private final PixelleFrame frame;
private JPanel swatchPanel;
private JTextField xField;
private JTextField yField;
private JTextField colorField;
- public PixelInspector() {
+ public PixelInspector(PixelleFrame pf) {
+ frame = pf;
initComponents();
+ initListeners();
}
public void setInspectorColor(final Color c) {
@@ -102,4 +108,13 @@
cp.add(infoPanel, BorderLayout.CENTER);
pack();
}
+
+ private void initListeners() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent we) {
+ frame.toggleInspector();
+ }
+ });
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 22:06:58
|
Revision: 187
http://pixelle.svn.sourceforge.net/pixelle/?rev=187&view=rev
Author: dbrosius
Date: 2008-11-14 22:06:56 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
better positioning
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-14 22:00:09 UTC (rev 186)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-14 22:06:56 UTC (rev 187)
@@ -23,6 +23,8 @@
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Rectangle;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
@@ -278,11 +280,15 @@
if (inspector == null) {
inspector = new PixelInspector();
inspector.setAlwaysOnTop(true);
- inspector.setLocationRelativeTo(this);
+ Rectangle bounds = getBounds();
+ Point p = new Point(bounds.x + bounds.width - inspector.getWidth() - 20, bounds.y + 50);
+ inspector.setLocation(p);
inspector.setVisible(true);
+ inspectorItem.setSelected(true);
} else {
inspector.dispose();
inspector = null;
+ inspectorItem.setSelected(false);
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-11-14 22:00:09 UTC (rev 186)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-11-14 22:06:56 UTC (rev 187)
@@ -47,6 +47,9 @@
menu.transform.newwindow = Transform creates new Window
menu.transform.transform = Transform
+menu.goodies.title = Goodies
+menu.goodies.inspector = Pixel Inspector
+
label.graphic_files = Graphic Files
formula.red = p[x,y].r
@@ -79,3 +82,7 @@
label.wave_color = Color Waving
label.save_overwrite = The file "{0}" already exists, do you want to overwrite it?
+
+label.x = x:
+label.y = y:
+label.color = color:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 22:00:14
|
Revision: 186
http://pixelle.svn.sourceforge.net/pixelle/?rev=186&view=rev
Author: dbrosius
Date: 2008-11-14 22:00:09 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
stub in the Pixel inspector - not hooked up yet
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/InspectorAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-11-14 21:44:47 UTC (rev 185)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-11-14 22:00:09 UTC (rev 186)
@@ -52,6 +52,8 @@
public static final String OPTIONS_ITEM = "menu.transform.options";
public static final String TRANSFORM_NEW_ITEM = "menu.transform.newwindow";
public static final String TRANSFORM_ITEM = "menu.transform.transform";
+ public static final String GOODIES_MENU = "menu.goodies.title";
+ public static final String INSPECTOR_ITEM = "menu.goodies.inspector";
public static final String GRAPHIC_FILES = "label.graphic_files";
public static final String SAVE_ALGORITHM = "save.algorithm";
public static final String DELETE_ALGORITHM = "delete.algorithm";
@@ -79,6 +81,9 @@
public static final String ROLL_COLOR = "label.roll_color";
public static final String WAVE_COLOR = "label.wave_color";
public static final String SAVE_OVERWRITE = "label.save_overwrite";
+ public static final String X = "label.x";
+ public static final String Y = "label.y";
+ public static final String COLOR = "label.color";
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 2008-11-14 21:44:47 UTC (rev 185)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-14 22:00:09 UTC (rev 186)
@@ -41,6 +41,7 @@
import javax.swing.JScrollPane;
import com.mebigfatguy.pixelle.actions.CloseFileAction;
+import com.mebigfatguy.pixelle.actions.InspectorAction;
import com.mebigfatguy.pixelle.actions.NewFileAction;
import com.mebigfatguy.pixelle.actions.OpenFileAction;
import com.mebigfatguy.pixelle.actions.OptionsAction;
@@ -52,6 +53,7 @@
import com.mebigfatguy.pixelle.actions.TransformAction;
import com.mebigfatguy.pixelle.actions.TransformNewWindowAction;
import com.mebigfatguy.pixelle.actions.ZoomAction;
+import com.mebigfatguy.pixelle.dialogs.PixelInspector;
import com.mebigfatguy.pixelle.utils.GuiUtils;
import com.mebigfatguy.pixelle.utils.ZoomLevel;
@@ -84,10 +86,14 @@
JMenuItem optionsItem;
JMenuItem transformItem;
+ JMenu goodiesMenu;
+ JCheckBoxMenuItem inspectorItem;
+
File imageFile;
JScrollPane scroll;
ImagePanel panel;
transient PixelleImage image;
+ PixelInspector inspector;
boolean doNewWindow;
public PixelleFrame() throws PixelleTransformException {
@@ -180,6 +186,12 @@
mb.add(transformMenu);
+ goodiesMenu = new JMenu(PixelleBundle.getString(PixelleBundle.GOODIES_MENU));
+ inspectorItem = new JCheckBoxMenuItem(new InspectorAction(this));
+ goodiesMenu.add(inspectorItem);
+
+ mb.add(goodiesMenu);
+
setJMenuBar(mb);
Container cp = getContentPane();
@@ -262,6 +274,18 @@
panel.repaint();
}
+ public final void toggleInspector() {
+ if (inspector == null) {
+ inspector = new PixelInspector();
+ inspector.setAlwaysOnTop(true);
+ inspector.setLocationRelativeTo(this);
+ inspector.setVisible(true);
+ } else {
+ inspector.dispose();
+ inspector = null;
+ }
+ }
+
public class ImagePanel extends JPanel {
private static final long serialVersionUID = -1572146409734928935L;
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/InspectorAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/InspectorAction.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/InspectorAction.java 2008-11-14 22:00:09 UTC (rev 186)
@@ -0,0 +1,43 @@
+/*
+ * pixelle - Graphics algorithmic editor
+ * Copyright (C) 2008 Dave Brosius
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package com.mebigfatguy.pixelle.actions;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.KeyStroke;
+
+import com.mebigfatguy.pixelle.PixelleBundle;
+import com.mebigfatguy.pixelle.PixelleFrame;
+
+public class InspectorAction extends AbstractAction {
+
+ private static final long serialVersionUID = 2938266078773417057L;
+ private final PixelleFrame frame;
+
+ public InspectorAction(PixelleFrame pf) {
+ super(PixelleBundle.getString(PixelleBundle.INSPECTOR_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('I', ActionEvent.CTRL_MASK));
+ frame = pf;
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ frame.toggleInspector();
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/InspectorAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-14 22:00:09 UTC (rev 186)
@@ -0,0 +1,105 @@
+/*
+ * pixelle - Graphics algorithmic editor
+ * Copyright (C) 2008 Dave Brosius
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package com.mebigfatguy.pixelle.dialogs;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Container;
+import java.awt.EventQueue;
+
+import javax.swing.BoxLayout;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import com.mebigfatguy.pixelle.PixelleBundle;
+import com.mebigfatguy.pixelle.utils.GuiUtils;
+import com.mebigfatguy.pixelle.utils.GuiUtils.Sizing;
+
+public class PixelInspector extends JFrame {
+
+ private static final long serialVersionUID = 713537909520529431L;
+
+ private JPanel swatchPanel;
+ private JTextField xField;
+ private JTextField yField;
+ private JTextField colorField;
+
+ public PixelInspector() {
+ initComponents();
+ }
+
+ public void setInspectorColor(final Color c) {
+ EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ swatchPanel.setBackground(c);
+ swatchPanel.repaint();
+ }
+ });
+ }
+ private void initComponents() {
+ Container cp = getContentPane();
+ cp.setLayout(new BorderLayout(4, 4));
+
+ swatchPanel = new JPanel();
+ cp.add(swatchPanel, BorderLayout.WEST);
+
+ JPanel infoPanel = new JPanel();
+ infoPanel.setLayout(new BoxLayout(infoPanel, BoxLayout.Y_AXIS));
+
+ JLabel xLabel = new JLabel(PixelleBundle.getString(PixelleBundle.X));
+ JLabel yLabel = new JLabel(PixelleBundle.getString(PixelleBundle.Y));
+ JLabel colorLabel = new JLabel(PixelleBundle.getString(PixelleBundle.COLOR));
+ GuiUtils.sizeUniformly(Sizing.Both, xLabel, yLabel, colorLabel);
+
+ xField = new JTextField(6);
+ yField = new JTextField(6);
+ colorField = new JTextField(6);
+ GuiUtils.sizeUniformly(Sizing.Both, xField, yField, colorField);
+
+ xField.setEnabled(false);
+ yField.setEnabled(false);
+ colorField.setEnabled(false);
+
+ xLabel.setLabelFor(xField);
+ yLabel.setLabelFor(yField);
+ colorLabel.setLabelFor(colorField);
+
+ JPanel xPanel = new JPanel();
+ xPanel.setLayout(new BoxLayout(xPanel, BoxLayout.X_AXIS));
+ xPanel.add(xLabel);
+ xPanel.add(xField);
+ JPanel yPanel = new JPanel();
+ yPanel.setLayout(new BoxLayout(yPanel, BoxLayout.X_AXIS));
+ yPanel.add(yLabel);
+ yPanel.add(yField);
+ JPanel colorPanel = new JPanel();
+ colorPanel.setLayout(new BoxLayout(colorPanel, BoxLayout.X_AXIS));
+ colorPanel.add(colorLabel);
+ colorPanel.add(colorField);
+
+ infoPanel.add(xPanel);
+ infoPanel.add(yPanel);
+ infoPanel.add(colorPanel);
+
+ cp.add(infoPanel, BorderLayout.CENTER);
+ pack();
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 21:44:51
|
Revision: 185
http://pixelle.svn.sourceforge.net/pixelle/?rev=185&view=rev
Author: dbrosius
Date: 2008-11-14 21:44:47 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
use EventQueue.invokeLater, rather than SwingUtilities
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-14 17:17:15 UTC (rev 184)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-14 21:44:47 UTC (rev 185)
@@ -21,6 +21,7 @@
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
+import java.awt.EventQueue;
import java.awt.Graphics;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
@@ -38,7 +39,6 @@
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
-import javax.swing.SwingUtilities;
import com.mebigfatguy.pixelle.actions.CloseFileAction;
import com.mebigfatguy.pixelle.actions.NewFileAction;
@@ -235,7 +235,7 @@
try {
image = new PixelleImage(ImageIO.read(f));
imageFile = f;
- SwingUtilities.invokeLater(new Runnable() {
+ EventQueue.invokeLater(new Runnable() {
public void run() {
Container cp = getContentPane();
cp.removeAll();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 17:17:20
|
Revision: 184
http://pixelle.svn.sourceforge.net/pixelle/?rev=184&view=rev
Author: dbrosius
Date: 2008-11-14 17:17:15 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
simplify controls by relying on PixelleComponent, as opposed to some hazy implicit array to component association
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-11-14 16:45:44 UTC (rev 183)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-11-14 17:17:15 UTC (rev 184)
@@ -48,37 +48,29 @@
import com.mebigfatguy.pixelle.utils.GuiUtils;
public class PixelleExpressionDialog extends JDialog {
-
- private static final long serialVersionUID = -420573137466431577L;
-
- private static final int NUM_LABELS = 5;
- private final JLabel lhs[] =
- {
- new JLabel(PixelleBundle.getString(PixelleBundle.RED_FORMULA) + " = "),
- new JLabel(PixelleBundle.getString(PixelleBundle.GREEN_FORMULA) + " = "),
- new JLabel(PixelleBundle.getString(PixelleBundle.BLUE_FORMULA) + " = "),
- new JLabel(PixelleBundle.getString(PixelleBundle.TRANSPARENCY_FORMULA) + " = "),
- new JLabel(PixelleBundle.getString(PixelleBundle.SELECTION_FORMULA) + " = ")
- };
+ private static final long serialVersionUID = -4273352119079307059L;
- private final JTextField editor[] =
- {
- new JTextField(PixelleBundle.getString(PixelleBundle.RED_FORMULA), 50),
- new JTextField(PixelleBundle.getString(PixelleBundle.GREEN_FORMULA), 50),
- new JTextField(PixelleBundle.getString(PixelleBundle.BLUE_FORMULA), 50),
- new JTextField(PixelleBundle.getString(PixelleBundle.TRANSPARENCY_FORMULA), 50),
- new JTextField(PixelleBundle.getString(PixelleBundle.SELECTION_FORMULA), 50),
- };
+ private final Map<PixelleComponent, JLabel> lhs = new EnumMap<PixelleComponent, JLabel>(PixelleComponent.class);
+ {
+ for (PixelleComponent comp : PixelleComponent.values()) {
+ lhs.put(comp, new JLabel(PixelleBundle.getString("formula." + comp.name().toLowerCase()) + " = "));
+ }
+ };
+
+ private final Map<PixelleComponent, JTextField> editor = new EnumMap<PixelleComponent, JTextField>(PixelleComponent.class);
+ {
+ for (PixelleComponent comp : PixelleComponent.values()) {
+ editor.put(comp, new JTextField(PixelleBundle.getString("formula." + comp.name().toLowerCase()), 50));
+ }
+ };
- private final JLabel labels[] =
- {
- new JLabel(PixelleBundle.getString(PixelleBundle.RED_LABEL)),
- new JLabel(PixelleBundle.getString(PixelleBundle.GREEN_LABEL)),
- new JLabel(PixelleBundle.getString(PixelleBundle.BLUE_LABEL)),
- new JLabel(PixelleBundle.getString(PixelleBundle.TRANSPARENCY_LABEL)),
- new JLabel(PixelleBundle.getString(PixelleBundle.SELECTION_LABEL))
- };
+ private final Map<PixelleComponent, JLabel> labels = new EnumMap<PixelleComponent, JLabel>(PixelleComponent.class);
+ {
+ for (PixelleComponent comp : PixelleComponent.values()) {
+ labels.put(comp, new JLabel(PixelleBundle.getString("label." + comp.name().toLowerCase())));
+ }
+ };
PixelleFrame frame;
JButton ok;
@@ -104,11 +96,9 @@
public Map<PixelleComponent, String> getAlgorithms() {
Map<PixelleComponent, String> algorithms = new EnumMap<PixelleComponent, String>(PixelleComponent.class);
- algorithms.put(PixelleComponent.RED, editor[0].getText());
- algorithms.put(PixelleComponent.GREEN, editor[1].getText());
- algorithms.put(PixelleComponent.BLUE, editor[2].getText());
- algorithms.put(PixelleComponent.TRANSPARENCY, editor[3].getText());
- algorithms.put(PixelleComponent.SELECTION, editor[4].getText());
+ for (PixelleComponent comp : PixelleComponent.values()) {
+ algorithms.put(comp, editor.get(comp).getText());
+ }
return algorithms;
}
@@ -142,21 +132,17 @@
String groupName = (String)item.getClientProperty(AlgorithmArchiver.NAME);
selectedAlgorithm.setText(algorithmName);
Map<PixelleComponent, String> algorithms = AlgorithmArchiver.getArchiver().getAlgorithm(groupName, algorithmName);
- editor[0].setText(algorithms.get(PixelleComponent.RED));
- editor[1].setText(algorithms.get(PixelleComponent.GREEN));
- editor[2].setText(algorithms.get(PixelleComponent.BLUE));
- editor[3].setText(algorithms.get(PixelleComponent.TRANSPARENCY));
- editor[4].setText(algorithms.get(PixelleComponent.SELECTION));
+ for (PixelleComponent comp : PixelleComponent.values()) {
+ editor.get(comp).setText(algorithms.get(comp));
+ }
}
});
try {
Map<PixelleComponent, String> algorithms = AlgorithmArchiver.getArchiver().getCurrent();
if (algorithms != null) {
- editor[0].setText(algorithms.get(PixelleComponent.RED));
- editor[1].setText(algorithms.get(PixelleComponent.GREEN));
- editor[2].setText(algorithms.get(PixelleComponent.BLUE));
- editor[3].setText(algorithms.get(PixelleComponent.TRANSPARENCY));
- editor[4].setText(algorithms.get(PixelleComponent.SELECTION));
+ for (PixelleComponent comp : PixelleComponent.values()) {
+ editor.get(comp).setText(algorithms.get(comp));
+ }
}
} catch (IllegalArgumentException iae) {
}
@@ -172,17 +158,17 @@
JPanel algoPanel = new JPanel();
algoPanel.setLayout(new GridLayout(5, 1));
- GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, lhs);
- GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, editor);
- GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, labels);
+ GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, lhs.values().toArray(new JComponent[lhs.size()]));
+ GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, editor.values().toArray(new JComponent[lhs.size()]));
+ GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, labels.values().toArray(new JComponent[lhs.size()]));
- for (int i = 0; i < NUM_LABELS; i++) {
+ for (PixelleComponent comp : PixelleComponent.values()) {
JPanel p = new JPanel();
p.setLayout(new BorderLayout(10, 10));
- p.add(lhs[i], BorderLayout.WEST);
- p.add(editor[i], BorderLayout.CENTER);
- p.add(labels[i], BorderLayout.EAST);
- labels[i].setLabelFor(editor[i]);
+ p.add(lhs.get(comp), BorderLayout.WEST);
+ p.add(editor.get(comp), BorderLayout.CENTER);
+ p.add(labels.get(comp), BorderLayout.EAST);
+ labels.get(comp).setLabelFor(editor.get(comp));
p.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
algoPanel.add(p);
}
@@ -260,11 +246,9 @@
reset.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
- editor[0].setText(PixelleBundle.getString(PixelleBundle.RED_FORMULA));
- editor[1].setText(PixelleBundle.getString(PixelleBundle.GREEN_FORMULA));
- editor[2].setText(PixelleBundle.getString(PixelleBundle.BLUE_FORMULA));
- editor[3].setText(PixelleBundle.getString(PixelleBundle.TRANSPARENCY_FORMULA));
- editor[4].setText(PixelleBundle.getString(PixelleBundle.SELECTION_FORMULA));
+ for (PixelleComponent comp : PixelleComponent.values()) {
+ editor.get(comp).setText(PixelleBundle.getString("formula." + comp.name().toLowerCase()));
+ }
}
});
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 16:45:50
|
Revision: 183
http://pixelle.svn.sourceforge.net/pixelle/?rev=183&view=rev
Author: dbrosius
Date: 2008-11-14 16:45:44 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
use EnumMap for algorithm
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-11-14 16:44:57 UTC (rev 182)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-11-14 16:45:44 UTC (rev 183)
@@ -24,7 +24,7 @@
import java.io.IOException;
import java.security.AccessController;
import java.security.PrivilegedAction;
-import java.util.HashMap;
+import java.util.EnumMap;
import java.util.Map;
import org.antlr.runtime.ANTLRStringStream;
@@ -59,7 +59,7 @@
* @return a set of transformation algorithms
*/
public static Map<PixelleComponent, String> getSampleTransform() {
- Map<PixelleComponent, String> algorithms = new HashMap<PixelleComponent, String>();
+ Map<PixelleComponent, String> algorithms = new EnumMap<PixelleComponent, String>(PixelleComponent.class);
algorithms.put(PixelleComponent.RED, "x");
algorithms.put(PixelleComponent.GREEN, "y");
algorithms.put(PixelleComponent.BLUE, "abs((width/2) - x)");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 16:45:05
|
Revision: 182
http://pixelle.svn.sourceforge.net/pixelle/?rev=182&view=rev
Author: dbrosius
Date: 2008-11-14 16:44:57 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
use EnumMap for currentAlgorithm
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java 2008-11-14 16:43:44 UTC (rev 181)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java 2008-11-14 16:44:57 UTC (rev 182)
@@ -29,6 +29,7 @@
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
+import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
@@ -241,7 +242,7 @@
currentGroup = new HashMap<String, Map<PixelleComponent, String>>();
algorithms.put(atts.getValue(NAME), currentGroup);
} else if (ALGORITHM.equals(localName)) {
- currentAlgorithm = new HashMap<PixelleComponent, String>();
+ currentAlgorithm = new EnumMap<PixelleComponent, String>(PixelleComponent.class);
currentGroup.put(atts.getValue(NAME), currentAlgorithm);
} else if (COMPONENT.equals(localName)) {
currentComponentName = atts.getValue(NAME);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 16:43:47
|
Revision: 181
http://pixelle.svn.sourceforge.net/pixelle/?rev=181&view=rev
Author: dbrosius
Date: 2008-11-14 16:43:44 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
use isEmpty
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/FrameMgr.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/FrameMgr.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/FrameMgr.java 2008-11-14 16:42:24 UTC (rev 180)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/FrameMgr.java 2008-11-14 16:43:44 UTC (rev 181)
@@ -57,7 +57,7 @@
*/
public void remove(JFrame frame) {
frames.remove(frame);
- if (frames.size() == 0)
+ if (frames.isEmpty())
System.exit(0);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 16:42:27
|
Revision: 180
http://pixelle.svn.sourceforge.net/pixelle/?rev=180&view=rev
Author: dbrosius
Date: 2008-11-14 16:42:24 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
simplify by using Closeable
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java 2008-11-14 16:40:19 UTC (rev 179)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java 2008-11-14 16:42:24 UTC (rev 180)
@@ -18,50 +18,19 @@
*/
package com.mebigfatguy.pixelle.utils;
+import java.io.Closeable;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.Writer;
-public class Closer {
+public final class Closer {
private Closer() {
}
- public static void close(InputStream is) {
+ public static void close(Closeable c) {
try {
- if (is != null) {
- is.close();
+ if (c != null) {
+ c.close();
}
} catch (IOException ioe) {
}
}
-
- public static void close(OutputStream os) {
- try {
- if (os != null) {
- os.close();
- }
- } catch (IOException ioe) {
- }
- }
-
- public static void close(Reader r) {
- try {
- if (r != null) {
- r.close();
- }
- } catch (IOException ioe) {
- }
- }
-
- public static void close(Writer w) {
- try {
- if (w != null) {
- w.close();
- }
- } catch (IOException ioe) {
- }
- }
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 16:40:25
|
Revision: 179
http://pixelle.svn.sourceforge.net/pixelle/?rev=179&view=rev
Author: dbrosius
Date: 2008-11-14 16:40:19 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
BAS fix
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-11-14 15:14:42 UTC (rev 178)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-11-14 16:40:19 UTC (rev 179)
@@ -199,10 +199,11 @@
if (bit == 0)
selectionByte = 0;
- int bitOffset = 1 << (7 - bit);
- if (value != 0.0)
+ if (value != 0.0) {
+ int bitOffset = 1 << (7 - bit);
selectionByte |= bitOffset;
-
+ }
+
if ((bit == 7) || (x == width))
srcImage.setSelectionByte(x >> 3, y, selectionByte);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 15:14:44
|
Revision: 178
http://pixelle.svn.sourceforge.net/pixelle/?rev=178&view=rev
Author: dbrosius
Date: 2008-11-14 15:14:42 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
impl removeAlgorithm
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java 2008-11-14 05:55:54 UTC (rev 177)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java 2008-11-14 15:14:42 UTC (rev 178)
@@ -144,7 +144,10 @@
}
public void removeAlgorithm(String group, String name) {
-
+ Map<String, Map<PixelleComponent, String>> algoGroup = userAlgorithms.get(group);
+ if (algoGroup != null) {
+ algoGroup.remove(name);
+ }
}
public void save() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 05:55:55
|
Revision: 177
http://pixelle.svn.sourceforge.net/pixelle/?rev=177&view=rev
Author: dbrosius
Date: 2008-11-14 05:55:54 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
more doc
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-11-14 05:50:34 UTC (rev 176)
+++ trunk/pixelle/htdocs/index.html 2008-11-14 05:55:54 UTC (rev 177)
@@ -119,7 +119,7 @@
<p>Still to be done is recognition of more image types, working with multiple
input sources, creating non ABGR images, more options handling such as fractional pixels,
- a bunch of bugs, and a bunch of stuff I have yet to think about.</p>
+ a pixel inspector, a bunch of bugs, and a bunch of stuff I have yet to think about.</p>
</div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 05:50:39
|
Revision: 176
http://pixelle.svn.sourceforge.net/pixelle/?rev=176&view=rev
Author: dbrosius
Date: 2008-11-14 05:50:34 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
make current selection less kludgy
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java 2008-11-14 05:39:04 UTC (rev 175)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java 2008-11-14 05:50:34 UTC (rev 176)
@@ -51,6 +51,7 @@
private static final String SYSTEM_ALGO_XML_PATH = "/com/mebigfatguy/pixelle/resources/algorithms.xml";
private static final String SYSTEM_ALGO_XSD_PATH = "/com/mebigfatguy/pixelle/resources/algorithms.xsd";
public static final String GROUP = "group";
+ public static final String CURRENT = "current_";
public static final String ALGORITHM = "algorithm";
public static final String COMPONENT = "component";
public static final String NAME = "name";
@@ -85,13 +86,15 @@
private void populateMenuAlgorithms(JPopupMenu menu, Map<String, Map<String, Map<PixelleComponent, String>>> algorithms, ActionListener l) {
for (final Map.Entry<String, Map<String, Map<PixelleComponent, String>>> entry : algorithms.entrySet()) {
String groupName = entry.getKey();
- JMenu group = new JMenu(groupName);
- menu.add(group);
- for (final String algos : entry.getValue().keySet()) {
- JMenuItem algoItem = new JMenuItem(algos);
- algoItem.putClientProperty(NAME, groupName);
- algoItem.addActionListener(l);
- group.add(algoItem);
+ if (!CURRENT.equals(groupName)) {
+ JMenu group = new JMenu(groupName);
+ menu.add(group);
+ for (final String algos : entry.getValue().keySet()) {
+ JMenuItem algoItem = new JMenuItem(algos);
+ algoItem.putClientProperty(NAME, groupName);
+ algoItem.addActionListener(l);
+ group.add(algoItem);
+ }
}
}
}
@@ -132,6 +135,14 @@
group.put(algorithmName, new HashMap<PixelleComponent, String>(algorithm));
}
+ public void setCurrent(Map<PixelleComponent, String> algorithm) {
+ addAlgorithm(AlgorithmArchiver.CURRENT, AlgorithmArchiver.CURRENT, algorithm);
+ }
+
+ public Map<PixelleComponent, String> getCurrent() {
+ return getAlgorithm(AlgorithmArchiver.CURRENT, AlgorithmArchiver.CURRENT);
+ }
+
public void removeAlgorithm(String group, String name) {
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-11-14 05:39:04 UTC (rev 175)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-11-14 05:50:34 UTC (rev 176)
@@ -21,8 +21,6 @@
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.GridLayout;
-import java.awt.Menu;
-import java.awt.MenuItem;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@@ -42,7 +40,6 @@
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JTextField;
-import javax.swing.MenuElement;
import com.mebigfatguy.pixelle.AlgorithmArchiver;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -55,7 +52,6 @@
private static final long serialVersionUID = -420573137466431577L;
private static final int NUM_LABELS = 5;
- private static final String CURRENT = "current_";
private final JLabel lhs[] =
{
@@ -154,7 +150,7 @@
}
});
try {
- Map<PixelleComponent, String> algorithms = AlgorithmArchiver.getArchiver().getAlgorithm(CURRENT, CURRENT);
+ Map<PixelleComponent, String> algorithms = AlgorithmArchiver.getArchiver().getCurrent();
if (algorithms != null) {
editor[0].setText(algorithms.get(PixelleComponent.RED));
editor[1].setText(algorithms.get(PixelleComponent.GREEN));
@@ -248,7 +244,7 @@
public void actionPerformed(ActionEvent ae) {
Map<PixelleComponent, String> algorithm = getAlgorithms();
AlgorithmArchiver archiver = AlgorithmArchiver.getArchiver();
- archiver.addAlgorithm(CURRENT, CURRENT, algorithm);
+ archiver.setCurrent(algorithm);
archiver.save();
clickedOK = true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 05:39:13
|
Revision: 175
http://pixelle.svn.sourceforge.net/pixelle/?rev=175&view=rev
Author: dbrosius
Date: 2008-11-14 05:39:04 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
update pic
Modified Paths:
--------------
trunk/pixelle/htdocs/algodlg.png
Modified: trunk/pixelle/htdocs/algodlg.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 05:36:17
|
Revision: 174
http://pixelle.svn.sourceforge.net/pixelle/?rev=174&view=rev
Author: dbrosius
Date: 2008-11-14 05:36:12 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
update docs
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-11-14 05:17:58 UTC (rev 173)
+++ trunk/pixelle/htdocs/index.html 2008-11-14 05:36:12 UTC (rev 174)
@@ -82,7 +82,7 @@
The number e, the base of the natural logarithms</li>
</ul>
- <p><pre>As of July 4, simple expressions should work. Some examples:
+ <p><pre>As of November 14, simple expressions should work. Some examples:
p[x,y].r = <b>(x + y) == 100 ? 255 : p[x,y].r</b>
@@ -118,7 +118,7 @@
</pre></p>
<p>Still to be done is recognition of more image types, working with multiple
- input sources, saving named algorithms, creating non ABGR images, more options handling such as fractional pixels,
+ input sources, creating non ABGR images, more options handling such as fractional pixels,
a bunch of bugs, and a bunch of stuff I have yet to think about.</p>
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-11-14 05:18:03
|
Revision: 173
http://pixelle.svn.sourceforge.net/pixelle/?rev=173&view=rev
Author: dbrosius
Date: 2008-11-14 05:17:58 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
save the current algorithm
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-11-14 04:51:08 UTC (rev 172)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-11-14 05:17:58 UTC (rev 173)
@@ -21,6 +21,8 @@
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.GridLayout;
+import java.awt.Menu;
+import java.awt.MenuItem;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@@ -40,6 +42,7 @@
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JTextField;
+import javax.swing.MenuElement;
import com.mebigfatguy.pixelle.AlgorithmArchiver;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -52,6 +55,7 @@
private static final long serialVersionUID = -420573137466431577L;
private static final int NUM_LABELS = 5;
+ private static final String CURRENT = "current_";
private final JLabel lhs[] =
{
@@ -149,6 +153,18 @@
editor[4].setText(algorithms.get(PixelleComponent.SELECTION));
}
});
+ try {
+ Map<PixelleComponent, String> algorithms = AlgorithmArchiver.getArchiver().getAlgorithm(CURRENT, CURRENT);
+ if (algorithms != null) {
+ editor[0].setText(algorithms.get(PixelleComponent.RED));
+ editor[1].setText(algorithms.get(PixelleComponent.GREEN));
+ editor[2].setText(algorithms.get(PixelleComponent.BLUE));
+ editor[3].setText(algorithms.get(PixelleComponent.TRANSPARENCY));
+ editor[4].setText(algorithms.get(PixelleComponent.SELECTION));
+ }
+ } catch (IllegalArgumentException iae) {
+ }
+
savedAlgorithms.setInvoker(selectedAlgorithm);
optionsPanel.add(savedAlgorithms);
optionsPanel.add(Box.createHorizontalGlue());
@@ -230,6 +246,11 @@
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
+ Map<PixelleComponent, String> algorithm = getAlgorithms();
+ AlgorithmArchiver archiver = AlgorithmArchiver.getArchiver();
+ archiver.addAlgorithm(CURRENT, CURRENT, algorithm);
+ archiver.save();
+
clickedOK = true;
dispose();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|