patchanim-commit Mailing List for patchanim (Page 9)
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-08 05:39:45
|
Revision: 105 http://patchanim.svn.sourceforge.net/patchanim/?rev=105&view=rev Author: dbrosius Date: 2008-02-07 21:39:50 -0800 (Thu, 07 Feb 2008) Log Message: ----------- better random patches Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java 2008-02-08 05:37:17 UTC (rev 104) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java 2008-02-08 05:39:50 UTC (rev 105) @@ -34,7 +34,7 @@ Random r = new Random(); for (int u = 0; u < PatchCoords.ORDER; u++) { for (int v = 0; v < PatchCoords.ORDER; v++) { - coords[u][v] = new Coordinate((u * 100.0) / (PatchCoords.ORDER - 1), (v * 100.0) / (PatchCoords.ORDER - 1), r.nextInt(256)); + coords[u][v] = new Coordinate((u * 100.0) / (PatchCoords.ORDER - 1), (v * 100.0) / (PatchCoords.ORDER - 1), r.nextInt(400) - 50); } } return new PatchCoords(coords); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-08 05:37:13
|
Revision: 104 http://patchanim.svn.sourceforge.net/patchanim/?rev=104&view=rev Author: dbrosius Date: 2008-02-07 21:37:17 -0800 (Thu, 07 Feb 2008) Log Message: ----------- pull out buildCoefficients 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-08 05:29:50 UTC (rev 103) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchGenerator.java 2008-02-08 05:37:17 UTC (rev 104) @@ -47,8 +47,8 @@ coords[1] = patch.getPatch(PatchColor.Green); coords[2] = patch.getPatch(PatchColor.Blue); - double u, u2, u3, oneMinusU, oneMinusU2, oneMinusU3; - double v, v2, v3, oneMinusV, oneMinusV2, oneMinusV3; + double u; + double v; double[] uCoeffs = new double[PatchCoords.ORDER]; double[] vCoeffs = new double[PatchCoords.ORDER]; double[] value = new double[3]; @@ -59,29 +59,11 @@ for (int iv = 0; iv < sampleSizeY; iv++) { v = (double)iv / (double)sampleSizeY; - v2 = v * v; - v3 = v2 * v; - oneMinusV = 1.0 - v; - oneMinusV2 = oneMinusV * oneMinusV; - oneMinusV3 = oneMinusV2 * oneMinusV; + buildCoefficients(v, vCoeffs); - vCoeffs[0] = oneMinusV3; - vCoeffs[1] = 3.0 * v * oneMinusV2; - vCoeffs[2] = 3.0 * v2 * oneMinusV; - vCoeffs[3] = v3; - for (int iu = 0; iu < sampleSizeX; iu++) { u = (double)iu / (double)sampleSizeX; - u2 = u * u; - u3 = u2 * u; - oneMinusU = 1.0 - u; - oneMinusU2 = oneMinusU * oneMinusU; - oneMinusU3 = oneMinusU2 * oneMinusU; - - uCoeffs[0] = oneMinusU3; - uCoeffs[1] = 3.0 * u * oneMinusU2; - uCoeffs[2] = 3.0 * u2 * oneMinusU; - uCoeffs[3] = u3; + buildCoefficients(u, uCoeffs); value[0] = value[1] = value[2] = 0.0; @@ -127,8 +109,8 @@ PatchCoords coords = patch.getPatch(color); - double u, u2, u3, oneMinusU, oneMinusU2, oneMinusU3; - double v, v2, v3, oneMinusV, oneMinusV2, oneMinusV3; + double u; + double v; double[] uCoeffs = new double[PatchCoords.ORDER]; double[] vCoeffs = new double[PatchCoords.ORDER]; @@ -137,29 +119,11 @@ for (int iv = 0; iv < sampleSizeY; iv++) { v = (double)iv / (double)sampleSizeY; - v2 = v * v; - v3 = v2 * v; - oneMinusV = 1.0 - v; - oneMinusV2 = oneMinusV * oneMinusV; - oneMinusV3 = oneMinusV2 * oneMinusV; + buildCoefficients(v, vCoeffs); - vCoeffs[0] = oneMinusV3; - vCoeffs[1] = 3.0 * v * oneMinusV2; - vCoeffs[2] = 3.0 * v2 * oneMinusV; - vCoeffs[3] = v3; - for (int iu = 0; iu < sampleSizeX; iu++) { u = (double)iu / (double)sampleSizeX; - u2 = u * u; - u3 = u2 * u; - oneMinusU = 1.0 - u; - oneMinusU2 = oneMinusU * oneMinusU; - oneMinusU3 = oneMinusU2 * oneMinusU; - - uCoeffs[0] = oneMinusU3; - uCoeffs[1] = 3.0 * u * oneMinusU2; - uCoeffs[2] = 3.0 * u2 * oneMinusU; - uCoeffs[3] = u3; + buildCoefficients(u, uCoeffs); double value = 0.0; for (int i = 0; i < PatchCoords.ORDER; i++) { @@ -212,5 +176,18 @@ graphics.fillRect(0, 0, sampleSizeX, sampleSizeY); return image; } + + private static void buildCoefficients(double t, double[] coeffs) { + double t2 = t * t; + double t3 = t2 * t; + double oneMinusT = 1.0 - t; + double oneMinusT2 = oneMinusT * oneMinusT; + double oneMinusT3 = oneMinusT2 * oneMinusT; + + coeffs[0] = oneMinusT3; + coeffs[1] = 3.0 * t * oneMinusT2; + coeffs[2] = 3.0 * t2 * oneMinusT; + coeffs[3] = t3; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-08 05:29:46
|
Revision: 103 http://patchanim.svn.sourceforge.net/patchanim/?rev=103&view=rev Author: dbrosius Date: 2008-02-07 21:29:50 -0800 (Thu, 07 Feb 2008) Log Message: ----------- use setLocationRelativeTo for test window Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 2008-02-08 04:59:17 UTC (rev 102) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 2008-02-08 05:29:50 UTC (rev 103) @@ -241,7 +241,7 @@ testButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { JTestFrame tf = new JTestFrame(); - tf.setLocationRelativeTo(null); + tf.setLocationRelativeTo(JPatchControlPanel.this.getRootPane()); tf.setVisible(true); tf.beginAnimation(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-08 04:59:13
|
Revision: 102 http://patchanim.svn.sourceforge.net/patchanim/?rev=102&view=rev Author: dbrosius Date: 2008-02-07 20:59:17 -0800 (Thu, 07 Feb 2008) Log Message: ----------- on focus lost, don't do anything if the field hasn't changed Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 2008-02-05 04:39:46 UTC (rev 101) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 2008-02-08 04:59:17 UTC (rev 102) @@ -161,27 +161,38 @@ @Override public void focusLost(FocusEvent arg0) { try { - document.setWidth(Integer.parseInt(widthField.getText())); + int oldWidth = document.getWidth(); + int newWidth = Integer.parseInt(widthField.getText()); + if (oldWidth != newWidth) { + document.setWidth(newWidth); + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + mediator.fireSettingsChanged(); + } } catch (NumberFormatException nfe) { - document.setWidth(0); - } - PatchPanelMediator mediator = PatchPanelMediator.getMediator(); - mediator.fireSettingsChanged(); + document.setWidth(100); + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + mediator.fireSettingsChanged(); + } } }); - heightField.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent arg0) { try { - document.setHeight(Integer.parseInt(heightField.getText())); + int oldHeight = document.getHeight(); + int newHeight = Integer.parseInt(heightField.getText()); + if (oldHeight != newHeight) { + document.setHeight(newHeight); + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + mediator.fireSettingsChanged(); + } } catch (NumberFormatException nfe) { - document.setHeight(0); + document.setHeight(100); + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + mediator.fireSettingsChanged(); } - PatchPanelMediator mediator = PatchPanelMediator.getMediator(); - mediator.fireSettingsChanged(); } }); @@ -190,12 +201,18 @@ @Override public void focusLost(FocusEvent arg0) { try { - document.setTweenCount(Integer.parseInt(tweenFramesField.getText())); + int oldTween = document.getTweenCount(); + int newTween = Integer.parseInt(tweenFramesField.getText()); + if (oldTween != newTween) { + document.setTweenCount(newTween); + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + mediator.fireSettingsChanged(); + } } catch (NumberFormatException nfe) { - document.setTweenCount(0); + document.setTweenCount(10); + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + mediator.fireSettingsChanged(); } - PatchPanelMediator mediator = PatchPanelMediator.getMediator(); - mediator.fireSettingsChanged(); } }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-05 04:39:41
|
Revision: 101 http://patchanim.svn.sourceforge.net/patchanim/?rev=101&view=rev Author: dbrosius Date: 2008-02-04 20:39:46 -0800 (Mon, 04 Feb 2008) Log Message: ----------- when you click a point, select all the associated pt value text 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-03 04:21:48 UTC (rev 100) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java 2008-02-05 04:39:46 UTC (rev 101) @@ -46,7 +46,7 @@ private static final long serialVersionUID = -2524694507912574529L; private static final double MINCLICKDISTANCESQ = 12.0; - private static final double MINDRAGDISTANCESQ = 3.0; + //private static final double MINDRAGDISTANCESQ = 3.0; private PatchCoords coords; private PatchColor color; @@ -159,6 +159,9 @@ setColorField(false); SwingUtilities.invokeLater(new Runnable() { public void run() { + colorField.requestFocusInWindow(); + colorField.setSelectionStart(0); + colorField.setSelectionEnd(Integer.MAX_VALUE); invalidate(); revalidate(); repaint(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-03 04:21:43
|
Revision: 100 http://patchanim.svn.sourceforge.net/patchanim/?rev=100&view=rev Author: dbrosius Date: 2008-02-02 20:21:48 -0800 (Sat, 02 Feb 2008) Log Message: ----------- sample output file Added Paths: ----------- trunk/patchanim/htdocs/animation.gif Added: trunk/patchanim/htdocs/animation.gif =================================================================== (Binary files differ) Property changes on: trunk/patchanim/htdocs/animation.gif ___________________________________________________________________ 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-03 04:20:06
|
Revision: 99 http://patchanim.svn.sourceforge.net/patchanim/?rev=99&view=rev Author: dbrosius Date: 2008-02-02 20:20:10 -0800 (Sat, 02 Feb 2008) Log Message: ----------- show sample animation Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-03 03:05:27 UTC (rev 98) +++ trunk/patchanim/htdocs/index.html 2008-02-03 04:20:10 UTC (rev 99) @@ -21,6 +21,9 @@ <a href="http://en.wikipedia.org/wiki/B%C3%A9zier_surface">Bezier Patches</a>. This sequence of blends is tweened and animated giving smooth transitions from one blend to another. Blend animations can be outputted to animated gifs, mpegs or a series of bitmaps.</p> + <div style="position:relative;left:100;"><img src="animation.gif"/></div> + <p>Unfortunately gif files are 256 images, and so you get some grainyness. Eventually MPeg and APng will be supported to + get around this shortcoming</p> <p>A Cubic Bezier <b>curve</b> is a curve defined by 4 control points. The curve goes thru both end points, and the curve is influenced by the two middle points. In fact the slope of the curve at the first point is equal to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-03 03:05:22
|
Revision: 98 http://patchanim.svn.sourceforge.net/patchanim/?rev=98&view=rev Author: dbrosius Date: 2008-02-02 19:05:27 -0800 (Sat, 02 Feb 2008) Log Message: ----------- fix cloning Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java trunk/patchanim/src/com/mebigfatguy/patchanim/surface/Coordinate.java trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java 2008-02-03 02:39:39 UTC (rev 97) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java 2008-02-03 03:05:27 UTC (rev 98) @@ -56,8 +56,9 @@ public Object clone() { try { CombinedPatch clonedPatch = (CombinedPatch)super.clone(); + clonedPatch.patches = new EnumMap<PatchColor, PatchCoords>(PatchColor.class); for (Map.Entry<PatchColor, PatchCoords> entry : patches.entrySet()) { - entry.setValue((PatchCoords)entry.getValue().clone()); + clonedPatch.patches.put(entry.getKey(), (PatchCoords)entry.getValue().clone()); } return clonedPatch; } catch (CloneNotSupportedException cnse) { Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/Coordinate.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/Coordinate.java 2008-02-03 02:39:39 UTC (rev 97) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/Coordinate.java 2008-02-03 03:05:27 UTC (rev 98) @@ -20,7 +20,7 @@ import java.io.Serializable; -public class Coordinate implements Serializable { +public class Coordinate implements Serializable, Cloneable { private static final long serialVersionUID = 5211344767856486552L; @@ -32,6 +32,15 @@ color = colorVal; } + @Override + public Object clone() { + try { + return super.clone(); + } catch (CloneNotSupportedException cnse) { + return new Coordinate(0.0, 0.0, 0.0); + } + } + public double getX() { return x; } Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java 2008-02-03 02:39:39 UTC (rev 97) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java 2008-02-03 03:05:27 UTC (rev 98) @@ -51,7 +51,14 @@ @Override public Object clone() { try { - return super.clone(); + PatchCoords clonedCoords = (PatchCoords)super.clone(); + clonedCoords.coords = new Coordinate[ORDER][ORDER]; + for (int u = 0; u < PatchCoords.ORDER; u++) { + for (int v = 0; v < PatchCoords.ORDER; v++) { + clonedCoords.coords[u][v] = (Coordinate)coords[u][v].clone(); + } + } + return clonedCoords; } catch (CloneNotSupportedException cnse) { return buildRandomPatch(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-03 02:39:34
|
Revision: 97 http://patchanim.svn.sourceforge.net/patchanim/?rev=97&view=rev Author: dbrosius Date: 2008-02-02 18:39:39 -0800 (Sat, 02 Feb 2008) Log Message: ----------- clip dragging to the u,v bounds 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-03 02:35:56 UTC (rev 96) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java 2008-02-03 02:39:39 UTC (rev 97) @@ -174,6 +174,9 @@ /* double inputX = ((p.x - bounds.x) * 100.0) / bounds.width; double inputY = ((p.y - bounds.y) * 100.0) / bounds.height; + inputX = Math.min(100.0, Math.max(inputX, 0.0)); + inputY = Math.min(100.0, Math.max(inputY, 0.0)); + Coordinate c= coords.getCoordinate(selectedXPt, selectedYPt); double oldX = c.getX(); double oldY = c.getY(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-03 02:35:50
|
Revision: 96 http://patchanim.svn.sourceforge.net/patchanim/?rev=96&view=rev Author: dbrosius Date: 2008-02-02 18:35:56 -0800 (Sat, 02 Feb 2008) Log Message: ----------- better control point clicking, and add drag ability but commented out till i can figure how to effect the blend with it. Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchDecorator.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchPanelMediator.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java 2008-02-03 01:47:06 UTC (rev 95) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java 2008-02-03 02:35:56 UTC (rev 96) @@ -45,6 +45,8 @@ public class JColorControlPatchPanel extends JPanel implements PatchDecorator { private static final long serialVersionUID = -2524694507912574529L; + private static final double MINCLICKDISTANCESQ = 12.0; + private static final double MINDRAGDISTANCESQ = 3.0; private PatchCoords coords; private PatchColor color; @@ -151,19 +153,79 @@ } } - public void click(Point p, Rectangle bounds) { - int newSelectedXPt = ((((p.x - bounds.x) * 100) / bounds.width) + 16) / 33; - int newSelectedYPt = ((((p.y - bounds.y) * 100) / bounds.height) + 16) / 33; - if ((newSelectedXPt != selectedXPt) || (newSelectedYPt != selectedYPt)) { - selectedXPt = newSelectedXPt; - selectedYPt = newSelectedYPt; + public boolean press(Point p, Rectangle bounds) { + + if (setSelectedControlPt(p, bounds)) { setColorField(false); - invalidate(); - revalidate(); - repaint(); + SwingUtilities.invokeLater(new Runnable() { + public void run() { + invalidate(); + revalidate(); + repaint(); + } + }); + return true; } + return false; } + public boolean drag(Point p, Rectangle bounds) { + return false; +/* + double inputX = ((p.x - bounds.x) * 100.0) / bounds.width; + double inputY = ((p.y - bounds.y) * 100.0) / bounds.height; + Coordinate c= coords.getCoordinate(selectedXPt, selectedYPt); + double oldX = c.getX(); + double oldY = c.getY(); + + double xDeltaSq = inputX - oldX; + xDeltaSq *= xDeltaSq; + double yDeltaSq = inputY - oldY; + yDeltaSq *= yDeltaSq; + + if ((xDeltaSq + yDeltaSq) > MINDRAGDISTANCESQ) { + c.setX(inputX); + c.sety(inputY); + return true; + } + + return false; +*/ + } + + private boolean setSelectedControlPt(Point p, Rectangle bounds) { + double minDistanceSq = Double.MAX_VALUE; + double inputX = ((p.x - bounds.x) * 100.0) / bounds.width; + double inputY = ((p.y - bounds.y) * 100.0) / bounds.height; + int minU = 0; + int minV = 0; + + for (int u = 0; u < 4; u++) { + for (int v = 0; v < 4; v++) { + Coordinate c = coords.getCoordinate(u, v); + double xSq = c.getX() - inputX; + xSq *= xSq; + double ySq = c.getY() - inputY; + ySq *= ySq; + + double distSq = xSq + ySq; + if (distSq < minDistanceSq) { + minDistanceSq = distSq; + minU = u; + minV = v; + } + } + } + + if (minDistanceSq < MINCLICKDISTANCESQ) { + selectedXPt = minU; + selectedYPt = minV; + return true; + } + + return false; + } + class ValueDocumentListener implements DocumentListener { public void changedUpdate(DocumentEvent de) { Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-02-03 01:47:06 UTC (rev 95) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-02-03 02:35:56 UTC (rev 96) @@ -27,6 +27,7 @@ import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; import java.awt.image.BufferedImage; import java.util.ResourceBundle; @@ -65,6 +66,7 @@ private Thread redrawThread = null; private Object redrawLock = new Object(); private boolean redrawing = false; + private boolean dragging = false; public JPatchSamplePanel(PatchColor c) { color = c; @@ -99,24 +101,34 @@ private void initListeners() { addMouseListener(new MouseAdapter() { @Override - public void mouseClicked(MouseEvent me) { - if (decorator != null) - decorator.click(me.getPoint(), JPatchSamplePanel.this.getBounds()); - } - - @Override public void mousePressed(MouseEvent me) { if ((color != PatchColor.Combined) && me.isPopupTrigger()) showPatchContentMenu(me); + else if (decorator != null) { + dragging = decorator.press(me.getPoint(), JPatchSamplePanel.this.getBounds()); + } } @Override public void mouseReleased(MouseEvent me) { if ((color != PatchColor.Combined) && me.isPopupTrigger()) showPatchContentMenu(me); + dragging = false; } }); + addMouseMotionListener(new MouseMotionAdapter() { + @Override + public void mouseDragged(MouseEvent me) { + if ((decorator != null) && dragging) + if (decorator.drag(me.getPoint(), JPatchSamplePanel.this.getBounds())) { + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + CombinedPatch currentPatch = mediator.getActivePatch(); + recalcImage(color, currentPatch); + } + } + }); + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); mediator.addActivePatchChangedListener(new ActivePatchChangedListener() { public void activePatchChanged(ActivePatchChangedEvent apce) { Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchDecorator.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchDecorator.java 2008-02-03 01:47:06 UTC (rev 95) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchDecorator.java 2008-02-03 02:35:56 UTC (rev 96) @@ -25,5 +25,7 @@ public interface PatchDecorator { void drawDecoration(Graphics2D g, Rectangle bounds); - void click(Point p, Rectangle bounds); + boolean press(Point p, Rectangle bounds); + + boolean drag(Point p, Rectangle bounds); } Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchPanelMediator.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchPanelMediator.java 2008-02-03 01:47:06 UTC (rev 95) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchPanelMediator.java 2008-02-03 02:35:56 UTC (rev 96) @@ -62,17 +62,23 @@ } public void addActivePatchChangedListener(ActivePatchChangedListener apcl) { - apclisteners.add(apcl); + synchronized(apclisteners) { + apclisteners.add(apcl); + } } public void addSettingsChangedListener(SettingsChangedListener scl) { - sclisteners.add(scl); + synchronized(sclisteners) { + sclisteners.add(scl); + } } public void fireSettingsChanged() { - SettingsChangedEvent sce = new SettingsChangedEvent(this, document); - for (SettingsChangedListener scl : sclisteners) { - scl.settingsChanged(sce); + synchronized(sclisteners) { + SettingsChangedEvent sce = new SettingsChangedEvent(this, document); + for (SettingsChangedListener scl : sclisteners) { + scl.settingsChanged(sce); + } } } @@ -83,8 +89,10 @@ public void setNewActivePatch(CombinedPatch patch) { activePatch = patch; ActivePatchChangedEvent apce = new ActivePatchChangedEvent(this, patch); - for (ActivePatchChangedListener apcl : apclisteners) { - apcl.activePatchChanged(apce); + synchronized(apclisteners) { + for (ActivePatchChangedListener apcl : apclisteners) { + apcl.activePatchChanged(apce); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-03 01:47:20
|
Revision: 95 http://patchanim.svn.sourceforge.net/patchanim/?rev=95&view=rev Author: dbrosius Date: 2008-02-02 17:47:06 -0800 (Sat, 02 Feb 2008) Log Message: ----------- update status Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-03 01:40:24 UTC (rev 94) +++ trunk/patchanim/htdocs/index.html 2008-02-03 01:47:06 UTC (rev 95) @@ -51,7 +51,6 @@ <li>export to mpeg, apng?</li> <li>Patch Library</li> <li>Color Swatch for editing values</li> - <li>Patch cloning</li> <li>....and much more</li> </ul> </p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-03 01:40:20
|
Revision: 94 http://patchanim.svn.sourceforge.net/patchanim/?rev=94&view=rev Author: dbrosius Date: 2008-02-02 17:40:24 -0800 (Sat, 02 Feb 2008) Log Message: ----------- make sure to jar up the gifs Modified Paths: -------------- trunk/patchanim/build.xml Modified: trunk/patchanim/build.xml =================================================================== --- trunk/patchanim/build.xml 2008-02-03 01:32:12 UTC (rev 93) +++ trunk/patchanim/build.xml 2008-02-03 01:40:24 UTC (rev 94) @@ -73,6 +73,7 @@ <fileset dir="${classes.dir}"> <include name="**/*.class"/> <include name="**/*.properties"/> + <include name="**/*.gif"/> </fileset> <fileset dir="${basedir}"> <include name="license.txt"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-03 01:32:08
|
Revision: 93 http://patchanim.svn.sourceforge.net/patchanim/?rev=93&view=rev Author: dbrosius Date: 2008-02-02 17:32:12 -0800 (Sat, 02 Feb 2008) Log Message: ----------- add clone to the list context menu Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.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 Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-02-03 01:11:24 UTC (rev 92) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-02-03 01:32:12 UTC (rev 93) @@ -33,8 +33,10 @@ import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JList; +import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; +import javax.swing.JPopupMenu; import javax.swing.JScrollPane; import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; @@ -215,9 +217,40 @@ } } } + + @Override + public void mousePressed(MouseEvent me) { + if (me.isPopupTrigger()) { + showPatchListMenu(me); + } + } + + @Override + public void mouseReleased(MouseEvent me) { + if (me.isPopupTrigger()) { + showPatchListMenu(me); + } + } }); } + private void showPatchListMenu(MouseEvent me) { + ResourceBundle rb = PatchAnimBundle.getBundle(); + JPopupMenu patchMenu = new JPopupMenu(); + JMenuItem cloneItem = new JMenuItem(rb.getString(PatchAnimBundle.CLONE)); + cloneItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + int selIndex = patchList.getSelectedIndex(); + CombinedPatch patch = (CombinedPatch)patchListModel.getElementAt(selIndex); + CombinedPatch newPatch = (CombinedPatch)patch.clone(); + patchListModel.add(selIndex + 1, newPatch); + patchList.setSelectedIndex(selIndex + 1); + } + }); + patchMenu.add(cloneItem); + patchMenu.show(JPatchListPanel.this, me.getX(), me.getY()); + } + private void enabledMovementCtrls() { int selIndex = patchList.getSelectedIndex(); int lastIndex = patchListModel.getSize() - 1; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-03 01:11:24 UTC (rev 92) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-03 01:32:12 UTC (rev 93) @@ -60,6 +60,7 @@ public static final String ENTERNEWPATCHNAME = "patchanim.enternewpatchname"; public static final String ADD = "patchanim.add"; public static final String REMOVE = "patchanim.remove"; + public static final String CLONE = "patchanim.clone"; public static final String COLOR = "patchanim.color"; public static final String SETALLPOINTS = "patchanim.setallpoints"; public static final String BLACK = "patchanim.black"; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-03 01:11:24 UTC (rev 92) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-03 01:32:12 UTC (rev 93) @@ -53,6 +53,7 @@ patchanim.enternewpatchname = Rename Patch to patchanim.add = Add patchanim.remove = Remove +patchanim.clone = Clone patchanim.color = Color patchanim.setallpoints = Set all control points to... patchanim.black = Black Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java 2008-02-03 01:11:24 UTC (rev 92) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java 2008-02-03 01:32:12 UTC (rev 93) @@ -20,12 +20,13 @@ import java.io.Serializable; import java.util.EnumMap; +import java.util.Map; import java.util.ResourceBundle; import com.mebigfatguy.patchanim.PatchColor; import com.mebigfatguy.patchanim.main.PatchAnimBundle; -public class CombinedPatch implements Serializable { +public class CombinedPatch implements Serializable, Cloneable { private static final long serialVersionUID = 3521025714125245036L; private EnumMap<PatchColor, PatchCoords> patches = new EnumMap<PatchColor, PatchCoords>(PatchColor.class); @@ -51,6 +52,18 @@ patches.put(PatchColor.Blue, bluePatch); } + @Override + public Object clone() { + try { + CombinedPatch clonedPatch = (CombinedPatch)super.clone(); + for (Map.Entry<PatchColor, PatchCoords> entry : patches.entrySet()) { + entry.setValue((PatchCoords)entry.getValue().clone()); + } + return clonedPatch; + } catch (CloneNotSupportedException cnse) { + return new CombinedPatch(true); + } + } public static CombinedPatch tween(CombinedPatch startPatch, CombinedPatch endPatch, double frac) { CombinedPatch tweenPatch = new CombinedPatch(false); { Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java 2008-02-03 01:11:24 UTC (rev 92) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java 2008-02-03 01:32:12 UTC (rev 93) @@ -22,7 +22,7 @@ import java.util.Arrays; import java.util.Random; -public class PatchCoords implements Serializable { +public class PatchCoords implements Serializable, Cloneable { private static final long serialVersionUID = -4052789167154764908L; public static final int ORDER = 4; @@ -48,6 +48,14 @@ coords = coordinates; } + @Override + public Object clone() { + try { + return super.clone(); + } catch (CloneNotSupportedException cnse) { + return buildRandomPatch(); + } + } public static PatchCoords tween(PatchCoords startCoords, PatchCoords endCoords, double frac) { PatchCoords tweenCoords = new PatchCoords(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-03 01:11:18
|
Revision: 92 http://patchanim.svn.sourceforge.net/patchanim/?rev=92&view=rev Author: dbrosius Date: 2008-02-02 17:11:24 -0800 (Sat, 02 Feb 2008) Log Message: ----------- more docs with pretty pictures Modified Paths: -------------- trunk/patchanim/htdocs/index.html trunk/patchanim/htdocs/sample.jpg Added Paths: ----------- trunk/patchanim/htdocs/nameediting.jpg trunk/patchanim/htdocs/patchediting.jpg Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-03 00:55:42 UTC (rev 91) +++ trunk/patchanim/htdocs/index.html 2008-02-03 01:11:24 UTC (rev 92) @@ -58,6 +58,7 @@ <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> <img src="sample.jpg"/> + <p><table cellpadding="10"><tr><td><img src="nameediting.jpg"/></td><td><img src="patchediting.jpg"/></td></tr></table></p> </div> </body> </html> Added: trunk/patchanim/htdocs/nameediting.jpg =================================================================== (Binary files differ) Property changes on: trunk/patchanim/htdocs/nameediting.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/patchanim/htdocs/patchediting.jpg =================================================================== (Binary files differ) Property changes on: trunk/patchanim/htdocs/patchediting.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/patchanim/htdocs/sample.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-03 00:56:36
|
Revision: 91 http://patchanim.svn.sourceforge.net/patchanim/?rev=91&view=rev Author: dbrosius Date: 2008-02-02 16:55:42 -0800 (Sat, 02 Feb 2008) Log Message: ----------- better wording Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-03 00:54:01 UTC (rev 90) +++ trunk/patchanim/htdocs/index.html 2008-02-03 00:55:42 UTC (rev 91) @@ -32,8 +32,8 @@ <div style="position:relative;left:300px;"/><img src="bezier.jpg"/></div> <p>Now this tool uses Cubic Bezier <b>patches</b>, not curves. A Bezier patch is a description of a 3D surface consisting of 16 control points. You can think of a patch as a set of bezier curves running in parallel along the - x axis, and a cross cutting set of curves running along the y axis. (This is an over-simplification, but is - good enough to understand what this application is doing). Again, though, the z value in + x axis, and a cross cutting set of curves running along the y axis. (This is an over-simplification, and in fact incorrect, + but is good enough to understand what this application is doing). Again, though, the z value in this application is mapped to a color, where values of 0 are mapped to black, and values of 255 are mapped to full color (in this case red). In the color blend samples, then, you can imagine that you are looking straight down on the patch from above. In this application, you can only move the control points This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-03 00:53:57
|
Revision: 90 http://patchanim.svn.sourceforge.net/patchanim/?rev=90&view=rev Author: dbrosius Date: 2008-02-02 16:54:01 -0800 (Sat, 02 Feb 2008) Log Message: ----------- update progress Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-03 00:52:44 UTC (rev 89) +++ trunk/patchanim/htdocs/index.html 2008-02-03 00:54:01 UTC (rev 90) @@ -45,15 +45,13 @@ very easy to generate in-between images from two separate blend descriptions.</p> - <p><b>Jan 30, 2008 - This tool is not finished at this time, although the patch animations work</b><br/> + <p><b>Feb 2, 2008 - This tool is not finished at this time, although the patch animations work</b><br/> Still to be done: <ul> <li>export to mpeg, apng?</li> <li>Patch Library</li> <li>Color Swatch for editing values</li> - <li>Patch Name editing</li> - <li>Patch reordering</li> - <li>Patch cloneing</li> + <li>Patch cloning</li> <li>....and much more</li> </ul> </p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-03 00:52:41
|
Revision: 89 http://patchanim.svn.sourceforge.net/patchanim/?rev=89&view=rev Author: dbrosius Date: 2008-02-02 16:52:44 -0800 (Sat, 02 Feb 2008) Log Message: ----------- allow for named patches, and fix error messages Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.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 Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-03 00:28:51 UTC (rev 88) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-03 00:52:44 UTC (rev 89) @@ -137,7 +137,8 @@ dispose(); System.exit(0); } catch (IOException ioe) { - JOptionPane.showMessageDialog(JPatchAnimFrame.this, PatchAnimBundle.SAVEFAILED); + ResourceBundle rb = PatchAnimBundle.getBundle(); + JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.SAVEFAILED)); } } }); @@ -158,7 +159,8 @@ documentLocation = null; saveItem.setEnabled(false); } catch (IOException ioe) { - JOptionPane.showMessageDialog(JPatchAnimFrame.this, PatchAnimBundle.SAVEFAILED); + ResourceBundle rb = PatchAnimBundle.getBundle(); + JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.SAVEFAILED)); } } }); @@ -176,7 +178,8 @@ } load(); } catch (IOException ioe) { - JOptionPane.showMessageDialog(JPatchAnimFrame.this, PatchAnimBundle.LOADFAILED); + ResourceBundle rb = PatchAnimBundle.getBundle(); + JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.LOADFAILED)); } } }); @@ -190,7 +193,8 @@ save(); } } catch (IOException ioe) { - JOptionPane.showMessageDialog(JPatchAnimFrame.this, PatchAnimBundle.SAVEFAILED); + ResourceBundle rb = PatchAnimBundle.getBundle(); + JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.SAVEFAILED)); } } }); @@ -200,7 +204,8 @@ try { saveAs(); } catch (IOException ioe) { - JOptionPane.showMessageDialog(JPatchAnimFrame.this, PatchAnimBundle.SAVEFAILED); + ResourceBundle rb = PatchAnimBundle.getBundle(); + JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.SAVEFAILED)); } } }); @@ -243,7 +248,8 @@ dispose(); System.exit(0); } catch (IOException ioe) { - JOptionPane.showMessageDialog(JPatchAnimFrame.this, PatchAnimBundle.SAVEFAILED); + ResourceBundle rb = PatchAnimBundle.getBundle(); + JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.SAVEFAILED)); } } }); @@ -289,7 +295,8 @@ document = PatchAnimIO.loadFile(documentLocation); } } catch (Exception e) { - JOptionPane.showMessageDialog(JPatchAnimFrame.this, PatchAnimBundle.SAVEFAILED); + ResourceBundle rb = PatchAnimBundle.getBundle(); + JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.SAVEFAILED)); documentLocation = null; document = new PatchAnimDocument(); } finally { @@ -384,7 +391,8 @@ } }); } catch (IOException ioe) { - JOptionPane.showMessageDialog(JPatchAnimFrame.this, PatchAnimBundle.EXPORTFAILED); + ResourceBundle rb = PatchAnimBundle.getBundle(); + JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.EXPORTFAILED)); } } }); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-02-03 00:28:51 UTC (rev 88) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-02-03 00:52:44 UTC (rev 89) @@ -22,6 +22,8 @@ import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import java.util.ResourceBundle; import javax.swing.BorderFactory; @@ -31,6 +33,7 @@ import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JList; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.ListSelectionModel; @@ -192,6 +195,27 @@ } } }); + + patchList.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent me) { + ResourceBundle rb = PatchAnimBundle.getBundle(); + if (me.getClickCount() == 2) { + CombinedPatch patch = (CombinedPatch)patchList.getSelectedValue(); + if (patch != null) { + String newName = JOptionPane.showInputDialog(JPatchListPanel.this, rb.getString(PatchAnimBundle.ENTERNEWPATCHNAME), patch.getName()); + if (newName != null) { + patch.setName(newName); + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + mediator.getDocument().setDirty(true); + patchList.invalidate(); + patchList.revalidate(); + patchList.repaint(); + } + } + } + } + }); } private void enabledMovementCtrls() { Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-03 00:28:51 UTC (rev 88) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-03 00:52:44 UTC (rev 89) @@ -56,6 +56,8 @@ public static final String TWEENFRAMES = "patchanim.tween"; public static final String TEST = "patchanim.test"; public static final String STOP = "patchanim.stop"; + public static final String DEFAULTPATCHNAME = "patchanim.defaultpatchname"; + public static final String ENTERNEWPATCHNAME = "patchanim.enternewpatchname"; public static final String ADD = "patchanim.add"; public static final String REMOVE = "patchanim.remove"; public static final String COLOR = "patchanim.color"; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-03 00:28:51 UTC (rev 88) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-03 00:52:44 UTC (rev 89) @@ -49,6 +49,8 @@ patchanim.tween = In-between frames patchanim.test = Test patchanim.stop = Stop +patchanim.defaultpatchname = Patch Coordinates +patchanim.enternewpatchname = Rename Patch to patchanim.add = Add patchanim.remove = Remove patchanim.color = Color Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java 2008-02-03 00:28:51 UTC (rev 88) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java 2008-02-03 00:52:44 UTC (rev 89) @@ -20,13 +20,16 @@ import java.io.Serializable; import java.util.EnumMap; +import java.util.ResourceBundle; import com.mebigfatguy.patchanim.PatchColor; +import com.mebigfatguy.patchanim.main.PatchAnimBundle; public class CombinedPatch implements Serializable { - private static final long serialVersionUID = 8732763987020552187L; + private static final long serialVersionUID = 3521025714125245036L; private EnumMap<PatchColor, PatchCoords> patches = new EnumMap<PatchColor, PatchCoords>(PatchColor.class); + private String name; public CombinedPatch(boolean init) { if (init) { @@ -38,6 +41,8 @@ patches.put(PatchColor.Green, new PatchCoords()); patches.put(PatchColor.Blue, new PatchCoords()); } + ResourceBundle rb = PatchAnimBundle.getBundle(); + name = rb.getString(PatchAnimBundle.DEFAULTPATCHNAME); } public CombinedPatch(PatchCoords redPatch, PatchCoords greenPatch, PatchCoords bluePatch) { @@ -74,8 +79,15 @@ patches.put(color, coords); } + public String getName() { + return name; + } + + public void setName(String patchName) { + name = patchName; + } @Override public String toString() { - return "Patch Coordinates"; + return name; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-03 00:28:46
|
Revision: 88 http://patchanim.svn.sourceforge.net/patchanim/?rev=88&view=rev Author: dbrosius Date: 2008-02-02 16:28:51 -0800 (Sat, 02 Feb 2008) Log Message: ----------- title the list panel, and size the ctrl and list panels width the same Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimPanel.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.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/JPatchAnimPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimPanel.java 2008-02-03 00:10:34 UTC (rev 87) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimPanel.java 2008-02-03 00:28:51 UTC (rev 88) @@ -23,6 +23,7 @@ import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; +import javax.swing.JComponent; import javax.swing.JPanel; import com.mebigfatguy.patchanim.PatchColor; @@ -55,8 +56,11 @@ p = new JPanel(); p.setLayout(new BorderLayout(4, 4)); - p.add(new JPatchListPanel(), BorderLayout.WEST); + JPanel listPanel = new JPatchListPanel(); + p.add(listPanel, BorderLayout.WEST); + Utils.sizeUniformly(new JComponent[] { ctrl, listPanel }, Utils.Sizing.Width); + q = new JPanel(); { q.setLayout(new BoxLayout(q, BoxLayout.X_AXIS)); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-02-03 00:10:34 UTC (rev 87) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-02-03 00:28:51 UTC (rev 88) @@ -24,6 +24,7 @@ import java.awt.event.ActionListener; import java.util.ResourceBundle; +import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.ImageIcon; @@ -96,6 +97,8 @@ moveCtrls.add(downButton); moveCtrls.add(Box.createVerticalGlue()); add(moveCtrls, BorderLayout.EAST); + + setBorder(BorderFactory.createTitledBorder(rb.getString(PatchAnimBundle.PATCHES))); } private void initListeners() { Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-03 00:10:34 UTC (rev 87) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-03 00:28:51 UTC (rev 88) @@ -43,6 +43,7 @@ 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 PATCHES = "patchanim.patches"; public static final String WIDTH = "patchanim.width"; public static final String HEIGHT = "patchanim.height"; public static final String ANIMATION = "patchanim.animation"; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-03 00:10:34 UTC (rev 87) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-03 00:28:51 UTC (rev 88) @@ -36,6 +36,7 @@ patchanim.exportfile = Exporting Animation patchanim.quit = Quit patchanim.control = Controls +patchanim.patches = Patches patchanim.width = Width patchanim.height = Height patchanim.animation = Animation Repeat This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-03 00:10:30
|
Revision: 87 http://patchanim.svn.sourceforge.net/patchanim/?rev=87&view=rev Author: dbrosius Date: 2008-02-02 16:10:34 -0800 (Sat, 02 Feb 2008) Log Message: ----------- add up down controls for patch list Modified Paths: -------------- trunk/patchanim/build.xml trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchListModel.java Added Paths: ----------- trunk/patchanim/src/com/mebigfatguy/patchanim/down.gif trunk/patchanim/src/com/mebigfatguy/patchanim/up.gif Modified: trunk/patchanim/build.xml =================================================================== --- trunk/patchanim/build.xml 2008-02-02 23:36:35 UTC (rev 86) +++ trunk/patchanim/build.xml 2008-02-03 00:10:34 UTC (rev 87) @@ -63,6 +63,7 @@ <copy todir="${classes.dir}"> <fileset dir="${src.dir}"> <include name="**/*.properties"/> + <include name="**/*.gif"/> </fileset> </copy> </target> Added: trunk/patchanim/src/com/mebigfatguy/patchanim/down.gif =================================================================== (Binary files differ) Property changes on: trunk/patchanim/src/com/mebigfatguy/patchanim/down.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-02-02 23:36:35 UTC (rev 86) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-02-03 00:10:34 UTC (rev 87) @@ -26,6 +26,7 @@ import javax.swing.Box; import javax.swing.BoxLayout; +import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JList; @@ -42,12 +43,16 @@ import com.mebigfatguy.patchanim.surface.CombinedPatch; public class JPatchListPanel extends JPanel { - private static final long serialVersionUID = -6673383252840039387L; + private static final long serialVersionUID = -5365174588964238457L; + private static final String UPBUTTON = "/com/mebigfatguy/patchanim/up.gif"; + private static final String DOWNBUTTON = "/com/mebigfatguy/patchanim/down.gif"; private JList patchList; private PatchListModel patchListModel; private JButton addButton; private JButton removeButton; + private JButton upButton; + private JButton downButton; public JPatchListPanel() { initComponents(); @@ -76,7 +81,21 @@ modCtrls.add(Box.createHorizontalStrut(10)); modCtrls.add(removeButton); modCtrls.add(Box.createHorizontalGlue()); - add(modCtrls, BorderLayout.SOUTH); + add(modCtrls, BorderLayout.SOUTH); + + JPanel moveCtrls = new JPanel(); + upButton = new JButton(new ImageIcon(getClass().getResource(UPBUTTON))); + downButton = new JButton(new ImageIcon(getClass().getResource(DOWNBUTTON))); + upButton.setEnabled(false); + downButton.setEnabled(false); + Utils.sizeUniformly(new JComponent[] {upButton, downButton}, Utils.Sizing.Both); + moveCtrls.setLayout(new BoxLayout(moveCtrls, BoxLayout.Y_AXIS)); + moveCtrls.add(Box.createVerticalGlue()); + moveCtrls.add(upButton); + moveCtrls.add(Box.createVerticalStrut(10)); + moveCtrls.add(downButton); + moveCtrls.add(Box.createVerticalGlue()); + add(moveCtrls, BorderLayout.EAST); } private void initListeners() { @@ -89,6 +108,7 @@ patchListModel = new PatchListModel(dce.getDocument()); patchList.setModel(patchListModel); mediator.setNewActivePatch((CombinedPatch)patchListModel.getElementAt(0)); + enabledMovementCtrls(); } }); } @@ -106,6 +126,7 @@ patchListModel.add(selIndex, newPatch); patchList.setSelectedIndex(selIndex); removeButton.setEnabled(patchListModel.getSize() > 1); + enabledMovementCtrls(); } }); @@ -121,10 +142,40 @@ PatchPanelMediator mediator = PatchPanelMediator.getMediator(); mediator.setNewActivePatch((CombinedPatch)patchListModel.getElementAt(selIndex)); removeButton.setEnabled(patchListModel.getSize() > 1); + enabledMovementCtrls(); } } }); + + upButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + int selIndex = patchList.getSelectedIndex(); + if (selIndex > 0) { + CombinedPatch patch = (CombinedPatch) patchListModel.getElementAt(selIndex); + patchListModel.remove(selIndex); + selIndex--; + patchListModel.add(selIndex, patch); + patchList.setSelectedIndex(selIndex); + enabledMovementCtrls(); + } + } + }); + + downButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + int selIndex = patchList.getSelectedIndex(); + if ((selIndex >= 0) && (selIndex < (patchListModel.getSize() - 1))) { + CombinedPatch patch = (CombinedPatch) patchListModel.getElementAt(selIndex); + patchListModel.remove(selIndex); + selIndex++; + patchListModel.add(selIndex, patch); + patchList.setSelectedIndex(selIndex); + enabledMovementCtrls(); + } + } + }); + patchList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { @@ -133,9 +184,23 @@ CombinedPatch newPatch = (CombinedPatch)patchListModel.getElementAt(selIndex); PatchPanelMediator mediator = PatchPanelMediator.getMediator(); mediator.setNewActivePatch(newPatch); + enabledMovementCtrls(); } } } }); } + + private void enabledMovementCtrls() { + int selIndex = patchList.getSelectedIndex(); + int lastIndex = patchListModel.getSize() - 1; + + if ((lastIndex <= 0) || (selIndex < 0)) { + upButton.setEnabled(false); + downButton.setEnabled(false); + } else { + upButton.setEnabled(selIndex > 0); + downButton.setEnabled(selIndex < lastIndex); + } + } } Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchListModel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchListModel.java 2008-02-02 23:36:35 UTC (rev 86) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchListModel.java 2008-02-03 00:10:34 UTC (rev 87) @@ -44,7 +44,7 @@ return; List<CombinedPatch> patches = doc.getPatches(); - patches.add(patch); + patches.add(pos, patch); doc.setDirty(true); fireIntervalAdded(this, pos, pos); } Added: trunk/patchanim/src/com/mebigfatguy/patchanim/up.gif =================================================================== (Binary files differ) Property changes on: trunk/patchanim/src/com/mebigfatguy/patchanim/up.gif ___________________________________________________________________ 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-02 23:36:32
|
Revision: 86 http://patchanim.svn.sourceforge.net/patchanim/?rev=86&view=rev Author: dbrosius Date: 2008-02-02 15:36:35 -0800 (Sat, 02 Feb 2008) Log Message: ----------- javadoc Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/PatchAnimDocument.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/PatchAnimDocument.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/PatchAnimDocument.java 2008-02-01 08:27:35 UTC (rev 85) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/PatchAnimDocument.java 2008-02-02 23:36:35 UTC (rev 86) @@ -24,6 +24,9 @@ import com.mebigfatguy.patchanim.surface.CombinedPatch; +/** + * represents the document that can be saved to file. + */ public class PatchAnimDocument implements Serializable { private static final long serialVersionUID = -587863884486252874L; @@ -36,6 +39,9 @@ private OutOfBoundsColor outOfBoundsColor; private int tweenCount; + /** + * constructs a new document for the New menu item + */ public PatchAnimDocument() { patches = new ArrayList<CombinedPatch>(); CombinedPatch patch = new CombinedPatch(true); @@ -47,58 +53,114 @@ tweenCount = 10; } + /** + * determines if the document has been modified since it was last saved + * @return whether the document has been modified. + */ public boolean isDirty() { return dirty; } + /** + * marks whether or not the document has been modified. + * @param isDirty whether or not the document has been modified + */ public void setDirty(boolean isDirty) { dirty = isDirty; } + /** + * retrieves a list of all the bezier patches + * @return the list of all the bezier patches + */ public List<CombinedPatch> getPatches() { return patches; } + /** + * sets the list of bezier patches to use for color blends + * @param patches the list of bezier patches + */ public void setPatches(List<CombinedPatch> patches) { this.patches = patches; } + /** + * returns the preferred width in pixels of the generated animation file + * @return the width in pixels + */ public int getWidth() { return width; } + /** + * sets the preferred width in pixels of generated animation files + * @param width the width in pixels + */ public void setWidth(int width) { this.width = width; } + /** + * gets the height in pixels of the generated animation file + * @return the height in pixels + */ public int getHeight() { return height; } + /** + * sets the height in pixels of the gnerated animation files + * @param height the height in pixels + */ public void setHeight(int height) { this.height = height; } + /** + * gets the preferred animation type to use for the animation files + * @return the preferred animation type + */ public AnimationType getAnimationType() { return animationType; } + /** + * sets the preferred animation type to use for animation files + * @param animationType the preferred animation type + */ public void setAnimationType(AnimationType animationType) { this.animationType = animationType; } + /** + * gets the algorithm to use when a color is beyond the 0 - 255 range + * @return the algorithm choice to use for out of bounds color + */ public OutOfBoundsColor getOutOfBoundsColor() { return outOfBoundsColor; } + /** + * sets the algorithm to use when a color is beyond the 0 - 255 range + * @param outOfBoundsColor the algorithm choice to use for out of bounds colors + */ public void setOutOfBoundsColor(OutOfBoundsColor outOfBoundsColor) { this.outOfBoundsColor = outOfBoundsColor; } + /** + * gets the preferred number of in-between frames to generate when creating animations + * @return the number of in-between frames + */ public int getTweenCount() { return tweenCount; } + /** + * sets the preferred number of in-between frames to generate when creating animations + * @param tweenCount the number of in-between frames + */ public void setTweenCount(int tweenCount) { this.tweenCount = tweenCount; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-01 08:27:30
|
Revision: 85 http://patchanim.svn.sourceforge.net/patchanim/?rev=85&view=rev Author: dbrosius Date: 2008-02-01 00:27:35 -0800 (Fri, 01 Feb 2008) Log Message: ----------- fix javadoc Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/AnimationType.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/AnimationType.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/AnimationType.java 2008-02-01 08:18:46 UTC (rev 84) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/AnimationType.java 2008-02-01 08:27:35 UTC (rev 85) @@ -27,7 +27,7 @@ * <ul> * <li><b>None</b> Animation progress from start to finish and then stops</li> * <li><b>Cycle</b> Animation progress from start to finish and then from finish to start, and repeats</li> - * <li><b>None</b> Animation progress from start to finish and then repeats</li> + * <li><b>Wave</b> Animation progress from start to finish and then repeats</li> * </ul> */ public enum AnimationType { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-01 08:18:43
|
Revision: 84 http://patchanim.svn.sourceforge.net/patchanim/?rev=84&view=rev Author: dbrosius Date: 2008-02-01 00:18:46 -0800 (Fri, 01 Feb 2008) Log Message: ----------- javadoc Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java 2008-02-01 08:14:28 UTC (rev 83) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/OutOfBoundsColor.java 2008-02-01 08:18:46 UTC (rev 84) @@ -22,10 +22,21 @@ import com.mebigfatguy.patchanim.main.PatchAnimBundle; +/** + * 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> + * </ul> + */ public enum OutOfBoundsColor { Clip, Roll; + /** + * returns the localized value of the enum + * @return the localized display value + */ @Override public String toString() { ResourceBundle rb = PatchAnimBundle.getBundle(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-01 08:14:30
|
Revision: 83 http://patchanim.svn.sourceforge.net/patchanim/?rev=83&view=rev Author: dbrosius Date: 2008-02-01 00:14:28 -0800 (Fri, 01 Feb 2008) Log Message: ----------- javadoc Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/AnimationType.java trunk/patchanim/src/com/mebigfatguy/patchanim/ExportType.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/AnimationType.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/AnimationType.java 2008-02-01 08:02:15 UTC (rev 82) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/AnimationType.java 2008-02-01 08:14:28 UTC (rev 83) @@ -22,11 +22,22 @@ import com.mebigfatguy.patchanim.main.PatchAnimBundle; +/** + * denotes the way animations progress through the series of images. + * <ul> + * <li><b>None</b> Animation progress from start to finish and then stops</li> + * <li><b>Cycle</b> Animation progress from start to finish and then from finish to start, and repeats</li> + * <li><b>None</b> Animation progress from start to finish and then repeats</li> + * </ul> + */ public enum AnimationType { None, Cycle, Wave; + /** + * returns the localized value of the type + */ @Override public String toString() { ResourceBundle rb = PatchAnimBundle.getBundle(); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/ExportType.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/ExportType.java 2008-02-01 08:02:15 UTC (rev 82) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/ExportType.java 2008-02-01 08:14:28 UTC (rev 83) @@ -2,6 +2,16 @@ import com.mebigfatguy.patchanim.main.PatchAnimBundle; +/** + * denotes the type of file to export to + * <ul> + * <li><b>JPegs</b> a series of jpeg files in a directory</li> + * <li><b>Pngs</b> a series of Png files in a directory</li> + * <li><b>Gifs</b> a series of Gif files in a directory</li> + * <li><b>AnimatedGif</b> an animated gif file</li> + * <li><b>Mpeg</b> an animated mpeg file</li> + * </ul> + */ public enum ExportType { JPegs("jpg", true, PatchAnimBundle.JPGSERIESFILTER), Pngs("png", true, PatchAnimBundle.PNGSERIESFILTER), @@ -13,20 +23,38 @@ private boolean multi; private String key; + /** + * constructs an ExportType enum + * @param extension the file extension used for this type + * @param multipleFiles whether or not this file type generates multiple files + * @param descriptionKey the resource bundle key for the display value + */ private ExportType(String extension, boolean multipleFiles, String descriptionKey) { ext = extension; multi = multipleFiles; key = descriptionKey; } + /** + * returns the file extension for this export type + * @return the file extension + */ public String getExtension() { return ext; } + /** + * returns whether or not this file type generates multiple files + * @return whether the export generates multiple files + */ public boolean isMultipleFiles() { return multi; } + /** + * returns the resource bundle key for the localized value + * @return the resource key + */ public String getDescriptionKey() { return key; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-01 08:02:13
|
Revision: 82 http://patchanim.svn.sourceforge.net/patchanim/?rev=82&view=rev Author: dbrosius Date: 2008-02-01 00:02:15 -0800 (Fri, 01 Feb 2008) Log Message: ----------- add copy patch from 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-01 07:43:51 UTC (rev 81) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-02-01 08:02:15 UTC (rev 82) @@ -224,20 +224,67 @@ public void actionPerformed(ActionEvent ae) { deltaAllPts(10.0); } - }); - + }); menu.add(lightenPatch); + JMenuItem darkenPatch = new JMenuItem(rb.getString(PatchAnimBundle.DARKENPATCH)); darkenPatch.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { deltaAllPts(-10.0); } }); + menu.add(darkenPatch); + + JMenu copy = new JMenu(rb.getString(PatchAnimBundle.COPYPATCHFROM)); + if (color != PatchColor.Red) { + JMenuItem copyRed = new JMenuItem(rb.getString(PatchAnimBundle.REDPATCH)); + copyRed.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + copyPatch(PatchColor.Red); + } + }); + copy.add(copyRed); + } + if (color != PatchColor.Green) { + JMenuItem copyGreen = new JMenuItem(rb.getString(PatchAnimBundle.GREENPATCH)); + copyGreen.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + copyPatch(PatchColor.Green); + } + }); + copy.add(copyGreen); + } + if (color != PatchColor.Blue) { + JMenuItem copyBlue = new JMenuItem(rb.getString(PatchAnimBundle.BLUEPATCH)); + copyBlue.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + copyPatch(PatchColor.Blue); + } + }); + copy.add(copyBlue); + } - menu.add(darkenPatch); + menu.add(copy); menu.show(JPatchSamplePanel.this, me.getX(), me.getY()); } + private void copyPatch(PatchColor copyColor) { + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + CombinedPatch patch = mediator.getActivePatch(); + PatchCoords srcCoords = patch.getPatch(copyColor); + PatchCoords dstCoords = patch.getPatch(color); + for (int i = 0; i < PatchCoords.ORDER; i++) { + for (int j = 0; j < PatchCoords.ORDER; j++) { + Coordinate srcCoord = srcCoords.getCoordinate(i, j); + double value = srcCoord.getColor(); + Coordinate dstCoord = dstCoords.getCoordinate(i, j); + dstCoord.setColor(value); + } + } + mediator.setNewActivePatch(patch); + + } + private void deltaAllPts(double d) { PatchPanelMediator mediator = PatchPanelMediator.getMediator(); CombinedPatch patch = mediator.getActivePatch(); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-01 07:43:51 UTC (rev 81) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-01 08:02:15 UTC (rev 82) @@ -64,6 +64,10 @@ public static final String VALUE="patchanim.value"; public static final String LIGHTENPATCH = "patchanim.lightenpatch"; public static final String DARKENPATCH = "patchanim.darkenpatch"; + public static final String COPYPATCHFROM = "patchanim.copypatchfrom"; + public static final String REDPATCH = "patchanim.redpatch"; + public static final String GREENPATCH = "patchanim.greenpatch"; + public static final String BLUEPATCH = "patchanim.bluepatch"; public static final String ASKSAVE = "patchanim.asksave"; public static final String LOADFAILED = "patchanim.err.loadfailed"; public static final String SAVEFAILED = "patchanim.err.savefailed"; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-01 07:43:51 UTC (rev 81) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-01 08:02:15 UTC (rev 82) @@ -57,6 +57,10 @@ patchanim.value = Value... patchanim.lightenpatch = Lighten Patch patchanim.darkenpatch = Darken Patch +patchanim.copypatchfrom = Copy patch from... +patchanim.redpatch = Red Patch +patchanim.greenpatch = Green Patch +patchanim.bluepatch = Blue Patch patchanim.asksave = Do you want to save your changes? patchanim.err.savefailed = Failed saving Patch Animation File patchanim.err.loadfailed = Failed loading Patch Animation File This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-01 07:43:46
|
Revision: 81 http://patchanim.svn.sourceforge.net/patchanim/?rev=81&view=rev Author: dbrosius Date: 2008-01-31 23:43:51 -0800 (Thu, 31 Jan 2008) Log Message: ----------- add lighten patch and darken patch commands to the 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-01-31 22:45:25 UTC (rev 80) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-02-01 07:43:51 UTC (rev 81) @@ -217,10 +217,41 @@ } } }); + setAllItem.add(valueItem); + JMenuItem lightenPatch = new JMenuItem(rb.getString(PatchAnimBundle.LIGHTENPATCH)); + lightenPatch.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + deltaAllPts(10.0); + } + }); + + menu.add(lightenPatch); + JMenuItem darkenPatch = new JMenuItem(rb.getString(PatchAnimBundle.DARKENPATCH)); + darkenPatch.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + deltaAllPts(-10.0); + } + }); + + menu.add(darkenPatch); menu.show(JPatchSamplePanel.this, me.getX(), me.getY()); } + private void deltaAllPts(double d) { + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + CombinedPatch patch = mediator.getActivePatch(); + PatchCoords coords = patch.getPatch(color); + for (int i = 0; i < PatchCoords.ORDER; i++) { + for (int j = 0; j < PatchCoords.ORDER; j++) { + Coordinate c = coords.getCoordinate(i, j); + c.setColor(c.getColor() + d); + coords.setCoordinate(i, j, c); + } + } + mediator.setNewActivePatch(patch); + } + private void setAllPts(double d) { PatchPanelMediator mediator = PatchPanelMediator.getMediator(); CombinedPatch patch = mediator.getActivePatch(); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-01-31 22:45:25 UTC (rev 80) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-01 07:43:51 UTC (rev 81) @@ -62,6 +62,8 @@ public static final String BLACK = "patchanim.black"; public static final String FULLCOLOR="patchanim.fullcolor"; public static final String VALUE="patchanim.value"; + public static final String LIGHTENPATCH = "patchanim.lightenpatch"; + public static final String DARKENPATCH = "patchanim.darkenpatch"; public static final String ASKSAVE = "patchanim.asksave"; public static final String LOADFAILED = "patchanim.err.loadfailed"; public static final String SAVEFAILED = "patchanim.err.savefailed"; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-01-31 22:45:25 UTC (rev 80) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-01 07:43:51 UTC (rev 81) @@ -55,6 +55,8 @@ patchanim.black = Black patchanim.fullcolor = Full Color patchanim.value = Value... +patchanim.lightenpatch = Lighten Patch +patchanim.darkenpatch = Darken Patch patchanim.asksave = Do you want to save your changes? patchanim.err.savefailed = Failed saving Patch Animation File patchanim.err.loadfailed = Failed loading Patch Animation File This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |