pixelle-commit Mailing List for pixelle (Page 8)
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-07-06 21:29:32
|
Revision: 147
http://pixelle.svn.sourceforge.net/pixelle/?rev=147&view=rev
Author: dbrosius
Date: 2008-07-06 14:29:32 -0700 (Sun, 06 Jul 2008)
Log Message:
-----------
copy over xml and xsd files as well
Modified Paths:
--------------
trunk/pixelle/build.xml
Modified: trunk/pixelle/build.xml
===================================================================
--- trunk/pixelle/build.xml 2008-07-06 21:18:35 UTC (rev 146)
+++ trunk/pixelle/build.xml 2008-07-06 21:29:32 UTC (rev 147)
@@ -77,6 +77,8 @@
<fileset dir="${src.dir}">
<include name="**/*.properties"/>
<include name="**/*.png"/>
+ <include name="**/*.xml"/>
+ <include name="**/*.xsd"/>
</fileset>
</copy>
<copy todir="${jnlp.dir}">
@@ -111,6 +113,8 @@
<include name="**/*.class"/>
<include name="**/*.properties"/>
<include name="**/*.png"/>
+ <include name="**/*.xml"/>
+ <include name="**/*.xsd"/>
</fileset>
<fileset dir="${basedir}">
<include name="license.txt"/>
@@ -134,7 +138,10 @@
<include name="**/*.properties"/>
<include name="**/*.png"/>
<include name="**/*.g"/>
+ <include name="**/*.xml"/>
+ <include name="**/*.xsd"/>
<include name="lib/*.jar"/>
+
</fileset>
</zip>
</target>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-07-06 21:18:35
|
Revision: 146
http://pixelle.svn.sourceforge.net/pixelle/?rev=146&view=rev
Author: dbrosius
Date: 2008-07-06 14:18:35 -0700 (Sun, 06 Jul 2008)
Log Message:
-----------
close methods s/b static
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-07-06 21:17:18 UTC (rev 145)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java 2008-07-06 21:18:35 UTC (rev 146)
@@ -28,7 +28,7 @@
private Closer() {
}
- public void close(InputStream is) {
+ public static void close(InputStream is) {
try {
if (is != null) {
is.close();
@@ -37,7 +37,7 @@
}
}
- public void close(OutputStream os) {
+ public static void close(OutputStream os) {
try {
if (os != null) {
os.close();
@@ -46,7 +46,7 @@
}
}
- public void close(Reader r) {
+ public static void close(Reader r) {
try {
if (r != null) {
r.close();
@@ -55,7 +55,7 @@
}
}
- public void close(Writer w) {
+ public static void close(Writer w) {
try {
if (w != null) {
w.close();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-07-06 21:17:18
|
Revision: 145
http://pixelle.svn.sourceforge.net/pixelle/?rev=145&view=rev
Author: dbrosius
Date: 2008-07-06 14:17:18 -0700 (Sun, 06 Jul 2008)
Log Message:
-----------
utility to swallow exceptions on close
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java 2008-07-06 21:17:18 UTC (rev 145)
@@ -0,0 +1,67 @@
+/*
+ * 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.utils;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+
+public class Closer {
+ private Closer() {
+ }
+
+ public void close(InputStream is) {
+ try {
+ if (is != null) {
+ is.close();
+ }
+ } catch (IOException ioe) {
+ }
+ }
+
+ public void close(OutputStream os) {
+ try {
+ if (os != null) {
+ os.close();
+ }
+ } catch (IOException ioe) {
+ }
+ }
+
+ public void close(Reader r) {
+ try {
+ if (r != null) {
+ r.close();
+ }
+ } catch (IOException ioe) {
+ }
+ }
+
+ public void close(Writer w) {
+ try {
+ if (w != null) {
+ w.close();
+ }
+ } catch (IOException ioe) {
+ }
+ }
+
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.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-07-06 21:08:22
|
Revision: 144
http://pixelle.svn.sourceforge.net/pixelle/?rev=144&view=rev
Author: dbrosius
Date: 2008-07-06 14:08:20 -0700 (Sun, 06 Jul 2008)
Log Message:
-----------
start adding saved algorithm sets
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xml
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xsd
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java 2008-07-06 21:08:20 UTC (rev 144)
@@ -0,0 +1,54 @@
+/*
+ * 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.util.HashMap;
+import java.util.Map;
+
+import javax.swing.JPopupMenu;
+
+public class AlgorithmArchiver {
+
+ private static AlgorithmArchiver archiver = new AlgorithmArchiver();
+
+ private Map<String, Map<String, Map<PixelleComponent, String>>> systemAlgorithms;
+ private Map<String, Map<String, Map<PixelleComponent, String>>> userAlgorithms;
+
+ private AlgorithmArchiver() {
+ systemAlgorithms = new HashMap<String, Map<String, Map<PixelleComponent, String>>>();
+ userAlgorithms = new HashMap<String, Map<String, Map<PixelleComponent, String>>>();
+
+ }
+
+ public static AlgorithmArchiver getArchiver() {
+ return archiver;
+ }
+
+ public JPopupMenu getAlgorithmDisplayPopup() {
+ return new JPopupMenu(PixelleBundle.getString(PixelleBundle.PIXEL_ALGORITHM));
+ }
+
+ public void addAlgorithm(String group, String name, Map<PixelleComponent, String> algorithm) {
+
+ }
+
+ public void removeAlgorithm(String group, String name) {
+
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xml
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xml (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xml 2008-07-06 21:08:20 UTC (rev 144)
@@ -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
+ */
+-->
+<algorithms xmlns="http://pixelle.mebigfatguy.com/0.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.w3schools.com note.xsd">
+ <group name="Blends">
+ <algorithm name="simple">
+ <component name="red">
+ x
+ </component>
+ <component name="green">
+ y
+ </component>
+ <component name="blue">
+ width-x
+ </component>
+ <component name="transparency">
+ 255
+ </component>
+ <component name="selection">
+ 0
+ </component>
+ </algorithm>
+ </group>
+</algorithms>
\ No newline at end of file
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xsd
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xsd (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xsd 2008-07-06 21:08:20 UTC (rev 144)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://pixelle.mebigfatguy.com/0.1.0"
+ xmlns="http://pixelle.mebigfatguy.com/0.1.0"
+ elementFormDefault="qualified">
+ <xsd:complexType name="AlgorithmsClass">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="1" name="group" type="GroupClass"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="GroupClass">
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="algorithm" type="AlgorithmClass"/>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required"/>
+ </xsd:complexType>
+ <xsd:complexType name="AlgorithmClass">
+ <xsd:sequence>
+ <xsd:element maxOccurs="5" minOccurs="5" name="component" type="ComponentClass"/>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required"/>
+ </xsd:complexType>
+ <xsd:complexType name="ComponentClass">
+ <xsd:attribute name="name" type="NameClass" use="required"/>
+ </xsd:complexType>
+ <xsd:simpleType name="NameClass">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="transparency"/>
+ <xsd:enumeration value="red"/>
+ <xsd:enumeration value="blue"/>
+ <xsd:enumeration value="selection"/>
+ <xsd:enumeration value="green"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ <xsd:element name="algorithms" type="AlgorithmsClass"/>
+</xsd:schema>
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/xml
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-07-06 06:02:27
|
Revision: 143
http://pixelle.svn.sourceforge.net/pixelle/?rev=143&view=rev
Author: dbrosius
Date: 2008-07-05 23:02:27 -0700 (Sat, 05 Jul 2008)
Log Message:
-----------
more doc
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-07-05 18:56:17 UTC (rev 142)
+++ trunk/pixelle/htdocs/index.html 2008-07-06 06:02:27 UTC (rev 143)
@@ -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, more options handling such as fractional pixels,
+ input sources, saving named algorithms, 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-07-05 18:56:25
|
Revision: 142
http://pixelle.svn.sourceforge.net/pixelle/?rev=142&view=rev
Author: dbrosius
Date: 2008-07-05 11:56:17 -0700 (Sat, 05 Jul 2008)
Log Message:
-----------
more doc
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-07-05 05:30:02 UTC (rev 141)
+++ trunk/pixelle/htdocs/index.html 2008-07-05 18:56:17 UTC (rev 142)
@@ -118,8 +118,8 @@
</pre></p>
<p>Still to be done is recognition of more image types, working with multiple
- input sources, more options handling, a bunch of bugs, and a bunch of stuff I have
- yet to think about.</p>
+ input sources, saving named algorithms, more options handling such as fractional pixels,
+ 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-07-05 05:30:02
|
Revision: 141
http://pixelle.svn.sourceforge.net/pixelle/?rev=141&view=rev
Author: dbrosius
Date: 2008-07-04 22:30:02 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
google analytics right
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-07-05 05:22:38 UTC (rev 140)
+++ trunk/pixelle/htdocs/index.html 2008-07-05 05:30:02 UTC (rev 141)
@@ -122,14 +122,11 @@
yet to think about.</p>
</div>
-<script type="text/javascript">
-var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
-var pageTracker = _gat._getTracker("UA-xxxxxx-x");
-pageTracker._initData();
-pageTracker._trackPageview();
+_uacct = "UA-249537-4";
+urchinTracker();
</script>
</body>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-07-05 05:22:39
|
Revision: 140
http://pixelle.svn.sourceforge.net/pixelle/?rev=140&view=rev
Author: dbrosius
Date: 2008-07-04 22:22:38 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
add google analytics
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-07-05 04:25:41 UTC (rev 139)
+++ trunk/pixelle/htdocs/index.html 2008-07-05 05:22:38 UTC (rev 140)
@@ -121,5 +121,16 @@
input sources, more options handling, a bunch of bugs, and a bunch of stuff I have
yet to think about.</p>
</div>
+
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+var pageTracker = _gat._getTracker("UA-xxxxxx-x");
+pageTracker._initData();
+pageTracker._trackPageview();
+</script>
+
</body>
</html>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-07-05 04:25:41
|
Revision: 139
http://pixelle.svn.sourceforge.net/pixelle/?rev=139&view=rev
Author: dbrosius
Date: 2008-07-04 21:25:41 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
updated website doc
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-07-04 18:58:12 UTC (rev 138)
+++ trunk/pixelle/htdocs/index.html 2008-07-05 04:25:41 UTC (rev 139)
@@ -82,7 +82,7 @@
The number e, the base of the natural logarithms</li>
</ul>
- <p><pre>As of June 28, simple expressions should work. Some examples:
+ <p><pre>As of July 4, simple expressions should work. Some examples:
p[x,y].r = <b>(x + y) == 100 ? 255 : p[x,y].r</b>
@@ -117,8 +117,8 @@
</pre></p>
- <p>Still to be done is recognition of more image types,
- saving output images, more options handling, a bunch of bugs, and a bunch of stuff I have
+ <p>Still to be done is recognition of more image types, working with multiple
+ input sources, more options handling, a bunch of bugs, and a bunch of stuff I have
yet to think about.</p>
</div>
</body>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-07-04 18:58:13
|
Revision: 138
http://pixelle.svn.sourceforge.net/pixelle/?rev=138&view=rev
Author: dbrosius
Date: 2008-07-04 11:58:12 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
fix title for transformed windows, and set create new window to false on unnamed windows.
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-07-04 18:54:50 UTC (rev 137)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-07-04 18:58:12 UTC (rev 138)
@@ -91,7 +91,7 @@
boolean doNewWindow;
public PixelleFrame() throws PixelleTransformException {
- this(new PixelleTransformer(new PixelleImage(), PixelleTransformer.getSampleTransform()).transform());
+ this(new PixelleTransformer(new PixelleImage(), PixelleTransformer.getSampleTransform()).transform(), false);
}
public PixelleFrame(PixelleImage srcImage) {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java 2008-07-04 18:54:50 UTC (rev 137)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java 2008-07-04 18:58:12 UTC (rev 138)
@@ -19,6 +19,7 @@
package com.mebigfatguy.pixelle.actions;
import java.awt.event.ActionEvent;
+import java.text.MessageFormat;
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
@@ -54,6 +55,8 @@
if (dstImage != null) {
if (frame.createNewWindow()) {
PixelleFrame f = new PixelleFrame(dstImage);
+ String title = MessageFormat.format(PixelleBundle.getString(PixelleBundle.TITLE), PixelleBundle.getString(PixelleBundle.UNKNOWN));
+ f.setTitle(title);
f.setVisible(true);
} else
frame.setImage(dstImage);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-07-04 18:54:50
|
Revision: 137
http://pixelle.svn.sourceforge.net/pixelle/?rev=137&view=rev
Author: dbrosius
Date: 2008-07-04 11:54:50 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
better 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-07-04 18:52:11 UTC (rev 136)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-07-04 18:54:50 UTC (rev 137)
@@ -56,7 +56,7 @@
}
/**
- * factory method for creating an pixel evaluator for the type of image that is
+ * factory method for creating a pixel evaluator for the type of image that is
* passed in.
*
* @param image the image that will need to be evaluated
@@ -72,10 +72,10 @@
return new PixelleEval4ByteABGR(image, ioobOption, coobOption);
case BufferedImage.TYPE_BYTE_BINARY:
- break;
+ throw new IllegalArgumentException("Image type: " + image.getType() + " (Byte Binary) is not supported yet.");
case BufferedImage.TYPE_BYTE_INDEXED:
- break;
+ throw new IllegalArgumentException("Image type: " + image.getType() + " (Byte Indexed) is not supported yet.");
case BufferedImage.TYPE_BYTE_GRAY:
return new PixelleEvalByteGray(image, ioobOption, coobOption);
@@ -88,6 +88,9 @@
case BufferedImage.TYPE_INT_RGB:
return new PixelleEvalIntRGB(image, ioobOption, coobOption);
+
+ case BufferedImage.TYPE_CUSTOM:
+ throw new IllegalArgumentException("Image type: " + image.getType() + " (Custom) is not supported yet.");
}
throw new IllegalArgumentException("Unknown image type: " + image.getType());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-07-04 18:52:11
|
Revision: 136
http://pixelle.svn.sourceforge.net/pixelle/?rev=136&view=rev
Author: dbrosius
Date: 2008-07-04 11:52:11 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
oi
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-07-04 18:50:47 UTC (rev 135)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-07-04 18:52:11 UTC (rev 136)
@@ -24,6 +24,7 @@
import com.mebigfatguy.pixelle.eval.PixelleEval4ByteABGR;
import com.mebigfatguy.pixelle.eval.PixelleEvalByteGray;
import com.mebigfatguy.pixelle.eval.PixelleEvalIntARGB;
+import com.mebigfatguy.pixelle.eval.PixelleEvalIntBGR;
import com.mebigfatguy.pixelle.eval.PixelleEvalIntRGB;
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-07-04 18:50:46
|
Revision: 135
http://pixelle.svn.sourceforge.net/pixelle/?rev=135&view=rev
Author: dbrosius
Date: 2008-07-04 11:50:47 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
add support for IntBGR
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntBGR.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-07-04 18:48:31 UTC (rev 134)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-07-04 18:50:47 UTC (rev 135)
@@ -83,11 +83,10 @@
return new PixelleEvalIntARGB(image, ioobOption, coobOption);
case BufferedImage.TYPE_INT_BGR:
- break;
+ return new PixelleEvalIntBGR(image, ioobOption, coobOption);
case BufferedImage.TYPE_INT_RGB:
return new PixelleEvalIntRGB(image, ioobOption, coobOption);
- break;
}
throw new IllegalArgumentException("Unknown image type: " + image.getType());
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntBGR.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntBGR.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntBGR.java 2008-07-04 18:50:47 UTC (rev 135)
@@ -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.eval;
+
+import com.mebigfatguy.pixelle.ColorOutOfBoundsOption;
+import com.mebigfatguy.pixelle.IndexOutOfBoundsOption;
+import com.mebigfatguy.pixelle.PixelleEval;
+import com.mebigfatguy.pixelle.PixelleImage;
+
+public class PixelleEvalIntBGR extends PixelleEval {
+
+ public PixelleEvalIntBGR(PixelleImage srcImage, IndexOutOfBoundsOption iOption, ColorOutOfBoundsOption cOption) {
+ super(srcImage, iOption, cOption);
+ }
+
+ @Override
+ public double getTransparencyValue(int x, int y) {
+ return 255.0;
+ }
+
+ @Override
+ public double getBlueValue(int x, int y) {
+ return (double)((buffer.getElem(y * width + x) >> 16) & 0x00FF);
+ }
+
+ @Override
+ public double getGreenValue(int x, int y) {
+ return (double)((buffer.getElem(y * width + x) >> 8) & 0x00FF);
+ }
+
+ @Override
+ public double getRedValue(int x, int y) {
+ return (double)(buffer.getElem(y * width + x) & 0x00FF);
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntBGR.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-07-04 18:48:31
|
Revision: 134
http://pixelle.svn.sourceforge.net/pixelle/?rev=134&view=rev
Author: dbrosius
Date: 2008-07-04 11:48:31 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
add support for IntRGB
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntRGB.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-07-04 18:45:51 UTC (rev 133)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-07-04 18:48:31 UTC (rev 134)
@@ -24,6 +24,7 @@
import com.mebigfatguy.pixelle.eval.PixelleEval4ByteABGR;
import com.mebigfatguy.pixelle.eval.PixelleEvalByteGray;
import com.mebigfatguy.pixelle.eval.PixelleEvalIntARGB;
+import com.mebigfatguy.pixelle.eval.PixelleEvalIntRGB;
/**
* factory for creating pixel evaluation instances based on the type of image that is
@@ -85,6 +86,7 @@
break;
case BufferedImage.TYPE_INT_RGB:
+ return new PixelleEvalIntRGB(image, ioobOption, coobOption);
break;
}
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntRGB.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntRGB.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntRGB.java 2008-07-04 18:48:31 UTC (rev 134)
@@ -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.eval;
+
+import com.mebigfatguy.pixelle.ColorOutOfBoundsOption;
+import com.mebigfatguy.pixelle.IndexOutOfBoundsOption;
+import com.mebigfatguy.pixelle.PixelleEval;
+import com.mebigfatguy.pixelle.PixelleImage;
+
+public class PixelleEvalIntRGB extends PixelleEval {
+
+ public PixelleEvalIntRGB(PixelleImage srcImage, IndexOutOfBoundsOption iOption, ColorOutOfBoundsOption cOption) {
+ super(srcImage, iOption, cOption);
+ }
+
+ @Override
+ public double getTransparencyValue(int x, int y) {
+ return 255.0;
+ }
+
+ @Override
+ public double getBlueValue(int x, int y) {
+ return (double)(buffer.getElem(y * width + x) & 0x00FF);
+ }
+
+ @Override
+ public double getGreenValue(int x, int y) {
+ return (double)((buffer.getElem(y * width + x) >> 8) & 0x00FF);
+ }
+
+ @Override
+ public double getRedValue(int x, int y) {
+ return (double)((buffer.getElem(y * width + x) >> 16) & 0x00FF);
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntRGB.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-07-04 18:45:54
|
Revision: 133
http://pixelle.svn.sourceforge.net/pixelle/?rev=133&view=rev
Author: dbrosius
Date: 2008-07-04 11:45:51 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
add support for IntARGB
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntARGB.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-07-04 18:08:16 UTC (rev 132)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-07-04 18:45:51 UTC (rev 133)
@@ -23,6 +23,7 @@
import com.mebigfatguy.pixelle.eval.PixelleEval3ByteBGR;
import com.mebigfatguy.pixelle.eval.PixelleEval4ByteABGR;
import com.mebigfatguy.pixelle.eval.PixelleEvalByteGray;
+import com.mebigfatguy.pixelle.eval.PixelleEvalIntARGB;
/**
* factory for creating pixel evaluation instances based on the type of image that is
@@ -78,7 +79,7 @@
return new PixelleEvalByteGray(image, ioobOption, coobOption);
case BufferedImage.TYPE_INT_ARGB:
- break;
+ return new PixelleEvalIntARGB(image, ioobOption, coobOption);
case BufferedImage.TYPE_INT_BGR:
break;
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntARGB.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntARGB.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntARGB.java 2008-07-04 18:45:51 UTC (rev 133)
@@ -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.eval;
+
+import com.mebigfatguy.pixelle.ColorOutOfBoundsOption;
+import com.mebigfatguy.pixelle.IndexOutOfBoundsOption;
+import com.mebigfatguy.pixelle.PixelleEval;
+import com.mebigfatguy.pixelle.PixelleImage;
+
+public class PixelleEvalIntARGB extends PixelleEval {
+
+ public PixelleEvalIntARGB(PixelleImage srcImage, IndexOutOfBoundsOption iOption, ColorOutOfBoundsOption cOption) {
+ super(srcImage, iOption, cOption);
+ }
+
+ @Override
+ public double getTransparencyValue(int x, int y) {
+ return (double)((buffer.getElem(y * width + x) >> 24) & 0x00FF);
+ }
+
+ @Override
+ public double getBlueValue(int x, int y) {
+ return (double)(buffer.getElem(y * width + x) & 0x00FF);
+ }
+
+ @Override
+ public double getGreenValue(int x, int y) {
+ return (double)((buffer.getElem(y * width + x) >> 8) & 0x00FF);
+ }
+
+ @Override
+ public double getRedValue(int x, int y) {
+ return (double)((buffer.getElem(y * width + x) >> 16) & 0x00FF);
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntARGB.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-07-04 18:09:40
|
Revision: 132
http://pixelle.svn.sourceforge.net/pixelle/?rev=132&view=rev
Author: dbrosius
Date: 2008-07-04 11:08:16 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
javadoc
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-07-04 15:27:48 UTC (rev 131)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-07-04 18:08:16 UTC (rev 132)
@@ -24,6 +24,10 @@
import com.mebigfatguy.pixelle.eval.PixelleEval4ByteABGR;
import com.mebigfatguy.pixelle.eval.PixelleEvalByteGray;
+/**
+ * factory for creating pixel evaluation instances based on the type of image that is
+ * input.
+ */
public class PixelleEvalFactory {
private static IndexOutOfBoundsOption ioobOption = IndexOutOfBoundsOption.BorderColor;
@@ -48,6 +52,13 @@
coobOption = option;
}
+ /**
+ * factory method for creating an pixel evaluator for the type of image that is
+ * passed in.
+ *
+ * @param image the image that will need to be evaluated
+ * @return the pixel evaluator
+ */
public static PixelleEval create(PixelleImage image) {
switch (image.getType()) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-07-04 15:28:00
|
Revision: 131
http://pixelle.svn.sourceforge.net/pixelle/?rev=131&view=rev
Author: dbrosius
Date: 2008-07-04 08:27:48 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
add unary expression support for - expr and ! expr
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2008-07-04 04:23:19 UTC (rev 130)
+++ trunk/pixelle/etc/Pixelle.g 2008-07-04 15:27:48 UTC (rev 131)
@@ -80,10 +80,10 @@
cond_and_expr
( '?'
{
- mv.visitInsn(Opcodes.DCONST_1); //TRUE
+ mv.visitInsn(Opcodes.DCONST_0); //FALSE
mv.visitInsn(Opcodes.DCMPG);
falseLabel = new Label();
- mv.visitJumpInsn(Opcodes.IFNE, falseLabel);
+ mv.visitJumpInsn(Opcodes.IFEQ, falseLabel);
}
expr ':'
{
@@ -249,18 +249,38 @@
)* ;
mul_expr :
- factor
- (op=('*' | '/') factor
+ unaryExpression
+ (op=('*' | '/') unaryExpression
{
mv.visitInsn("*".equals($op.text)?Opcodes.DMUL:Opcodes.DDIV);
}
)* ;
+unaryExpression :
+ '!' unaryExpression
+ {
+ Label falseLabel = new Label();
+ Label continueLabel = new Label();
+ mv.visitInsn(Opcodes.DCONST_0);
+ mv.visitInsn(Opcodes.DCMPG);
+ mv.visitJumpInsn(Opcodes.IFEQ, falseLabel);
+ mv.visitInsn(Opcodes.DCONST_0);
+ mv.visitJumpInsn(Opcodes.GOTO, continueLabel);
+ mv.visitLabel(falseLabel);
+ mv.visitInsn(Opcodes.DCONST_1);
+ mv.visitLabel(continueLabel);
+ }
+ | '-' unaryExpression
+ {
+ mv.visitInsn(Opcodes.DNEG);
+ }
+ | factor ;
+
factor
: NUMBER
{
mv.visitLdcInsn(Double.valueOf($NUMBER.text));
- }
+ }
| '(' expr ')'
| 'p'
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-07-04 04:23:21
|
Revision: 130
http://pixelle.svn.sourceforge.net/pixelle/?rev=130&view=rev
Author: dbrosius
Date: 2008-07-03 21:23:19 -0700 (Thu, 03 Jul 2008)
Log Message:
-----------
add accelerators and default buttons
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/CloseFileAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/NewFileAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/PrintAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/QuitAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/ZoomAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/CloseFileAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/CloseFileAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/CloseFileAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -21,6 +21,7 @@
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.FrameMgr;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -33,6 +34,7 @@
public CloseFileAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.CLOSE_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('W', ActionEvent.CTRL_MASK));
frame = pf;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/NewFileAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/NewFileAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/NewFileAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -22,6 +22,7 @@
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.FrameMgr;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -36,6 +37,7 @@
public NewFileAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.NEW_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('N', ActionEvent.CTRL_MASK));
frame = pf;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -25,6 +25,7 @@
import javax.imageio.ImageIO;
import javax.swing.AbstractAction;
import javax.swing.JFileChooser;
+import javax.swing.KeyStroke;
import javax.swing.filechooser.FileFilter;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -38,6 +39,7 @@
public OpenFileAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.OPEN_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('O', ActionEvent.CTRL_MASK));
frame = pf;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -21,6 +21,7 @@
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleEvalFactory;
@@ -35,6 +36,7 @@
public OptionsAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.OPTIONS_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('O', ActionEvent.SHIFT_MASK | ActionEvent.CTRL_MASK));
frame = pf;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/PrintAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/PrintAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/PrintAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -21,6 +21,7 @@
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
@@ -31,6 +32,7 @@
public PrintAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.PRINT_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('P', ActionEvent.CTRL_MASK));
}
public void actionPerformed(ActionEvent e) {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/QuitAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/QuitAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/QuitAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -23,6 +23,7 @@
import javax.swing.AbstractAction;
import javax.swing.JFrame;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.FrameMgr;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -33,6 +34,7 @@
public QuitAction() {
super(PixelleBundle.getString(PixelleBundle.QUIT_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('Q', ActionEvent.CTRL_MASK));
}
public void actionPerformed(ActionEvent e) {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -25,6 +25,7 @@
import javax.imageio.ImageIO;
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
@@ -38,6 +39,7 @@
public SaveFileAction(PixelleFrame pf, SaveFileAsAction action) {
super(PixelleBundle.getString(PixelleBundle.SAVE_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('S', ActionEvent.CTRL_MASK));
frame = pf;
saveAsAction = action;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -28,6 +28,7 @@
import javax.swing.AbstractAction;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
+import javax.swing.KeyStroke;
import javax.swing.filechooser.FileFilter;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -41,6 +42,7 @@
public SaveFileAsAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.SAVEAS_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('A', ActionEvent.CTRL_MASK));
frame = pf;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -22,6 +22,7 @@
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
@@ -37,6 +38,7 @@
public TransformAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.TRANSFORM_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('T', ActionEvent.CTRL_MASK));
frame = pf;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -21,6 +21,7 @@
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
@@ -32,6 +33,7 @@
public TransformNewWindowAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.TRANSFORM_NEW_ITEM));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('W', ActionEvent.SHIFT_MASK | ActionEvent.CTRL_MASK));
frame = pf;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/ZoomAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/ZoomAction.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/ZoomAction.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -21,6 +21,7 @@
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
+import javax.swing.KeyStroke;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
@@ -34,6 +35,7 @@
public ZoomAction(PixelleFrame pf, ZoomLevel level) {
super(PixelleBundle.getString(level.getKey()));
+ putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke('Z', ActionEvent.CTRL_MASK));
frame = pf;
zoom = level;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -139,6 +139,8 @@
}
private void initListeners() {
+ getRootPane().setDefaultButton(ok);
+
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
clickedOK = true;
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-30 03:14:41 UTC (rev 129)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-07-04 04:23:19 UTC (rev 130)
@@ -204,6 +204,8 @@
}
private void initListeners() {
+ getRootPane().setDefaultButton(ok);
+
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
okClicked = true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-30 03:14:32
|
Revision: 129
http://pixelle.svn.sourceforge.net/pixelle/?rev=129&view=rev
Author: dbrosius
Date: 2008-06-29 20:14:41 -0700 (Sun, 29 Jun 2008)
Log Message:
-----------
implement save, and saveas
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.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-06-30 02:43:23 UTC (rev 128)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-06-30 03:14:41 UTC (rev 129)
@@ -73,6 +73,7 @@
public static final String CLIP_COLOR = "label.clip_color";
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";
private static ResourceBundle rb = ResourceBundle.getBundle("com/mebigfatguy/pixelle/resources/pixelle");
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java 2008-06-30 02:43:23 UTC (rev 128)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java 2008-06-30 03:14:41 UTC (rev 129)
@@ -22,6 +22,7 @@
import java.io.File;
import java.util.Locale;
+import javax.imageio.ImageIO;
import javax.swing.AbstractAction;
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileFilter;
@@ -50,7 +51,12 @@
return true;
String path = f.getPath().toLowerCase(Locale.getDefault());
- return (path.endsWith(".gif") || path.endsWith(".jpg") || path.endsWith(".png") || path.endsWith(".bmp"));
+ String[] formats = ImageIO.getReaderFormatNames();
+ for (String format : formats) {
+ if (path.endsWith(format.toLowerCase(Locale.getDefault())))
+ return true;
+ }
+ return false;
}
@Override
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java 2008-06-30 02:43:23 UTC (rev 128)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java 2008-06-30 03:14:41 UTC (rev 129)
@@ -19,8 +19,16 @@
package com.mebigfatguy.pixelle.actions;
import java.awt.event.ActionEvent;
+import java.io.File;
+import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.Locale;
+import javax.imageio.ImageIO;
import javax.swing.AbstractAction;
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+import javax.swing.filechooser.FileFilter;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
@@ -37,6 +45,48 @@
}
public void actionPerformed(ActionEvent e) {
-
+ JFileChooser fc = new JFileChooser();
+ fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
+ fc.setFileFilter(new FileFilter() {
+ @Override
+ public boolean accept(File f) {
+ if (f.isDirectory())
+ return true;
+
+ String path = f.getPath().toLowerCase(Locale.getDefault());
+ String[] formats = ImageIO.getReaderFormatNames();
+ for (String format : formats) {
+ if (path.endsWith(format.toLowerCase(Locale.getDefault())))
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Graphic Files";
+ }
+ });
+
+ if (JFileChooser.APPROVE_OPTION == fc.showSaveDialog(frame)) {
+ try {
+ File f = fc.getSelectedFile();
+ if (!f.exists() || askSaveFile(f)) {
+ String ext = f.getPath();
+ ext = ext.substring(ext.lastIndexOf('.')+1);
+ ImageIO.write(frame.getImage().getSaveImage(), ext, f);
+ }
+ } catch (IOException ioe) {
+ JOptionPane.showMessageDialog(frame, ioe.getMessage());
+ ioe.printStackTrace();
+ }
+ }
}
+
+ private boolean askSaveFile(File f) {
+ String title = MessageFormat.format(PixelleBundle.getString(PixelleBundle.TITLE), f.getName());
+ String message = MessageFormat.format(PixelleBundle.getString(PixelleBundle.SAVE_OVERWRITE), f.getPath());
+ int choice = JOptionPane.showConfirmDialog(frame, message, title, JOptionPane.YES_NO_OPTION);
+ return choice == JOptionPane.OK_OPTION;
+ }
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-06-30 02:43:23 UTC (rev 128)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-06-30 03:14:41 UTC (rev 129)
@@ -72,3 +72,5 @@
label.roll_color = Color Rolling
label.wave_color = Color Waving
+label.save_overwrite = The file "{0}" already exists, do you want to overwrite it?
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-30 02:43:19
|
Revision: 128
http://pixelle.svn.sourceforge.net/pixelle/?rev=128&view=rev
Author: dbrosius
Date: 2008-06-29 19:43:23 -0700 (Sun, 29 Jun 2008)
Log Message:
-----------
implement save
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/Pixelle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/Pixelle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/Pixelle.java 2008-06-30 01:55:46 UTC (rev 127)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/Pixelle.java 2008-06-30 02:43:23 UTC (rev 128)
@@ -19,6 +19,7 @@
package com.mebigfatguy.pixelle;
import java.awt.Rectangle;
+import java.text.MessageFormat;
import javax.swing.JOptionPane;
@@ -38,6 +39,8 @@
public static void main(String[] args) {
try {
PixelleFrame pf = new PixelleFrame();
+ String title = MessageFormat.format(PixelleBundle.getString(PixelleBundle.TITLE), PixelleBundle.getString(PixelleBundle.UNKNOWN));
+ pf.setTitle(title);
Rectangle bounds = GuiUtils.getScreenBounds();
pf.setBounds(bounds);
pf.setVisible(true);
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-06-30 01:55:46 UTC (rev 127)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-06-30 02:43:23 UTC (rev 128)
@@ -29,6 +29,7 @@
public static final String CANCEL = "cancel";
public static final String RESET = "reset";
public static final String TITLE = "pixelle.title";
+ public static final String UNKNOWN = "pixelle.unknown";
public static final String FILE_MENU = "menu.file.title";
public static final String NEW_ITEM = "menu.file.new";
public static final String OPEN_ITEM = "menu.file.open";
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-30 01:55:46 UTC (rev 127)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-30 02:43:23 UTC (rev 128)
@@ -26,6 +26,7 @@
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
+import java.text.MessageFormat;
import javax.imageio.ImageIO;
import javax.swing.ButtonGroup;
@@ -55,8 +56,9 @@
import com.mebigfatguy.pixelle.utils.ZoomLevel;
public class PixelleFrame extends JFrame {
- private static final long serialVersionUID = 3252160042874627103L;
+ private static final long serialVersionUID = -2993532609001467136L;
+
JMenu fileMenu;
JMenuItem newItem;
JMenuItem openItem;
@@ -82,6 +84,7 @@
JMenuItem optionsItem;
JMenuItem transformItem;
+ File imageFile;
JScrollPane scroll;
ImagePanel panel;
transient PixelleImage image;
@@ -96,12 +99,12 @@
}
private PixelleFrame(PixelleImage srcImage, boolean transformInNewWindow) {
+ imageFile = null;
image = srcImage;
doNewWindow = transformInNewWindow;
initComponents();
initListeners();
- setTitle(PixelleBundle.getString(PixelleBundle.TITLE));
FrameMgr.getInstance().add(this);
}
@@ -117,9 +120,9 @@
closeItem = new JMenuItem(new CloseFileAction(this));
fileMenu.add(closeItem);
fileMenu.addSeparator();
- saveItem = new JMenuItem(new SaveFileAction(this));
+ saveAsItem = new JMenuItem(new SaveFileAsAction(this));
+ saveItem = new JMenuItem(new SaveFileAction(this, (SaveFileAsAction)saveAsItem.getAction()));
fileMenu.add(saveItem);
- saveAsItem = new JMenuItem(new SaveFileAsAction(this));
fileMenu.add(saveAsItem);
fileMenu.addSeparator();
pageSetupItem = new JMenuItem(new PageSetupAction(this));
@@ -222,10 +225,16 @@
panel.repaint();
}
+ public File getImageFile() {
+ return imageFile;
+ }
+
public void openFile(File f) {
- setTitle(f.getName());
+ String title = MessageFormat.format(PixelleBundle.getString(PixelleBundle.TITLE), f.getName());
+ setTitle(title);
try {
image = new PixelleImage(ImageIO.read(f));
+ imageFile = f;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Container cp = getContentPane();
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-30 01:55:46 UTC (rev 127)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-30 02:43:23 UTC (rev 128)
@@ -54,6 +54,10 @@
g.fillRect(0, 0, getWidth(), getHeight());
}
+ public BufferedImage getSaveImage() {
+ return image;
+ }
+
public int getType() {
return image.getType();
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java 2008-06-30 01:55:46 UTC (rev 127)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java 2008-06-30 02:43:23 UTC (rev 128)
@@ -20,6 +20,7 @@
import java.awt.event.ActionEvent;
import java.io.File;
+import java.util.Locale;
import javax.swing.AbstractAction;
import javax.swing.JFileChooser;
@@ -48,7 +49,7 @@
if (f.isDirectory())
return true;
- String path = f.getPath();
+ String path = f.getPath().toLowerCase(Locale.getDefault());
return (path.endsWith(".gif") || path.endsWith(".jpg") || path.endsWith(".png") || path.endsWith(".bmp"));
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAction.java 2008-06-30 01:55:46 UTC (rev 127)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAction.java 2008-06-30 02:43:23 UTC (rev 128)
@@ -19,20 +19,42 @@
package com.mebigfatguy.pixelle.actions;
import java.awt.event.ActionEvent;
+import java.io.File;
+import java.io.IOException;
+import javax.imageio.ImageIO;
import javax.swing.AbstractAction;
+import javax.swing.JOptionPane;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
public class SaveFileAction extends AbstractAction {
- private static final long serialVersionUID = 4019520448443204442L;
+ private static final long serialVersionUID = -8339987202623985741L;
+
+ private PixelleFrame frame;
+ private SaveFileAsAction saveAsAction;
- public SaveFileAction(PixelleFrame pf) {
+ public SaveFileAction(PixelleFrame pf, SaveFileAsAction action) {
super(PixelleBundle.getString(PixelleBundle.SAVE_ITEM));
+ frame = pf;
+ saveAsAction = action;
}
public void actionPerformed(ActionEvent e) {
+ try {
+ File f = frame.getImageFile();
+ if (f == null)
+ saveAsAction.actionPerformed(e);
+ else {
+ String ext = f.getName();
+ ext = ext.substring(ext.lastIndexOf('.') + 1);
+ ImageIO.write(frame.getImage().getSaveImage(), ext, f);
+ }
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ JOptionPane.showMessageDialog(frame, ioe.getMessage());
+ }
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java 2008-06-30 01:55:46 UTC (rev 127)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/SaveFileAsAction.java 2008-06-30 02:43:23 UTC (rev 128)
@@ -27,12 +27,16 @@
public class SaveFileAsAction extends AbstractAction {
- private static final long serialVersionUID = -5814929763886809475L;
+ private static final long serialVersionUID = 548030636198842553L;
+
+ private PixelleFrame frame;
public SaveFileAsAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.SAVEAS_ITEM));
+ frame = pf;
}
public void actionPerformed(ActionEvent e) {
+
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-06-30 01:55:46 UTC (rev 127)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-06-30 02:43:23 UTC (rev 128)
@@ -19,7 +19,8 @@
cancel = CANCEL
reset = RESET
-pixelle.title = Pixelle
+pixelle.title = Pixelle - {0}
+pixelle.unknown = Unknown
menu.file.title = File
menu.file.new = New
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-30 01:55:36
|
Revision: 127
http://pixelle.svn.sourceforge.net/pixelle/?rev=127&view=rev
Author: dbrosius
Date: 2008-06-29 18:55:46 -0700 (Sun, 29 Jun 2008)
Log Message:
-----------
fix selection drawing
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-29 22:22:36 UTC (rev 126)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-30 01:55:46 UTC (rev 127)
@@ -39,9 +39,6 @@
public PixelleImage() {
this(new BufferedImage(400, 400, BufferedImage.TYPE_3BYTE_BGR));
- Graphics g = image.getGraphics();
- g.setColor(Color.RED);
- g.fillRect(0, 0, 400, 400);
}
public PixelleImage(BufferedImage img) {
@@ -51,7 +48,7 @@
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);
+ composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f);
Graphics g = selection.getGraphics();
g.setColor(Color.WHITE);
g.fillRect(0, 0, getWidth(), getHeight());
@@ -74,13 +71,13 @@
}
public void draw(Graphics g, int left, int top, int width, int height) {
- g.drawImage(image, left, top, width, height, Color.WHITE, null);
+ g.drawImage(image, left, top, width, height, 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);
+ g.drawImage(selection, left, top, width, height, null);
} finally {
g2d.setComposite(saveComposite);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-29 22:23:26
|
Revision: 126
http://pixelle.svn.sourceforge.net/pixelle/?rev=126&view=rev
Author: dbrosius
Date: 2008-06-29 15:22:36 -0700 (Sun, 29 Jun 2008)
Log Message:
-----------
fix selection calc (bit positions)
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-06-29 18:41:19 UTC (rev 125)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-29 22:22:36 UTC (rev 126)
@@ -195,18 +195,15 @@
* @param value the selection value to use where 0 is off
*/
protected void setSelectionValue(int x, int y, double value) {
- if ((x & 0x07) == 0) {
+ int bit = x & 0x07;
+ if (bit == 0)
selectionByte = 0;
- }
- int imageWidth = srcImage.getWidth();
- int bitOffset = 1 << (x & 0x07);
- if (value == 0.0)
- selectionByte &= ~bitOffset;
- else
+ int bitOffset = 1 << (7 - bit);
+ if (value != 0.0)
selectionByte |= bitOffset;
- if (((x & 0x07) == 7) || (x == imageWidth))
+ 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-06-29 18:41:14
|
Revision: 125
http://pixelle.svn.sourceforge.net/pixelle/?rev=125&view=rev
Author: dbrosius
Date: 2008-06-29 11:41:19 -0700 (Sun, 29 Jun 2008)
Log Message:
-----------
fix stutter in doc
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-06-29 05:25:52 UTC (rev 124)
+++ trunk/pixelle/htdocs/index.html 2008-06-29 18:41:19 UTC (rev 125)
@@ -52,7 +52,7 @@
The absolute value of an expression.</li>
<li>min(e, f)<br/>
The minimum value of two expressions.</li>
- <li>min(e, f)<br/>
+ <li>max(e, f)<br/>
The maximum value of two expressions.</li>
<li>pow(e, f)<br/>
One expression raised to the second expression's power</li>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-29 05:25:43
|
Revision: 124
http://pixelle.svn.sourceforge.net/pixelle/?rev=124&view=rev
Author: dbrosius
Date: 2008-06-28 22:25:52 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
fix doc
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-06-29 05:17:24 UTC (rev 123)
+++ trunk/pixelle/htdocs/index.html 2008-06-29 05:25:52 UTC (rev 124)
@@ -110,7 +110,7 @@
Sets the selection to any pixels where the red component equals either
the green or blue component.
- p[x,y].b = <b>(p[x,y].s || (p[x,y].r < p[x,y].g) ? 0 : 255
+ p[x,y].b = <b>(p[x,y].s || (p[x,y].r < p[x,y].g) ? 0 : 255</b>
Sets the blue pixel to full blue if the pixel is selected or if the red component
is less than the green component, or else it sets it to black.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-29 05:17:36
|
Revision: 123
http://pixelle.svn.sourceforge.net/pixelle/?rev=123&view=rev
Author: dbrosius
Date: 2008-06-28 22:17:24 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
implement color oob options
Modified Paths:
--------------
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/eval/PixelleEval3ByteBGR.java
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalByteGray.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-29 04:49:45 UTC (rev 122)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-29 05:17:24 UTC (rev 123)
@@ -31,21 +31,24 @@
protected DataBuffer buffer;
protected int width;
protected int height;
- protected IndexOutOfBoundsOption oobOption;
+ protected IndexOutOfBoundsOption ioobOption;
+ protected ColorOutOfBoundsOption coobOption;
private int selectionByte;
/**
* create an evaluator for a specific image and options
*
* @param image the image to evaluate
- * @param option the out of bounds pixels option to use
+ * @param iOption the out of bounds pixels option to use
+ * @param cOption TODO
*/
- public PixelleEval(PixelleImage image, IndexOutOfBoundsOption option) {
+ public PixelleEval(PixelleImage image, IndexOutOfBoundsOption iOption, ColorOutOfBoundsOption cOption) {
srcImage = image;
buffer = image.getBuffer();
width = image.getWidth();
height = image.getHeight();
- oobOption = option;
+ ioobOption = iOption;
+ coobOption = cOption;
}
/**
@@ -95,9 +98,9 @@
/* in the future, allow customization of out of bounds indices */
if (((x < 0) || (x >= width)) || ((y < 0) || (y >= height))) {
- switch (oobOption) {
+ switch (ioobOption) {
case SpecifiedColor:
- Color c = oobOption.getColor();
+ Color c = ioobOption.getColor();
switch (pixelSpec) {
case 'r':
return c.getRed();
@@ -206,4 +209,48 @@
if (((x & 0x07) == 7) || (x == imageWidth))
srcImage.setSelectionByte(x >> 3, y, selectionByte);
}
+
+ /**
+ * adjust out of bounds colors by applying rules of ColorOutOfBoundsOption
+ * @param value the input color value
+ * @return the output color value
+ */
+ protected double adjustColor(double value) {
+ if ((value >= 0.0) && (value <= 255.0))
+ return value;
+
+ switch (coobOption) {
+
+ case Roll: {
+ int ival = (int)(value + 0.49) % 256;
+ return (double)ival;
+ }
+
+ case Wave: {
+ int ival = (int)(value + 0.49);
+ int period = ival / 256;
+ if ((period & 0x01) != 0) {
+ if (ival > 0)
+ ival = 255 - (ival+1) & 0x00FF;
+ else
+ ival = ival & 0x00FF;
+ }
+ else {
+ if (ival > 0)
+ ival = ival & 0x00FF;
+ else
+ ival = 256 - ival & 0x00FF;
+ }
+ return (double)ival;
+ }
+
+ case Clip:
+ default: {
+ if (value < 0.0)
+ return 0.0;
+ else
+ return 255.0;
+ }
+ }
+ }
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-06-29 04:49:45 UTC (rev 122)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-06-29 05:17:24 UTC (rev 123)
@@ -52,10 +52,10 @@
switch (image.getType()) {
case BufferedImage.TYPE_3BYTE_BGR:
- return new PixelleEval3ByteBGR(image, ioobOption);
+ return new PixelleEval3ByteBGR(image, ioobOption, coobOption);
case BufferedImage.TYPE_4BYTE_ABGR:
- return new PixelleEval4ByteABGR(image, ioobOption);
+ return new PixelleEval4ByteABGR(image, ioobOption, coobOption);
case BufferedImage.TYPE_BYTE_BINARY:
break;
@@ -64,7 +64,7 @@
break;
case BufferedImage.TYPE_BYTE_GRAY:
- return new PixelleEvalByteGray(image, ioobOption);
+ return new PixelleEvalByteGray(image, ioobOption, coobOption);
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-29 04:49:45 UTC (rev 122)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-29 05:17:24 UTC (rev 123)
@@ -86,7 +86,7 @@
PixelleImage destImage = new PixelleImage(new BufferedImage(srcImage.getWidth(), srcImage.getHeight(), BufferedImage.TYPE_4BYTE_ABGR));
PixelleEval srcPE = PixelleEvalFactory.create(srcImage);
- PixelleEval4ByteABGR destPE = new PixelleEval4ByteABGR(destImage, IndexOutOfBoundsOption.BorderColor);
+ PixelleEval4ByteABGR destPE = new PixelleEval4ByteABGR(destImage, PixelleEvalFactory.getIndexOutOfBoundsOption(), PixelleEvalFactory.getColorOutOfBoundsOption());
PixelleClassLoader pcl = AccessController.doPrivileged(new PrivilegedAction<PixelleClassLoader>() {
public PixelleClassLoader run() {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteBGR.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteBGR.java 2008-06-29 04:49:45 UTC (rev 122)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteBGR.java 2008-06-29 05:17:24 UTC (rev 123)
@@ -18,14 +18,15 @@
*/
package com.mebigfatguy.pixelle.eval;
+import com.mebigfatguy.pixelle.ColorOutOfBoundsOption;
import com.mebigfatguy.pixelle.IndexOutOfBoundsOption;
import com.mebigfatguy.pixelle.PixelleEval;
import com.mebigfatguy.pixelle.PixelleImage;
public class PixelleEval3ByteBGR extends PixelleEval {
- public PixelleEval3ByteBGR(PixelleImage srcImage, IndexOutOfBoundsOption option) {
- super(srcImage, option);
+ public PixelleEval3ByteBGR(PixelleImage srcImage, IndexOutOfBoundsOption iOption, ColorOutOfBoundsOption cOption) {
+ super(srcImage, iOption, cOption);
}
@Override
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java 2008-06-29 04:49:45 UTC (rev 122)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java 2008-06-29 05:17:24 UTC (rev 123)
@@ -18,14 +18,15 @@
*/
package com.mebigfatguy.pixelle.eval;
+import com.mebigfatguy.pixelle.ColorOutOfBoundsOption;
import com.mebigfatguy.pixelle.IndexOutOfBoundsOption;
import com.mebigfatguy.pixelle.PixelleEval;
import com.mebigfatguy.pixelle.PixelleImage;
public class PixelleEval4ByteABGR extends PixelleEval {
- public PixelleEval4ByteABGR(PixelleImage srcImage, IndexOutOfBoundsOption option) {
- super(srcImage, option);
+ public PixelleEval4ByteABGR(PixelleImage srcImage, IndexOutOfBoundsOption iOption, ColorOutOfBoundsOption cOption) {
+ super(srcImage, iOption, cOption);
}
@Override
@@ -50,10 +51,7 @@
public void setValue(int x, int y, char pixelSpec, double value) {
- if (value < 0.0)
- value = 0.0;
- else if (value > 255.0)
- value = 255.0;
+ value = adjustColor(value);
switch (pixelSpec) {
case 't':
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalByteGray.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalByteGray.java 2008-06-29 04:49:45 UTC (rev 122)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalByteGray.java 2008-06-29 05:17:24 UTC (rev 123)
@@ -18,14 +18,15 @@
*/
package com.mebigfatguy.pixelle.eval;
+import com.mebigfatguy.pixelle.ColorOutOfBoundsOption;
import com.mebigfatguy.pixelle.IndexOutOfBoundsOption;
import com.mebigfatguy.pixelle.PixelleEval;
import com.mebigfatguy.pixelle.PixelleImage;
public class PixelleEvalByteGray extends PixelleEval {
- public PixelleEvalByteGray(PixelleImage srcImage, IndexOutOfBoundsOption option) {
- super(srcImage, option);
+ public PixelleEvalByteGray(PixelleImage srcImage, IndexOutOfBoundsOption iOption, ColorOutOfBoundsOption cOption) {
+ super(srcImage, iOption, cOption);
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|