patchanim-commit Mailing List for patchanim (Page 4)
Brought to you by:
dbrosius
You can subscribe to this list here.
2008 |
Jan
(80) |
Feb
(158) |
Mar
|
Apr
|
May
(3) |
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(26) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(3) |
2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dbr...@us...> - 2008-02-24 15:26:47
|
Revision: 230 http://patchanim.svn.sourceforge.net/patchanim/?rev=230&view=rev Author: dbrosius Date: 2008-02-24 07:26:52 -0800 (Sun, 24 Feb 2008) Log Message: ----------- BAS fixes Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java 2008-02-24 03:07:09 UTC (rev 229) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java 2008-02-24 15:26:52 UTC (rev 230) @@ -100,8 +100,8 @@ final PatchPanelMediator mediator = PatchPanelMediator.getMediator(); mediator.addActivePatchChangedListener(new ActivePatchChangedListener() { public void activePatchChanged(ActivePatchChangedEvent apce) { - CombinedPatch currentPatch = apce.getActivePatch(); if ((color != PatchColor.Alpha) || mediator.getDocument().useAlpha()) { + CombinedPatch currentPatch = apce.getActivePatch(); coords = currentPatch.getPatch(color); if (coords != null) { setColorField(false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-24 03:07:04
|
Revision: 229 http://patchanim.svn.sourceforge.net/patchanim/?rev=229&view=rev Author: dbrosius Date: 2008-02-23 19:07:09 -0800 (Sat, 23 Feb 2008) Log Message: ----------- show new dialog on start Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-24 02:52:12 UTC (rev 228) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-24 03:07:09 UTC (rev 229) @@ -185,21 +185,7 @@ } } - NewDocumentDialog newDialog = new NewDocumentDialog(); - newDialog.setModal(true); - newDialog.setLocationRelativeTo(JPatchAnimFrame.this); - newDialog.setVisible(true); - - int order = newDialog.getOrder(); - boolean useAlpha = newDialog.useAlpha(); - - document = new PatchAnimDocument(order, useAlpha); - documentLocation = null; - saveItem.setEnabled(false); - PatchPanelMediator mediator = PatchPanelMediator.getMediator(); - mediator.setDocument(document); - String title = MessageFormat.format(rb.getString(PatchAnimBundle.NAMEDTITLE), rb.getString(PatchAnimBundle.UNTITLED)); - setTitle(title); + newDocument(); } catch (IOException ioe) { JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.SAVEFAILED)); } @@ -328,6 +314,31 @@ }); } + @Override + public void setVisible(boolean show) { + newDocument(); + super.setVisible(show); + } + + private void newDocument() { + ResourceBundle rb = PatchAnimBundle.getBundle(); + NewDocumentDialog newDialog = new NewDocumentDialog(); + newDialog.setModal(true); + newDialog.setLocationRelativeTo(JPatchAnimFrame.this); + newDialog.setVisible(true); + + int order = newDialog.getOrder(); + boolean useAlpha = newDialog.useAlpha(); + + document = new PatchAnimDocument(order, useAlpha); + documentLocation = null; + saveItem.setEnabled(false); + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + mediator.setDocument(document); + String title = MessageFormat.format(rb.getString(PatchAnimBundle.NAMEDTITLE), rb.getString(PatchAnimBundle.UNTITLED)); + setTitle(title); + } + private void load() { try { JFileChooser chooser = new JFileChooser(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-24 02:52:07
|
Revision: 228 http://patchanim.svn.sourceforge.net/patchanim/?rev=228&view=rev Author: dbrosius Date: 2008-02-23 18:52:12 -0800 (Sat, 23 Feb 2008) Log Message: ----------- document transparency Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-24 02:50:05 UTC (rev 227) +++ trunk/patchanim/htdocs/index.html 2008-02-24 02:52:12 UTC (rev 228) @@ -50,14 +50,15 @@ to generate one full color blend. Since the description of the blend is very succinct (just 3 * 16 points), It is very easy to generate in-between images from two separate blend descriptions.</p> - <p>February 18, 2008 - added lately</p> + <p>February 23, 2008 - added lately</p> <ul> + <li>Support for controlling transparency with a separate alpha patch</li> + <li>Context Patch menu option to shift patch in any direction</li> + <li>Context Patch menu option to generate radial gradients for patch values</li> + <li>Added a new Out Of Bounds Color option, now available: Clip, Cycle, Roll</li> + <li>Context Patch menu option to invert the patch</li> <li>Context Patch menu option to generate linear gradients for patch values</li> <li>Patches can now be any order from 2 - 9, specified on the new dialog</li> - <li>Context Patch menu option to invert the patch</li> - <li>Added a new Out Of Bounds Color option, now available: Clip, Cycle, Roll</li> - <li>Context Patch menu option to generate radial gradients for patch values</li> - <li>Context Patch menu option to shift patch in any direction</li> </ul> <p>If you would like to see the tool as it progresses, you can run the webstart version <a href="jnlp/patchanim.jnlp">here.</a></p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-24 02:50:10
|
Revision: 227 http://patchanim.svn.sourceforge.net/patchanim/?rev=227&view=rev Author: dbrosius Date: 2008-02-23 18:50:05 -0800 (Sat, 23 Feb 2008) Log Message: ----------- bump to version 1.1.0 Modified Paths: -------------- trunk/patchanim/build.xml Modified: trunk/patchanim/build.xml =================================================================== --- trunk/patchanim/build.xml 2008-02-24 02:49:10 UTC (rev 226) +++ trunk/patchanim/build.xml 2008-02-24 02:50:05 UTC (rev 227) @@ -35,7 +35,7 @@ <property name="javac.deprecation" value="on"/> <property name="javac.debug" value="on"/> - <property name="patchanim.version" value="1.0.0"/> + <property name="patchanim.version" value="1.1.0"/> <target name="clean" description="removes all generated collateral"> <delete dir="${classes.dir}"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-24 02:49:04
|
Revision: 226 http://patchanim.svn.sourceforge.net/patchanim/?rev=226&view=rev Author: dbrosius Date: 2008-02-23 18:49:10 -0800 (Sat, 23 Feb 2008) Log Message: ----------- transparency seems to be mostly working Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchAnimator.java trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-02-24 02:28:36 UTC (rev 225) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-02-24 02:49:10 UTC (rev 226) @@ -95,7 +95,7 @@ } private void initComponents() { - image = PatchGenerator.buildImage(rgb, SAMPLE_SIZE, SAMPLE_SIZE); + image = PatchGenerator.buildImage(rgb, false, SAMPLE_SIZE, SAMPLE_SIZE); setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); Dimension d = new Dimension(SAMPLE_SIZE, SAMPLE_SIZE); setMinimumSize(d); @@ -146,6 +146,7 @@ mediator.addDocumentChangedListener(new DocumentChangedListener() { public void documentChanged(DocumentChangedEvent dce) { PatchAnimDocument doc = dce.getDocument(); + image = PatchGenerator.buildImage(rgb, doc.useAlpha(), SAMPLE_SIZE, SAMPLE_SIZE); oob = doc.getOutOfBoundsColor(); PatchPanelMediator mediator = PatchPanelMediator.getMediator(); if ((color != PatchColor.Alpha) || mediator.getDocument().useAlpha()) Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchAnimator.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchAnimator.java 2008-02-24 02:28:36 UTC (rev 225) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchAnimator.java 2008-02-24 02:49:10 UTC (rev 226) @@ -43,7 +43,7 @@ } public void animatePatches() throws InterruptedException { - BufferedImage image = PatchGenerator.buildImage(null, document.getWidth(), document.getHeight()); + BufferedImage image = PatchGenerator.buildImage(null, document.useAlpha(), document.getWidth(), document.getHeight()); List<CombinedPatch> patches = document.getPatches(); int lastPatch = patches.size() - 1; int tweenCount = document.getTweenCount(); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java 2008-02-24 02:28:36 UTC (rev 225) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java 2008-02-24 02:49:10 UTC (rev 226) @@ -37,23 +37,27 @@ if (patch == null) return; + int numComponents = image.getColorModel().getNumComponents(); + boolean useAlpha = numComponents == 4; + WritableRaster wr = image.getRaster(); DataBuffer db = wr.getDataBuffer(); int pixel = 0; - PatchCoords[] coords = new PatchCoords[3]; + PatchCoords[] coords = new PatchCoords[4]; coords[0] = patch.getPatch(PatchColor.Red); coords[1] = patch.getPatch(PatchColor.Green); coords[2] = patch.getPatch(PatchColor.Blue); + coords[3] = patch.getPatch(PatchColor.Alpha); int order = coords[0].getOrder(); double u; double v; double[] uCoeffs = new double[order]; double[] vCoeffs = new double[order]; - double[] value = new double[3]; - int[] iValue = new int[3]; + double[] value = new double[4]; + int[] iValue = new int[4]; int sampleSizeX = image.getWidth(); int sampleSizeY = image.getHeight(); @@ -66,21 +70,23 @@ u = (double)iu / (double)sampleSizeX; buildCoefficients(u, uCoeffs); - value[0] = value[1] = value[2] = 0.0; + value[0] = value[1] = value[2] = value[3] = 0.0; for (int j = 0; j < order; j++) { for (int i = 0; i < order; i++) { double coeff = uCoeffs[i] * vCoeffs[j]; - value[0] += coords[0].getCoordinate(i, j).getColor() * coeff; - value[1] += coords[1].getCoordinate(i, j).getColor() * coeff; - value[2] += coords[2].getCoordinate(i, j).getColor() * coeff; + for (int k = 0; k < numComponents; k++) { + value[k] += coords[k].getCoordinate(i, j).getColor() * coeff; + } } } - for (int k = 0; k < 3; k++) { + for (int k = 0; k < numComponents; k++) { iValue[k] = adjustColor(value[k], oob); } + if (useAlpha) + db.setElem(pixel++, iValue[3]); db.setElem(pixel++, iValue[2]); db.setElem(pixel++, iValue[1]); db.setElem(pixel++, iValue[0]); @@ -167,11 +173,11 @@ return value; } - public static BufferedImage buildImage(Color color, int sampleSizeX, int sampleSizeY) { + public static BufferedImage buildImage(Color color, boolean useAlpha, int sampleSizeX, int sampleSizeY) { BufferedImage image = null; if (color == null) { - image = new BufferedImage(sampleSizeX, sampleSizeY, BufferedImage.TYPE_3BYTE_BGR); + image = new BufferedImage(sampleSizeX, sampleSizeY, useAlpha ? BufferedImage.TYPE_4BYTE_ABGR : BufferedImage.TYPE_3BYTE_BGR); } else { byte[] r = new byte[256]; byte[] g = new byte[256]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-24 02:28:30
|
Revision: 225 http://patchanim.svn.sourceforge.net/patchanim/?rev=225&view=rev Author: dbrosius Date: 2008-02-23 18:28:36 -0800 (Sat, 23 Feb 2008) Log Message: ----------- Stub in support for controlling transparency with patches Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/PatchAnimDocument.java trunk/patchanim/src/com/mebigfatguy/patchanim/PatchColor.java trunk/patchanim/src/com/mebigfatguy/patchanim/ShiftDirection.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimPanel.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchPanelMediator.java trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java Added Paths: ----------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/NewDocumentDialog.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/SourcePatchesPanel.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/PatchAnimDocument.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/PatchAnimDocument.java 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/PatchAnimDocument.java 2008-02-24 02:28:36 UTC (rev 225) @@ -33,6 +33,7 @@ private boolean dirty; private int order; + private boolean useAlpha; private List<CombinedPatch> patches; private int width; private int height; @@ -43,8 +44,9 @@ /** * constructs a new document for the New menu item */ - public PatchAnimDocument(int patchOrder) { + public PatchAnimDocument(int patchOrder, boolean alpha) { order = patchOrder; + useAlpha = alpha; patches = new ArrayList<CombinedPatch>(); CombinedPatch patch = new CombinedPatch(order, true); patches.add(patch); @@ -80,6 +82,14 @@ } /** + * returns whether to use the alpha channel + * @return the alpha channel option flag + */ + public boolean useAlpha() { + return useAlpha; + } + + /** * retrieves a list of all the bezier patches * @return the list of all the bezier patches */ Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/PatchColor.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/PatchColor.java 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/PatchColor.java 2008-02-24 02:28:36 UTC (rev 225) @@ -22,5 +22,6 @@ Red, Green, Blue, + Alpha, Combined; } Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/ShiftDirection.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/ShiftDirection.java 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/ShiftDirection.java 2008-02-24 02:28:36 UTC (rev 225) @@ -1,3 +1,21 @@ +/* + * patchanim - A bezier surface patch color blend gif builder + * 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.patchanim; import java.util.ResourceBundle; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java 2008-02-24 02:28:36 UTC (rev 225) @@ -97,14 +97,16 @@ } private void initListeners() { - PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + final PatchPanelMediator mediator = PatchPanelMediator.getMediator(); mediator.addActivePatchChangedListener(new ActivePatchChangedListener() { public void activePatchChanged(ActivePatchChangedEvent apce) { CombinedPatch currentPatch = apce.getActivePatch(); - coords = currentPatch.getPatch(color); - if (coords != null) { - setColorField(false); - sample.recalcImage(color, currentPatch); + if ((color != PatchColor.Alpha) || mediator.getDocument().useAlpha()) { + coords = currentPatch.getPatch(color); + if (coords != null) { + setColorField(false); + sample.recalcImage(color, currentPatch); + } } } }); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-24 02:28:36 UTC (rev 225) @@ -83,7 +83,7 @@ cp.setLayout(new BorderLayout(4, 4)); JPatchAnimPanel patchPanel = new JPatchAnimPanel(); - document = new PatchAnimDocument(4); + document = new PatchAnimDocument(4, false); documentLocation = null; PatchPanelMediator mediator = PatchPanelMediator.getMediator(); mediator.setDocument(document); @@ -185,24 +185,15 @@ } } - Integer choice = (Integer)JOptionPane.showInputDialog(JPatchAnimFrame.this, - rb.getString(PatchAnimBundle.SETORDER), - rb.getString(PatchAnimBundle.TITLE), - JOptionPane.QUESTION_MESSAGE, - new ImageIcon(JPatchAnimFrame.this.getIconImage()), - new Object[] { Integer.valueOf(2), - Integer.valueOf(3), - Integer.valueOf(4), - Integer.valueOf(5), - Integer.valueOf(6), - Integer.valueOf(7), - Integer.valueOf(8), - Integer.valueOf(9) }, - Integer.valueOf(4)); - if (choice == null) - choice = Integer.valueOf(4); + NewDocumentDialog newDialog = new NewDocumentDialog(); + newDialog.setModal(true); + newDialog.setLocationRelativeTo(JPatchAnimFrame.this); + newDialog.setVisible(true); - document = new PatchAnimDocument(choice.intValue()); + int order = newDialog.getOrder(); + boolean useAlpha = newDialog.useAlpha(); + + document = new PatchAnimDocument(order, useAlpha); documentLocation = null; saveItem.setEnabled(false); PatchPanelMediator mediator = PatchPanelMediator.getMediator(); @@ -229,7 +220,7 @@ load(); ResourceBundle rb = PatchAnimBundle.getBundle(); - String title = MessageFormat.format(rb.getString(PatchAnimBundle.NAMEDTITLE), documentLocation.getName()); + String title = MessageFormat.format(rb.getString(PatchAnimBundle.NAMEDTITLE), documentLocation == null ? "" : documentLocation.getName()); setTitle(title); } catch (IOException ioe) { @@ -365,7 +356,7 @@ ResourceBundle rb = PatchAnimBundle.getBundle(); JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.LOADFAILED)); documentLocation = null; - document = new PatchAnimDocument(4); + document = new PatchAnimDocument(4, false); } finally { PatchPanelMediator mediator = PatchPanelMediator.getMediator(); mediator.setDocument(document); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimPanel.java 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimPanel.java 2008-02-24 02:28:36 UTC (rev 225) @@ -31,6 +31,8 @@ private static final long serialVersionUID = 3030850111559417377L; + private SourcePatchesPanel sourcesPanel; + public JPatchAnimPanel() { initComponents(); } @@ -59,23 +61,9 @@ Utils.sizeUniformly(Utils.Sizing.Width, ctrl, listPanel ); - q = new JPanel(); - { - q.setLayout(new BoxLayout(q, BoxLayout.X_AXIS)); - JColorControlPatchPanel redPatch = new JColorControlPatchPanel(PatchColor.Red); - JColorControlPatchPanel greenPatch = new JColorControlPatchPanel(PatchColor.Green); - JColorControlPatchPanel bluePatch = new JColorControlPatchPanel(PatchColor.Blue); - - q.add(Box.createHorizontalGlue()); - q.add(redPatch); - q.add(Box.createHorizontalStrut(10)); - q.add(greenPatch); - q.add(Box.createHorizontalStrut(10)); - q.add(bluePatch); - q.add(Box.createHorizontalGlue()); - } + sourcesPanel = new SourcePatchesPanel(); - p.add(q, BorderLayout.CENTER); + p.add(sourcesPanel, BorderLayout.CENTER); p.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6)); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-02-24 02:28:36 UTC (rev 225) @@ -79,6 +79,8 @@ rgb = Color.green; else if (c == PatchColor.Blue) rgb = Color.blue; + else if (c == PatchColor.Alpha) + rgb = Color.white; else rgb = null; @@ -146,14 +148,16 @@ PatchAnimDocument doc = dce.getDocument(); oob = doc.getOutOfBoundsColor(); PatchPanelMediator mediator = PatchPanelMediator.getMediator(); - recalcImage(color, mediator.getActivePatch()); + if ((color != PatchColor.Alpha) || mediator.getDocument().useAlpha()) + recalcImage(color, mediator.getActivePatch()); } }); mediator.addSettingsChangedListener(new SettingsChangedListener() { public void settingsChanged(SettingsChangedEvent sce) { oob = sce.getDocument().getOutOfBoundsColor(); PatchPanelMediator mediator = PatchPanelMediator.getMediator(); - recalcImage(color, mediator.getActivePatch()); + if ((color != PatchColor.Alpha) || mediator.getDocument().useAlpha()) + recalcImage(color, mediator.getActivePatch()); } }); } Added: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/NewDocumentDialog.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/NewDocumentDialog.java (rev 0) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/NewDocumentDialog.java 2008-02-24 02:28:36 UTC (rev 225) @@ -0,0 +1,142 @@ +/* + * patchanim - A bezier surface patch color blend gif builder + * 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.patchanim.gui; + +import java.awt.BorderLayout; +import java.awt.Container; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.util.ResourceBundle; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JPanel; + +import com.mebigfatguy.patchanim.main.PatchAnimBundle; + +public class NewDocumentDialog extends JDialog { + + private static final long serialVersionUID = 6141957372893989399L; + + private JComboBox orderCombo; + private JCheckBox useAlpha; + private JButton ok; + private JButton cancel; + private boolean isOk = false; + + public NewDocumentDialog() { + initComponents(); + initListeners(); + } + + private void initComponents() { + ResourceBundle rb = PatchAnimBundle.getBundle(); + Container cp = getContentPane(); + setTitle(rb.getString(PatchAnimBundle.NEWDOCUMENT)); + cp.setLayout(new BoxLayout(cp, BoxLayout.Y_AXIS)); + JLabel orderLabel = new JLabel(rb.getString(PatchAnimBundle.SETORDER)); + orderCombo = new JComboBox(new Object[] { Integer.valueOf(2), + Integer.valueOf(3), + Integer.valueOf(4), + Integer.valueOf(5), + Integer.valueOf(6), + Integer.valueOf(7), + Integer.valueOf(8), + Integer.valueOf(9) }); + orderCombo.setSelectedItem(Integer.valueOf(4)); + + JPanel p = new JPanel(); + p.setLayout(new BorderLayout(8, 8)); + p.add(orderLabel, BorderLayout.WEST); + p.add(orderCombo, BorderLayout.CENTER); + p.setBorder(BorderFactory.createEmptyBorder(10, 10, 5, 10)); + cp.add(p); + + useAlpha = new JCheckBox(rb.getString(PatchAnimBundle.USEALPHA)); + p = new JPanel(); + p.setLayout(new BorderLayout(8, 8)); + p.add(useAlpha, BorderLayout.CENTER); + p.setBorder(BorderFactory.createEmptyBorder(10, 10, 5, 10)); + cp.add(p); + + p = new JPanel(); + p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); + p.add(Box.createHorizontalGlue()); + ok = new JButton(rb.getString(PatchAnimBundle.OK)); + p.add(ok); + p.add(Box.createHorizontalStrut(10)); + cancel = new JButton(rb.getString(PatchAnimBundle.CANCEL)); + p.add(cancel); + p.add(Box.createHorizontalGlue()); + p.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + cp.add(p); + + Utils.sizeUniformly(Utils.Sizing.Width, orderCombo, useAlpha); + Utils.sizeUniformly(Utils.Sizing.Width, ok, cancel); + pack(); + } + + private void initListeners() { + ok.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + isOk = true; + dispose(); + } + }); + + cancel.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + isOk = false; + dispose(); + } + }); + + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent we) { + isOk = false; + dispose(); + } + }); + } + + public boolean isOk() { + return isOk; + } + + public int getOrder() { + if (isOk) + return ((Integer)orderCombo.getSelectedItem()).intValue(); + return 4; + } + + public boolean useAlpha() { + if (isOk) + return useAlpha.isSelected(); + return false; + } +} Property changes on: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/NewDocumentDialog.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchPanelMediator.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchPanelMediator.java 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchPanelMediator.java 2008-02-24 02:28:36 UTC (rev 225) @@ -47,14 +47,18 @@ return mediator; } public void addDocumentChangedListener(DocumentChangedListener dcl) { - dclisteners.add(dcl); + synchronized(dclisteners) { + dclisteners.add(dcl); + } } public void setDocument(PatchAnimDocument doc) { document = doc; DocumentChangedEvent dce = new DocumentChangedEvent(this, doc); - for (DocumentChangedListener dcl : dclisteners) { - dcl.documentChanged(dce); + synchronized(dclisteners) { + for (DocumentChangedListener dcl : dclisteners) { + dcl.documentChanged(dce); + } } } Added: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/SourcePatchesPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/SourcePatchesPanel.java (rev 0) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/SourcePatchesPanel.java 2008-02-24 02:28:36 UTC (rev 225) @@ -0,0 +1,90 @@ +/* + * patchanim - A bezier surface patch color blend gif builder + * 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.patchanim.gui; + +import java.awt.Container; + +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; + +import com.mebigfatguy.patchanim.PatchColor; +import com.mebigfatguy.patchanim.gui.events.DocumentChangedEvent; +import com.mebigfatguy.patchanim.gui.events.DocumentChangedListener; + +public class SourcePatchesPanel extends JPanel { + + private static final long serialVersionUID = 4186927445084750958L; + + private boolean useAlpha; + JColorControlPatchPanel redPatch; + JColorControlPatchPanel greenPatch; + JColorControlPatchPanel bluePatch; + JColorControlPatchPanel alphaPatch; + + + public SourcePatchesPanel() { + useAlpha = false; + + redPatch = new JColorControlPatchPanel(PatchColor.Red); + greenPatch = new JColorControlPatchPanel(PatchColor.Green); + bluePatch = new JColorControlPatchPanel(PatchColor.Blue); + alphaPatch = new JColorControlPatchPanel(PatchColor.Alpha); + + rebuild(useAlpha); + + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + mediator.addDocumentChangedListener(new DocumentChangedListener() { + public void documentChanged(DocumentChangedEvent dce) { + rebuild(dce.getDocument().useAlpha()); + } + }); + } + + public void rebuild(final boolean useAlpha) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + Container c = SourcePatchesPanel.this.getParent(); + if (c != null) + c.invalidate(); + removeAll(); + setLayout(new BoxLayout(SourcePatchesPanel.this, BoxLayout.X_AXIS)); + add(Box.createHorizontalGlue()); + add(redPatch); + add(Box.createHorizontalStrut(10)); + add(greenPatch); + add(Box.createHorizontalStrut(10)); + add(bluePatch); + if (useAlpha) { + add(Box.createHorizontalStrut(10)); + add(alphaPatch); + } + add(Box.createHorizontalGlue()); + invalidate(); + revalidate(); + if (c != null) { + c.invalidate(); + c.repaint(); + } + + } + }); + } +} Property changes on: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/SourcePatchesPanel.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-02-24 02:28:36 UTC (rev 225) @@ -27,6 +27,7 @@ <xsd:attribute name="version" type="xsd:string" use="required"/> </xsd:complexType> <xsd:complexType name="SettingsClass"> + <xsd:attribute name="alpha" type="xsd:boolean" default="false"/> <xsd:attribute name="animationType" type="AnimationTypeClass" use="required"/> <xsd:attribute name="height" type="xsd:integer" use="required"/> <xsd:attribute name="order" type="xsd:positiveInteger" default="4"/> @@ -50,9 +51,10 @@ </xsd:simpleType> <xsd:simpleType name="ColorClass"> <xsd:restriction base="xsd:string"> + <xsd:enumeration value="Red"/> <xsd:enumeration value="Green"/> <xsd:enumeration value="Blue"/> - <xsd:enumeration value="Red"/> + <xsd:enumeration value="Alpha"/> </xsd:restriction> </xsd:simpleType> <xsd:complexType name="CoordinateClass"> @@ -68,7 +70,7 @@ </xsd:complexType> <xsd:complexType name="CombinedPatchClass"> <xsd:sequence> - <xsd:element maxOccurs="3" minOccurs="3" name="Patch" type="PatchClass"/> + <xsd:element maxOccurs="4" minOccurs="3" name="Patch" type="PatchClass"/> </xsd:sequence> <xsd:attribute name="name" type="NameClass" use="required"/> </xsd:complexType> Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl 2008-02-24 02:28:36 UTC (rev 225) @@ -40,6 +40,9 @@ <xsl:attribute name="order"> <xsl:value-of select="pae:getOrder($ext)"/> </xsl:attribute> + <xsl:attribute name="alpha"> + <xsl:value-of select="pae:useAlpha($ext)"/> + </xsl:attribute> <xsl:attribute name="width"> <xsl:value-of select="pae:getWidth($ext)"/> </xsl:attribute> @@ -108,6 +111,23 @@ </Coordinate> </xsl:for-each> </Patch> + <xsl:if test="pae:useAlpha($ext)='true'"> + <Patch color="Alpha"> + <xsl:for-each select="pae:getCoordinates($ext)"> + <Coordinate> + <xsl:attribute name="x"> + <xsl:value-of select="pae:getX($ext, 'Alpha', $patchIndex, .)"/> + </xsl:attribute> + <xsl:attribute name="y"> + <xsl:value-of select="pae:getY($ext, 'Alpha', $patchIndex, .)"/> + </xsl:attribute> + <xsl:attribute name="color"> + <xsl:value-of select="pae:getColor($ext, 'Alpha', $patchIndex, .)"/> + </xsl:attribute> + </Coordinate> + </xsl:for-each> + </Patch> + </xsl:if> </CombinedPatch> </xsl:for-each> </Patches> Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java 2008-02-24 02:28:36 UTC (rev 225) @@ -83,6 +83,10 @@ return String.valueOf(paDoc.getTweenCount()); } + public String useAlpha(@SuppressWarnings("unused") ExpressionContext context) { + return String.valueOf(paDoc.useAlpha()); + } + public NodeList getPatches(@SuppressWarnings("unused") ExpressionContext context) { return new NodeList() { Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java 2008-02-24 02:28:36 UTC (rev 225) @@ -112,6 +112,7 @@ static class PatchAnimDocContentHandler extends DefaultHandler { private static final String SETTINGS = "Settings"; private static final String ORDER = "order"; + private static final String ALPHA = "alpha"; private static final String WIDTH = "width"; private static final String HEIGHT = "height"; private static final String ANIMATIONTYPE = "animationType"; @@ -135,7 +136,8 @@ public void startElement(String uri, String localName, String qName, Attributes atts) { if (SETTINGS.equals(localName)) { int order = Integer.parseInt(atts.getValue(ORDER)); - doc = new PatchAnimDocument(order); + boolean alpha = Boolean.parseBoolean(atts.getValue(ALPHA)); + doc = new PatchAnimDocument(order, alpha); doc.getPatches().clear(); doc.setWidth(Integer.parseInt(atts.getValue(WIDTH))); doc.setHeight(Integer.parseInt(atts.getValue(HEIGHT))); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-24 02:28:36 UTC (rev 225) @@ -47,7 +47,11 @@ public static final String EXPORTINGFILE = "patchanim.exportfile"; public static final String QUIT = "patchanim.quit"; public static final String CONTROLS = "patchanim.control"; + public static final String NEWDOCUMENT = "patchanim.newdocument"; public static final String SETORDER = "patchanim.setorder"; + public static final String USEALPHA = "patchanim.usealpha"; + public static final String OK = "patchanim.ok"; + public static final String CANCEL = "patchanim.cancel"; public static final String PATCHES = "patchanim.patches"; public static final String WIDTH = "patchanim.width"; public static final String WIDTH_TT = "patchanim.tooltip.width"; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-24 02:28:36 UTC (rev 225) @@ -40,7 +40,11 @@ patchanim.exportfile = Exporting Animation patchanim.quit = Quit patchanim.control = Controls +patchanim.newdocument = New PatchAnim document settings patchanim.setorder = Set the order of the patches to +patchanim.usealpha = Use Alpha channel (transparency) +patchanim.ok = OK +patchanim.cancel = Cancel patchanim.patches = Patches patchanim.width = Width patchanim.tooltip.width = The width of the exported animation Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java 2008-02-24 02:28:36 UTC (rev 225) @@ -24,6 +24,7 @@ import java.util.ResourceBundle; import com.mebigfatguy.patchanim.PatchColor; +import com.mebigfatguy.patchanim.gui.PatchPanelMediator; import com.mebigfatguy.patchanim.main.PatchAnimBundle; public class CombinedPatch implements Serializable, Cloneable { @@ -37,19 +38,22 @@ patches.put(PatchColor.Red, PatchCoords.buildRandomPatch(order)); patches.put(PatchColor.Green, PatchCoords.buildRandomPatch(order)); patches.put(PatchColor.Blue, PatchCoords.buildRandomPatch(order)); + patches.put(PatchColor.Alpha, PatchCoords.buildFullColorPatch(order)); } else { patches.put(PatchColor.Red, new PatchCoords(order)); patches.put(PatchColor.Green, new PatchCoords(order)); patches.put(PatchColor.Blue, new PatchCoords(order)); + patches.put(PatchColor.Alpha, new PatchCoords(order)); } ResourceBundle rb = PatchAnimBundle.getBundle(); name = rb.getString(PatchAnimBundle.DEFAULTPATCHNAME); } - public CombinedPatch(PatchCoords redPatch, PatchCoords greenPatch, PatchCoords bluePatch) { + public CombinedPatch(PatchCoords redPatch, PatchCoords greenPatch, PatchCoords bluePatch, PatchCoords alphaPatch) { patches.put(PatchColor.Red, redPatch); patches.put(PatchColor.Green, greenPatch); patches.put(PatchColor.Blue, bluePatch); + patches.put(PatchColor.Alpha, alphaPatch); } @Override @@ -82,6 +86,14 @@ PatchCoords eBlueCoords = endPatch.getPatch(PatchColor.Blue); tweenPatch.setPatch(PatchColor.Blue, PatchCoords.tween(sBlueCoords, eBlueCoords, frac)); } + + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + if (mediator.getDocument().useAlpha()) + { + PatchCoords sAlphaCoords = startPatch.getPatch(PatchColor.Alpha); + PatchCoords eAlphaCoords = endPatch.getPatch(PatchColor.Alpha); + tweenPatch.setPatch(PatchColor.Alpha, PatchCoords.tween(sAlphaCoords, eAlphaCoords, frac)); + } return tweenPatch; } Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java 2008-02-24 02:28:36 UTC (rev 225) @@ -39,6 +39,16 @@ return new PatchCoords(patchOrder, coords); } + public static PatchCoords buildFullColorPatch(int patchOrder) { + Coordinate[][] coords = new Coordinate[patchOrder][patchOrder]; + for (int u = 0; u < patchOrder; u++) { + for (int v = 0; v < patchOrder; v++) { + coords[u][v] = new Coordinate((u * 100.0) / (patchOrder - 1), (v * 100.0) / (patchOrder - 1), 255); + } + } + return new PatchCoords(patchOrder, coords); + } + public PatchCoords(int patchOrder) { order = patchOrder; coords = new Coordinate[patchOrder][patchOrder]; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java 2008-02-24 02:25:51 UTC (rev 224) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java 2008-02-24 02:28:36 UTC (rev 225) @@ -97,6 +97,9 @@ int pixel = 0; PatchCoords coords = patch.getPatch(color); + if (coords.getCoordinate(0, 0) == null) + return; + int order = coords.getOrder(); double u; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-24 02:25:47
|
Revision: 224 http://patchanim.svn.sourceforge.net/patchanim/?rev=224&view=rev Author: dbrosius Date: 2008-02-23 18:25:51 -0800 (Sat, 23 Feb 2008) Log Message: ----------- enum for directions to shift patches Added Paths: ----------- trunk/patchanim/src/com/mebigfatguy/patchanim/ShiftDirection.java Added: trunk/patchanim/src/com/mebigfatguy/patchanim/ShiftDirection.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/ShiftDirection.java (rev 0) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/ShiftDirection.java 2008-02-24 02:25:51 UTC (rev 224) @@ -0,0 +1,22 @@ +package com.mebigfatguy.patchanim; + +import java.util.ResourceBundle; + +import com.mebigfatguy.patchanim.main.PatchAnimBundle; + +public enum ShiftDirection { + Left, + Down, + Right, + Up; + + /** + * returns the localized value of the type + */ + @Override + public String toString() { + ResourceBundle rb = PatchAnimBundle.getBundle(); + return rb.getString(PatchAnimBundle.ROOT + name().toLowerCase()); + } + +} Property changes on: trunk/patchanim/src/com/mebigfatguy/patchanim/ShiftDirection.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-02-19 04:50:18
|
Revision: 223 http://patchanim.svn.sourceforge.net/patchanim/?rev=223&view=rev Author: dbrosius Date: 2008-02-18 20:50:21 -0800 (Mon, 18 Feb 2008) Log Message: ----------- Tag version 1.0.0 Added Paths: ----------- tags/patchanim/v1_0_0/ Copied: tags/patchanim/v1_0_0 (from rev 222, trunk/patchanim) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-19 04:49:18
|
Revision: 222 http://patchanim.svn.sourceforge.net/patchanim/?rev=222&view=rev Author: dbrosius Date: 2008-02-18 20:49:21 -0800 (Mon, 18 Feb 2008) Log Message: ----------- move to version 1.0.0 Modified Paths: -------------- trunk/patchanim/build.xml Modified: trunk/patchanim/build.xml =================================================================== --- trunk/patchanim/build.xml 2008-02-18 19:19:27 UTC (rev 221) +++ trunk/patchanim/build.xml 2008-02-19 04:49:21 UTC (rev 222) @@ -35,7 +35,7 @@ <property name="javac.deprecation" value="on"/> <property name="javac.debug" value="on"/> - <property name="patchanim.version" value="0.7.0"/> + <property name="patchanim.version" value="1.0.0"/> <target name="clean" description="removes all generated collateral"> <delete dir="${classes.dir}"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 19:19:24
|
Revision: 221 http://patchanim.svn.sourceforge.net/patchanim/?rev=221&view=rev Author: dbrosius Date: 2008-02-18 11:19:27 -0800 (Mon, 18 Feb 2008) Log Message: ----------- update doc Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-18 19:05:38 UTC (rev 220) +++ trunk/patchanim/htdocs/index.html 2008-02-18 19:19:27 UTC (rev 221) @@ -6,11 +6,8 @@ <body background> <div style="position:absolute;top:0;left:0;width:256;height:65535;z-index:1;background-image:url(blend.jpg);"> </div> - <div style="position:absolute;top:38;left:10;z-index:2;"> - <img src="colorwheel.png" align="middle"/> - </div> <div style="position:absolute;top:20;left:20;z-index:3;"> - <h1>PatchAnim</h1> + <h1><img style="position:relative;top:10;" src="colorwheel.png"/> PatchAnim</h1> <hr/> <a href="http://www.sourceforge.net/projects/patchanim">Project Page</a> <img src="vbar.gif" height="12"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 19:05:39
|
Revision: 220 http://patchanim.svn.sourceforge.net/patchanim/?rev=220&view=rev Author: dbrosius Date: 2008-02-18 11:05:38 -0800 (Mon, 18 Feb 2008) Log Message: ----------- add extra sample Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-18 19:05:13 UTC (rev 219) +++ trunk/patchanim/htdocs/index.html 2008-02-18 19:05:38 UTC (rev 220) @@ -6,14 +6,17 @@ <body background> <div style="position:absolute;top:0;left:0;width:256;height:65535;z-index:1;background-image:url(blend.jpg);"> </div> - <div style="position:absolute;top:20;left:20;z-index:2;"> + <div style="position:absolute;top:38;left:10;z-index:2;"> + <img src="colorwheel.png" align="middle"/> + </div> + <div style="position:absolute;top:20;left:20;z-index:3;"> <h1>PatchAnim</h1> <hr/> <a href="http://www.sourceforge.net/projects/patchanim">Project Page</a> <img src="vbar.gif" height="12"/> <a href="javadoc/index.html">JavaDoc</a> <img src="vbar.gif" height="12"/> - <a href="http://patchanim.sourceforge.net/jnlp/patchanim.jnlp">Web Start</a> + <a href="jnlp/patchanim.jnlp">Web Start</a> <hr/> <p>Thanks for your interest in PatchAnim.</p> @@ -60,7 +63,7 @@ <li>Context Patch menu option to shift patch in any direction</li> </ul> <p>If you would like to see the tool as it progresses, you can run the webstart version - <a href="http://patchanim.sourceforge.net/jnlp/patchanim.jnlp">here.</a></p> + <a href="jnlp/patchanim.jnlp">here.</a></p> <img src="sample.jpg"/> <p><table cellpadding="10"> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 19:05:11
|
Revision: 219 http://patchanim.svn.sourceforge.net/patchanim/?rev=219&view=rev Author: dbrosius Date: 2008-02-18 11:05:13 -0800 (Mon, 18 Feb 2008) Log Message: ----------- extra sample Added Paths: ----------- trunk/patchanim/htdocs/colorwheel.png Added: trunk/patchanim/htdocs/colorwheel.png =================================================================== (Binary files differ) Property changes on: trunk/patchanim/htdocs/colorwheel.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 18:54:59
|
Revision: 218 http://patchanim.svn.sourceforge.net/patchanim/?rev=218&view=rev Author: dbrosius Date: 2008-02-18 10:55:03 -0800 (Mon, 18 Feb 2008) Log Message: ----------- add ... to patch menus Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-18 18:52:39 UTC (rev 217) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-18 18:55:03 UTC (rev 218) @@ -79,10 +79,10 @@ patchanim.toptobottom = Top to Bottom patchanim.righttoleft = Right to Left patchanim.bottomtotop = Bottom to Top -patchanim.radialgradient = Radial Gradient +patchanim.radialgradient = Radial Gradient... patchanim.outward = Outward patchanim.inward = Inward -patchanim.shift = Shift +patchanim.shift = Shift... patchanim.left = Left patchanim.down = Down patchanim.right = Right This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 18:52:35
|
Revision: 217 http://patchanim.svn.sourceforge.net/patchanim/?rev=217&view=rev Author: dbrosius Date: 2008-02-18 10:52:39 -0800 (Mon, 18 Feb 2008) Log Message: ----------- update the image doc Modified Paths: -------------- trunk/patchanim/htdocs/patchediting.jpg Modified: trunk/patchanim/htdocs/patchediting.jpg =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 18:39:53
|
Revision: 216 http://patchanim.svn.sourceforge.net/patchanim/?rev=216&view=rev Author: dbrosius Date: 2008-02-18 10:39:57 -0800 (Mon, 18 Feb 2008) Log Message: ----------- update docs Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-18 18:36:45 UTC (rev 215) +++ trunk/patchanim/htdocs/index.html 2008-02-18 18:39:57 UTC (rev 216) @@ -56,6 +56,8 @@ <li>Patches can now be any order from 2 - 9, specified on the new dialog</li> <li>Context Patch menu option to invert the patch</li> <li>Added a new Out Of Bounds Color option, now available: Clip, Cycle, Roll</li> + <li>Context Patch menu option to generate radial gradients for patch values</li> + <li>Context Patch menu option to shift patch in any direction</li> </ul> <p>If you would like to see the tool as it progresses, you can run the webstart version <a href="http://patchanim.sourceforge.net/jnlp/patchanim.jnlp">here.</a></p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 18:36:38
|
Revision: 215 http://patchanim.svn.sourceforge.net/patchanim/?rev=215&view=rev Author: dbrosius Date: 2008-02-18 10:36:45 -0800 (Mon, 18 Feb 2008) Log Message: ----------- add shift menu to patch context menu Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-02-18 18:16:41 UTC (rev 214) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-02-18 18:36:45 UTC (rev 215) @@ -44,6 +44,7 @@ import com.mebigfatguy.patchanim.OutOfBoundsColor; import com.mebigfatguy.patchanim.PatchAnimDocument; import com.mebigfatguy.patchanim.PatchColor; +import com.mebigfatguy.patchanim.ShiftDirection; import com.mebigfatguy.patchanim.gui.events.ActivePatchChangedEvent; import com.mebigfatguy.patchanim.gui.events.ActivePatchChangedListener; import com.mebigfatguy.patchanim.gui.events.DocumentChangedEvent; @@ -305,7 +306,42 @@ radialGradient.add(outward); radialGradient.add(inward); menu.add(radialGradient); + + JMenu shift = new JMenu(rb.getString(PatchAnimBundle.SHIFT)); + JMenuItem left = new JMenuItem(rb.getString(PatchAnimBundle.LEFT)); + left.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + shiftPatch(ShiftDirection.Left); + } + }); + JMenuItem down = new JMenuItem(rb.getString(PatchAnimBundle.DOWN)); + down.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + shiftPatch(ShiftDirection.Down); + } + }); + + JMenuItem right = new JMenuItem(rb.getString(PatchAnimBundle.RIGHT)); + right.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + shiftPatch(ShiftDirection.Right); + } + }); + + JMenuItem up = new JMenuItem(rb.getString(PatchAnimBundle.UP)); + up.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + shiftPatch(ShiftDirection.Up); + } + }); + + shift.add(left); + shift.add(down); + shift.add(right); + shift.add(up); + menu.add(shift); + JMenuItem invert = new JMenuItem(rb.getString(PatchAnimBundle.INVERT)); invert.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { @@ -474,6 +510,43 @@ mediator.setNewActivePatch(patch); } + private void shiftPatch(ShiftDirection dir) { + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + CombinedPatch patch = mediator.getActivePatch(); + PatchCoords coords = patch.getPatch(color); + int order = coords.getOrder(); + + PatchCoords srcCoords = (PatchCoords)coords.clone(); + + for (int i = 0; i < order; i++) { + for (int j = 0; j < order; j++) { + Coordinate c = coords.getCoordinate(i, j); + Coordinate srcC = null; + switch (dir) { + case Left: + srcC = srcCoords.getCoordinate((i + 1) % order, j); + break; + + case Down: + srcC = srcCoords.getCoordinate(i, (j - 1 + order) % order); + break; + + case Right: + srcC = srcCoords.getCoordinate((i - 1 + order) % order, j); + break; + + case Up: + srcC = srcCoords.getCoordinate(i, (j + 1) % order); + break; + } + + c.setColor(srcC.getColor()); + coords.setCoordinate(i, j, c); + } + } + mediator.setNewActivePatch(patch); + } + @Override public void paintComponent(Graphics g) { Shape clip = g.getClip(); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-18 18:16:41 UTC (rev 214) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-18 18:36:45 UTC (rev 215) @@ -89,6 +89,11 @@ public static final String RADIALGRADIENT = "patchanim.radialgradient"; public static final String OUTWARD = "patchanim.outward"; public static final String INWARD = "patchanim.inward"; + public static final String SHIFT = "patchanim.shift"; + public static final String LEFT = "patchanim.left"; + public static final String DOWN = "patchanim.down"; + public static final String RIGHT = "patchanim.right"; + public static final String UP = "patchanim.up"; public static final String INVERT = "patchanim.invert"; public static final String COPYPATCHFROM = "patchanim.copypatchfrom"; public static final String REDPATCH = "patchanim.redpatch"; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-18 18:16:41 UTC (rev 214) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-18 18:36:45 UTC (rev 215) @@ -82,6 +82,11 @@ patchanim.radialgradient = Radial Gradient patchanim.outward = Outward patchanim.inward = Inward +patchanim.shift = Shift +patchanim.left = Left +patchanim.down = Down +patchanim.right = Right +patchanim.up = Up patchanim.invert = Invert patchanim.copypatchfrom = Copy patch from... patchanim.redpatch = Red Patch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 18:16:35
|
Revision: 214 http://patchanim.svn.sourceforge.net/patchanim/?rev=214&view=rev Author: dbrosius Date: 2008-02-18 10:16:41 -0800 (Mon, 18 Feb 2008) Log Message: ----------- add radialGradient menu option to patch sample Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/AnimationType.java trunk/patchanim/src/com/mebigfatguy/patchanim/BlendDirection.java trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/AnimationType.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/AnimationType.java 2008-02-18 17:43:09 UTC (rev 213) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/AnimationType.java 2008-02-18 18:16:41 UTC (rev 214) @@ -35,12 +35,13 @@ Cycle, Wave; + private static final String TYPE = "type."; /** * returns the localized value of the type */ @Override public String toString() { ResourceBundle rb = PatchAnimBundle.getBundle(); - return rb.getString(PatchAnimBundle.ROOT + name().toLowerCase()); + return rb.getString(PatchAnimBundle.ROOT + TYPE + name().toLowerCase()); } } Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/BlendDirection.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/BlendDirection.java 2008-02-18 17:43:09 UTC (rev 213) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/BlendDirection.java 2008-02-18 18:16:41 UTC (rev 214) @@ -26,7 +26,9 @@ LeftToRight, TopToBottom, RightToLeft, - BottomToTop; + BottomToTop, + Outward, + Inward; /** * returns the localized value of the type Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java 2008-02-18 17:43:09 UTC (rev 213) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java 2008-02-18 18:16:41 UTC (rev 214) @@ -35,6 +35,7 @@ Cycle, Wave; + private static final String OOB = "oob."; /** * returns the localized value of the enum * @return the localized display value @@ -42,6 +43,6 @@ @Override public String toString() { ResourceBundle rb = PatchAnimBundle.getBundle(); - return rb.getString(PatchAnimBundle.ROOT + name().toLowerCase()); + return rb.getString(PatchAnimBundle.ROOT + OOB + name().toLowerCase()); } } Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-02-18 17:43:09 UTC (rev 213) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-02-18 18:16:41 UTC (rev 214) @@ -172,6 +172,9 @@ redrawThread = new Thread(new Runnable() { public void run() { + if (oob == null) + oob = OutOfBoundsColor.Clip; + if (color == PatchColor.Combined) { PatchGenerator.recalcCombinedImage(patch, image, oob); } else { @@ -249,40 +252,59 @@ }); menu.add(darkenPatch); - JMenu linearBlend = new JMenu(rb.getString(PatchAnimBundle.LINEARGRADIENT)); + JMenu linearGradient = new JMenu(rb.getString(PatchAnimBundle.LINEARGRADIENT)); JMenuItem leftToRight = new JMenuItem(rb.getString(PatchAnimBundle.LEFTTORIGHT)); leftToRight.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { - linearBlend(BlendDirection.LeftToRight); + linearGradient(BlendDirection.LeftToRight); } }); JMenuItem topToBottom = new JMenuItem(rb.getString(PatchAnimBundle.TOPTOBOTTOM)); topToBottom.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { - linearBlend(BlendDirection.TopToBottom); + linearGradient(BlendDirection.TopToBottom); } }); JMenuItem rightToLeft = new JMenuItem(rb.getString(PatchAnimBundle.RIGHTTOLEFT)); rightToLeft.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { - linearBlend(BlendDirection.RightToLeft); + linearGradient(BlendDirection.RightToLeft); } }); JMenuItem bottomToTop = new JMenuItem(rb.getString(PatchAnimBundle.BOTTOMTOTOP)); bottomToTop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { - linearBlend(BlendDirection.BottomToTop); + linearGradient(BlendDirection.BottomToTop); } }); - linearBlend.add(leftToRight); - linearBlend.add(topToBottom); - linearBlend.add(rightToLeft); - linearBlend.add(bottomToTop); - menu.add(linearBlend); + linearGradient.add(leftToRight); + linearGradient.add(topToBottom); + linearGradient.add(rightToLeft); + linearGradient.add(bottomToTop); + menu.add(linearGradient); + + JMenu radialGradient = new JMenu(rb.getString(PatchAnimBundle.RADIALGRADIENT)); + JMenuItem outward = new JMenuItem(rb.getString(PatchAnimBundle.OUTWARD)); + outward.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + radialGradient(BlendDirection.Outward); + } + }); + + JMenuItem inward = new JMenuItem(rb.getString(PatchAnimBundle.INWARD)); + inward.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + radialGradient(BlendDirection.Inward); + } + }); + + radialGradient.add(outward); + radialGradient.add(inward); + menu.add(radialGradient); JMenuItem invert = new JMenuItem(rb.getString(PatchAnimBundle.INVERT)); invert.addActionListener(new ActionListener() { @@ -388,7 +410,7 @@ mediator.setNewActivePatch(patch); } - private void linearBlend(BlendDirection direction) { + private void linearGradient(BlendDirection direction) { PatchPanelMediator mediator = PatchPanelMediator.getMediator(); CombinedPatch patch = mediator.getActivePatch(); PatchCoords coords = patch.getPatch(color); @@ -423,6 +445,35 @@ mediator.setNewActivePatch(patch); } + private void radialGradient(BlendDirection direction) { + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + CombinedPatch patch = mediator.getActivePatch(); + PatchCoords coords = patch.getPatch(color); + int order = coords.getOrder(); + double color = 0.0; + + double midOrder = (order - 1) / 2.0; + double midOrderSq = midOrder * midOrder; + for (int i = 0; i < order; i++) { + for (int j = 0; j < order; j++) { + Coordinate c = coords.getCoordinate(i, j); + switch (direction) { + case Outward: + color = (double)(int)((255.0 * Math.abs(i - midOrder) * Math.abs(j - midOrder)) / midOrderSq); + break; + + case Inward: + color = (double)(int)(255.0 - (255.0 * (Math.abs(i - midOrder) * Math.abs(j - midOrder))) / midOrderSq); + break; + } + + c.setColor(color); + coords.setCoordinate(i, j, c); + } + } + mediator.setNewActivePatch(patch); + } + @Override public void paintComponent(Graphics g) { Shape clip = g.getClip(); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-18 17:43:09 UTC (rev 213) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-18 18:16:41 UTC (rev 214) @@ -86,6 +86,9 @@ public static final String TOPTOBOTTOM = "patchanim.toptobottom"; public static final String RIGHTTOLEFT = "patchanim.righttoleft"; public static final String BOTTOMTOTOP = "patchanim.bottomtotop"; + public static final String RADIALGRADIENT = "patchanim.radialgradient"; + public static final String OUTWARD = "patchanim.outward"; + public static final String INWARD = "patchanim.inward"; public static final String INVERT = "patchanim.invert"; public static final String COPYPATCHFROM = "patchanim.copypatchfrom"; public static final String REDPATCH = "patchanim.redpatch"; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-18 17:43:09 UTC (rev 213) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-18 18:16:41 UTC (rev 214) @@ -54,8 +54,8 @@ patchanim.outofboundscolor = Out Of Bounds Color patchanim.tooltip.outofboundscolor = How colors that are out of the range of 0 - 255 are handled patchanim.oob.clip = Clip -patchanim.oob.Cycle = Cycle -patchanim.oob.Wave = Wave +patchanim.oob.cycle = Cycle +patchanim.oob.wave = Wave patchanim.tween = In-between frames patchanim.tooltip.tween = How many frames are generated as transitions from one patch to the next patchanim.test = Test @@ -79,6 +79,9 @@ patchanim.toptobottom = Top to Bottom patchanim.righttoleft = Right to Left patchanim.bottomtotop = Bottom to Top +patchanim.radialgradient = Radial Gradient +patchanim.outward = Outward +patchanim.inward = Inward patchanim.invert = Invert patchanim.copypatchfrom = Copy patch from... patchanim.redpatch = Red Patch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 17:43:05
|
Revision: 213 http://patchanim.svn.sourceforge.net/patchanim/?rev=213&view=rev Author: dbrosius Date: 2008-02-18 09:43:09 -0800 (Mon, 18 Feb 2008) Log Message: ----------- make oob names more consistent with animation type constants as they are similar Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java 2008-02-18 07:58:56 UTC (rev 212) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java 2008-02-18 17:43:09 UTC (rev 213) @@ -33,7 +33,7 @@ public enum OutOfBoundsColor { Clip, Cycle, - Roll; + Wave; /** * returns the localized value of the enum Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 2008-02-18 07:58:56 UTC (rev 212) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 2008-02-18 17:43:09 UTC (rev 213) @@ -114,7 +114,7 @@ outOfBoundsLabel = new JLabel(rb.getString(PatchAnimBundle.OUTOFBOUNDSCOLOR)); outOfBoundsColorCB = new JComboBox(new Object[] { OutOfBoundsColor.Clip, OutOfBoundsColor.Cycle, - OutOfBoundsColor.Roll }); + OutOfBoundsColor.Wave }); outOfBoundsColorCB.setToolTipText(rb.getString(PatchAnimBundle.OUTOFBOUNDSCOLOR_TT)); outOfBoundsLabel.setLabelFor(outOfBoundsColorCB); JPanel p = Utils.createFormPanel(outOfBoundsLabel, outOfBoundsColorCB); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-02-18 07:58:56 UTC (rev 212) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-02-18 17:43:09 UTC (rev 213) @@ -45,7 +45,7 @@ <xsd:restriction base="xsd:string"> <xsd:enumeration value="Clip"/> <xsd:enumeration value="Cycle"/> - <xsd:enumeration value="Roll"/> + <xsd:enumeration value="Wave"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="ColorClass"> Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-18 07:58:56 UTC (rev 212) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-18 17:43:09 UTC (rev 213) @@ -55,13 +55,14 @@ public static final String HEIGHT_TT = "patchanim.tooltip.height"; public static final String ANIMATION = "patchanim.animation"; public static final String ANIMATION_TT = "patchanim.tooltip.animation"; - public static final String NONE = "patchanim.none"; - public static final String CYCLE = "patchanim.cycle"; - public static final String WAVE = "patchanim.wave"; + public static final String TYPENONE = "patchanim.type.none"; + public static final String TYPECYCLE = "patchanim.type.cycle"; + public static final String TYPEWAVE = "patchanim.type.wave"; public static final String OUTOFBOUNDSCOLOR = "patchanim.outofboundscolor"; public static final String OUTOFBOUNDSCOLOR_TT = "patchanim.tooltip.outofboundscolor"; - public static final String CLIP = "patchanim.clip"; - public static final String ROLL = "patchanim.roll"; + public static final String OOBCLIP = "patchanim.oob.clip"; + public static final String OOBROLL = "patchanim.oob.cycle"; + public static final String OOBWAVE = "patchanim.oob.wave"; public static final String TWEENFRAMES = "patchanim.tween"; public static final String TWEENFRAMES_TT = "patchanim.tooltip.tween"; public static final String TEST = "patchanim.test"; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-18 07:58:56 UTC (rev 212) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-18 17:43:09 UTC (rev 213) @@ -48,13 +48,14 @@ patchanim.tooltip.height = The height of the exported animation patchanim.animation = Animation Repeat patchanim.tooltip.animation = The type of repetition that the animation uses -patchanim.none = None -patchanim.cycle = Cycle -patchanim.wave = Wave +patchanim.type.none = None +patchanim.type.cycle = Cycle +patchanim.type.wave = Wave patchanim.outofboundscolor = Out Of Bounds Color patchanim.tooltip.outofboundscolor = How colors that are out of the range of 0 - 255 are handled -patchanim.clip = Clip -patchanim.roll = Roll +patchanim.oob.clip = Clip +patchanim.oob.Cycle = Cycle +patchanim.oob.Wave = Wave patchanim.tween = In-between frames patchanim.tooltip.tween = How many frames are generated as transitions from one patch to the next patchanim.test = Test Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java 2008-02-18 07:58:56 UTC (rev 212) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java 2008-02-18 17:43:09 UTC (rev 213) @@ -144,7 +144,7 @@ value = value & 0x00FF; break; - case Roll: + case Wave: int period = value / 256; if ((period & 0x01) != 0) { if (value > 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 07:58:51
|
Revision: 212 http://patchanim.svn.sourceforge.net/patchanim/?rev=212&view=rev Author: dbrosius Date: 2008-02-17 23:58:56 -0800 (Sun, 17 Feb 2008) Log Message: ----------- more docs Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-18 07:51:42 UTC (rev 211) +++ trunk/patchanim/htdocs/index.html 2008-02-18 07:58:56 UTC (rev 212) @@ -50,11 +50,12 @@ to generate one full color blend. Since the description of the blend is very succinct (just 3 * 16 points), It is very easy to generate in-between images from two separate blend descriptions.</p> - <p>February 16, 2008 - added lately</p> + <p>February 18, 2008 - added lately</p> <ul> <li>Context Patch menu option to generate linear gradients for patch values</li> <li>Patches can now be any order from 2 - 9, specified on the new dialog</li> <li>Context Patch menu option to invert the patch</li> + <li>Added a new Out Of Bounds Color option, now available: Clip, Cycle, Roll</li> </ul> <p>If you would like to see the tool as it progresses, you can run the webstart version <a href="http://patchanim.sourceforge.net/jnlp/patchanim.jnlp">here.</a></p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 07:51:37
|
Revision: 211 http://patchanim.svn.sourceforge.net/patchanim/?rev=211&view=rev Author: dbrosius Date: 2008-02-17 23:51:42 -0800 (Sun, 17 Feb 2008) Log Message: ----------- fix roll of negative values Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java 2008-02-18 07:40:54 UTC (rev 210) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java 2008-02-18 07:51:42 UTC (rev 211) @@ -146,10 +146,18 @@ case Roll: int period = value / 256; - if ((period & 0x01) != 0) - value = 255 - value & 0x00FF; - else - value = value & 0x00FF; + if ((period & 0x01) != 0) { + if (value > 0) + value = 255 - (value+1) & 0x00FF; + else + value = value & 0x00FF; + } + else { + if (value > 0) + value = value & 0x00FF; + else + value = 256 - value & 0x00FF; + } break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 07:40:50
|
Revision: 210 http://patchanim.svn.sourceforge.net/patchanim/?rev=210&view=rev Author: dbrosius Date: 2008-02-17 23:40:54 -0800 (Sun, 17 Feb 2008) Log Message: ----------- enable remove button on load, if mulitple patches Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-02-18 07:40:16 UTC (rev 209) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-02-18 07:40:54 UTC (rev 210) @@ -112,11 +112,13 @@ public void documentChanged(final DocumentChangedEvent dce) { SwingUtilities.invokeLater(new Runnable() { public void run() { - patchList.setSelectedIndex(0); patchListModel = new PatchListModel(dce.getDocument()); patchList.setModel(patchListModel); + patchList.setSelectedIndex(0); mediator.setNewActivePatch((CombinedPatch)patchListModel.getElementAt(0)); enabledMovementCtrls(); + removeButton.setEnabled(patchListModel.getSize() > 1); + } }); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 07:40:10
|
Revision: 209 http://patchanim.svn.sourceforge.net/patchanim/?rev=209&view=rev Author: dbrosius Date: 2008-02-17 23:40:16 -0800 (Sun, 17 Feb 2008) Log Message: ----------- fix schema spelling Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-02-18 07:38:08 UTC (rev 208) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-02-18 07:40:16 UTC (rev 209) @@ -45,7 +45,7 @@ <xsd:restriction base="xsd:string"> <xsd:enumeration value="Clip"/> <xsd:enumeration value="Cycle"/> - <xsd:enumeration value="Role"/> + <xsd:enumeration value="Roll"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="ColorClass"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 07:38:03
|
Revision: 208 http://patchanim.svn.sourceforge.net/patchanim/?rev=208&view=rev Author: dbrosius Date: 2008-02-17 23:38:08 -0800 (Sun, 17 Feb 2008) Log Message: ----------- add 'Cycle' to the schema for oob Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-02-18 07:34:04 UTC (rev 207) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-02-18 07:38:08 UTC (rev 208) @@ -44,6 +44,7 @@ <xsd:simpleType name="OutOfBoundsColorClass"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="Clip"/> + <xsd:enumeration value="Cycle"/> <xsd:enumeration value="Role"/> </xsd:restriction> </xsd:simpleType> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 07:33:59
|
Revision: 207 http://patchanim.svn.sourceforge.net/patchanim/?rev=207&view=rev Author: dbrosius Date: 2008-02-17 23:34:04 -0800 (Sun, 17 Feb 2008) Log Message: ----------- rename oob roll to be cycle, and add roll (wave) Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java 2008-02-18 06:53:28 UTC (rev 206) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java 2008-02-18 07:34:04 UTC (rev 207) @@ -26,11 +26,13 @@ * denotes how to render colors when they are outside the range of 0 - 255 * <ul> * <li><b>Clip</b> Clip high values to 255, and low values to 0</li> - * <li><b>Roll</b> Use the remainder from the color value and 255 to calculate a value</li> + * <li><b>Cycle</b> Uses the remainder of the color with 255</li> + * <li><b>Roll</b> Inverses the value at 255 and 0</li> * </ul> */ public enum OutOfBoundsColor { Clip, + Cycle, Roll; /** Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 2008-02-18 06:53:28 UTC (rev 206) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 2008-02-18 07:34:04 UTC (rev 207) @@ -113,6 +113,7 @@ { outOfBoundsLabel = new JLabel(rb.getString(PatchAnimBundle.OUTOFBOUNDSCOLOR)); outOfBoundsColorCB = new JComboBox(new Object[] { OutOfBoundsColor.Clip, + OutOfBoundsColor.Cycle, OutOfBoundsColor.Roll }); outOfBoundsColorCB.setToolTipText(rb.getString(PatchAnimBundle.OUTOFBOUNDSCOLOR_TT)); outOfBoundsLabel.setLabelFor(outOfBoundsColorCB); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java 2008-02-18 06:53:28 UTC (rev 206) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java 2008-02-18 07:34:04 UTC (rev 207) @@ -78,19 +78,7 @@ } for (int k = 0; k < 3; k++) { - iValue[k] = (int)value[k]; - if (iValue[k] > 255) { - if (oob == OutOfBoundsColor.Clip) - iValue[k] = 255; - else - iValue[k] = iValue[k] & 0x00FF; - } - else if (iValue[k] < 0) { - if (oob == OutOfBoundsColor.Clip) - iValue[k] = 0; - else - iValue[k] = iValue[k] & 0x00FF; - } + iValue[k] = adjustColor(value[k], oob); } db.setElem(pixel++, iValue[2]); @@ -133,25 +121,40 @@ value += coords.getCoordinate(i, j).getColor() * uCoeffs[i] * vCoeffs[j]; } } - - int iValue = (int)value; - if (iValue > 255) { - if (oob == OutOfBoundsColor.Clip) - iValue = 255; - else - iValue = iValue & 0x00FF; - } - else if (iValue < 0) { - if (oob == OutOfBoundsColor.Clip) - iValue = 0; - else - iValue = iValue & 0x00FF; - } - - db.setElem(pixel++, iValue); + + db.setElem(pixel++, adjustColor(value, oob)); } } } + + private static int adjustColor(double color, OutOfBoundsColor oob) { + int value = (int)color; + if ((value & 0xFFFFFF00) == 0) + return value; + + switch (oob) { + case Clip: + if (value < 0) + value = 0; + else + value = 255; + break; + + case Cycle: + value = value & 0x00FF; + break; + + case Roll: + int period = value / 256; + if ((period & 0x01) != 0) + value = 255 - value & 0x00FF; + else + value = value & 0x00FF; + break; + } + + return value; + } public static BufferedImage buildImage(Color color, int sampleSizeX, int sampleSizeY) { BufferedImage image = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-18 06:53:23
|
Revision: 206 http://patchanim.svn.sourceforge.net/patchanim/?rev=206&view=rev Author: dbrosius Date: 2008-02-17 22:53:28 -0800 (Sun, 17 Feb 2008) Log Message: ----------- simplify Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java 2008-02-18 06:48:22 UTC (rev 205) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java 2008-02-18 06:53:28 UTC (rev 206) @@ -183,14 +183,14 @@ double tt = 1.0; for (int i = 0; i < coeffs.length; i++) { coeffs[i] = tt; - tt = tt * t; + tt *= t; } double oneMinusT = 1.0 - t; double oneMinusTT = 1.0; for (int i = coeffs.length - 1; i >= 0; i--) { coeffs[i] *= oneMinusTT; - oneMinusTT = oneMinusTT * oneMinusT; + oneMinusTT *= oneMinusT; } for (int i = 0; i < coeffs.length; i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |