polycasso-commit Mailing List for polycasso (Page 6)
Brought to you by:
dbrosius
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(115) |
Dec
(92) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
(1) |
Oct
(4) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <dbr...@us...> - 2009-12-01 14:31:21
|
Revision: 125
http://polycasso.svn.sourceforge.net/polycasso/?rev=125&view=rev
Author: dbrosius
Date: 2009-12-01 14:31:12 +0000 (Tue, 01 Dec 2009)
Log Message:
-----------
add NumCompetingImages
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java 2009-12-01 14:25:34 UTC (rev 124)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java 2009-12-01 14:31:12 UTC (rev 125)
@@ -174,6 +174,7 @@
Settings dlgSettings = dialog.getSettings();
settings.setMaxImageSize(dlgSettings.getMaxImageSize());
settings.setMaxPolygons(dlgSettings.getMaxPolygons());
+ settings.setNumCompetingImages(dlgSettings.getNumCompetingImages());
settings.setMaxPoints(dlgSettings.getMaxPoints());
settings.setMaxPtMovement(dlgSettings.getMaxPtMovement());
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java 2009-12-01 14:25:34 UTC (rev 124)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java 2009-12-01 14:31:12 UTC (rev 125)
@@ -45,6 +45,7 @@
Width("pc.width"),
Height("pc.height"),
MaximumPolygons("pc.maximumpolygons"),
+ NumberOfCompetingImages("pc.numberofcompetingimages"),
MaximumPolygonPoints("pc.maxpolygonpoints"),
MaximumPointMovement("pc.maximumpointmovement"),
MaximumColorChange("pc.maximumcolorchange"),
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-12-01 14:25:34 UTC (rev 124)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-12-01 14:31:12 UTC (rev 125)
@@ -39,6 +39,7 @@
public Settings() {
maxImageSize = new Dimension(800, 600);
maxPolygons = 50;
+ numCompetingImages = 100;
maxPoints = 8;
maxPtMovement = 20;
maxColorChange = 40;
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2009-12-01 14:25:34 UTC (rev 124)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2009-12-01 14:31:12 UTC (rev 125)
@@ -54,6 +54,7 @@
private JTextField widthField;
private JTextField heightField;
private JTextField maxPolygonField;
+ private JTextField numCompetingImagesField;
private JTextField maxPolygonPointsField;
private JTextField maxPtMoveField;
private JTextField maxColorChangeField;
@@ -112,7 +113,7 @@
SelectAllFocuser focuser = new SelectAllFocuser();
JPanel optPanel = new JPanel();
optPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
- optPanel.setLayout(new FormLayout("pref, 3dlu, 100px, 5dlu, pref, 3dlu, 100px", "pref, 1dlu, pref, 15dlu, pref, 1dlu, pref, 1dlu, pref, 1dlu, pref"));
+ optPanel.setLayout(new FormLayout("pref, 3dlu, 100px, 5dlu, pref, 3dlu, 100px", "pref, 1dlu, pref, 15dlu, pref, 1dlu, pref, 1dlu, pref, 1dlu, pref, 1dlu, pref"));
CellConstraints cc = new CellConstraints();
JLabel maxSizeLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaxImageSize));
@@ -145,31 +146,40 @@
optPanel.add(maxPolygonField, cc.xy(7, 5));
maxPolygonField.addFocusListener(focuser);
+ JLabel numCompetingImagesLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.NumberOfCompetingImages));
+ optPanel.add(numCompetingImagesLabel, cc.xyw(1, 7, 5));
+ numCompetingImagesField = new JTextField(4);
+ numCompetingImagesField.setDocument(new IntegerDocument());
+ numCompetingImagesLabel.setLabelFor(numCompetingImagesField);
+ numCompetingImagesField.setText(String.valueOf(dlgSettings.getNumCompetingImages()));
+ optPanel.add(numCompetingImagesField, cc.xy(7, 7));
+ numCompetingImagesField.addFocusListener(focuser);
+
JLabel maxPolyPointLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumPolygonPoints));
- optPanel.add(maxPolyPointLabel, cc.xyw(1, 7, 7));
+ optPanel.add(maxPolyPointLabel, cc.xyw(1, 9, 7));
maxPolygonPointsField = new JTextField(4);
maxPolygonPointsField.setDocument(new IntegerDocument());
maxPolyPointLabel.setLabelFor(maxPolygonPointsField);
maxPolygonPointsField.setText(String.valueOf(dlgSettings.getMaxPoints()));
- optPanel.add(maxPolygonPointsField, cc.xy(7, 7));
+ optPanel.add(maxPolygonPointsField, cc.xy(7, 9));
maxPolygonPointsField.addFocusListener(focuser);
JLabel maxPtMoveLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumPointMovement));
- optPanel.add(maxPtMoveLabel, cc.xyw(1, 9, 5));
+ optPanel.add(maxPtMoveLabel, cc.xyw(1, 11, 5));
maxPtMoveField = new JTextField(4);
maxPtMoveField.setDocument(new IntegerDocument());
maxPtMoveLabel.setLabelFor(maxPtMoveField);
maxPtMoveField.setText(String.valueOf(dlgSettings.getMaxPtMovement()));
- optPanel.add(maxPtMoveField, cc.xy(7, 9));
+ optPanel.add(maxPtMoveField, cc.xy(7, 11));
maxPtMoveField.addFocusListener(focuser);
JLabel maxColorChangeLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumColorChange));
- optPanel.add(maxColorChangeLabel, cc.xyw(1, 11, 5));
+ optPanel.add(maxColorChangeLabel, cc.xyw(1, 13, 5));
maxColorChangeField = new JTextField(4);
maxColorChangeField.setDocument(new IntegerDocument());
maxColorChangeLabel.setLabelFor(maxColorChangeField);
maxColorChangeField.setText(String.valueOf(dlgSettings.getMaxColorChange()));
- optPanel.add(maxColorChangeField, cc.xy(7, 11));
+ optPanel.add(maxColorChangeField, cc.xy(7, 13));
maxColorChangeField.addFocusListener(focuser);
return optPanel;
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2009-12-01 14:25:34 UTC (rev 124)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2009-12-01 14:31:12 UTC (rev 125)
@@ -32,6 +32,7 @@
pc.width = Width
pc.height = Height
pc.maximumpolygons = Maximum Polygons
+pc.numberofcompetingimages = Number of Competing Images
pc.maxpolygonpoints = Maximum Points per Polygon
pc.maximumpointmovement = Maximum Point Movement
pc.maximumcolorchange = Maximum Color Change
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-01 14:25:43
|
Revision: 124
http://polycasso.svn.sourceforge.net/polycasso/?rev=124&view=rev
Author: dbrosius
Date: 2009-12-01 14:25:34 +0000 (Tue, 01 Dec 2009)
Log Message:
-----------
add numCompetingImages
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-11-29 07:12:03 UTC (rev 123)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-12-01 14:25:34 UTC (rev 124)
@@ -27,6 +27,7 @@
public class Settings implements Cloneable {
private Dimension maxImageSize;
+ private int numCompetingImages;
private int maxPolygons;
private int maxPoints;
private int maxPtMovement;
@@ -76,6 +77,24 @@
}
/**
+ * set the number of images that are competing in parallel for the best image
+ *
+ * @param competingImages number of images
+ */
+ public void setNumCompetingImages(int competingImages) {
+ numCompetingImages = competingImages;
+ }
+
+ /**
+ * gets the number of images that are competing in parallel for the best image
+ *
+ * @return the number of images
+ */
+ public int getNumCompetingImages() {
+ return numCompetingImages;
+ }
+
+ /**
* sets the maximum polygons that can be used to image the picture
*
* @param maxPolys the maximum number of polygons
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 07:12:11
|
Revision: 123
http://polycasso.svn.sourceforge.net/polycasso/?rev=123&view=rev
Author: dbrosius
Date: 2009-11-29 07:12:03 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
move max color to the settings dialog
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java 2009-11-29 06:56:23 UTC (rev 122)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java 2009-11-29 07:12:03 UTC (rev 123)
@@ -47,6 +47,7 @@
MaximumPolygons("pc.maximumpolygons"),
MaximumPolygonPoints("pc.maxpolygonpoints"),
MaximumPointMovement("pc.maximumpointmovement"),
+ MaximumColorChange("pc.maximumcolorchange"),
BadSetting("pc.badsetting");
String id;
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2009-11-29 06:56:23 UTC (rev 122)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2009-11-29 07:12:03 UTC (rev 123)
@@ -56,6 +56,7 @@
private JTextField maxPolygonField;
private JTextField maxPolygonPointsField;
private JTextField maxPtMoveField;
+ private JTextField maxColorChangeField;
private boolean isOK;
/**
@@ -111,7 +112,7 @@
SelectAllFocuser focuser = new SelectAllFocuser();
JPanel optPanel = new JPanel();
optPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
- optPanel.setLayout(new FormLayout("pref, 3dlu, 100px, 5dlu, pref, 3dlu, 100px", "pref, 1dlu, pref, 15dlu, pref, 1dlu, pref, 1dlu, pref"));
+ optPanel.setLayout(new FormLayout("pref, 3dlu, 100px, 5dlu, pref, 3dlu, 100px", "pref, 1dlu, pref, 15dlu, pref, 1dlu, pref, 1dlu, pref, 1dlu, pref"));
CellConstraints cc = new CellConstraints();
JLabel maxSizeLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaxImageSize));
@@ -161,6 +162,16 @@
maxPtMoveField.setText(String.valueOf(dlgSettings.getMaxPtMovement()));
optPanel.add(maxPtMoveField, cc.xy(7, 9));
maxPtMoveField.addFocusListener(focuser);
+
+ JLabel maxColorChangeLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumColorChange));
+ optPanel.add(maxColorChangeLabel, cc.xyw(1, 11, 5));
+ maxColorChangeField = new JTextField(4);
+ maxColorChangeField.setDocument(new IntegerDocument());
+ maxColorChangeLabel.setLabelFor(maxColorChangeField);
+ maxColorChangeField.setText(String.valueOf(dlgSettings.getMaxColorChange()));
+ optPanel.add(maxColorChangeField, cc.xy(7, 11));
+ maxColorChangeField.addFocusListener(focuser);
+
return optPanel;
}
@@ -196,7 +207,7 @@
dlgSettings.setMaxPolygons(Integer.parseInt(maxPolygonField.getText()));
dlgSettings.setMaxPoints(Integer.parseInt(maxPolygonPointsField.getText()));
dlgSettings.setMaxPtMovement(Integer.parseInt(maxPtMoveField.getText()));
-
+ dlgSettings.setMaxColorChange(Integer.parseInt(maxColorChangeField.getText()));
if (validateSettings()) {
isOK = true;
dispose();
@@ -260,6 +271,9 @@
} else if (dlgSettings.getMaxPtMovement() < 5) {
maxPtMoveField.setText("5");
maxPtMoveField.requestFocus();
+ } else if (dlgSettings.getMaxColorChange() < 5) {
+ maxColorChangeField.setText("5");
+ maxColorChangeField.requestFocus();
} else {
return true;
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2009-11-29 06:56:23 UTC (rev 122)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2009-11-29 07:12:03 UTC (rev 123)
@@ -34,4 +34,5 @@
pc.maximumpolygons = Maximum Polygons
pc.maxpolygonpoints = Maximum Points per Polygon
pc.maximumpointmovement = Maximum Point Movement
+pc.maximumcolorchange = Maximum Color Change
pc.badsetting = The setting specified was too small to properly function
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 06:56:31
|
Revision: 122
http://polycasso.svn.sourceforge.net/polycasso/?rev=122&view=rev
Author: dbrosius
Date: 2009-11-29 06:56:23 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
use maxColorChange out of settings
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2009-11-29 06:55:52 UTC (rev 121)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2009-11-29 06:56:23 UTC (rev 122)
@@ -265,25 +265,26 @@
PolygonData pd = (PolygonData)polygons.get(idx).clone();
Color color = pd.getColor();
int comp = r.nextInt(3);
+ int maxChange = settings.getMaxColorChange();
switch (comp) {
case 0: {
- int newColor = color.getRed() + (r.nextInt(10) - 5);
+ int newColor = color.getRed() + (r.nextInt(2 * maxChange) - maxChange);
newColor = clipToRange(0, 255, newColor);
pd.setColor(new Color(newColor, color.getGreen(), color.getBlue()));
}
break;
case 1: {
- int newColor = color.getGreen() + (r.nextInt(10) - 5);
+ int newColor = color.getGreen() + (r.nextInt(2 * maxChange) - maxChange);
newColor = clipToRange(0, 255, newColor);
pd.setColor(new Color(color.getRed(), newColor, color.getBlue()));
}
break;
case 2: {
- int newColor = color.getBlue() + (r.nextInt(10) - 5);
+ int newColor = color.getBlue() + (r.nextInt(2 * maxChange) - maxChange);
newColor = clipToRange(0, 255, newColor);
- pd.setColor(new Color(color.getRed(), color.getGreen(), r.nextInt(255)));
+ pd.setColor(new Color(color.getRed(), color.getGreen(), newColor));
}
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 06:55:59
|
Revision: 121
http://polycasso.svn.sourceforge.net/polycasso/?rev=121&view=rev
Author: dbrosius
Date: 2009-11-29 06:55:52 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
add max color change to settings
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-11-29 03:22:09 UTC (rev 120)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-11-29 06:55:52 UTC (rev 121)
@@ -30,6 +30,7 @@
private int maxPolygons;
private int maxPoints;
private int maxPtMovement;
+ private int maxColorChange;
/**
* constructs a settings object with rational defaults
@@ -39,6 +40,7 @@
maxPolygons = 50;
maxPoints = 8;
maxPtMovement = 20;
+ maxColorChange = 40;
}
/**
@@ -128,4 +130,22 @@
public int getMaxPtMovement() {
return maxPtMovement;
}
+
+ /**
+ * sets the maximum color component change
+ *
+ * @param maxColorChg the max color change
+ */
+ public void setMaxColorChange(int maxColorChg) {
+ maxColorChange = maxColorChg;
+ }
+
+ /**
+ * gets the maximum color component change
+ *
+ * @return the max color change
+ */
+ public int getMaxColorChange() {
+ return maxColorChange;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 03:22:15
|
Revision: 120
http://polycasso.svn.sourceforge.net/polycasso/?rev=120&view=rev
Author: dbrosius
Date: 2009-11-29 03:22:09 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
spilleng
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2009-11-29 03:16:59 UTC (rev 119)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2009-11-29 03:22:09 UTC (rev 120)
@@ -19,7 +19,7 @@
pc.title = Polycasso
pc.ok = OK
pc.cancel = Cancel
-pc.info = A cubism-style artwork generator that layers semi-transparent polygons \nvia a training feedback loop. Produces increasingly realistic work \nthough hill climbing.
+pc.info = A cubism-style artwork generator that layers semi-transparent polygons \nvia a training feedback loop. Produces increasingly realistic work \nthrough hill climbing.
pc.file = File
pc.paintimage = Start Generating Image
pc.completeimage = Complete Image
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 03:17:11
|
Revision: 119
http://polycasso.svn.sourceforge.net/polycasso/?rev=119&view=rev
Author: dbrosius
Date: 2009-11-29 03:16:59 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
engrish
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2009-11-29 03:16:28 UTC (rev 118)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2009-11-29 03:16:59 UTC (rev 119)
@@ -19,7 +19,7 @@
pc.title = Polycasso
pc.ok = OK
pc.cancel = Cancel
-pc.info = A cubism-style artwork generator that layers semi-transparent polygon \nvia a training feedback loop. Produces increasingly realistic work \nthough hill climbing.
+pc.info = A cubism-style artwork generator that layers semi-transparent polygons \nvia a training feedback loop. Produces increasingly realistic work \nthough hill climbing.
pc.file = File
pc.paintimage = Start Generating Image
pc.completeimage = Complete Image
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 03:16:38
|
Revision: 118
http://polycasso.svn.sourceforge.net/polycasso/?rev=118&view=rev
Author: dbrosius
Date: 2009-11-29 03:16:28 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
better line break
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2009-11-29 03:12:16 UTC (rev 117)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2009-11-29 03:16:28 UTC (rev 118)
@@ -19,7 +19,7 @@
pc.title = Polycasso
pc.ok = OK
pc.cancel = Cancel
-pc.info = A cubism-style artwork generator that layers semi-transparent polygon \nvia a training feedback loop. Produces increasingly \nrealistic work though hill climbing.
+pc.info = A cubism-style artwork generator that layers semi-transparent polygon \nvia a training feedback loop. Produces increasingly realistic work \nthough hill climbing.
pc.file = File
pc.paintimage = Start Generating Image
pc.completeimage = Complete Image
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 03:12:27
|
Revision: 117
http://polycasso.svn.sourceforge.net/polycasso/?rev=117&view=rev
Author: dbrosius
Date: 2009-11-29 03:12:16 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-11-29 03:11:25 UTC (rev 116)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-11-29 03:12:16 UTC (rev 117)
@@ -44,7 +44,7 @@
/**
* clones the Settings object
*
- * @returns a new copy of the settings object
+ * @return a new copy of the settings object
*/
@Override
public Object clone() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 03:11:32
|
Revision: 116
http://polycasso.svn.sourceforge.net/polycasso/?rev=116&view=rev
Author: dbrosius
Date: 2009-11-29 03:11:25 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2009-11-29 03:09:43 UTC (rev 115)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2009-11-29 03:11:25 UTC (rev 116)
@@ -106,7 +106,7 @@
/**
* builds a string of all the different types success statistics
*
- * @returns a statistics string
+ * @return a statistics string
*/
@Override
public String toString() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 03:09:50
|
Revision: 115
http://polycasso.svn.sourceforge.net/polycasso/?rev=115&view=rev
Author: dbrosius
Date: 2009-11-29 03:09:43 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-11-29 03:05:47 UTC (rev 114)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-11-29 03:09:43 UTC (rev 115)
@@ -20,6 +20,10 @@
import java.awt.Dimension;
+/**
+ * a simple java bean holding settings that are used to control how
+ * Polycasso runs
+ */
public class Settings implements Cloneable {
private Dimension maxImageSize;
@@ -27,6 +31,9 @@
private int maxPoints;
private int maxPtMovement;
+ /**
+ * constructs a settings object with rational defaults
+ */
public Settings() {
maxImageSize = new Dimension(800, 600);
maxPolygons = 50;
@@ -34,6 +41,11 @@
maxPtMovement = 20;
}
+ /**
+ * clones the Settings object
+ *
+ * @returns a new copy of the settings object
+ */
@Override
public Object clone() {
try {
@@ -43,34 +55,76 @@
}
}
+ /**
+ * sets the maximum image size
+ *
+ * @param imageSize the image size
+ */
public void setMaxImageSize(Dimension imageSize) {
maxImageSize = imageSize;
}
+ /**
+ * gets the maximum image size
+ *
+ * @return the image size
+ */
public Dimension getMaxImageSize() {
return maxImageSize;
}
+ /**
+ * sets the maximum polygons that can be used to image the picture
+ *
+ * @param maxPolys the maximum number of polygons
+ */
public void setMaxPolygons(int maxPolys) {
maxPolygons = maxPolys;
}
+ /**
+ * gets the maximum polygons that can be used to image the picture
+ *
+ * @return the maximum number of polygons
+ */
public int getMaxPolygons() {
return maxPolygons;
}
+ /**
+ * sets the maximum number of points per polygon
+ *
+ * @param maxPts the maximum polygon points
+ */
public void setMaxPoints(int maxPts) {
maxPoints = maxPts;
}
+ /**
+ * gets the maximum number of points per polygon
+ *
+ * @return the maximum polygon points
+ */
public int getMaxPoints() {
return maxPoints;
}
+ /**
+ * sets the largest movement that any polygon point can make in one
+ * improvement attempt
+ *
+ * @param maxPointMovement the maximum allowed movement
+ */
public void setMaxPtMovement(int maxPointMovement) {
maxPtMovement = maxPointMovement;
}
+ /**
+ * gets the largest movement that any polygon point can make in one
+ * improvement attempt
+ *
+ * @return the maximum allowed movement
+ */
public int getMaxPtMovement() {
return maxPtMovement;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 03:05:54
|
Revision: 114
http://polycasso.svn.sourceforge.net/polycasso/?rev=114&view=rev
Author: dbrosius
Date: 2009-11-29 03:05:47 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2009-11-29 03:01:29 UTC (rev 113)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2009-11-29 03:05:47 UTC (rev 114)
@@ -40,6 +40,10 @@
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
+/**
+ * a simple dialog to allow for the editing of various settings used to
+ * control how Polycasso works.
+ */
public class SettingsDialog extends JDialog {
private static final long serialVersionUID = 5044661806014080056L;
@@ -54,6 +58,11 @@
private JTextField maxPtMoveField;
private boolean isOK;
+ /**
+ * constructs the dialog using the passed in settings to set default values
+ *
+ * @param settings the default values for settings
+ */
public SettingsDialog(Settings settings) {
setTitle(PolycassoBundle.getString(PolycassoBundle.Key.Settings));
dlgSettings = (Settings)settings.clone();
@@ -62,14 +71,27 @@
isOK = false;
}
+ /**
+ * did the user click the ok button
+ *
+ * @return if the ok button was clicked
+ */
public boolean isOK() {
return isOK;
}
+ /**
+ * retrieves the settings set in the dialog by the user
+ *
+ * @return the updated settings
+ */
public Settings getSettings() {
return dlgSettings;
}
+ /**
+ * creates and layouts the components
+ */
private void initComponents() {
Container cp = getContentPane();
cp.setLayout(new BorderLayout(4, 4));
@@ -79,6 +101,11 @@
pack();
}
+ /**
+ * creates the options (settings) panel
+ *
+ * @returns the options panel
+ */
private JPanel createOptionsPanel() {
SelectAllFocuser focuser = new SelectAllFocuser();
@@ -137,6 +164,11 @@
return optPanel;
}
+ /**
+ * creates the control panel
+ *
+ * @return the control panel
+ */
private JPanel createControlPanel() {
JPanel ctrlPanel = new JPanel();
ctrlPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
@@ -153,6 +185,9 @@
return ctrlPanel;
}
+ /**
+ * sets up all the control listeners for the dialog
+ */
private void initListeners() {
okButton.addActionListener(new ActionListener() {
@Override
@@ -178,19 +213,37 @@
});
}
+ /**
+ * a class that selects the text component's text when focus is gained
+ */
private static class SelectAllFocuser implements FocusListener {
+ /**
+ * implements the listener to select all the text
+ *
+ * @param fe the focus event
+ */
@Override
public void focusGained(FocusEvent fe) {
JTextComponent comp = (JTextComponent)fe.getSource();
comp.selectAll();
}
+ /**
+ * unused
+ *
+ * @param fe the focus event
+ */
@Override
public void focusLost(FocusEvent fe) {
}
}
+ /**
+ * makes sure that settings selected are rational, and warns otherwise
+ *
+ * @return whether the settings are valid
+ */
private boolean validateSettings() {
if (dlgSettings.getMaxImageSize().width < 10) {
widthField.setText("10");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 03:01:35
|
Revision: 113
http://polycasso.svn.sourceforge.net/polycasso/?rev=113&view=rev
Author: dbrosius
Date: 2009-11-29 03:01:29 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java 2009-11-29 02:59:04 UTC (rev 112)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java 2009-11-29 03:01:29 UTC (rev 113)
@@ -48,18 +48,37 @@
polygon = poly;
}
+ /**
+ * retrieve the polygon (points) of this polygondata
+ *
+ * @return a polygon
+ */
public Polygon getPolygon() {
return polygon;
}
+ /**
+ * sets the transparency of this polygon; 0.0 is transparent, 1.0 is opaque
+ * @param xpar the transparency value
+ */
public void setAlpha(float xpar) {
alpha = xpar;
}
+ /**
+ * retrieves the color of this polygon
+ *
+ * @return the polygon color
+ */
public Color getColor() {
return color;
}
+ /**
+ * sets the color of this polygon
+ *
+ * @param newColor the new color to use
+ */
public void setColor(Color newColor) {
color = newColor;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 02:59:10
|
Revision: 112
http://polycasso.svn.sourceforge.net/polycasso/?rev=112&view=rev
Author: dbrosius
Date: 2009-11-29 02:59:04 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java 2009-11-29 02:57:16 UTC (rev 111)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java 2009-11-29 02:59:04 UTC (rev 112)
@@ -24,10 +24,22 @@
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;
+/**
+ * a Document model class for text components to only allow
+ * integer values
+ */
public class IntegerDocument extends PlainDocument {
private static final long serialVersionUID = -6755728406523769124L;
+ /**
+ * intercepts string insertions to make sure that the values to be put into
+ * a text component is only an integer value
+ *
+ * @param pos where the text is being inserted
+ * @param insertStr the new text that was typed
+ * @param atts the attributes for the text (unused)
+ */
@Override
public void insertString(int pos, String insertStr, AttributeSet atts) throws BadLocationException {
StringBuilder text = new StringBuilder(getText(0, getLength()));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 02:57:26
|
Revision: 111
http://polycasso.svn.sourceforge.net/polycasso/?rev=111&view=rev
Author: dbrosius
Date: 2009-11-29 02:57:16 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2009-11-29 02:55:21 UTC (rev 110)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2009-11-29 02:57:16 UTC (rev 111)
@@ -103,6 +103,11 @@
return ImprovementType.CompleteChange;
}
+ /**
+ * builds a string of all the different types success statistics
+ *
+ * @returns a statistics string
+ */
@Override
public String toString() {
StringBuilder sb = new StringBuilder(100);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 02:55:29
|
Revision: 110
http://polycasso.svn.sourceforge.net/polycasso/?rev=110&view=rev
Author: dbrosius
Date: 2009-11-29 02:55:21 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageCompleter.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageCompleter.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageCompleter.java 2009-11-29 02:54:09 UTC (rev 109)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageCompleter.java 2009-11-29 02:55:21 UTC (rev 110)
@@ -66,6 +66,9 @@
}
}
+ /**
+ * implements the Runnable interface to gradually fade in the real image over time
+ */
@Override
public void run() {
try {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 02:54:18
|
Revision: 109
http://polycasso.svn.sourceforge.net/polycasso/?rev=109&view=rev
Author: dbrosius
Date: 2009-11-29 02:54:09 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/AboutDialog.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/AboutDialog.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/AboutDialog.java 2009-11-29 02:48:59 UTC (rev 108)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/AboutDialog.java 2009-11-29 02:54:09 UTC (rev 109)
@@ -28,16 +28,25 @@
import javax.swing.JPanel;
import javax.swing.JTextArea;
+/**
+ * a simple dialog thats typical application about box information
+ */
public class AboutDialog extends JDialog {
private static final long serialVersionUID = -686787510942505991L;
+ /**
+ * creates the dialog
+ */
public AboutDialog() {
setTitle(PolycassoBundle.getString(PolycassoBundle.Key.AboutPolycasso));
initComponents();
pack();
}
+ /**
+ * initializes the components and lays them out
+ */
private void initComponents() {
Container cp = getContentPane();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 02:49:07
|
Revision: 108
http://polycasso.svn.sourceforge.net/polycasso/?rev=108&view=rev
Author: dbrosius
Date: 2009-11-29 02:48:59 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
add max points per poly to settings, and add validation to the settings dialog
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java
trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2009-11-29 02:28:13 UTC (rev 107)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2009-11-29 02:48:59 UTC (rev 108)
@@ -87,7 +87,7 @@
*/
public ImprovementType improveRandomly() {
if (polygons.isEmpty()) {
- polygons.add(PolygonData.randomPoly(imageSize));
+ polygons.add(PolygonData.randomPoly(imageSize, settings.getMaxPoints()));
return ImprovementType.AddPolygon;
}
@@ -96,7 +96,7 @@
switch (type) {
case AddPolygon: {
if (polygons.size() < settings.getMaxPolygons()) {
- PolygonData pd = PolygonData.randomPoly(imageSize);
+ PolygonData pd = PolygonData.randomPoly(imageSize, settings.getMaxPoints());
polygons.add(pd);
} else {
randomCompleteChange();
@@ -116,7 +116,7 @@
int idx = r.nextInt(polygons.size());
PolygonData pd = (PolygonData)polygons.get(idx).clone();
Polygon polygon = pd.getPolygon();
- if (polygon.npoints <= PolygonData.MAX_POINTS) {
+ if (polygon.npoints <= settings.getMaxPoints()) {
polygon.addPoint(0, 0);
int insPos = r.nextInt(polygon.npoints);
int lastPt = (insPos + polygon.npoints - 1) % polygon.npoints;
@@ -312,7 +312,7 @@
*/
private void randomCompleteChange() {
int idx = r.nextInt(polygons.size());
- polygons.set(idx, PolygonData.randomPoly(imageSize));
+ polygons.set(idx, PolygonData.randomPoly(imageSize, settings.getMaxPoints()));
}
/**
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java 2009-11-29 02:28:13 UTC (rev 107)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java 2009-11-29 02:48:59 UTC (rev 108)
@@ -174,6 +174,7 @@
Settings dlgSettings = dialog.getSettings();
settings.setMaxImageSize(dlgSettings.getMaxImageSize());
settings.setMaxPolygons(dlgSettings.getMaxPolygons());
+ settings.setMaxPoints(dlgSettings.getMaxPoints());
settings.setMaxPtMovement(dlgSettings.getMaxPtMovement());
}
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java 2009-11-29 02:28:13 UTC (rev 107)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java 2009-11-29 02:48:59 UTC (rev 108)
@@ -45,7 +45,9 @@
Width("pc.width"),
Height("pc.height"),
MaximumPolygons("pc.maximumpolygons"),
- MaximumPointMovement("pc.maximumpointmovement");
+ MaximumPolygonPoints("pc.maxpolygonpoints"),
+ MaximumPointMovement("pc.maximumpointmovement"),
+ BadSetting("pc.badsetting");
String id;
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java 2009-11-29 02:28:13 UTC (rev 107)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java 2009-11-29 02:48:59 UTC (rev 108)
@@ -30,7 +30,6 @@
* and alpha level.
*/
public class PolygonData implements Cloneable {
- public static final int MAX_POINTS = 8;
private Color color;
private float alpha;
@@ -71,10 +70,10 @@
* @param size the maximum size of the bounding box of the polygon
* @return a random polygon
*/
- public static PolygonData randomPoly(Dimension size) {
+ public static PolygonData randomPoly(Dimension size, int maxPoints) {
Random r = new Random();
Polygon polygon = new Polygon();
- int numPoints = r.nextInt(MAX_POINTS - 3) + 3;
+ int numPoints = r.nextInt(maxPoints - 3) + 3;
for (int i = 0; i < numPoints; i++) {
polygon.addPoint(r.nextInt(size.width), r.nextInt(size.height));
@@ -98,7 +97,7 @@
return clone;
} catch (CloneNotSupportedException cnse) {
- return randomPoly(new Dimension(100, 100));
+ return randomPoly(new Dimension(100, 100), 3);
}
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2009-11-29 02:28:13 UTC (rev 107)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2009-11-29 02:48:59 UTC (rev 108)
@@ -32,6 +32,7 @@
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
+import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.text.JTextComponent;
@@ -49,6 +50,7 @@
private JTextField widthField;
private JTextField heightField;
private JTextField maxPolygonField;
+ private JTextField maxPolygonPointsField;
private JTextField maxPtMoveField;
private boolean isOK;
@@ -82,7 +84,7 @@
SelectAllFocuser focuser = new SelectAllFocuser();
JPanel optPanel = new JPanel();
optPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
- optPanel.setLayout(new FormLayout("pref, 3dlu, 100px, 5dlu, pref, 3dlu, 100px", "pref, 1dlu, pref, 15dlu, pref, 1dlu, pref"));
+ optPanel.setLayout(new FormLayout("pref, 3dlu, 100px, 5dlu, pref, 3dlu, 100px", "pref, 1dlu, pref, 15dlu, pref, 1dlu, pref, 1dlu, pref"));
CellConstraints cc = new CellConstraints();
JLabel maxSizeLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaxImageSize));
@@ -115,13 +117,22 @@
optPanel.add(maxPolygonField, cc.xy(7, 5));
maxPolygonField.addFocusListener(focuser);
+ JLabel maxPolyPointLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumPolygonPoints));
+ optPanel.add(maxPolyPointLabel, cc.xyw(1, 7, 7));
+ maxPolygonPointsField = new JTextField(4);
+ maxPolygonPointsField.setDocument(new IntegerDocument());
+ maxPolyPointLabel.setLabelFor(maxPolygonPointsField);
+ maxPolygonPointsField.setText(String.valueOf(dlgSettings.getMaxPoints()));
+ optPanel.add(maxPolygonPointsField, cc.xy(7, 7));
+ maxPolygonPointsField.addFocusListener(focuser);
+
JLabel maxPtMoveLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumPointMovement));
- optPanel.add(maxPtMoveLabel, cc.xyw(1, 7, 5));
+ optPanel.add(maxPtMoveLabel, cc.xyw(1, 9, 5));
maxPtMoveField = new JTextField(4);
maxPtMoveField.setDocument(new IntegerDocument());
maxPtMoveLabel.setLabelFor(maxPtMoveField);
maxPtMoveField.setText(String.valueOf(dlgSettings.getMaxPtMovement()));
- optPanel.add(maxPtMoveField, cc.xy(7, 7));
+ optPanel.add(maxPtMoveField, cc.xy(7, 9));
maxPtMoveField.addFocusListener(focuser);
return optPanel;
}
@@ -148,9 +159,13 @@
public void actionPerformed(ActionEvent ae) {
dlgSettings.setMaxImageSize(new Dimension(Integer.parseInt(widthField.getText()), Integer.parseInt(heightField.getText())));
dlgSettings.setMaxPolygons(Integer.parseInt(maxPolygonField.getText()));
+ dlgSettings.setMaxPoints(Integer.parseInt(maxPolygonPointsField.getText()));
dlgSettings.setMaxPtMovement(Integer.parseInt(maxPtMoveField.getText()));
- isOK = true;
- dispose();
+
+ if (validateSettings()) {
+ isOK = true;
+ dispose();
+ }
}
});
@@ -173,7 +188,31 @@
@Override
public void focusLost(FocusEvent fe) {
+ }
+ }
+
+ private boolean validateSettings() {
+ if (dlgSettings.getMaxImageSize().width < 10) {
+ widthField.setText("10");
+ widthField.requestFocus();
+ } else if (dlgSettings.getMaxImageSize().height < 10) {
+ heightField.setText("10");
+ heightField.requestFocus();
+ } else if (dlgSettings.getMaxPolygons() < 10) {
+ maxPolygonField.setText("10");
+ maxPolygonField.requestFocus();
+ } else if (dlgSettings.getMaxPoints() < 3) {
+ maxPolygonPointsField.setText("3");
+ maxPolygonPointsField.requestFocus();
+ } else if (dlgSettings.getMaxPtMovement() < 5) {
+ maxPtMoveField.setText("5");
+ maxPtMoveField.requestFocus();
+ } else {
+ return true;
}
+ JOptionPane.showMessageDialog(this, PolycassoBundle.getString(PolycassoBundle.Key.BadSetting));
+ return false;
+
}
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2009-11-29 02:28:13 UTC (rev 107)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2009-11-29 02:48:59 UTC (rev 108)
@@ -32,4 +32,6 @@
pc.width = Width
pc.height = Height
pc.maximumpolygons = Maximum Polygons
+pc.maxpolygonpoints = Maximum Points per Polygon
pc.maximumpointmovement = Maximum Point Movement
+pc.badsetting = The setting specified was too small to properly function
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 02:28:23
|
Revision: 107
http://polycasso.svn.sourceforge.net/polycasso/?rev=107&view=rev
Author: dbrosius
Date: 2009-11-29 02:28:13 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
move max polygon points to settings
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-11-29 02:22:48 UTC (rev 106)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-11-29 02:28:13 UTC (rev 107)
@@ -24,11 +24,13 @@
private Dimension maxImageSize;
private int maxPolygons;
+ private int maxPoints;
private int maxPtMovement;
public Settings() {
maxImageSize = new Dimension(800, 600);
maxPolygons = 50;
+ maxPoints = 8;
maxPtMovement = 20;
}
@@ -57,6 +59,14 @@
return maxPolygons;
}
+ public void setMaxPoints(int maxPts) {
+ maxPoints = maxPts;
+ }
+
+ public int getMaxPoints() {
+ return maxPoints;
+ }
+
public void setMaxPtMovement(int maxPointMovement) {
maxPtMovement = maxPointMovement;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 02:22:56
|
Revision: 106
http://polycasso.svn.sourceforge.net/polycasso/?rev=106&view=rev
Author: dbrosius
Date: 2009-11-29 02:22:48 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
really pass settings to the improver
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2009-11-29 02:19:59 UTC (rev 105)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2009-11-29 02:22:48 UTC (rev 106)
@@ -38,6 +38,7 @@
public class ImageGenerator implements Runnable {
private static int attempt = 0;
private Set<ImageGeneratedListener> listeners = new HashSet<ImageGeneratedListener>();
+ private Settings settings;
private BufferedImage targetImage;
private PolygonData[] bestData;
private double bestScore = Double.MAX_VALUE;
@@ -49,11 +50,12 @@
/**
* creates an ImageGenerator for the given target image, and size
- * @param settings the configuration settings
+ * @param confSettings the configuration settings
* @param image the target image
* @param size the dimension of the image
*/
- public ImageGenerator(Settings settings, Image image, Dimension size) {
+ public ImageGenerator(Settings confSettings, Image image, Dimension size) {
+ settings = confSettings;
imageSize = trimSize(size, settings.getMaxImageSize());
targetImage = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
Graphics g = targetImage.getGraphics();
@@ -164,7 +166,7 @@
BufferedImage image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D g2d = (Graphics2D)image.getGraphics();
Composite srcOpaque = AlphaComposite.getInstance(AlphaComposite.SRC, 1.0f);
- Improver improver = new Improver(null, imageSize);
+ Improver improver = new Improver(settings, imageSize);
while (!Thread.interrupted()) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 02:20:12
|
Revision: 105
http://polycasso.svn.sourceforge.net/polycasso/?rev=105&view=rev
Author: dbrosius
Date: 2009-11-29 02:19:59 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
select all on focus
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2009-11-29 02:11:06 UTC (rev 104)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2009-11-29 02:19:59 UTC (rev 105)
@@ -23,6 +23,8 @@
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
import javax.swing.BorderFactory;
import javax.swing.Box;
@@ -32,6 +34,7 @@
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
+import javax.swing.text.JTextComponent;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
@@ -75,6 +78,8 @@
}
private JPanel createOptionsPanel() {
+
+ SelectAllFocuser focuser = new SelectAllFocuser();
JPanel optPanel = new JPanel();
optPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
optPanel.setLayout(new FormLayout("pref, 3dlu, 100px, 5dlu, pref, 3dlu, 100px", "pref, 1dlu, pref, 15dlu, pref, 1dlu, pref"));
@@ -90,6 +95,7 @@
widthLabel.setLabelFor(widthField);
widthField.setText(String.valueOf(dlgSettings.getMaxImageSize().width));
optPanel.add(widthField, cc.xy(3, 3));
+ widthField.addFocusListener(focuser);
JLabel heightLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.Height));
optPanel.add(heightLabel, cc.xy(5, 3));
@@ -98,6 +104,7 @@
heightLabel.setLabelFor(heightField);
heightField.setText(String.valueOf(dlgSettings.getMaxImageSize().height));
optPanel.add(heightField, cc.xy(7, 3));
+ heightField.addFocusListener(focuser);
JLabel maxPolyLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumPolygons));
optPanel.add(maxPolyLabel, cc.xyw(1, 5, 5));
@@ -106,6 +113,7 @@
maxPolyLabel.setLabelFor(maxPolygonField);
maxPolygonField.setText(String.valueOf(dlgSettings.getMaxPolygons()));
optPanel.add(maxPolygonField, cc.xy(7, 5));
+ maxPolygonField.addFocusListener(focuser);
JLabel maxPtMoveLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumPointMovement));
optPanel.add(maxPtMoveLabel, cc.xyw(1, 7, 5));
@@ -114,6 +122,7 @@
maxPtMoveLabel.setLabelFor(maxPtMoveField);
maxPtMoveField.setText(String.valueOf(dlgSettings.getMaxPtMovement()));
optPanel.add(maxPtMoveField, cc.xy(7, 7));
+ maxPtMoveField.addFocusListener(focuser);
return optPanel;
}
@@ -154,5 +163,17 @@
});
}
+ private static class SelectAllFocuser implements FocusListener {
+ @Override
+ public void focusGained(FocusEvent fe) {
+ JTextComponent comp = (JTextComponent)fe.getSource();
+ comp.selectAll();
+ }
+
+ @Override
+ public void focusLost(FocusEvent fe) {
+ }
+
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-29 02:11:15
|
Revision: 104
http://polycasso.svn.sourceforge.net/polycasso/?rev=104&view=rev
Author: dbrosius
Date: 2009-11-29 02:11:06 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
fcbl
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2009-11-28 23:47:04 UTC (rev 103)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2009-11-29 02:11:06 UTC (rev 104)
@@ -38,7 +38,6 @@
public class ImageGenerator implements Runnable {
private static int attempt = 0;
private Set<ImageGeneratedListener> listeners = new HashSet<ImageGeneratedListener>();
- private Settings settings;
private BufferedImage targetImage;
private PolygonData[] bestData;
private double bestScore = Double.MAX_VALUE;
@@ -50,12 +49,11 @@
/**
* creates an ImageGenerator for the given target image, and size
- * @param confSettings the configuration settings
+ * @param settings the configuration settings
* @param image the target image
* @param size the dimension of the image
*/
- public ImageGenerator(Settings confSettings, Image image, Dimension size) {
- settings = confSettings;
+ public ImageGenerator(Settings settings, Image image, Dimension size) {
imageSize = trimSize(size, settings.getMaxImageSize());
targetImage = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
Graphics g = targetImage.getGraphics();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-28 23:47:10
|
Revision: 103
http://polycasso.svn.sourceforge.net/polycasso/?rev=103&view=rev
Author: dbrosius
Date: 2009-11-28 23:47:04 +0000 (Sat, 28 Nov 2009)
Log Message:
-----------
add forms lib
Modified Paths:
--------------
trunk/polycasso/.classpath
Modified: trunk/polycasso/.classpath
===================================================================
--- trunk/polycasso/.classpath 2009-11-28 23:46:13 UTC (rev 102)
+++ trunk/polycasso/.classpath 2009-11-28 23:47:04 UTC (rev 103)
@@ -3,5 +3,6 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/commons-io-1.4.jar"/>
+ <classpathentry kind="lib" path="lib/forms-1.2.1.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-28 23:46:21
|
Revision: 102
http://polycasso.svn.sourceforge.net/polycasso/?rev=102&view=rev
Author: dbrosius
Date: 2009-11-28 23:46:13 +0000 (Sat, 28 Nov 2009)
Log Message:
-----------
add forms lib
Modified Paths:
--------------
trunk/polycasso/etc/polycasso.jnlp
Modified: trunk/polycasso/etc/polycasso.jnlp
===================================================================
--- trunk/polycasso/etc/polycasso.jnlp 2009-11-28 23:45:57 UTC (rev 101)
+++ trunk/polycasso/etc/polycasso.jnlp 2009-11-28 23:46:13 UTC (rev 102)
@@ -18,6 +18,7 @@
<j2se version="1.6+" initial-heap-size="400m" max-heap-size="800m"/>
<jar href="polycasso-$VERSION.jar"/>
<jar href="commons-io-1.4.jar"/>
+ <jar href="forms-1.2.1.jar"/>
</resources>
<application-desc main-class="com.mebigfatguy.polycasso.Polycasso"/>
</jnlp>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-28 23:46:06
|
Revision: 101
http://polycasso.svn.sourceforge.net/polycasso/?rev=101&view=rev
Author: dbrosius
Date: 2009-11-28 23:45:57 +0000 (Sat, 28 Nov 2009)
Log Message:
-----------
add forms lib
Modified Paths:
--------------
trunk/polycasso/build.xml
Modified: trunk/polycasso/build.xml
===================================================================
--- trunk/polycasso/build.xml 2009-11-28 23:45:42 UTC (rev 100)
+++ trunk/polycasso/build.xml 2009-11-28 23:45:57 UTC (rev 101)
@@ -56,6 +56,7 @@
<mkdir dir="${javadoc.dir}"/>
<path id="polycasso.classpath">
<pathelement location="${lib.dir}/commons-io-1.4.jar"/>
+ <pathelement location="${lib.dir}/forms-1.2.1.jar"/>
</path>
</target>
@@ -104,7 +105,7 @@
<manifest>
<attribute name="polycasso-version" value="${polycasso.version}"/>
<attribute name="Main-Class" value="com.mebigfatguy.polycasso.Polycasso"/>
- <attribute name="Class-Path" value="commons-io-1.4.jar"/>
+ <attribute name="Class-Path" value="commons-io-1.4.jar forms-1.2.1.jar"/>
</manifest>
</jar>
</target>
@@ -171,7 +172,7 @@
<target name="binzip" depends="build" description="zips up all jars">
<zip destfile="${basedir}/polycasso-bin-${polycasso.version}.zip"
basedir="${jnlp.dir}"
- includes="polycasso-${polycasso.version}.jar commons-io-1.4.jar"/>
+ includes="polycasso-${polycasso.version}.jar commons-io-1.4.jar forms-1.2.1.jar"/>
</target>
<target name="release" depends="build, jnlp, binzip, srczip, javadoc" description="prepares everything for a release"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|