pixelle-commit Mailing List for pixelle (Page 11)
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-06-25 02:51:43
|
Revision: 72
http://pixelle.svn.sourceforge.net/pixelle/?rev=72&view=rev
Author: dbrosius
Date: 2008-06-24 19:51:52 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleClassLoader.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleClassLoader.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleClassLoader.java 2008-06-25 02:48:55 UTC (rev 71)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleClassLoader.java 2008-06-25 02:51:52 UTC (rev 72)
@@ -18,11 +18,28 @@
*/
package com.mebigfatguy.pixelle;
+/**
+ * a dynamic class loader for holding generated pixel evaluation classes that
+ * are derived from PixelleEval. An instance of this class loader only exists
+ * as long as it takes to transform the bitmap.
+ */
public class PixelleClassLoader extends ClassLoader {
+ /**
+ * constructs a new dynamic class loader derived from a parent loader as per
+ * the classloader delegation paradigm.
+ *
+ * @param parent the parent class loader
+ */
public PixelleClassLoader(ClassLoader parent) {
super(parent);
}
+ /**
+ * adds a new dynamic class to the class loader
+ *
+ * @param name the name of the class to add
+ * @param byteCode the data that represents the bytecode of the class
+ */
public void addClass(String name, byte[] byteCode) {
defineClass(name, byteCode, 0, byteCode.length);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-25 02:48:46
|
Revision: 71
http://pixelle.svn.sourceforge.net/pixelle/?rev=71&view=rev
Author: dbrosius
Date: 2008-06-24 19:48:55 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-06-25 02:47:29 UTC (rev 70)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-06-25 02:48:55 UTC (rev 71)
@@ -20,6 +20,9 @@
import java.util.ResourceBundle;
+/**
+ * manages the resource bundle using in the program
+ */
public class PixelleBundle {
public static final String OK = "ok";
@@ -70,6 +73,12 @@
{
}
+ /**
+ * returns a localized string from a given key
+ *
+ * @param key the key of the string to return
+ * @return the localized string
+ */
public static String getString(String key) {
return rb.getString(key);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-25 02:47:20
|
Revision: 70
http://pixelle.svn.sourceforge.net/pixelle/?rev=70&view=rev
Author: dbrosius
Date: 2008-06-24 19:47:29 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/Pixelle.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/Pixelle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/Pixelle.java 2008-06-25 02:46:15 UTC (rev 69)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/Pixelle.java 2008-06-25 02:47:29 UTC (rev 70)
@@ -22,8 +22,17 @@
import com.mebigfatguy.pixelle.utils.GuiUtils;
+/**
+ * the main class of the program
+
+ */
public class Pixelle {
+ /**
+ * the main method of the program
+ *
+ * @param args command line arguments
+ */
public static void main(String[] args) {
PixelleFrame pf = new PixelleFrame();
Rectangle bounds = GuiUtils.getScreenBounds();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-25 02:46:09
|
Revision: 69
http://pixelle.svn.sourceforge.net/pixelle/?rev=69&view=rev
Author: dbrosius
Date: 2008-06-24 19:46:15 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java 2008-06-25 02:43:28 UTC (rev 68)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java 2008-06-25 02:46:15 UTC (rev 69)
@@ -20,17 +20,34 @@
import java.awt.Color;
+/**
+ * an enum that represents what to do when an index specified is outside the coordinates
+ * of the source bitmap.
+ */
public enum OutOfBoundsOption {
+ /** use the specified color */
SpecifiedColor,
+ /** use the closest border color */
BorderColor,
+ /** calculate a new index using the modulus function of the width or height */
WrapColor;
private Color color = Color.WHITE;
+ /**
+ * retrieves the color that is used for when the enum is 'SpecifiedColor'
+ *
+ * @return the specified color
+ */
public Color getColor() {
return color;
}
+ /**
+ * sets the color that is used for when the enum is 'SpecifiedColor'
+ *
+ * @param the specified color
+ */
public void setColor(Color clr) {
color = clr;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-25 02:43:21
|
Revision: 68
http://pixelle.svn.sourceforge.net/pixelle/?rev=68&view=rev
Author: dbrosius
Date: 2008-06-24 19:43:28 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
record the op for later use
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2008-06-25 02:42:32 UTC (rev 67)
+++ trunk/pixelle/etc/Pixelle.g 2008-06-25 02:43:28 UTC (rev 68)
@@ -68,7 +68,7 @@
eq_expr ( '||' eq_expr )* ;
eq_expr :
- rel_expr ( ('==' | '!=') rel_expr )* ;
+ rel_expr ( op=('==' | '!=') rel_expr {} )* ;
rel_expr :
add_expr ( rel_op add_expr )* ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-25 02:42:43
|
Revision: 67
http://pixelle.svn.sourceforge.net/pixelle/?rev=67&view=rev
Author: dbrosius
Date: 2008-06-24 19:42:32 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
javadoc
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-06-24 04:15:06 UTC (rev 66)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/FrameMgr.java 2008-06-25 02:42:32 UTC (rev 67)
@@ -23,6 +23,9 @@
import javax.swing.JFrame;
+/**
+ * manages the set of open windows
+ */
public class FrameMgr {
private static FrameMgr mgr = new FrameMgr();
@@ -30,20 +33,39 @@
private FrameMgr() {}
+ /**
+ * return the singleton frame manager
+ */
public static FrameMgr getInstance() {
return mgr;
}
+ /**
+ * add a window to the frame manager
+ *
+ * @param frame the new window that is about to be shown
+ */
public void add(JFrame frame) {
frames.add(frame);
}
+ /**
+ * removes the window from the frame manager. When the last
+ * window is remove, the program exits.
+ *
+ * @param frame the window to remove
+ */
public void remove(JFrame frame) {
frames.remove(frame);
if (frames.size() == 0)
System.exit(0);
}
+ /**
+ * retrieves all the active windows currently on the desktop
+ *
+ * @return a list of window available
+ */
public Set<JFrame> getFrames() {
return new HashSet<JFrame>(frames);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-24 04:15:04
|
Revision: 66
http://pixelle.svn.sourceforge.net/pixelle/?rev=66&view=rev
Author: dbrosius
Date: 2008-06-23 21:15:06 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
start embellishing the grammar
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2008-06-23 22:14:25 UTC (rev 65)
+++ trunk/pixelle/etc/Pixelle.g 2008-06-24 04:15:06 UTC (rev 66)
@@ -55,20 +55,37 @@
pixelle :
expr {mv.visitInsn(Opcodes.DRETURN);mv.visitMaxs(0,0);cw.visitEnd();} ;
-expr
- : term
- ('+' term
- {mv.visitInsn(Opcodes.DADD);}
- | '-' term
- {mv.visitInsn(Opcodes.DSUB);})*;
-
-term
- : factor
- ('*' factor
- {mv.visitInsn(Opcodes.DMUL);}
- | '/' factor
- {mv.visitInsn(Opcodes.DDIV);})*;
+expr :
+ cond_expr ;
+
+cond_expr :
+ cond_or_expr ( '?' expr ':' expr )? ;
+
+cond_or_expr :
+ cond_and_expr ( '&&' cond_and_expr )* ;
+cond_and_expr :
+ eq_expr ( '||' eq_expr )* ;
+
+eq_expr :
+ rel_expr ( ('==' | '!=') rel_expr )* ;
+
+rel_expr :
+ add_expr ( rel_op add_expr )* ;
+
+rel_op :
+ ('<' '=')=>
+ | ('>' '=')=>
+ | '<'
+ | '>'
+ ;
+
+add_expr :
+ mul_expr (op=('+' | '-') mul_expr {mv.visitInsn("+".equals($op.text)?Opcodes.DADD:Opcodes.DSUB);})* ;
+
+mul_expr :
+ factor (op=('*' | '/') factor {mv.visitInsn("*".equals($op.text)?Opcodes.DMUL:Opcodes.DDIV);})* ;
+
factor
: NUMBER
{mv.visitLdcInsn(Double.valueOf($NUMBER.text));}
@@ -85,5 +102,4 @@
NUMBER : '0'..'9'+ ( '.' ('0'..'9'+))?;
NEWLINE:'\r'? '\n' ;
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-23 22:14:16
|
Revision: 65
http://pixelle.svn.sourceforge.net/pixelle/?rev=65&view=rev
Author: dbrosius
Date: 2008-06-23 15:14:25 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-23 05:58:47 UTC (rev 64)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-23 22:14:25 UTC (rev 65)
@@ -25,6 +25,7 @@
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
+import java.awt.image.IndexColorModel;
public class PixelleImage {
@@ -35,7 +36,10 @@
public PixelleImage(BufferedImage img) {
image = img;
- selection = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_BYTE_BINARY);
+ byte[] wb = new byte[] {-1, 0};
+ byte[] alpha = new byte[] {0, -1};
+ IndexColorModel model = new IndexColorModel(1, 2, wb, wb, wb, alpha);
+ selection = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_BYTE_BINARY, model);
composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f);
Graphics g = selection.getGraphics();
g.setColor(Color.WHITE);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-23 05:58:40
|
Revision: 64
http://pixelle.svn.sourceforge.net/pixelle/?rev=64&view=rev
Author: dbrosius
Date: 2008-06-22 22:58:47 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
get rid of the strips, and improve performance
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-23 05:53:42 UTC (rev 63)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-23 05:58:47 UTC (rev 64)
@@ -112,7 +112,12 @@
}
private double getSelectionValue(int x, int y) {
- return srcImage.getSelectionValue(x, y);
+ if ((x & 0x07) == 0) {
+ selectionByte = srcImage.getSelectionByte(x >> 3, y);
+ }
+
+ int bitOffset = 1 << (x & 0x07);
+ return ((selectionByte & bitOffset) == 0) ? 0 : 1;
}
protected void setSelectionValue(int x, int y, double value) {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-23 05:53:42 UTC (rev 63)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-23 05:58:47 UTC (rev 64)
@@ -72,11 +72,10 @@
}
}
- public int getSelectionValue(int x, int y) {
+ public int getSelectionByte(int xByteOffset, int y) {
DataBuffer buffer = selection.getRaster().getDataBuffer();
int byteWidth = (getWidth() + 7) >> 3;
- int byteValue = buffer.getElem(y * byteWidth + (x >> 3));
- return ((byteValue & (1 << (x >> 3))) != 0) ? 1 : 0;
+ return buffer.getElem(y * byteWidth + xByteOffset);
}
public void setSelectionByte(int xByteOffset, int y, int byteValue) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-23 05:53:33
|
Revision: 63
http://pixelle.svn.sourceforge.net/pixelle/?rev=63&view=rev
Author: dbrosius
Date: 2008-06-22 22:53:42 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
unbreak getting selection
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-23 05:41:26 UTC (rev 62)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-23 05:53:42 UTC (rev 63)
@@ -74,12 +74,14 @@
public int getSelectionValue(int x, int y) {
DataBuffer buffer = selection.getRaster().getDataBuffer();
- return buffer.getElem(y * image.getWidth() + x);
+ int byteWidth = (getWidth() + 7) >> 3;
+ int byteValue = buffer.getElem(y * byteWidth + (x >> 3));
+ return ((byteValue & (1 << (x >> 3))) != 0) ? 1 : 0;
}
public void setSelectionByte(int xByteOffset, int y, int byteValue) {
DataBuffer buffer = selection.getRaster().getDataBuffer();
- int byteWidth = (getWidth() + 7) / 8;
+ int byteWidth = (getWidth() + 7) >> 3;
buffer.setElem(y * byteWidth + xByteOffset, byteValue);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-23 05:41:17
|
Revision: 62
http://pixelle.svn.sourceforge.net/pixelle/?rev=62&view=rev
Author: dbrosius
Date: 2008-06-22 22:41:26 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
selection barely working - not really
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-23 03:54:13 UTC (rev 61)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-23 05:41:26 UTC (rev 62)
@@ -116,7 +116,7 @@
}
protected void setSelectionValue(int x, int y, double value) {
- if ((x & 0x03) == 0) {
+ if ((x & 0x07) == 0) {
selectionByte = 0;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-23 03:54:13 UTC (rev 61)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-23 05:41:26 UTC (rev 62)
@@ -36,7 +36,10 @@
image = img;
selection = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_BYTE_BINARY);
- composite = AlphaComposite.getInstance(AlphaComposite.XOR, 0.5f);
+ composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f);
+ Graphics g = selection.getGraphics();
+ g.setColor(Color.WHITE);
+ g.fillRect(0, 0, getWidth(), getHeight());
}
public int getType() {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-23 03:54:13 UTC (rev 61)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-23 05:41:26 UTC (rev 62)
@@ -28,7 +28,6 @@
import org.antlr.runtime.ANTLRStringStream;
import org.antlr.runtime.CharStream;
import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.RecognitionException;
import com.mebigfatguy.pixelle.antlr.PixelleLexer;
import com.mebigfatguy.pixelle.antlr.PixelleParser;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-23 03:54:10
|
Revision: 61
http://pixelle.svn.sourceforge.net/pixelle/?rev=61&view=rev
Author: dbrosius
Date: 2008-06-22 20:54:13 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
start hooking up selection processing
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteABGR.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-23 01:14:48 UTC (rev 60)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-23 03:54:13 UTC (rev 61)
@@ -28,6 +28,7 @@
protected int width;
protected int height;
protected OutOfBoundsOption oobOption;
+ private int selectionByte;
public PixelleEval(PixelleImage image, OutOfBoundsOption option) {
srcImage = image;
@@ -111,9 +112,22 @@
}
private double getSelectionValue(int x, int y) {
- return 0.0;
+ return srcImage.getSelectionValue(x, y);
}
- private void setSelectionValue(int x, int y, double value) {
+ protected void setSelectionValue(int x, int y, double value) {
+ if ((x & 0x03) == 0) {
+ selectionByte = 0;
+ }
+
+ int imageWidth = srcImage.getWidth();
+ int bitOffset = 1 << (x & 0x07);
+ if (value == 0.0)
+ selectionByte &= ~bitOffset;
+ else
+ selectionByte |= bitOffset;
+
+ if (((x & 0x07) == 7) || (x == imageWidth))
+ srcImage.setSelectionByte(x >> 3, y, selectionByte);
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-06-23 01:14:48 UTC (rev 60)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-06-23 03:54:13 UTC (rev 61)
@@ -50,6 +50,9 @@
case BufferedImage.TYPE_BYTE_BINARY:
break;
+ case BufferedImage.TYPE_BYTE_INDEXED:
+ break;
+
case BufferedImage.TYPE_BYTE_GRAY:
return new PixelleEvalByteGray(image, oobOption);
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-23 01:14:48 UTC (rev 60)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-23 03:54:13 UTC (rev 61)
@@ -18,23 +18,25 @@
*/
package com.mebigfatguy.pixelle;
+import java.awt.AlphaComposite;
import java.awt.Color;
+import java.awt.Composite;
import java.awt.Graphics;
+import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
-import java.awt.image.IndexColorModel;
public class PixelleImage {
private BufferedImage image;
private BufferedImage selection;
+ private Composite composite;
public PixelleImage(BufferedImage img) {
image = img;
- byte[] color = new byte[] {0, -1};
- IndexColorModel bw = new IndexColorModel(1, 2, color, color, color);
- selection = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_BYTE_BINARY, bw);
+ selection = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_BYTE_BINARY);
+ composite = AlphaComposite.getInstance(AlphaComposite.XOR, 0.5f);
}
public int getType() {
@@ -52,8 +54,29 @@
public DataBuffer getBuffer() {
return image.getRaster().getDataBuffer();
}
+
public void draw(Graphics g, int left, int top, int width, int height) {
g.drawImage(image, left, top, width, height, Color.WHITE, null);
+ if (g instanceof Graphics2D) {
+ Graphics2D g2d = (Graphics2D)g;
+ Composite saveComposite = g2d.getComposite();
+ try {
+ g2d.setComposite(composite);
+ g.drawImage(selection, left, top, width, height, Color.WHITE, null);
+ } finally {
+ g2d.setComposite(saveComposite);
+ }
+ }
}
-
+
+ public int getSelectionValue(int x, int y) {
+ DataBuffer buffer = selection.getRaster().getDataBuffer();
+ return buffer.getElem(y * image.getWidth() + x);
+ }
+
+ public void setSelectionByte(int xByteOffset, int y, int byteValue) {
+ DataBuffer buffer = selection.getRaster().getDataBuffer();
+ int byteWidth = (getWidth() + 7) / 8;
+ buffer.setElem(y * byteWidth + xByteOffset, byteValue);
+ }
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-23 01:14:48 UTC (rev 60)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-23 03:54:13 UTC (rev 61)
@@ -28,6 +28,7 @@
import org.antlr.runtime.ANTLRStringStream;
import org.antlr.runtime.CharStream;
import org.antlr.runtime.CommonTokenStream;
+import org.antlr.runtime.RecognitionException;
import com.mebigfatguy.pixelle.antlr.PixelleLexer;
import com.mebigfatguy.pixelle.antlr.PixelleParser;
@@ -44,6 +45,10 @@
}
public PixelleImage transform() throws PixelleTransformException {
+
+ String currentComponent = "";
+ String currentAlgorithm = "";
+
try {
/** eventually allow for gui to set width/height */
PixelleImage destImage = new PixelleImage(new BufferedImage(srcImage.getWidth(), srcImage.getHeight(), BufferedImage.TYPE_4BYTE_ABGR));
@@ -58,17 +63,21 @@
});
for (Map.Entry<PixelleComponent, String> entry : algorithms.entrySet()) {
- CharStream cs = new ANTLRStringStream(entry.getValue());
+ currentComponent = entry.getKey().name();
+ currentAlgorithm = entry.getValue();
+
+ CharStream cs = new ANTLRStringStream(currentAlgorithm);
PixelleLexer pl = new PixelleLexer(cs);
CommonTokenStream tokens = new CommonTokenStream();
tokens.setTokenSource(pl);
- String clsName = "com.mebigfatguy.pixelle.asm.PixelleExpr" + entry.getKey().name();
+
+ String clsName = "com.mebigfatguy.pixelle.asm.PixelleExpr" + currentComponent;
PixelleParser pp = new PixelleParser(tokens, clsName);
pp.pixelle();
byte[] bytes = pp.getClassBytes();
- dump(bytes, clsName + ".class");
+ dump(bytes, clsName.substring(clsName.lastIndexOf('.') + 1) + ".class");
pcl.addClass(clsName, bytes);
Class<?> cl = pcl.loadClass(clsName);
@@ -81,16 +90,14 @@
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
double value = expr.eval(srcPE, x, y);
-
destPE.setValue(x, y, pixelSpec, value);
}
}
}
return destImage;
-
} catch (Exception e) {
- throw new PixelleTransformException("Failed transforming the image", e);
+ throw new PixelleTransformException("Failed to transform the image: " + currentComponent + ": " + currentAlgorithm, e);
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteABGR.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteABGR.java 2008-06-23 01:14:48 UTC (rev 60)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteABGR.java 2008-06-23 03:54:13 UTC (rev 61)
@@ -73,6 +73,7 @@
break;
case 's':
+ setSelectionValue(x, y, value);
break;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-23 01:14:40
|
Revision: 60
http://pixelle.svn.sourceforge.net/pixelle/?rev=60&view=rev
Author: dbrosius
Date: 2008-06-22 18:14:48 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
use the PixelleTransformException rather than the hookey return null paradigm.
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-23 01:12:59 UTC (rev 59)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-23 01:14:48 UTC (rev 60)
@@ -43,7 +43,7 @@
algorithms = algos;
}
- public PixelleImage transform() {
+ public PixelleImage transform() throws PixelleTransformException {
try {
/** eventually allow for gui to set width/height */
PixelleImage destImage = new PixelleImage(new BufferedImage(srcImage.getWidth(), srcImage.getHeight(), BufferedImage.TYPE_4BYTE_ABGR));
@@ -90,7 +90,7 @@
return destImage;
} catch (Exception e) {
- return null;
+ throw new PixelleTransformException("Failed transforming the image", e);
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java 2008-06-23 01:12:59 UTC (rev 59)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java 2008-06-23 01:14:48 UTC (rev 60)
@@ -21,10 +21,12 @@
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
+import javax.swing.JOptionPane;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
import com.mebigfatguy.pixelle.PixelleImage;
+import com.mebigfatguy.pixelle.PixelleTransformException;
import com.mebigfatguy.pixelle.PixelleTransformer;
import com.mebigfatguy.pixelle.dialogs.PixelleExpressionDialog;
@@ -39,17 +41,21 @@
}
public void actionPerformed(ActionEvent e) {
- PixelleExpressionDialog d = new PixelleExpressionDialog(frame);
- d.setLocationRelativeTo(frame);
- d.setModal(true);
- d.setVisible(true);
- if (d.isOK()) {
- PixelleTransformer transformer = new PixelleTransformer(frame.getImage(), d.getAlgorithms());
- PixelleImage dstImage = transformer.transform();
- if (dstImage != null) {
- PixelleFrame f = new PixelleFrame(dstImage);
- f.setVisible(true);
+ try {
+ PixelleExpressionDialog d = new PixelleExpressionDialog(frame);
+ d.setLocationRelativeTo(frame);
+ d.setModal(true);
+ d.setVisible(true);
+ if (d.isOK()) {
+ PixelleTransformer transformer = new PixelleTransformer(frame.getImage(), d.getAlgorithms());
+ PixelleImage dstImage = transformer.transform();
+ if (dstImage != null) {
+ PixelleFrame f = new PixelleFrame(dstImage);
+ f.setVisible(true);
+ }
}
+ } catch (PixelleTransformException pe) {
+ JOptionPane.showMessageDialog(frame, pe.getMessage());
}
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-23 01:12:52
|
Revision: 59
http://pixelle.svn.sourceforge.net/pixelle/?rev=59&view=rev
Author: dbrosius
Date: 2008-06-22 18:12:59 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
an exception representing a failed pixel transformation
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformException.java
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformException.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformException.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformException.java 2008-06-23 01:12:59 UTC (rev 59)
@@ -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;
+
+public class PixelleTransformException extends Exception {
+ private static final long serialVersionUID = -7209029044223677078L;
+
+ public PixelleTransformException(String message, Throwable initCause) {
+ super(message, initCause);
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: 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-06-23 01:08:55
|
Revision: 58
http://pixelle.svn.sourceforge.net/pixelle/?rev=58&view=rev
Author: dbrosius
Date: 2008-06-22 18:09:02 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
make setZoom final
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-06-23 01:07:26 UTC (rev 57)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-23 01:09:02 UTC (rev 58)
@@ -216,7 +216,7 @@
}
}
- public void setZoom(final ZoomLevel zoom) {
+ public final void setZoom(final ZoomLevel zoom) {
if (image == null)
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-23 01:07:17
|
Revision: 57
http://pixelle.svn.sourceforge.net/pixelle/?rev=57&view=rev
Author: dbrosius
Date: 2008-06-22 18:07:26 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
don't document runtime exceptions
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-06-23 00:57:50 UTC (rev 56)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-06-23 01:07:26 UTC (rev 57)
@@ -38,7 +38,7 @@
oobOption = option;
}
- public static PixelleEval create(PixelleImage image) throws IllegalArgumentException {
+ public static PixelleEval create(PixelleImage image) {
switch (image.getType()) {
case BufferedImage.TYPE_3BYTE_BGR:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-23 00:57:44
|
Revision: 56
http://pixelle.svn.sourceforge.net/pixelle/?rev=56&view=rev
Author: dbrosius
Date: 2008-06-22 17:57:50 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
oi
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-22 15:08:52 UTC (rev 55)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-23 00:57:50 UTC (rev 56)
@@ -23,7 +23,6 @@
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.awt.image.IndexColorModel;
-import java.awt.image.SampleModel;
public class PixelleImage {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-22 15:08:43
|
Revision: 55
http://pixelle.svn.sourceforge.net/pixelle/?rev=55&view=rev
Author: dbrosius
Date: 2008-06-22 08:08:52 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
oi
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-22 15:06:22 UTC (rev 54)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-22 15:08:52 UTC (rev 55)
@@ -38,7 +38,6 @@
import com.mebigfatguy.pixelle.OutOfBoundsOption;
import com.mebigfatguy.pixelle.PixelleBundle;
-import com.mebigfatguy.pixelle.PixelleEvalFactory;
import com.mebigfatguy.pixelle.PixelleFrame;
import com.mebigfatguy.pixelle.utils.GuiUtils;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-22 15:06:17
|
Revision: 54
http://pixelle.svn.sourceforge.net/pixelle/?rev=54&view=rev
Author: dbrosius
Date: 2008-06-22 08:06:22 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
hook up the out of bounds color
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-22 14:45:54 UTC (rev 53)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-22 15:06:22 UTC (rev 54)
@@ -18,6 +18,7 @@
*/
package com.mebigfatguy.pixelle;
+import java.awt.Color;
import java.awt.image.DataBuffer;
public abstract class PixelleEval {
@@ -44,10 +45,41 @@
public double getValue(int x, int y, char pixelSpec) {
/* in the future, allow customization of out of bounds indices */
- if ((x < 0) || (x >= width))
- return 1.0;
- if ((y < 0) || (y >= height))
- return 1.0;
+ if (((x < 0) || (x >= width)) || ((y < 0) || (y >= height))) {
+ switch (oobOption) {
+ case SpecifiedColor:
+ Color c = oobOption.getColor();
+ switch (pixelSpec) {
+ case 'r':
+ return c.getRed();
+ case 'g':
+ return c.getGreen();
+ case 'b':
+ return c.getBlue();
+ case 't':
+ return 1.0;
+ case 's':
+ default:
+ return 0.0;
+ }
+
+ case BorderColor:
+ if (x < 0)
+ x = 0;
+ else if (x >= width)
+ x = width - 1;
+ if (y < 0)
+ y = 0;
+ else if (y >= height)
+ y = height - 1;
+ break;
+
+ case WrapColor:
+ x %= width;
+ y %= height;
+ break;
+ }
+ }
switch (pixelSpec) {
case 'r':
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-22 14:45:54 UTC (rev 53)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-22 15:06:22 UTC (rev 54)
@@ -53,17 +53,27 @@
private JButton ok = new JButton(PixelleBundle.getString(PixelleBundle.OK));
private JButton cancel = new JButton(PixelleBundle.getString(PixelleBundle.CANCEL));
private boolean okClicked = false;
+ private Color color;
private OutOfBoundsOption oobOption;
public PixelleOptionsDialog(PixelleFrame owner, OutOfBoundsOption option) {
super(owner, PixelleBundle.getString(PixelleBundle.PIXEL_OPTIONS));
oobOption = option;
+ color = oobOption.getColor();
initComponents();
initListeners();
pack();
}
public boolean isOK() {
+ if (colorBox.isSelected()) {
+ oobOption = OutOfBoundsOption.SpecifiedColor;
+ oobOption.setColor(color);
+ }
+ else if (borderColorBox.isSelected())
+ oobOption = OutOfBoundsOption.BorderColor;
+ else
+ oobOption = OutOfBoundsOption.WrapColor;
return okClicked;
}
@@ -82,7 +92,7 @@
GuiUtils.sizeUniformly(GuiUtils.Sizing.Height, colorBox, colorButton, borderColorBox, wrappedColorBox);
- colorButton.setColor(oobOption.getColor());
+ colorButton.setColor(color);
JPanel colorP = new JPanel();
colorP.setLayout(new BoxLayout(colorP, BoxLayout.X_AXIS));
@@ -158,9 +168,9 @@
colorButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
colorBox.setSelected(true);
- Color chosenColor = JColorChooser.showDialog(PixelleOptionsDialog.this, PixelleBundle.getString(PixelleBundle.PICK_COLOR), oobOption.getColor());
+ Color chosenColor = JColorChooser.showDialog(PixelleOptionsDialog.this, PixelleBundle.getString(PixelleBundle.PICK_COLOR), color);
if (chosenColor != null) {
- oobOption.setColor(chosenColor);
+ color = chosenColor;
colorButton.setColor(chosenColor);
colorButton.repaint();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-22 14:45:45
|
Revision: 53
http://pixelle.svn.sourceforge.net/pixelle/?rev=53&view=rev
Author: dbrosius
Date: 2008-06-22 07:45:54 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
use value passed into ctor
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-22 14:44:43 UTC (rev 52)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-22 14:45:54 UTC (rev 53)
@@ -82,8 +82,6 @@
GuiUtils.sizeUniformly(GuiUtils.Sizing.Height, colorBox, colorButton, borderColorBox, wrappedColorBox);
- oobOption = PixelleEvalFactory.getOutOfBoundsOption();
-
colorButton.setColor(oobOption.getColor());
JPanel colorP = new JPanel();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-22 14:44:35
|
Revision: 52
http://pixelle.svn.sourceforge.net/pixelle/?rev=52&view=rev
Author: dbrosius
Date: 2008-06-22 07:44:43 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
get out of bounds options working
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.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/eval/PixelleEval3ByteABGR.java
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteBGR.java
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalByteGray.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java 2008-06-22 14:27:07 UTC (rev 51)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java 2008-06-22 14:44:43 UTC (rev 52)
@@ -25,7 +25,7 @@
BorderColor,
WrapColor;
- private Color color;
+ private Color color = Color.WHITE;
public Color getColor() {
return color;
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-22 14:27:07 UTC (rev 51)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-22 14:44:43 UTC (rev 52)
@@ -26,12 +26,14 @@
protected DataBuffer buffer;
protected int width;
protected int height;
+ protected OutOfBoundsOption oobOption;
- public PixelleEval(PixelleImage image) {
+ public PixelleEval(PixelleImage image, OutOfBoundsOption option) {
srcImage = image;
buffer = image.getBuffer();
width = image.getWidth();
height = image.getHeight();
+ oobOption = option;
}
public abstract double getRedValue(int x, int y);
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-06-22 14:27:07 UTC (rev 51)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-06-22 14:44:43 UTC (rev 52)
@@ -25,14 +25,24 @@
public class PixelleEvalFactory {
+ private static OutOfBoundsOption oobOption = OutOfBoundsOption.BorderColor;
+
private PixelleEvalFactory() {
}
+ public static OutOfBoundsOption getOutOfBoundsOption() {
+ return oobOption;
+ }
+
+ public static void setOutOfBoundsOption(OutOfBoundsOption option) {
+ oobOption = option;
+ }
+
public static PixelleEval create(PixelleImage image) throws IllegalArgumentException {
switch (image.getType()) {
case BufferedImage.TYPE_3BYTE_BGR:
- return new PixelleEval3ByteBGR(image);
+ return new PixelleEval3ByteBGR(image, oobOption);
case BufferedImage.TYPE_4BYTE_ABGR:
break;
@@ -41,7 +51,7 @@
break;
case BufferedImage.TYPE_BYTE_GRAY:
- return new PixelleEvalByteGray(image);
+ return new PixelleEvalByteGray(image, oobOption);
case BufferedImage.TYPE_INT_ARGB:
break;
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-22 14:27:07 UTC (rev 51)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-22 14:44:43 UTC (rev 52)
@@ -49,7 +49,7 @@
PixelleImage destImage = new PixelleImage(new BufferedImage(srcImage.getWidth(), srcImage.getHeight(), BufferedImage.TYPE_4BYTE_ABGR));
PixelleEval srcPE = PixelleEvalFactory.create(srcImage);
- PixelleEval3ByteABGR destPE = new PixelleEval3ByteABGR(destImage);
+ PixelleEval3ByteABGR destPE = new PixelleEval3ByteABGR(destImage, OutOfBoundsOption.BorderColor);
PixelleClassLoader pcl = AccessController.doPrivileged(new PrivilegedAction<PixelleClassLoader>() {
public PixelleClassLoader run() {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java 2008-06-22 14:27:07 UTC (rev 51)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java 2008-06-22 14:44:43 UTC (rev 52)
@@ -23,6 +23,7 @@
import javax.swing.AbstractAction;
import com.mebigfatguy.pixelle.PixelleBundle;
+import com.mebigfatguy.pixelle.PixelleEvalFactory;
import com.mebigfatguy.pixelle.PixelleFrame;
import com.mebigfatguy.pixelle.dialogs.PixelleOptionsDialog;
@@ -38,11 +39,12 @@
}
public void actionPerformed(ActionEvent e) {
- PixelleOptionsDialog d = new PixelleOptionsDialog(frame);
+ PixelleOptionsDialog d = new PixelleOptionsDialog(frame, PixelleEvalFactory.getOutOfBoundsOption());
d.setLocationRelativeTo(frame);
d.setModal(true);
d.setVisible(true);
if (d.isOK()) {
+ PixelleEvalFactory.setOutOfBoundsOption(d.getOutOfBoundsOption());
}
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-22 14:27:07 UTC (rev 51)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-22 14:44:43 UTC (rev 52)
@@ -36,7 +36,9 @@
import javax.swing.JDialog;
import javax.swing.JPanel;
+import com.mebigfatguy.pixelle.OutOfBoundsOption;
import com.mebigfatguy.pixelle.PixelleBundle;
+import com.mebigfatguy.pixelle.PixelleEvalFactory;
import com.mebigfatguy.pixelle.PixelleFrame;
import com.mebigfatguy.pixelle.utils.GuiUtils;
@@ -51,10 +53,11 @@
private JButton ok = new JButton(PixelleBundle.getString(PixelleBundle.OK));
private JButton cancel = new JButton(PixelleBundle.getString(PixelleBundle.CANCEL));
private boolean okClicked = false;
- private Color defColor = Color.WHITE;
+ private OutOfBoundsOption oobOption;
- public PixelleOptionsDialog(PixelleFrame owner) {
+ public PixelleOptionsDialog(PixelleFrame owner, OutOfBoundsOption option) {
super(owner, PixelleBundle.getString(PixelleBundle.PIXEL_OPTIONS));
+ oobOption = option;
initComponents();
initListeners();
pack();
@@ -64,6 +67,10 @@
return okClicked;
}
+ public OutOfBoundsOption getOutOfBoundsOption() {
+ return oobOption;
+ }
+
private void initComponents() {
Container cp = getContentPane();
cp.setLayout(new BoxLayout(cp, BoxLayout.Y_AXIS));
@@ -74,8 +81,11 @@
p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), PixelleBundle.getString(PixelleBundle.OUT_OF_BOUNDS_PIXELS)));
GuiUtils.sizeUniformly(GuiUtils.Sizing.Height, colorBox, colorButton, borderColorBox, wrappedColorBox);
- colorButton.setColor(defColor);
+ oobOption = PixelleEvalFactory.getOutOfBoundsOption();
+
+ colorButton.setColor(oobOption.getColor());
+
JPanel colorP = new JPanel();
colorP.setLayout(new BoxLayout(colorP, BoxLayout.X_AXIS));
colorP.add(colorBox);
@@ -92,7 +102,19 @@
g.add(borderColorBox);
g.add(wrappedColorBox);
- borderColorBox.setSelected(true);
+ switch (oobOption) {
+ case SpecifiedColor:
+ colorBox.setSelected(true);
+ break;
+
+ case BorderColor:
+ borderColorBox.setSelected(true);
+ break;
+
+ case WrapColor:
+ wrappedColorBox.setSelected(true);
+ break;
+ }
cp.add(p);
}
@@ -138,10 +160,10 @@
colorButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
colorBox.setSelected(true);
- Color chosenColor = JColorChooser.showDialog(PixelleOptionsDialog.this, PixelleBundle.getString(PixelleBundle.PICK_COLOR), defColor);
+ Color chosenColor = JColorChooser.showDialog(PixelleOptionsDialog.this, PixelleBundle.getString(PixelleBundle.PICK_COLOR), oobOption.getColor());
if (chosenColor != null) {
- defColor = chosenColor;
- colorButton.setColor(defColor);
+ oobOption.setColor(chosenColor);
+ colorButton.setColor(chosenColor);
colorButton.repaint();
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteABGR.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteABGR.java 2008-06-22 14:27:07 UTC (rev 51)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteABGR.java 2008-06-22 14:44:43 UTC (rev 52)
@@ -18,13 +18,14 @@
*/
package com.mebigfatguy.pixelle.eval;
+import com.mebigfatguy.pixelle.OutOfBoundsOption;
import com.mebigfatguy.pixelle.PixelleEval;
import com.mebigfatguy.pixelle.PixelleImage;
public class PixelleEval3ByteABGR extends PixelleEval {
- public PixelleEval3ByteABGR(PixelleImage srcImage) {
- super(srcImage);
+ public PixelleEval3ByteABGR(PixelleImage srcImage, OutOfBoundsOption option) {
+ super(srcImage, option);
}
@Override
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteBGR.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteBGR.java 2008-06-22 14:27:07 UTC (rev 51)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteBGR.java 2008-06-22 14:44:43 UTC (rev 52)
@@ -18,13 +18,14 @@
*/
package com.mebigfatguy.pixelle.eval;
+import com.mebigfatguy.pixelle.OutOfBoundsOption;
import com.mebigfatguy.pixelle.PixelleEval;
import com.mebigfatguy.pixelle.PixelleImage;
public class PixelleEval3ByteBGR extends PixelleEval {
- public PixelleEval3ByteBGR(PixelleImage srcImage) {
- super(srcImage);
+ public PixelleEval3ByteBGR(PixelleImage srcImage, OutOfBoundsOption option) {
+ super(srcImage, option);
}
@Override
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalByteGray.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalByteGray.java 2008-06-22 14:27:07 UTC (rev 51)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalByteGray.java 2008-06-22 14:44:43 UTC (rev 52)
@@ -18,13 +18,14 @@
*/
package com.mebigfatguy.pixelle.eval;
+import com.mebigfatguy.pixelle.OutOfBoundsOption;
import com.mebigfatguy.pixelle.PixelleEval;
import com.mebigfatguy.pixelle.PixelleImage;
public class PixelleEvalByteGray extends PixelleEval {
- public PixelleEvalByteGray(PixelleImage srcImage) {
- super(srcImage);
+ public PixelleEvalByteGray(PixelleImage srcImage, OutOfBoundsOption option) {
+ super(srcImage, option);
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-22 14:26:59
|
Revision: 51
http://pixelle.svn.sourceforge.net/pixelle/?rev=51&view=rev
Author: dbrosius
Date: 2008-06-22 07:27:07 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
an enum to determine what to do about out of bounds pixels
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java 2008-06-22 14:27:07 UTC (rev 51)
@@ -0,0 +1,37 @@
+/*
+ * 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;
+
+import java.awt.Color;
+
+public enum OutOfBoundsOption {
+ SpecifiedColor,
+ BorderColor,
+ WrapColor;
+
+ private Color color;
+
+ public Color getColor() {
+ return color;
+ }
+
+ public void setColor(Color clr) {
+ color = clr;
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: 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-06-22 14:10:21
|
Revision: 50
http://pixelle.svn.sourceforge.net/pixelle/?rev=50&view=rev
Author: dbrosius
Date: 2008-06-22 07:10:25 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
more options dialog work
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-22 14:09:48 UTC (rev 49)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-06-22 14:10:25 UTC (rev 50)
@@ -62,6 +62,7 @@
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";
+ public static final String PICK_COLOR = "title.pick_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-22 14:09:48 UTC (rev 49)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java 2008-06-22 14:10:25 UTC (rev 50)
@@ -43,7 +43,6 @@
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-22 14:09:48 UTC (rev 49)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-22 14:10:25 UTC (rev 50)
@@ -18,6 +18,7 @@
*/
package com.mebigfatguy.pixelle.dialogs;
+import java.awt.Color;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
@@ -31,6 +32,7 @@
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JCheckBox;
+import javax.swing.JColorChooser;
import javax.swing.JDialog;
import javax.swing.JPanel;
@@ -40,12 +42,16 @@
public class PixelleOptionsDialog extends JDialog {
+ private static final long serialVersionUID = -2593224982080676492L;
+
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 ColorButton colorButton = new ColorButton(Color.WHITE);
private JButton ok = new JButton(PixelleBundle.getString(PixelleBundle.OK));
private JButton cancel = new JButton(PixelleBundle.getString(PixelleBundle.CANCEL));
private boolean okClicked = false;
+ private Color defColor = Color.WHITE;
public PixelleOptionsDialog(PixelleFrame owner) {
super(owner, PixelleBundle.getString(PixelleBundle.PIXEL_OPTIONS));
@@ -67,9 +73,17 @@
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);
+ GuiUtils.sizeUniformly(GuiUtils.Sizing.Height, colorBox, colorButton, borderColorBox, wrappedColorBox);
+ colorButton.setColor(defColor);
- p.add(colorBox);
+ JPanel colorP = new JPanel();
+ colorP.setLayout(new BoxLayout(colorP, BoxLayout.X_AXIS));
+ colorP.add(colorBox);
+ colorP.add(Box.createHorizontalStrut(5));
+ colorP.add(colorButton);
+ colorP.add(Box.createHorizontalGlue());
+
+ p.add(colorP);
p.add(borderColorBox);
p.add(wrappedColorBox);
@@ -120,5 +134,17 @@
dispose();
}
});
+
+ colorButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent ae) {
+ colorBox.setSelected(true);
+ Color chosenColor = JColorChooser.showDialog(PixelleOptionsDialog.this, PixelleBundle.getString(PixelleBundle.PICK_COLOR), defColor);
+ if (chosenColor != null) {
+ defColor = chosenColor;
+ colorButton.setColor(defColor);
+ colorButton.repaint();
+ }
+ }
+ });
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties 2008-06-22 14:09:48 UTC (rev 49)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties 2008-06-22 14:10:25 UTC (rev 50)
@@ -60,7 +60,8 @@
label.selection = (Selection)
title.pixel_options = Pixel Options
-title.out_of_bounds_pixels = For out of Bounds Pixels use:
+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
+label.wrapped_color = Wrapped color
+title.pick_color = Pick a color for out of bounds indices
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-22 14:09:40
|
Revision: 49
http://pixelle.svn.sourceforge.net/pixelle/?rev=49&view=rev
Author: dbrosius
Date: 2008-06-22 07:09:48 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
a color chooser button
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/ColorButton.java
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/ColorButton.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/ColorButton.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/ColorButton.java 2008-06-22 14:09:48 UTC (rev 49)
@@ -0,0 +1,53 @@
+/*
+ * 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.Color;
+import java.awt.Graphics;
+
+import javax.swing.JButton;
+
+public class ColorButton extends JButton {
+
+ private static final long serialVersionUID = -8845705944739341059L;
+
+ private Color color;
+
+ public ColorButton(Color clr) {
+ color = clr;
+ }
+
+ public void setColor(Color clr) {
+ color = clr;
+ }
+
+ @Override
+ public void paintComponent(Graphics g) {
+ Color saveColor = g.getColor();
+ try {
+ g.setColor(color);
+ g.fillRect(0, 0, getWidth(), getHeight());
+ g.setColor(Color.BLACK);
+ g.drawRect(0, 0, getWidth(), getHeight());
+ }
+ finally {
+ g.setColor(saveColor);
+ }
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/ColorButton.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: 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-06-22 05:30:54
|
Revision: 40
http://pixelle.svn.sourceforge.net/pixelle/?rev=40&view=rev
Author: dbrosius
Date: 2008-06-21 09:21:30 -0700 (Sat, 21 Jun 2008)
Log Message:
-----------
when the last window closes, shutdown the app
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/FrameMgr.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/FrameMgr.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/FrameMgr.java 2008-06-21 03:11:14 UTC (rev 39)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/FrameMgr.java 2008-06-21 16:21:30 UTC (rev 40)
@@ -40,6 +40,8 @@
public void remove(JFrame frame) {
frames.remove(frame);
+ if (frames.size() == 0)
+ System.exit(0);
}
public Set<JFrame> getFrames() {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-21 03:11:14 UTC (rev 39)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-21 16:21:30 UTC (rev 40)
@@ -22,6 +22,8 @@
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.util.ResourceBundle;
@@ -84,6 +86,7 @@
public PixelleFrame() {
initComponents();
+ initListeners();
setTitle(rb.getString("pixelle.title"));
}
@@ -173,6 +176,16 @@
cp.setLayout(new BorderLayout());
}
+ private void initListeners() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent we) {
+ dispose();
+ FrameMgr.getInstance().remove(PixelleFrame.this);
+ }
+ });
+ }
+
public PixelleImage getImage() {
return image;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|