pixelle-commit Mailing List for pixelle (Page 2)
Brought to you by:
dbrosius
You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(129) |
Jul
(39) |
Aug
|
Sep
|
Oct
|
Nov
(63) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(1) |
Feb
(24) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(41) |
Aug
(1) |
Sep
(7) |
Oct
|
Nov
|
Dec
(5) |
| 2010 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
(2) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <dbr...@us...> - 2009-07-22 06:02:49
|
Revision: 297
http://pixelle.svn.sourceforge.net/pixelle/?rev=297&view=rev
Author: dbrosius
Date: 2009-07-22 06:02:47 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
separate the selection bits from the outline used for display
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2009-07-22 05:53:08 UTC (rev 296)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2009-07-22 06:02:47 UTC (rev 297)
@@ -34,7 +34,8 @@
public class PixelleImage {
private final BufferedImage image;
- private BufferedImage selection;
+ private final BufferedImage selection;
+ private final BufferedImage selectionOutline;
private final Composite composite;
public PixelleImage() {
@@ -52,7 +53,10 @@
Graphics g = selection.getGraphics();
g.setColor(Color.WHITE);
g.fillRect(0, 0, getWidth(), getHeight());
- }
+ selectionOutline = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_BYTE_BINARY, model);
+ g = selectionOutline.getGraphics();
+ g.setColor(Color.WHITE);
+ g.fillRect(0, 0, getWidth(), getHeight()); }
public BufferedImage getSaveImage() {
return image;
@@ -81,7 +85,7 @@
Composite saveComposite = g2d.getComposite();
try {
g2d.setComposite(composite);
- g.drawImage(selection, left, top, width, height, null);
+ g.drawImage(selectionOutline, left, top, width, height, null);
} finally {
g2d.setComposite(saveComposite);
}
@@ -102,6 +106,6 @@
public void finishImage() {
SelectionOutliner so = new SelectionOutliner();
- selection = so.createOutline(selection);
+ so.createOutline(selection, selectionOutline);
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java 2009-07-22 05:53:08 UTC (rev 296)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java 2009-07-22 06:02:47 UTC (rev 297)
@@ -19,18 +19,15 @@
package com.mebigfatguy.pixelle;
import java.awt.image.BufferedImage;
-import java.awt.image.IndexColorModel;
import java.awt.image.WritableRaster;
public class SelectionOutliner {
- public BufferedImage createOutline(BufferedImage selectionImage) {
- BufferedImage outlineSelection = new BufferedImage(selectionImage.getWidth(), selectionImage.getHeight(), BufferedImage.TYPE_BYTE_BINARY, (IndexColorModel)selectionImage.getColorModel());
-
+ public void createOutline(BufferedImage selectionImage, BufferedImage selectionOutline) {
int width = selectionImage.getWidth();
int height = selectionImage.getHeight();
- WritableRaster outRaster = outlineSelection.getRaster();
+ WritableRaster outRaster = selectionOutline.getRaster();
WritableRaster inRaster = selectionImage.getRaster();
double[] pixel = new double[9];
@@ -63,6 +60,5 @@
}
}
}
- return outlineSelection;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-22 05:53:09
|
Revision: 296
http://pixelle.svn.sourceforge.net/pixelle/?rev=296&view=rev
Author: dbrosius
Date: 2009-07-22 05:53:08 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
fix looking for unselected bits
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java 2009-07-22 05:49:39 UTC (rev 295)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java 2009-07-22 05:53:08 UTC (rev 296)
@@ -50,12 +50,14 @@
if (!xedge && !yedge) {
pixel = inRaster.getPixels(col - 1, row - 1, 3, 3, pixel);
+ boolean foundUnselected = false;
for (int p = 0; p < 9; p++) {
if (pixel[p] == 0) {
+ foundUnselected = true;
break;
}
}
- pixel[0] = 0.0;
+ pixel[0] = foundUnselected ? 1.0 : 0.0;
}
outRaster.setPixel(col, row, pixel);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-22 05:49:41
|
Revision: 295
http://pixelle.svn.sourceforge.net/pixelle/?rev=295&view=rev
Author: dbrosius
Date: 2009-07-22 05:49:39 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
use 1.0 for alpha selection for now, so we can see it.
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2009-07-22 05:43:15 UTC (rev 294)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2009-07-22 05:49:39 UTC (rev 295)
@@ -48,7 +48,7 @@
byte[] alpha = new byte[] {0, -1};
IndexColorModel model = new IndexColorModel(1, 2, wb, wb, wb, alpha);
selection = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_BYTE_BINARY, model);
- composite = AlphaComposite.getInstance(AlphaComposite.XOR, 0.5f);
+ composite = AlphaComposite.getInstance(AlphaComposite.XOR, 1.0f);
Graphics g = selection.getGraphics();
g.setColor(Color.WHITE);
g.fillRect(0, 0, getWidth(), getHeight());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-22 05:43:18
|
Revision: 294
http://pixelle.svn.sourceforge.net/pixelle/?rev=294&view=rev
Author: dbrosius
Date: 2009-07-22 05:43:15 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
start building selection outline
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2009-07-22 03:49:52 UTC (rev 293)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2009-07-22 05:43:15 UTC (rev 294)
@@ -48,7 +48,7 @@
byte[] alpha = new byte[] {0, -1};
IndexColorModel model = new IndexColorModel(1, 2, wb, wb, wb, alpha);
selection = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_BYTE_BINARY, model);
- composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f);
+ composite = AlphaComposite.getInstance(AlphaComposite.XOR, 0.5f);
Graphics g = selection.getGraphics();
g.setColor(Color.WHITE);
g.fillRect(0, 0, getWidth(), getHeight());
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java 2009-07-22 03:49:52 UTC (rev 293)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java 2009-07-22 05:43:15 UTC (rev 294)
@@ -18,20 +18,49 @@
*/
package com.mebigfatguy.pixelle;
-import java.awt.Color;
-import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.awt.image.IndexColorModel;
+import java.awt.image.WritableRaster;
public class SelectionOutliner {
public BufferedImage createOutline(BufferedImage selectionImage) {
BufferedImage outlineSelection = new BufferedImage(selectionImage.getWidth(), selectionImage.getHeight(), BufferedImage.TYPE_BYTE_BINARY, (IndexColorModel)selectionImage.getColorModel());
- Graphics g = selectionImage.getGraphics();
- g.setColor(Color.WHITE);
- g.fillRect(0, 0, selectionImage.getWidth(), selectionImage.getHeight());
+ int width = selectionImage.getWidth();
+ int height = selectionImage.getHeight();
+ WritableRaster outRaster = outlineSelection.getRaster();
+ WritableRaster inRaster = selectionImage.getRaster();
+
+ double[] pixel = new double[9];
+
+ for (int row = 0; row < height; row++) {
+ boolean yedge = (row == 0) || (row == (height - 1));
+
+ for (int col = 0; col < width; col++) {
+ pixel = inRaster.getPixel(col, row, pixel);
+
+ // If the current pixel is selected, look to see if it's got a non selected pixel next to it
+ if (pixel[0] != 0) {
+ boolean xedge = false;
+ if (!yedge) {
+ xedge = (col == 0) || (col == (width - 1));
+ }
+
+ if (!xedge && !yedge) {
+ pixel = inRaster.getPixels(col - 1, row - 1, 3, 3, pixel);
+ for (int p = 0; p < 9; p++) {
+ if (pixel[p] == 0) {
+ break;
+ }
+ }
+ pixel[0] = 0.0;
+ }
+ outRaster.setPixel(col, row, pixel);
+ }
+ }
+ }
return outlineSelection;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-22 03:49:54
|
Revision: 293
http://pixelle.svn.sourceforge.net/pixelle/?rev=293&view=rev
Author: dbrosius
Date: 2009-07-22 03:49:52 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
make the editor fields monospaced
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2009-07-22 03:47:19 UTC (rev 292)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2009-07-22 03:49:52 UTC (rev 293)
@@ -69,44 +69,48 @@
import com.mebigfatguy.pixelle.utils.GuiUtils.Sizing;
public class PixelleExpressionDialog extends JDialog {
-
+
private static final long serialVersionUID = -4273352119079307059L;
-
+
private final Map<PixelleComponent, JLabel> rgbLHS = new EnumMap<PixelleComponent, JLabel>(PixelleComponent.class);
{
for (PixelleComponent comp : PixelleComponent.rgbValues()) {
rgbLHS.put(comp, new JLabel(PixelleBundle.getString("formula." + comp.name().toLowerCase()) + " = "));
}
};
-
+
private final Map<PixelleComponent, JTextField> rgbEditor = new EnumMap<PixelleComponent, JTextField>(PixelleComponent.class);
{
for (PixelleComponent comp : PixelleComponent.rgbValues()) {
- rgbEditor.put(comp, new JTextField(PixelleBundle.getString("formula." + comp.name().toLowerCase()), 50));
+ JTextField tf = new JTextField(PixelleBundle.getString("formula." + comp.name().toLowerCase()), 50);
+ tf.setFont(EditorFontFactory.getEditorFont());
+ rgbEditor.put(comp, tf);
}
};
-
+
private final Map<PixelleComponent, JLabel> rgbLabels = new EnumMap<PixelleComponent, JLabel>(PixelleComponent.class);
{
for (PixelleComponent comp : PixelleComponent.rgbValues()) {
rgbLabels.put(comp, new JLabel(PixelleBundle.getString("label." + comp.name().toLowerCase())));
}
};
-
+
private final Map<PixelleComponent, JLabel> gsLHS = new EnumMap<PixelleComponent, JLabel>(PixelleComponent.class);
{
for (PixelleComponent comp : PixelleComponent.gsValues()) {
gsLHS.put(comp, new JLabel(PixelleBundle.getString("formula." + comp.name().toLowerCase()) + " = "));
}
};
-
+
private final Map<PixelleComponent, JTextField> gsEditor = new EnumMap<PixelleComponent, JTextField>(PixelleComponent.class);
{
for (PixelleComponent comp : PixelleComponent.gsValues()) {
- gsEditor.put(comp, new JTextField(PixelleBundle.getString("formula." + comp.name().toLowerCase()), 50));
+ JTextField tf = new JTextField(PixelleBundle.getString("formula." + comp.name().toLowerCase()), 50);
+ tf.setFont(EditorFontFactory.getEditorFont());
+ gsEditor.put(comp, tf);
}
};
-
+
private final Map<PixelleComponent, JLabel> gsLabels = new EnumMap<PixelleComponent, JLabel>(PixelleComponent.class);
{
for (PixelleComponent comp : PixelleComponent.gsValues()) {
@@ -114,7 +118,7 @@
}
};
-
+
PixelleFrame frame;
JButton ok;
JButton cancel;
@@ -127,26 +131,26 @@
JTabbedPane tabbedPane;
JTextField widthField;
JTextField heightField;
-
+
JButton save;
JButton delete;
boolean clickedOK = false;
-
+
public PixelleExpressionDialog(PixelleFrame owner) {
super(owner, PixelleBundle.getString(PixelleBundle.PIXEL_ALGORITHMS));
frame = owner;
initComponents();
initListeners();
}
-
+
public boolean isOK() {
return clickedOK;
}
-
+
public ImageType getImageType() {
return (tabbedPane.getSelectedIndex() == 0) ? ImageType.RGB : ImageType.Grayscale;
}
-
+
public Map<PixelleComponent, String> getAlgorithms(ImageType imageType) {
Map<PixelleComponent, String> algorithms = new EnumMap<PixelleComponent, String>(PixelleComponent.class);
for (PixelleComponent comp : (imageType == ImageType.RGB) ? PixelleComponent.rgbValues() : PixelleComponent.gsValues()) {
@@ -154,22 +158,23 @@
}
return algorithms;
}
-
+
public Point getOutputSize() {
return new Point(Integer.parseInt(widthField.getText()), Integer.parseInt(heightField.getText()));
}
-
+
public PixelleImage[] getSourceImages() {
PixelleImage[] images = sourcePanel.getSourceImages();
- if (images.length == 0)
+ if (images.length == 0) {
images = new PixelleImage[] { frame.getImage() };
-
+ }
+
return images;
}
-
+
private void initComponents() {
Container cp = getContentPane();
-
+
ok = new JButton(PixelleBundle.getString(PixelleBundle.OK));
cancel = new JButton(PixelleBundle.getString(PixelleBundle.CANCEL));
reset = new JButton(PixelleBundle.getString(PixelleBundle.RESET));
@@ -178,48 +183,48 @@
GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, new JComponent[] {ok, cancel, reset, save, delete});
cp.setLayout(new BorderLayout(4, 4));
-
+
sourcePanel = new SourcePanel();
cp.add(sourcePanel, BorderLayout.NORTH);
-
+
JPanel centerPanel = new JPanel();
centerPanel.setLayout(new BorderLayout(4, 4));
cp.add(centerPanel, BorderLayout.CENTER);
-
+
centerPanel.setBorder(BorderFactory.createTitledBorder(PixelleBundle.getString(PixelleBundle.PIXEL_ALGORITHMS)));
-
+
tabbedPane = new JTabbedPane();
centerPanel.add(tabbedPane, BorderLayout.CENTER);
-
+
tabbedPane.add(PixelleBundle.getString(PixelleBundle.RGB), buildRGBPane());
tabbedPane.add(PixelleBundle.getString(PixelleBundle.GRAYSCALE), buildGrayscalePanel());
-
+
centerPanel.add(buildSizingPanel(), BorderLayout.SOUTH);
-
+
cp.add(buildCtrlPanel(), BorderLayout.SOUTH);
-
+
pack();
}
-
+
private JPanel buildSizingPanel() {
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
panel.setBorder(BorderFactory.createTitledBorder(PixelleBundle.getString(PixelleBundle.OUTPUT_PROPERTIES)));
-
+
JLabel wl = new JLabel(PixelleBundle.getString(PixelleBundle.WIDTH));
JLabel hl = new JLabel(PixelleBundle.getString(PixelleBundle.HEIGHT));
GuiUtils.sizeUniformly(Sizing.Both, wl, hl);
-
+
widthField = new JTextField(new IntegerDocument(), "", 6);
heightField = new JTextField(new IntegerDocument(), "", 6);
GuiUtils.sizeUniformly(Sizing.Both, widthField, heightField);
-
+
wl.setLabelFor(widthField);
hl.setLabelFor(heightField);
-
+
widthField.setText(String.valueOf(frame.getImage().getWidth()));
heightField.setText(String.valueOf(frame.getImage().getHeight()));
-
+
panel.add(Box.createHorizontalStrut(20));
panel.add(wl);
panel.add(Box.createHorizontalStrut(10));
@@ -229,11 +234,11 @@
panel.add(Box.createHorizontalStrut(10));
panel.add(heightField);
panel.add(Box.createHorizontalGlue());
-
+
return panel;
}
-
- private JPanel buildCtrlPanel() {
+
+ private JPanel buildCtrlPanel() {
JPanel ctlPanel = new JPanel();
ctlPanel.setLayout(new BoxLayout(ctlPanel, BoxLayout.X_AXIS));
ctlPanel.add(Box.createHorizontalStrut(10));
@@ -248,15 +253,15 @@
ctlPanel.add(cancel);
ctlPanel.add(Box.createHorizontalStrut(10));
ctlPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
-
+
return ctlPanel;
}
-
+
private JPanel buildRGBPane() {
-
+
JPanel rgbPanel = new JPanel();
rgbPanel.setLayout(new BoxLayout(rgbPanel, BoxLayout.Y_AXIS));
-
+
{
JPanel optionsPanel = new JPanel();
optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.X_AXIS));
@@ -290,22 +295,22 @@
}
} catch (IllegalArgumentException iae) {
}
-
+
savedRGBAlgorithms.setInvoker(selectedRGBAlgorithm);
optionsPanel.add(savedRGBAlgorithms);
optionsPanel.add(Box.createHorizontalGlue());
optionsPanel.setBorder(BorderFactory.createEmptyBorder(10, 4, 5, 4));
rgbPanel.add(optionsPanel);
}
-
+
{
JPanel algoPanel = new JPanel();
algoPanel.setLayout(new GridLayout(5, 1));
-
+
GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, rgbLHS.values().toArray(new JComponent[rgbLHS.size()]));
GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, rgbEditor.values().toArray(new JComponent[rgbEditor.size()]));
GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, rgbLabels.values().toArray(new JComponent[rgbLabels.size()]));
-
+
for (PixelleComponent comp : PixelleComponent.rgbValues()) {
JPanel p = new JPanel();
p.setLayout(new BorderLayout(10, 10));
@@ -316,17 +321,17 @@
p.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
algoPanel.add(p);
}
-
+
rgbPanel.add(algoPanel);
}
-
+
return rgbPanel;
}
-
+
private JPanel buildGrayscalePanel() {
JPanel gsPanel = new JPanel();
gsPanel.setLayout(new BoxLayout(gsPanel, BoxLayout.Y_AXIS));
-
+
{
JPanel optionsPanel = new JPanel();
optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.X_AXIS));
@@ -360,22 +365,22 @@
}
} catch (IllegalArgumentException iae) {
}
-
+
savedGSAlgorithms.setInvoker(selectedGSAlgorithm);
optionsPanel.add(savedGSAlgorithms);
optionsPanel.add(Box.createHorizontalGlue());
optionsPanel.setBorder(BorderFactory.createEmptyBorder(10, 4, 5, 4));
gsPanel.add(optionsPanel);
}
-
+
{
JPanel algoPanel = new JPanel();
algoPanel.setLayout(new GridLayout(5, 1));
-
+
GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, gsLHS.values().toArray(new JComponent[gsLHS.size()]));
GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, gsEditor.values().toArray(new JComponent[gsEditor.size()]));
GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, gsLabels.values().toArray(new JComponent[gsLabels.size()]));
-
+
for (PixelleComponent comp : PixelleComponent.gsValues()) {
JPanel p = new JPanel();
p.setLayout(new BorderLayout(10, 10));
@@ -386,16 +391,16 @@
p.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
algoPanel.add(p);
}
-
+
gsPanel.add(algoPanel);
}
-
+
return gsPanel;
}
-
+
private void initListeners() {
getRootPane().setDefaultButton(ok);
-
+
selectedRGBAlgorithm.addMouseListener(new MouseAdapter() {
@Override
@@ -404,7 +409,7 @@
savedRGBAlgorithms.show(selectedRGBAlgorithm, 0, 0);
}
});
-
+
selectedGSAlgorithm.addMouseListener(new MouseAdapter() {
@Override
@@ -413,17 +418,17 @@
savedGSAlgorithms.show(selectedGSAlgorithm, 0, 0);
}
});
-
+
for (final PixelleComponent comp : PixelleComponent.gsValues()) {
final JTextField tf = gsEditor.get(comp);
tf.addFocusListener(new FocusExpansionListener(tf, comp));
}
-
+
for (final PixelleComponent comp : PixelleComponent.rgbValues()) {
final JTextField tf = rgbEditor.get(comp);
tf.addFocusListener(new FocusExpansionListener(tf, comp));
}
-
+
save.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
ImageType imageType = getImageType();
@@ -441,7 +446,7 @@
}
}
});
-
+
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
ImageType imageType = getImageType();
@@ -449,12 +454,12 @@
AlgorithmArchiver archiver = AlgorithmArchiver.getArchiver();
archiver.setCurrent(imageType, algorithm);
archiver.save();
-
+
clickedOK = true;
dispose();
}
});
-
+
cancel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
dispose();
@@ -471,17 +476,17 @@
});
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
-
- static class FocusExpansionListener extends FocusAdapter
+
+ static class FocusExpansionListener extends FocusAdapter
{
- private JTextField textField;
- private PixelleComponent component;
-
+ private final JTextField textField;
+ private final PixelleComponent component;
+
public FocusExpansionListener(JTextField tf, PixelleComponent comp) {
textField = tf;
component = comp;
}
-
+
@Override
public void focusGained(FocusEvent e) {
Point pt = textField.getLocation();
@@ -495,7 +500,7 @@
textField.setEnabled(true);
}
}
-
+
class SourcePanel extends JPanel
{
private static final long serialVersionUID = -8696503930565383721L;
@@ -505,25 +510,25 @@
DefaultTableModel sourceModel;
JButton addButton;
JButton removeButton;
-
+
public SourcePanel() {
initComponents();
initListeners();
}
-
+
public PixelleImage[] getSourceImages() {
int imageCount = sourceModel.getRowCount();
PixelleImage[] selectedImages = new PixelleImage[imageCount];
for (int i = 0; i < imageCount; i++) {
selectedImages[i] = ((PixelleFrame)sourceModel.getValueAt(i, 1)).getImage();
}
-
+
return selectedImages;
}
-
+
public void initComponents() {
setLayout(new BorderLayout(4, 4));
-
+
sourceModel = new DefaultTableModel();
sourceModel.addColumn(PixelleBundle.getString(PixelleBundle.SOURCES_NUMBER));
sourceModel.addColumn(PixelleBundle.getString(PixelleBundle.SOURCES_NAME));
@@ -533,12 +538,12 @@
@Override
public boolean isCellEditable(int row, int column) {
- return false;
- }
+ return false;
+ }
};
ListSelectionModel selectionModel = sourceTable.getSelectionModel();
selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-
+
TableColumnModel columnModel = sourceTable.getColumnModel();
TableColumn column = columnModel.getColumn(0);
column.setMaxWidth(50);
@@ -548,7 +553,7 @@
scroller.setMaximumSize(d);
scroller.setPreferredSize(d);
add(scroller, BorderLayout.CENTER);
-
+
JPanel ctlPanel = new JPanel();
ctlPanel.setLayout(new BoxLayout(ctlPanel, BoxLayout.Y_AXIS));
Icon plus = new ImageIcon(SourcePanel.class.getResource(PLUS_ICON));
@@ -564,10 +569,10 @@
ctlPanel.add(removeButton);
ctlPanel.add(Box.createVerticalGlue());
add(ctlPanel, BorderLayout.EAST);
-
+
setBorder(BorderFactory.createTitledBorder(PixelleBundle.getString(PixelleBundle.SOURCES_LABEL)));
}
-
+
public void initListeners() {
addButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
@@ -579,7 +584,7 @@
}
}
});
-
+
removeButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
int[] selRows = sourceTable.getSelectedRows();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-22 03:47:20
|
Revision: 292
http://pixelle.svn.sourceforge.net/pixelle/?rev=292&view=rev
Author: dbrosius
Date: 2009-07-22 03:47:19 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
of course, make the it static
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/EditorFontFactory.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/EditorFontFactory.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/EditorFontFactory.java 2009-07-22 03:45:12 UTC (rev 291)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/EditorFontFactory.java 2009-07-22 03:47:19 UTC (rev 292)
@@ -22,12 +22,12 @@
public final class EditorFontFactory {
- private final Font monoSpacedFont = new Font(Font.MONOSPACED, Font.PLAIN, 12 );
+ private static final Font monoSpacedFont = new Font(Font.MONOSPACED, Font.PLAIN, 12 );
private EditorFontFactory() {
}
- public Font getEditorFont() {
+ public static Font getEditorFont() {
return monoSpacedFont;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-22 03:45:25
|
Revision: 291
http://pixelle.svn.sourceforge.net/pixelle/?rev=291&view=rev
Author: dbrosius
Date: 2009-07-22 03:45:12 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
a singleton for getting the editor font
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/EditorFontFactory.java
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/EditorFontFactory.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/EditorFontFactory.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/EditorFontFactory.java 2009-07-22 03:45:12 UTC (rev 291)
@@ -0,0 +1,33 @@
+/*
+ * pixelle - Graphics algorithmic editor
+ * Copyright (C) 2008-2009 Dave Brosius
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package com.mebigfatguy.pixelle.dialogs;
+
+import java.awt.Font;
+
+public final class EditorFontFactory {
+
+ private final Font monoSpacedFont = new Font(Font.MONOSPACED, Font.PLAIN, 12 );
+
+ private EditorFontFactory() {
+ }
+
+ public Font getEditorFont() {
+ return monoSpacedFont;
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/EditorFontFactory.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-20 07:39:23
|
Revision: 290
http://pixelle.svn.sourceforge.net/pixelle/?rev=290&view=rev
Author: dbrosius
Date: 2009-07-20 07:39:22 +0000 (Mon, 20 Jul 2009)
Log Message:
-----------
stub in selection outliner
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2009-07-20 07:36:47 UTC (rev 289)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2009-07-20 07:39:22 UTC (rev 290)
@@ -21,12 +21,12 @@
import java.awt.Color;
import java.awt.image.DataBuffer;
-/**
+/**
* an abstract class for evaluation pixels in arbitrary images by enforcing a
* template pattern that derived classes implement per image format.
*/
public abstract class PixelleEval {
-
+
protected PixelleImage srcImage;
protected DataBuffer buffer;
protected int width;
@@ -34,7 +34,7 @@
protected IndexOutOfBoundsOption ioobOption;
protected ColorOutOfBoundsOption coobOption;
private int selectionByte;
-
+
/**
* create an evaluator for a specific image and options
*
@@ -50,7 +50,7 @@
ioobOption = iOption;
coobOption = cOption;
}
-
+
/**
* template method to get the red value at a specific x and y
*
@@ -95,65 +95,67 @@
* @return the pixel value at the given coordinate for the pixel specification
*/
public double getValue(int x, int y, char pixelSpec) {
-
+
/* in the future, allow customization of out of bounds indices */
if (((x < 0) || (x >= width)) || ((y < 0) || (y >= height))) {
switch (ioobOption) {
- case SpecifiedColor:
- Color c = ioobOption.getColor();
- switch (pixelSpec) {
- case 'r':
- return c.getRed();
- case 'g':
- return c.getGreen();
- case 'b':
- return c.getBlue();
- case 't':
- return 1.0;
- case 's':
- default:
- return 0.0;
- }
-
- case BorderColor:
- if (x < 0)
- x = 0;
- else if (x >= width)
- x = width - 1;
- if (y < 0)
- y = 0;
- else if (y >= height)
- y = height - 1;
+ case SpecifiedColor:
+ Color c = ioobOption.getColor();
+ switch (pixelSpec) {
+ case 'r':
+ return c.getRed();
+ case 'g':
+ return c.getGreen();
+ case 'b':
+ return c.getBlue();
+ case 't':
+ return 1.0;
+ case 's':
+ default:
+ return 0.0;
+ }
+
+ case BorderColor:
+ if (x < 0) {
+ x = 0;
+ } else if (x >= width) {
+ x = width - 1;
+ }
+ if (y < 0) {
+ y = 0;
+ } else if (y >= height) {
+ y = height - 1;
+ }
break;
-
- case WrapColor:
- x %= width;
- y %= height;
+
+ case WrapColor:
+ x %= width;
+ y %= height;
break;
}
}
-
+
switch (pixelSpec) {
- case 'r':
- return getRedValue(x, y);
-
- case 'g':
- return getGreenValue(x, y);
-
- case 'b':
- return getBlueValue(x, y);
-
- case 't':
- return getTransparencyValue(x, y);
-
- case 's':
- return getSelectionValue(x, y);
-
- default:
- return 0.0;
+ case 'r':
+ return getRedValue(x, y);
+
+ case 'g':
+ return getGreenValue(x, y);
+
+ case 'b':
+ return getBlueValue(x, y);
+
+ case 't':
+ return getTransparencyValue(x, y);
+
+ case 's':
+ return getSelectionValue(x, y);
+
+ default:
+ return 0.0;
}
}
-
+
/**
* sets the pixel value at the specified x, y
* @param x the x coordinate
@@ -164,7 +166,7 @@
public void setValue(int x, int y, char pixelSpec, double value) {
//Overridden in classes that are uses for output images
}
-
+
/**
* gets the width of the source image
*
@@ -173,7 +175,7 @@
public int getWidth() {
return width;
}
-
+
/**
* gets the height of the source image
*
@@ -182,7 +184,7 @@
public int getHeight() {
return height;
}
-
+
/**
* gets the selection value at specific index
*
@@ -194,11 +196,11 @@
if ((x & 0x07) == 0) {
selectionByte = srcImage.getSelectionByte(x >> 3, y);
}
-
+
int bitOffset = 1 << (x & 0x07);
return ((selectionByte & bitOffset) == 0) ? 0 : 1;
}
-
+
/**
* sets the selection value at a specific index
* @param x the x coordinate
@@ -207,59 +209,65 @@
*/
protected void setSelectionValue(int x, int y, double value) {
int bit = x & 0x07;
- if (bit == 0)
+ if (bit == 0) {
selectionByte = 0;
-
+ }
+
if (value != 0.0) {
int bitOffset = 1 << (7 - bit);
selectionByte |= bitOffset;
}
-
- if ((bit == 7) || (x == width))
+
+ if ((bit == 7) || (x == width)) {
srcImage.setSelectionByte(x >> 3, y, selectionByte);
+ }
}
-
+
/**
* adjust out of bounds colors by applying rules of ColorOutOfBoundsOption
* @param value the input color value
* @return the output color value
*/
protected double adjustColor(double value) {
- if ((value >= 0.0) && (value <= 255.0))
+ if ((value >= 0.0) && (value <= 255.0)) {
return value;
-
+ }
+
switch (coobOption) {
-
- case Roll: {
- int ival = (int)(value + 0.49) % 256;
- return ival;
- }
- case Wave: {
- int ival = (int)(value + 0.49);
- int period = ival / 256;
- if ((period & 0x01) != 0) {
- if (ival > 0)
- ival = 255 - (ival+1) & 0x00FF;
- else
- ival = ival & 0x00FF;
+ case Roll: {
+ int ival = (int)(value + 0.49) % 256;
+ return ival;
+ }
+
+ case Wave: {
+ int ival = (int)(value + 0.49);
+ int period = ival / 256;
+ if ((period & 0x01) != 0) {
+ if (ival > 0) {
+ ival = 255 - (ival+1) & 0x00FF;
+ } else {
+ ival = ival & 0x00FF;
}
- else {
- if (ival > 0)
- ival = ival & 0x00FF;
- else
- ival = 256 - ival & 0x00FF;
+ }
+ else {
+ if (ival > 0) {
+ ival = ival & 0x00FF;
+ } else {
+ ival = 256 - ival & 0x00FF;
}
- return ival;
}
+ return ival;
+ }
- case Clip:
- default: {
- if (value < 0.0)
- return 0.0;
- else
- return 255.0;
+ case Clip:
+ default: {
+ if (value < 0.0) {
+ return 0.0;
+ } else {
+ return 255.0;
}
}
+ }
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2009-07-20 07:36:47 UTC (rev 289)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2009-07-20 07:39:22 UTC (rev 290)
@@ -32,18 +32,18 @@
* to represent the real image, and the second to represent selection.
*/
public class PixelleImage {
-
- private BufferedImage image;
+
+ private final BufferedImage image;
private BufferedImage selection;
- private Composite composite;
-
+ private final Composite composite;
+
public PixelleImage() {
this(new BufferedImage(400, 400, BufferedImage.TYPE_3BYTE_BGR));
}
-
+
public PixelleImage(BufferedImage img) {
image = img;
-
+
byte[] wb = new byte[] {-1, 0};
byte[] alpha = new byte[] {0, -1};
IndexColorModel model = new IndexColorModel(1, 2, wb, wb, wb, alpha);
@@ -53,27 +53,27 @@
g.setColor(Color.WHITE);
g.fillRect(0, 0, getWidth(), getHeight());
}
-
+
public BufferedImage getSaveImage() {
return image;
}
-
+
public int getType() {
return image.getType();
}
-
+
public final int getWidth() {
return image.getWidth();
}
-
+
public final int getHeight() {
return image.getHeight();
}
-
+
public DataBuffer getBuffer() {
return image.getRaster().getDataBuffer();
}
-
+
public void draw(Graphics g, int left, int top, int width, int height) {
g.drawImage(image, left, top, width, height, null);
if (g instanceof Graphics2D) {
@@ -87,16 +87,21 @@
}
}
}
-
+
public int getSelectionByte(int xByteOffset, int y) {
DataBuffer buffer = selection.getRaster().getDataBuffer();
int byteWidth = (getWidth() + 7) >> 3;
return buffer.getElem(y * byteWidth + xByteOffset);
}
-
+
public void setSelectionByte(int xByteOffset, int y, int byteValue) {
DataBuffer buffer = selection.getRaster().getDataBuffer();
int byteWidth = (getWidth() + 7) >> 3;
buffer.setElem(y * byteWidth + xByteOffset, byteValue);
}
+
+ public void finishImage() {
+ SelectionOutliner so = new SelectionOutliner();
+ selection = so.createOutline(selection);
+ }
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2009-07-20 07:36:47 UTC (rev 289)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2009-07-20 07:39:22 UTC (rev 290)
@@ -41,12 +41,12 @@
* transforms one bitmap into another based on the algorithms defined by the user.
*/
public class PixelleTransformer {
-
+
private final PixelleImage[] srcImages;
private Map<PixelleComponent, String> algorithms = null;
private final ImageType outputImageType;
private final Point dimension;
-
+
/**
* constructions a transformer given a source bitmap and algorithms
* @param images the source images
@@ -59,7 +59,7 @@
outputImageType = imageType;
dimension = newDimension;
}
-
+
/**
* builds a sample set of algorithms that creates a 'pleasing' image
*
@@ -76,7 +76,7 @@
}
/**
* transforms the image into a destination image based on the algorithms supplied.
- * It does this by generating classes that implement the PixelleExpr interface, and
+ * It does this by generating classes that implement the PixelleExpr interface, and
* dynamically loads them to create the new pixel values.
*
* @return the destination bitmap
@@ -84,14 +84,14 @@
* a bitmap
*/
public PixelleImage transform() throws PixelleTransformException {
-
+
String currentComponent = "";
String currentAlgorithm = "";
try {
PixelleImage destImage;
PixelleEval destPE;
-
+
if (outputImageType == ImageType.RGB) {
destImage = new PixelleImage(new BufferedImage(dimension.x, dimension.y, BufferedImage.TYPE_4BYTE_ABGR));
destPE = new PixelleEval4ByteABGR(destImage, PixelleEvalFactory.getIndexOutOfBoundsOption(), PixelleEvalFactory.getColorOutOfBoundsOption());
@@ -99,17 +99,17 @@
destImage = new PixelleImage(new BufferedImage(dimension.x, dimension.y, BufferedImage.TYPE_BYTE_GRAY));
destPE = new PixelleEvalByteGray(destImage, PixelleEvalFactory.getIndexOutOfBoundsOption(), PixelleEvalFactory.getColorOutOfBoundsOption());
}
-
+
PixelleEval[] sourceEvals = new PixelleEval[srcImages.length];
for (int i = 0; i < srcImages.length; i++) {
PixelleEval srcPE = PixelleEvalFactory.create(srcImages[i]);
sourceEvals[i] = srcPE;
}
-
+
PixelleClassLoader pcl = AccessController.doPrivileged(new PrivilegedAction<PixelleClassLoader>() {
- public PixelleClassLoader run() {
- return new PixelleClassLoader(Thread.currentThread().getContextClassLoader());
- }
+ public PixelleClassLoader run() {
+ return new PixelleClassLoader(Thread.currentThread().getContextClassLoader());
+ }
});
for (Map.Entry<PixelleComponent, String> entry : algorithms.entrySet()) {
@@ -120,24 +120,24 @@
PixelleLexer pl = new PixelleLexer(cs);
CommonTokenStream tokens = new CommonTokenStream();
tokens.setTokenSource(pl);
-
-
+
+
String clsName = "com.mebigfatguy.pixelle.asm.PixelleExpr" + currentComponent;
PixelleParser pp = new PixelleParser(tokens, clsName);
pp.pixelle();
-
+
byte[] bytes = pp.getClassBytes();
//dump(bytes, clsName.substring(clsName.lastIndexOf('.') + 1) + ".class");
-
- pcl.addClass(clsName, bytes);
- Class<?> cl = pcl.loadClass(clsName);
- PixelleExpr expr = (PixelleExpr)cl.newInstance();
-
- int width = destImage.getWidth();
- int height = destImage.getHeight();
- expr.setOutputSize(width, height);
-
- char pixelSpec = entry.getKey().getPixelSpec();
+
+ pcl.addClass(clsName, bytes);
+ Class<?> cl = pcl.loadClass(clsName);
+ PixelleExpr expr = (PixelleExpr)cl.newInstance();
+
+ int width = destImage.getWidth();
+ int height = destImage.getHeight();
+ expr.setOutputSize(width, height);
+
+ char pixelSpec = entry.getKey().getPixelSpec();
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
double value = expr.eval(sourceEvals, x, y);
@@ -145,36 +145,39 @@
}
}
}
-
+
+ destImage.finishImage();
+
return destImage;
} catch (Exception e) {
throw new PixelleTransformException("Failed to transform the image: " + currentComponent + ": " + currentAlgorithm, e);
}
}
-
- /** for debugging */
- private static void dump(byte[] byteCode, String name)
- {
- FileOutputStream fos = null;
- try
- {
- File clsFile = new File(System.getProperty("java.io.tmpdir"), name);
- fos = new FileOutputStream(clsFile);
- fos.write(byteCode);
- fos.flush();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- try {
- if (fos != null)
- fos.close();
- } catch (IOException ioe) {
- }
- }
- }
+ /** for debugging */
+ private static void dump(byte[] byteCode, String name)
+ {
+ FileOutputStream fos = null;
+ try
+ {
+ File clsFile = new File(System.getProperty("java.io.tmpdir"), name);
+ fos = new FileOutputStream(clsFile);
+ fos.write(byteCode);
+ fos.flush();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ try {
+ if (fos != null) {
+ fos.close();
+ }
+ } catch (IOException ioe) {
+ }
+ }
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-20 07:37:12
|
Revision: 289
http://pixelle.svn.sourceforge.net/pixelle/?rev=289&view=rev
Author: dbrosius
Date: 2009-07-20 07:36:47 +0000 (Mon, 20 Jul 2009)
Log Message:
-----------
first start at outlining the selection bits
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java 2009-07-20 07:36:47 UTC (rev 289)
@@ -0,0 +1,37 @@
+/*
+ * pixelle - Graphics algorithmic editor
+ * Copyright (C) 2008-2009 Dave Brosius
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package com.mebigfatguy.pixelle;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+import java.awt.image.IndexColorModel;
+
+public class SelectionOutliner {
+
+ public BufferedImage createOutline(BufferedImage selectionImage) {
+ BufferedImage outlineSelection = new BufferedImage(selectionImage.getWidth(), selectionImage.getHeight(), BufferedImage.TYPE_BYTE_BINARY, (IndexColorModel)selectionImage.getColorModel());
+ Graphics g = selectionImage.getGraphics();
+ g.setColor(Color.WHITE);
+ g.fillRect(0, 0, selectionImage.getWidth(), selectionImage.getHeight());
+
+
+ return outlineSelection;
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/SelectionOutliner.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-20 07:13:16
|
Revision: 288
http://pixelle.svn.sourceforge.net/pixelle/?rev=288&view=rev
Author: dbrosius
Date: 2009-07-20 07:13:11 +0000 (Mon, 20 Jul 2009)
Log Message:
-----------
don't issue warnings on whitespace
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2009-07-18 20:17:33 UTC (rev 287)
+++ trunk/pixelle/etc/Pixelle.g 2009-07-20 07:13:11 UTC (rev 288)
@@ -422,5 +422,7 @@
NUMBER : '0'..'9'+ ( '.' ('0'..'9'+))?;
-NEWLINE:'\r'? '\n' ;
+WS : (' '|'\t'|'\f'|'\n'|'\r')+{ skip(); };
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 20:17:34
|
Revision: 287
http://pixelle.svn.sourceforge.net/pixelle/?rev=287&view=rev
Author: dbrosius
Date: 2009-07-18 20:17:33 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
add version to the codebase so that changes to versions pull new ones.
Modified Paths:
--------------
trunk/pixelle/etc/pixelle.jnlp
Modified: trunk/pixelle/etc/pixelle.jnlp
===================================================================
--- trunk/pixelle/etc/pixelle.jnlp 2009-07-18 20:13:53 UTC (rev 286)
+++ trunk/pixelle/etc/pixelle.jnlp 2009-07-18 20:17:33 UTC (rev 287)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<jnlp
spec="1.0+"
- codebase="http://pixelle.sourceforge.net/jnlp"
+ codebase="http://pixelle.sourceforge.net/jnlp?v=$VERSION"
href="pixelle.jnlp">
<information>
<title>Pixelle</title>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 20:13:58
|
Revision: 286
http://pixelle.svn.sourceforge.net/pixelle/?rev=286&view=rev
Author: dbrosius
Date: 2009-07-18 20:13:53 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
add functions to shortcut menu
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 20:06:45 UTC (rev 285)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 20:13:53 UTC (rev 286)
@@ -211,6 +211,43 @@
shortcuts.add(operatorMenu);
+ JMenu functionMenu = new JMenu(PixelleBundle.getString(PixelleBundle.FUNCTIONS));
+ JMenuItem absItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.ABS));
+ JMenuItem maxItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.MAX));
+ JMenuItem minItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.MIN));
+ JMenuItem powItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.POW));
+ JMenuItem sqrtItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.SQRT));
+ JMenuItem sinItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.SIN));
+ JMenuItem cosItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.COS));
+ JMenuItem tanItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.TAN));
+ JMenuItem asinItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.ASIN));
+ JMenuItem acosItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.ACOS));
+ JMenuItem atanItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.ATAN));
+ JMenuItem logItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.LOG));
+ JMenuItem expItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.EXP));
+ JMenuItem eItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.E));
+ JMenuItem piItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.PI));
+ JMenuItem randomItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.RANDOM));
+
+ functionMenu.add(absItem);
+ functionMenu.add(maxItem);
+ functionMenu.add(minItem);
+ functionMenu.add(powItem);
+ functionMenu.add(sqrtItem);
+ functionMenu.add(sinItem);
+ functionMenu.add(cosItem);
+ functionMenu.add(tanItem);
+ functionMenu.add(asinItem);
+ functionMenu.add(acosItem);
+ functionMenu.add(atanItem);
+ functionMenu.add(logItem);
+ functionMenu.add(expItem);
+ functionMenu.add(eItem);
+ functionMenu.add(piItem);
+ functionMenu.add(randomItem);
+
+ shortcuts.add(functionMenu);
+
addSimpleShortCutListener(redSpecItem, "p(0)[x,y].r");
addSimpleShortCutListener(greenSpecItem, "p(0)[x,y].g");
addSimpleShortCutListener(blueSpecItem, "p(0)[x,y].b");
@@ -239,6 +276,23 @@
addSimpleShortCutListener(addItem, " + ");
addSimpleShortCutListener(subtractItem, " - ");
addSimpleShortCutListener(notItem, " !");
+
+ addSimpleShortCutListener(absItem, "abs(x)");
+ addSimpleShortCutListener(maxItem, "max(x,y)");
+ addSimpleShortCutListener(minItem, "min(x,y)");
+ addSimpleShortCutListener(powItem, "pow(x,y)");
+ addSimpleShortCutListener(sqrtItem, "sqrt(x)");
+ addSimpleShortCutListener(sinItem, "sin(x)");
+ addSimpleShortCutListener(cosItem, "cos(x)");
+ addSimpleShortCutListener(tanItem, "tan(x)");
+ addSimpleShortCutListener(asinItem, "asin(x)");
+ addSimpleShortCutListener(acosItem, "acos(x)");
+ addSimpleShortCutListener(atanItem, "atan(x)");
+ addSimpleShortCutListener(logItem, "log(x)");
+ addSimpleShortCutListener(expItem, "exp(x)");
+ addSimpleShortCutListener(eItem, "e()");
+ addSimpleShortCutListener(piItem, "pi()");
+ addSimpleShortCutListener(randomItem, "random()");
}
private void addSimpleShortCutListener(JMenuItem mi, final String sc) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 20:06:48
|
Revision: 285
http://pixelle.svn.sourceforge.net/pixelle/?rev=285&view=rev
Author: dbrosius
Date: 2009-07-18 20:06:45 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
add constants to PixelleBundle
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-07-18 20:02:33 UTC (rev 284)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-07-18 20:06:45 UTC (rev 285)
@@ -125,6 +125,23 @@
public static final String ADD = "label.add";
public static final String SUBTRACT = "label.subtract";
public static final String NOT = "label.not";
+ public static final String FUNCTIONS = "label.functions";
+ public static final String ABS = "label.abs";
+ public static final String MAX = "label.max";
+ public static final String MIN = "label.min";
+ public static final String POW = "label.pow";
+ public static final String SQRT = "label.sqrt";
+ public static final String SIN = "label.sin";
+ public static final String COS = "label.cos";
+ public static final String TAN = "label.tan";
+ public static final String ASIN = "label.asin";
+ public static final String ACOS = "label.acos";
+ public static final String ATAN = "label.atan";
+ public static final String LOG = "label.log";
+ public static final String EXP = "label.exp";
+ public static final String E = "label.e";
+ public static final String PI = "label.pi";
+ public static final String RANDOM = "label.random";
private static ResourceBundle rb = ResourceBundle.getBundle("com/mebigfatguy/pixelle/resources/pixelle");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 20:02:34
|
Revision: 284
http://pixelle.svn.sourceforge.net/pixelle/?rev=284&view=rev
Author: dbrosius
Date: 2009-07-18 20:02:33 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
add functions to properties, and make random a method
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2009-07-18 19:55:14 UTC (rev 283)
+++ trunk/pixelle/etc/Pixelle.g 2009-07-18 20:02:33 UTC (rev 284)
@@ -415,7 +415,7 @@
{
mv.visitLdcInsn(Double.valueOf(Math.PI));
}
- | 'random'
+ | 'random' '(' ')'
{
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "random", "()D");
} ;
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-07-18 19:55:14 UTC (rev 283)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-07-18 20:02:33 UTC (rev 284)
@@ -138,3 +138,22 @@
label.subtract = Subtract (-)
label.not = Not (!)
+label.functions = Functions
+label.abs = abs(x)
+label.max = max(x, y)
+label.min = min(x, y)
+label.pow = pow(x, y)
+label.sqrt = sqrt(x)
+label.sin = sin(x)
+label.cos = cos(x)
+label.tan = tan(x)
+label.asin = asin(x)
+label.acos = acos(x)
+label.atan = atan(x)
+label.log = log(x)
+label.exp = exp(x)
+label.e = e()
+label.pi = pi()
+label.random = random()
+
+
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties 2009-07-18 19:55:14 UTC (rev 283)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties 2009-07-18 20:02:33 UTC (rev 284)
@@ -134,4 +134,22 @@
label.divide = Divide (/)
label.add = Hinzuf\xFCgen (+)
label.subtract = Subtrahieren (-)
-label.not = Nicht (!)
\ No newline at end of file
+label.not = Nicht (!)
+
+label.functions = Funktionen
+label.abs = abs(x)
+label.max = max(x, y)
+label.min = min(x, y)
+label.pow = pow(x, y)
+label.sqrt = sqrt(x)
+label.sin = sin(x)
+label.cos = cos(x)
+label.tan = tan(x)
+label.asin = asin(x)
+label.acos = acos(x)
+label.atan = atan(x)
+label.log = log(x)
+label.exp = exp(x)
+label.e = e()
+label.pi = pi()
+label.random = random()
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 19:55:19
|
Revision: 283
http://pixelle.svn.sourceforge.net/pixelle/?rev=283&view=rev
Author: dbrosius
Date: 2009-07-18 19:55:14 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
move settings to .mebigfatguy/pixelle
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java 2009-07-18 19:40:12 UTC (rev 282)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java 2009-07-18 19:55:14 UTC (rev 283)
@@ -60,12 +60,12 @@
public static final String ALGORITHM = "algorithm";
public static final String COMPONENT = "component";
public static final String NAME = "name";
- public static final String PIXELLE = ".pixelle";
+ public static final String PIXELLE = ".mebigfatguy/pixelle";
public static final String ALGORITHMS_FILE = "algorithms.xml";
-
-
+
+
private static AlgorithmArchiver archiver = new AlgorithmArchiver();
-
+
private final Map<ImageType, Map<String, Map<String, Map<PixelleComponent, String>>>> systemAlgorithms;
private final Map<ImageType, Map<String, Map<String, Map<PixelleComponent, String>>>> userAlgorithms;
@@ -75,19 +75,19 @@
loadSystemAlgorithms();
loadUserAlgorithms();
}
-
+
public static AlgorithmArchiver getArchiver() {
return archiver;
}
-
+
public JPopupMenu getAlgorithmDisplayPopup(ImageType imageType, ActionListener l) {
JPopupMenu m = new JPopupMenu(PixelleBundle.getString(PixelleBundle.PIXEL_ALGORITHM));
populateMenuAlgorithms(m, systemAlgorithms.get(imageType), l);
populateMenuAlgorithms(m, userAlgorithms.get(imageType), l);
-
+
return m;
}
-
+
private void populateMenuAlgorithms(JPopupMenu menu, Map<String, Map<String, Map<PixelleComponent, String>>> algorithms, ActionListener l) {
if (algorithms != null) {
for (final Map.Entry<String, Map<String, Map<PixelleComponent, String>>> entry : algorithms.entrySet()) {
@@ -105,68 +105,69 @@
}
}
}
-
+
public Map<PixelleComponent, String> getAlgorithm(ImageType imageType, String groupName, String algorithmName) {
Map<String, Map<String, Map<PixelleComponent, String>>> type = systemAlgorithms.get(imageType);
if (type != null) {
Map<String, Map<PixelleComponent, String>> group = type.get(groupName);
if (group != null) {
Map<PixelleComponent, String> algo = group.get(algorithmName);
- if (algo != null)
+ if (algo != null) {
return algo;
+ }
}
}
-
+
type = userAlgorithms.get(imageType);
if (type == null) {
throw new IllegalArgumentException("Unknown type name " + imageType.name());
}
-
+
Map<String, Map<PixelleComponent, String>> group = type.get(groupName);
if (group == null) {
throw new IllegalArgumentException("Unknown group name " + groupName);
}
-
+
Map<PixelleComponent, String> algo = group.get(algorithmName);
if (algo == null) {
throw new IllegalArgumentException("Unknown algorithm name " + algorithmName);
}
-
+
return algo;
-
+
}
-
+
public String[] getUserGroups(ImageType imageType) {
Set<String> groups = new TreeSet<String>(userAlgorithms.get(imageType).keySet());
groups.remove(CURRENT);
return groups.toArray(new String[groups.size()]);
}
-
+
public void addAlgorithm(ImageType imageType, String groupName, String algorithmName, Map<PixelleComponent, String> algorithm) {
Map<String, Map<String, Map<PixelleComponent, String>>> type = userAlgorithms.get(imageType);
if (type == null) {
type = new HashMap<String, Map<String, Map<PixelleComponent, String>>>();
userAlgorithms.put(imageType, type);
}
-
-
+
+
Map<String, Map<PixelleComponent, String>> group = type.get(groupName);
if (group == null) {
group = new HashMap<String, Map<PixelleComponent, String>>();
type.put(groupName, group);
}
-
+
group.put(algorithmName, new EnumMap<PixelleComponent, String>(algorithm));
}
-
+
public void setCurrent(ImageType imageType, Map<PixelleComponent, String> algorithm) {
addAlgorithm(imageType, AlgorithmArchiver.CURRENT, AlgorithmArchiver.CURRENT, algorithm);
}
-
+
public Map<PixelleComponent, String> getCurrent(ImageType imageType) {
return getAlgorithm(imageType, AlgorithmArchiver.CURRENT, AlgorithmArchiver.CURRENT);
}
-
+
public void removeAlgorithm(ImageType imageType, String group, String name) {
Map<String, Map<String, Map<PixelleComponent, String>>> type = userAlgorithms.get(imageType);
if (type != null) {
@@ -176,7 +177,7 @@
}
}
}
-
+
public void save() {
OutputStream xmlOut = null;
try {
@@ -190,9 +191,9 @@
} finally {
Closer.close(xmlOut);
}
-
+
}
-
+
private void loadSystemAlgorithms() {
InputStream xmlIs = null;
try {
@@ -204,7 +205,7 @@
Closer.close(xmlIs);
}
}
-
+
private void loadUserAlgorithms() {
InputStream is = null;
try {
@@ -220,9 +221,9 @@
} finally {
Closer.close(is);
}
-
+
}
-
+
private void writeAlgorithms(OutputStream is, Map<ImageType, Map<String, Map<String, Map<PixelleComponent, String>>>> algorithms) throws IOException {
PrintWriter pw = null;
try {
@@ -230,15 +231,15 @@
pw.println("<algorithms xmlns='http://pixelle.mebigfatguy.com/" + Version.getVersion() + "'");
pw.println(" xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'");
pw.println(" xsi:schemaLocation='/com/mebigfatguy/pixelle/resources/algorithms.xsd'>");
-
+
for (Map.Entry<ImageType, Map<String, Map<String, Map<PixelleComponent, String>>>> type : algorithms.entrySet()) {
pw.println(" <type name='" + type.getKey() + "'>");
for (Map.Entry<String, Map<String, Map<PixelleComponent, String>>> group : type.getValue().entrySet()) {
pw.println(" <group name='" + group.getKey() + "'>");
-
+
for (Map.Entry<String, Map<PixelleComponent, String>> algorithm : group.getValue().entrySet()) {
pw.println(" <algorithm name='" + algorithm.getKey() + "'>");
-
+
for (Map.Entry<PixelleComponent, String> component : algorithm.getValue().entrySet()) {
pw.println(" <component name='" + component.getKey().name().toLowerCase() + "'>");
pw.println(" " + XMLEncoder.xmlEncode(component.getValue()));
@@ -257,7 +258,7 @@
pw.close();
}
}
-
+
private void parseAlgorithms(InputStream is, final Map<ImageType, Map<String, Map<String, Map<PixelleComponent, String>>>> algorithms) throws IOException, SAXException {
XMLReader r = XMLReaderFactory.createXMLReader();
r.setContentHandler(new DefaultHandler() {
@@ -266,7 +267,7 @@
Map<PixelleComponent, String> currentAlgorithm = null;
String currentComponentName = null;
StringBuilder algorithmText = null;
-
+
@Override
public void startElement(String uri, String localName, String qName, Attributes atts) {
if (TYPE.equals(localName)) {
@@ -283,14 +284,14 @@
algorithmText = new StringBuilder();
}
}
-
+
@Override
public void characters(char[] c, int start, int offset) {
if (currentComponentName != null) {
algorithmText.append(c, start, offset);
}
}
-
+
@Override
public void endElement(String uri, String localName, String qName) {
if (COMPONENT.equals(localName)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 19:40:13
|
Revision: 282
http://pixelle.svn.sourceforge.net/pixelle/?rev=282&view=rev
Author: dbrosius
Date: 2009-07-18 19:40:12 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
default pixelle spec to p(0)
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 19:31:32 UTC (rev 281)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 19:40:12 UTC (rev 282)
@@ -211,12 +211,12 @@
shortcuts.add(operatorMenu);
- addSimpleShortCutListener(redSpecItem, "p[x,y].r");
- addSimpleShortCutListener(greenSpecItem, "p[x,y].g");
- addSimpleShortCutListener(blueSpecItem, "p[x,y].b");
- addSimpleShortCutListener(blackSpecItem, "p[x,y].k");
- addSimpleShortCutListener(transparentSpecItem, "p[x,y].t");
- addSimpleShortCutListener(selectionSpecItem, "p[x,y].s");
+ addSimpleShortCutListener(redSpecItem, "p(0)[x,y].r");
+ addSimpleShortCutListener(greenSpecItem, "p(0)[x,y].g");
+ addSimpleShortCutListener(blueSpecItem, "p(0)[x,y].b");
+ addSimpleShortCutListener(blackSpecItem, "p(0)[x,y].k");
+ addSimpleShortCutListener(transparentSpecItem, "p(0)[x,y].t");
+ addSimpleShortCutListener(selectionSpecItem, "p(0)[x,y].s");
addSimpleShortCutListener(leftItem, "0");
addSimpleShortCutListener(topItem, "0");
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-07-18 19:31:32 UTC (rev 281)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-07-18 19:40:12 UTC (rev 282)
@@ -52,12 +52,12 @@
label.graphic_files = Graphic Files
-formula.red = p[x,y].r
-formula.green = p[x,y].g
-formula.blue = p[x,y].b
-formula.black = p[x,y].k
-formula.transparency = p[x,y].t
-formula.selection = p[x,y].s
+formula.red = p(0)[x,y].r
+formula.green = p(0)[x,y].g
+formula.blue = p(0)[x,y].b
+formula.black = p(0)[x,y].k
+formula.transparency = p(0)[x,y].t
+formula.selection = p(0)[x,y].s
label.group = Group
title.algorithms = Pixel Algorithms
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 19:31:34
|
Revision: 281
http://pixelle.svn.sourceforge.net/pixelle/?rev=281&view=rev
Author: dbrosius
Date: 2009-07-18 19:31:32 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
bump the version to 1.1.0 so people get a new copy
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2009-07-18 19:29:41 UTC (rev 280)
+++ trunk/pixelle/htdocs/index.html 2009-07-18 19:31:32 UTC (rev 281)
@@ -13,7 +13,7 @@
<img src="vbar.gif" height="12"/>
<a href="javadoc/index.html">JavaDoc</a>
<img src="vbar.gif" height="12"/>
- <a href="jnlp/pixelle.jnlp">Web Start</a>
+ <a href="jnlp/pixelle.jnlp?v=1.1.0">Web Start</a>
<hr/>
<p>Thanks for your interest in Pixelle.</p>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 19:29:42
|
Revision: 280
http://pixelle.svn.sourceforge.net/pixelle/?rev=280&view=rev
Author: dbrosius
Date: 2009-07-18 19:29:41 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
typos
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-07-18 19:24:34 UTC (rev 279)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-07-18 19:29:41 UTC (rev 280)
@@ -109,7 +109,7 @@
public static final String RIGHT = "label.right";
public static final String BOTTOM = "label.bottom";
public static final String CENTERX = "label.centerx";
- public static final String CENTERY = "label.centerx";
+ public static final String CENTERY = "label.centery";
public static final String OPERATORS = "label.operators";
public static final String AND = "label.and";
public static final String OR = "label.or";
@@ -117,7 +117,7 @@
public static final String EQUALS = "label.equals";
public static final String NOTEQUALS = "label.notequals";
public static final String LESS_THAN_OR_EQUALS= "label.lessorequals";
- public static final String GREATER_THAN_OR_QEUALS= "label.greaterthanorequals";
+ public static final String GREATER_THAN_OR_EQUALS= "label.greaterthanorequals";
public static final String LESS_THAN = "label.lessthan";
public static final String GREATER_THAN = "label.greaterthan";
public static final String MULTIPLY = "label.multiply";
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 19:24:34 UTC (rev 279)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 19:29:41 UTC (rev 280)
@@ -185,7 +185,7 @@
JMenuItem equalsItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.EQUALS));
JMenuItem notEqualsItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.NOTEQUALS));
JMenuItem lessThanOrEqualsItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.LESS_THAN_OR_EQUALS));
- JMenuItem greaterThanOrEqualsItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.GREATER_THAN_OR_QEUALS));
+ JMenuItem greaterThanOrEqualsItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.GREATER_THAN_OR_EQUALS));
JMenuItem lessThanItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.LESS_THAN));
JMenuItem greaterThanItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.GREATER_THAN));
JMenuItem multiplyItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.MULTIPLY));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 19:24:35
|
Revision: 279
http://pixelle.svn.sourceforge.net/pixelle/?rev=279&view=rev
Author: dbrosius
Date: 2009-07-18 19:24:34 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
add operators to the menu
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 19:12:30 UTC (rev 278)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 19:24:34 UTC (rev 279)
@@ -178,6 +178,39 @@
posMenu.add(centerYItem);
shortcuts.add(posMenu);
+ JMenu operatorMenu = new JMenu(PixelleBundle.getString(PixelleBundle.OPERATORS));
+ JMenuItem andItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.AND));
+ JMenuItem orItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.OR));
+ JMenuItem trinaryItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.TRINARY));
+ JMenuItem equalsItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.EQUALS));
+ JMenuItem notEqualsItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.NOTEQUALS));
+ JMenuItem lessThanOrEqualsItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.LESS_THAN_OR_EQUALS));
+ JMenuItem greaterThanOrEqualsItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.GREATER_THAN_OR_QEUALS));
+ JMenuItem lessThanItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.LESS_THAN));
+ JMenuItem greaterThanItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.GREATER_THAN));
+ JMenuItem multiplyItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.MULTIPLY));
+ JMenuItem divideItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.DIVIDE));
+ JMenuItem addItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.ADD));
+ JMenuItem subtractItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.SUBTRACT));
+ JMenuItem notItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.NOT));
+
+ operatorMenu.add(andItem);
+ operatorMenu.add(orItem);
+ operatorMenu.add(trinaryItem);
+ operatorMenu.add(equalsItem);
+ operatorMenu.add(notEqualsItem);
+ operatorMenu.add(lessThanOrEqualsItem);
+ operatorMenu.add(greaterThanOrEqualsItem);
+ operatorMenu.add(lessThanItem);
+ operatorMenu.add(greaterThanItem);
+ operatorMenu.add(multiplyItem);
+ operatorMenu.add(divideItem);
+ operatorMenu.add(addItem);
+ operatorMenu.add(subtractItem);
+ operatorMenu.add(notItem);
+
+ shortcuts.add(operatorMenu);
+
addSimpleShortCutListener(redSpecItem, "p[x,y].r");
addSimpleShortCutListener(greenSpecItem, "p[x,y].g");
addSimpleShortCutListener(blueSpecItem, "p[x,y].b");
@@ -191,6 +224,21 @@
addSimpleShortCutListener(bottomItem, "height");
addSimpleShortCutListener(centerXItem, "(width/2)");
addSimpleShortCutListener(centerYItem, "(height/2)");
+
+ addSimpleShortCutListener(andItem, " && ");
+ addSimpleShortCutListener(orItem, " || ");
+ addSimpleShortCutListener(trinaryItem, " ? ");
+ addSimpleShortCutListener(equalsItem, " == ");
+ addSimpleShortCutListener(notEqualsItem, " != ");
+ addSimpleShortCutListener(lessThanOrEqualsItem, " <= ");
+ addSimpleShortCutListener(greaterThanOrEqualsItem, " >= ");
+ addSimpleShortCutListener(lessThanItem, " < ");
+ addSimpleShortCutListener(greaterThanItem, " > ");
+ addSimpleShortCutListener(multiplyItem, " * ");
+ addSimpleShortCutListener(divideItem, " / ");
+ addSimpleShortCutListener(addItem, " + ");
+ addSimpleShortCutListener(subtractItem, " - ");
+ addSimpleShortCutListener(notItem, " !");
}
private void addSimpleShortCutListener(JMenuItem mi, final String sc) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 19:12:33
|
Revision: 278
http://pixelle.svn.sourceforge.net/pixelle/?rev=278&view=rev
Author: dbrosius
Date: 2009-07-18 19:12:30 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
add operators to PixelleBundle
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-07-18 19:08:16 UTC (rev 277)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-07-18 19:12:30 UTC (rev 278)
@@ -108,9 +108,25 @@
public static final String TOP = "label.top";
public static final String RIGHT = "label.right";
public static final String BOTTOM = "label.bottom";
- public static final String CENTERX= "label.centerx";
- public static final String CENTERY= "label.centerx";
+ public static final String CENTERX = "label.centerx";
+ public static final String CENTERY = "label.centerx";
+ public static final String OPERATORS = "label.operators";
+ public static final String AND = "label.and";
+ public static final String OR = "label.or";
+ public static final String TRINARY = "label.trinary";
+ public static final String EQUALS = "label.equals";
+ public static final String NOTEQUALS = "label.notequals";
+ public static final String LESS_THAN_OR_EQUALS= "label.lessorequals";
+ public static final String GREATER_THAN_OR_QEUALS= "label.greaterthanorequals";
+ public static final String LESS_THAN = "label.lessthan";
+ public static final String GREATER_THAN = "label.greaterthan";
+ public static final String MULTIPLY = "label.multiply";
+ public static final String DIVIDE = "label.divide";
+ public static final String ADD = "label.add";
+ public static final String SUBTRACT = "label.subtract";
+ public static final String NOT = "label.not";
+
private static ResourceBundle rb = ResourceBundle.getBundle("com/mebigfatguy/pixelle/resources/pixelle");
private PixelleBundle()
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-07-18 19:08:16 UTC (rev 277)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-07-18 19:12:30 UTC (rev 278)
@@ -132,7 +132,7 @@
label.greaterthanorequals = Greater than or equals (>=)
label.lessthan = Less than (<)
label.greaterthan = Greater than (>)
-label.multiple = Multiply (*)
+label.multiply = Multiply (*)
label.divide = Divide (/)
label.add = Add (+)
label.subtract = Subtract (-)
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties 2009-07-18 19:08:16 UTC (rev 277)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties 2009-07-18 19:12:30 UTC (rev 278)
@@ -130,7 +130,7 @@
label.greaterthanorequals = Gr\xF6\xDFer als oder gleich (>=)
label.lessthan = Weniger als (<)
label.greaterthan = Gr\xF6\xDFer als (>)
-label.multiple = Multiplizieren (*)
+label.multiply = Multiplizieren (*)
label.divide = Divide (/)
label.add = Hinzuf\xFCgen (+)
label.subtract = Subtrahieren (-)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 19:08:24
|
Revision: 277
http://pixelle.svn.sourceforge.net/pixelle/?rev=277&view=rev
Author: dbrosius
Date: 2009-07-18 19:08:16 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
add operator properties
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-07-18 18:59:35 UTC (rev 276)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-07-18 19:08:16 UTC (rev 277)
@@ -120,4 +120,21 @@
label.right = Right
label.bottom = Bottom
label.centerx = Center.X
-label.centery = Center.Y
\ No newline at end of file
+label.centery = Center.Y
+
+label.operators = Operators
+label.and = And (&&)
+label.or = Or (||)
+label.trinary = Trinary (?)
+label.equals = Equals (==)
+label.notequals = Not Equals (!=)
+label.lessorequals = Less than or equals (<=)
+label.greaterthanorequals = Greater than or equals (>=)
+label.lessthan = Less than (<)
+label.greaterthan = Greater than (>)
+label.multiple = Multiply (*)
+label.divide = Divide (/)
+label.add = Add (+)
+label.subtract = Subtract (-)
+label.not = Not (!)
+
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties 2009-07-18 18:59:35 UTC (rev 276)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties 2009-07-18 19:08:16 UTC (rev 277)
@@ -118,4 +118,20 @@
label.right = Richtig
label.bottom = Boden
label.centerx = Center.X
-label.centery = Center.Y
\ No newline at end of file
+label.centery = Center.Y
+
+label.operators = Die Betreiber
+label.and = Und (&&)
+label.or = Oder (||)
+label.trinary = Trinary (?)
+label.equals = Gleich (==)
+label.notequals = Nicht gleich (!=)
+label.lessorequals = Weniger als oder gleich (<=)
+label.greaterthanorequals = Gr\xF6\xDFer als oder gleich (>=)
+label.lessthan = Weniger als (<)
+label.greaterthan = Gr\xF6\xDFer als (>)
+label.multiple = Multiplizieren (*)
+label.divide = Divide (/)
+label.add = Hinzuf\xFCgen (+)
+label.subtract = Subtrahieren (-)
+label.not = Nicht (!)
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 18:59:37
|
Revision: 276
http://pixelle.svn.sourceforge.net/pixelle/?rev=276&view=rev
Author: dbrosius
Date: 2009-07-18 18:59:35 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
move up to version 1.1.0
Modified Paths:
--------------
trunk/pixelle/build.xml
Modified: trunk/pixelle/build.xml
===================================================================
--- trunk/pixelle/build.xml 2009-07-18 18:57:35 UTC (rev 275)
+++ trunk/pixelle/build.xml 2009-07-18 18:59:35 UTC (rev 276)
@@ -36,7 +36,7 @@
<property name="javac.deprecation" value="on"/>
<property name="javac.debug" value="on"/>
- <property name="pixelle.version" value="1.0.0"/>
+ <property name="pixelle.version" value="1.1.0"/>
<target name="clean" description="removes all generated collateral">
<delete dir="${classes.dir}"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 18:57:36
|
Revision: 275
http://pixelle.svn.sourceforge.net/pixelle/?rev=275&view=rev
Author: dbrosius
Date: 2009-07-18 18:57:35 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
add pixel specifications to short cut menu
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-07-18 18:49:24 UTC (rev 274)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-07-18 18:57:35 UTC (rev 275)
@@ -24,7 +24,7 @@
* manages the resource bundle using in the program
*/
public class PixelleBundle {
-
+
public static final String OK = "ok";
public static final String CANCEL = "cancel";
public static final String RESET = "reset";
@@ -102,6 +102,7 @@
public static final String OUTPUT_PROPERTIES = "label.output_properties";
public static final String PICK_SOURCE_LABEL = "label.pick_source";
public static final String SHORTCUTS = "label.shortcuts";
+ public static final String PIXEL_SPECIFICATION = "label.pixelspecs";
public static final String POSITIONS = "label.positions";
public static final String LEFT = "label.left";
public static final String TOP = "label.top";
@@ -109,13 +110,13 @@
public static final String BOTTOM = "label.bottom";
public static final String CENTERX= "label.centerx";
public static final String CENTERY= "label.centerx";
-
+
private static ResourceBundle rb = ResourceBundle.getBundle("com/mebigfatguy/pixelle/resources/pixelle");
-
+
private PixelleBundle()
{
}
-
+
/**
* returns a localized string from a given key
*
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 18:49:24 UTC (rev 274)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 18:57:35 UTC (rev 275)
@@ -148,6 +148,21 @@
shortcuts = new JPopupMenu(PixelleBundle.getString(PixelleBundle.SHORTCUTS));
+ JMenu specMenu = new JMenu(PixelleBundle.getString(PixelleBundle.PIXEL_SPECIFICATION));
+ JMenuItem redSpecItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.RED_ALGORITHM));
+ JMenuItem greenSpecItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.GREEN_ALGORITHM));
+ JMenuItem blueSpecItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.BLUE_ALGORITHM));
+ JMenuItem blackSpecItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.BLACK_ALGORITHM));
+ JMenuItem transparentSpecItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.TRANSPARENCY_ALGORITHM));
+ JMenuItem selectionSpecItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.SELECTION_ALGORITHM));
+ specMenu.add(redSpecItem);
+ specMenu.add(greenSpecItem);
+ specMenu.add(blueSpecItem);
+ specMenu.add(blackSpecItem);
+ specMenu.add(transparentSpecItem);
+ specMenu.add(selectionSpecItem);
+ shortcuts.add(specMenu);
+
JMenu posMenu = new JMenu(PixelleBundle.getString(PixelleBundle.POSITIONS));
JMenuItem leftItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.LEFT));
JMenuItem topItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.TOP));
@@ -163,6 +178,13 @@
posMenu.add(centerYItem);
shortcuts.add(posMenu);
+ addSimpleShortCutListener(redSpecItem, "p[x,y].r");
+ addSimpleShortCutListener(greenSpecItem, "p[x,y].g");
+ addSimpleShortCutListener(blueSpecItem, "p[x,y].b");
+ addSimpleShortCutListener(blackSpecItem, "p[x,y].k");
+ addSimpleShortCutListener(transparentSpecItem, "p[x,y].t");
+ addSimpleShortCutListener(selectionSpecItem, "p[x,y].s");
+
addSimpleShortCutListener(leftItem, "0");
addSimpleShortCutListener(topItem, "0");
addSimpleShortCutListener(rightItem, "width");
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-07-18 18:49:24 UTC (rev 274)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-07-18 18:57:35 UTC (rev 275)
@@ -112,6 +112,8 @@
label.pick_source = Select the input source window to use in the transformation
label.shortcuts = ShortCuts
+label.pixelspecs = Pixel Specifications
+
label.positions = Positions
label.left = Left
label.top = Top
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 18:49:32
|
Revision: 274
http://pixelle.svn.sourceforge.net/pixelle/?rev=274&view=rev
Author: dbrosius
Date: 2009-07-18 18:49:24 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
hook up location shortcuts
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 18:42:04 UTC (rev 273)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 18:49:24 UTC (rev 274)
@@ -50,20 +50,20 @@
*/
public class AlgorithmEditor extends JDialog {
private static final long serialVersionUID = 7704059483753204128L;
-
+
private JEditorPane algo;
private JButton ok;
private JButton cancel;
- private String origValue;
+ private final String origValue;
private JLabel shortcutTrigger;
private JPopupMenu shortcuts;
private boolean isOK = false;
-
+
public AlgorithmEditor(PixelleComponent component, Point pt, Dimension dim, String value) {
origValue = value;
initComponents();
initListeners();
-
+
setTitle(component.toString());
pt.y -= dim.height + 5; // 5 is clearly a fudge
setLocation(pt);
@@ -71,32 +71,33 @@
setSize(dim);
algo.setText(value);
}
-
+
public String getValue() {
- if (isOK)
+ if (isOK) {
return algo.getText();
-
+ }
+
return origValue;
}
-
+
private void initComponents() {
Container cp = getContentPane();
cp.setLayout(new BorderLayout(4, 4));
-
+
algo = new JEditorPane();
cp.add(new JScrollPane(algo), BorderLayout.CENTER);
-
+
ok = new JButton(PixelleBundle.getString(PixelleBundle.OK));
cancel = new JButton(PixelleBundle.getString(PixelleBundle.CANCEL));
GuiUtils.sizeUniformly(Sizing.Both, ok, cancel);
-
+
shortcutTrigger = new JLabel(PixelleBundle.getString(PixelleBundle.SHORTCUTS));
shortcutTrigger.setBorder(BorderFactory.createEtchedBorder());
shortcutTrigger.setEnabled(true);
shortcutTrigger.setOpaque(true);
-
- shortcuts = buildShortCutsMenu();
-
+
+ buildShortCutsMenu();
+
JPanel p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
p.add(Box.createHorizontalStrut(20));
@@ -107,42 +108,46 @@
p.add(Box.createHorizontalStrut(10));
p.add(cancel);
p.add(Box.createHorizontalStrut(20));
-
+
cp.add(p, BorderLayout.SOUTH);
}
-
+
private void initListeners() {
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-
+
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
isOK = true;
dispose();
}
});
-
+
cancel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
dispose();
}
});
-
- shortcutTrigger.addMouseListener(new MouseAdapter() {
+
+ shortcutTrigger.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
shortcuts.show(e.getComponent(), e.getX(), e.getY());
}
});
}
-
+
public String getText() {
return algo.getText();
}
-
- private JPopupMenu buildShortCutsMenu()
+
+ private void buildShortCutsMenu()
{
- JPopupMenu menu = new JPopupMenu(PixelleBundle.getString(PixelleBundle.SHORTCUTS));
-
+ if (shortcuts != null) {
+ return;
+ }
+
+ shortcuts = new JPopupMenu(PixelleBundle.getString(PixelleBundle.SHORTCUTS));
+
JMenu posMenu = new JMenu(PixelleBundle.getString(PixelleBundle.POSITIONS));
JMenuItem leftItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.LEFT));
JMenuItem topItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.TOP));
@@ -150,14 +155,28 @@
JMenuItem bottomItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.BOTTOM));
JMenuItem centerXItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.CENTERX));
JMenuItem centerYItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.CENTERY));
- posMenu.add(leftItem);
- posMenu.add(topItem);
- posMenu.add(rightItem);
+ posMenu.add(leftItem);
+ posMenu.add(topItem);
+ posMenu.add(rightItem);
posMenu.add(bottomItem);
posMenu.add(centerXItem);
posMenu.add(centerYItem);
- menu.add(posMenu);
-
- return menu;
+ shortcuts.add(posMenu);
+
+ addSimpleShortCutListener(leftItem, "0");
+ addSimpleShortCutListener(topItem, "0");
+ addSimpleShortCutListener(rightItem, "width");
+ addSimpleShortCutListener(bottomItem, "height");
+ addSimpleShortCutListener(centerXItem, "(width/2)");
+ addSimpleShortCutListener(centerYItem, "(height/2)");
}
+
+ private void addSimpleShortCutListener(JMenuItem mi, final String sc) {
+ mi.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent ae) {
+ algo.replaceSelection(sc);
+ }
+ });
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-07-18 18:42:05
|
Revision: 273
http://pixelle.svn.sourceforge.net/pixelle/?rev=273&view=rev
Author: dbrosius
Date: 2009-07-18 18:42:04 +0000 (Sat, 18 Jul 2009)
Log Message:
-----------
add items to shortcuts menu
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-07-18 03:59:06 UTC (rev 272)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2009-07-18 18:42:04 UTC (rev 273)
@@ -102,6 +102,13 @@
public static final String OUTPUT_PROPERTIES = "label.output_properties";
public static final String PICK_SOURCE_LABEL = "label.pick_source";
public static final String SHORTCUTS = "label.shortcuts";
+ public static final String POSITIONS = "label.positions";
+ public static final String LEFT = "label.left";
+ public static final String TOP = "label.top";
+ public static final String RIGHT = "label.right";
+ public static final String BOTTOM = "label.bottom";
+ public static final String CENTERX= "label.centerx";
+ public static final String CENTERY= "label.centerx";
private static ResourceBundle rb = ResourceBundle.getBundle("com/mebigfatguy/pixelle/resources/pixelle");
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 03:59:06 UTC (rev 272)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-18 18:42:04 UTC (rev 273)
@@ -35,6 +35,7 @@
import javax.swing.JEditorPane;
import javax.swing.JLabel;
import javax.swing.JMenu;
+import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
@@ -126,22 +127,11 @@
}
});
- shortcutTrigger.addMouseListener(new MouseAdapter() {
- public void mousePressed(MouseEvent e) {
- maybeShowPopup(e);
- }
-
- public void mouseReleased(MouseEvent e) {
- maybeShowPopup(e);
- }
-
- private void maybeShowPopup(MouseEvent e) {
- if (e.isPopupTrigger()) {
- shortcuts.show(e.getComponent(), e.getX(), e.getY());
- }
- }
-
-
+ shortcutTrigger.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ shortcuts.show(e.getComponent(), e.getX(), e.getY());
+ }
});
}
@@ -153,7 +143,20 @@
{
JPopupMenu menu = new JPopupMenu(PixelleBundle.getString(PixelleBundle.SHORTCUTS));
- menu.add(new JMenu("Positions"));
+ JMenu posMenu = new JMenu(PixelleBundle.getString(PixelleBundle.POSITIONS));
+ JMenuItem leftItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.LEFT));
+ JMenuItem topItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.TOP));
+ JMenuItem rightItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.RIGHT));
+ JMenuItem bottomItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.BOTTOM));
+ JMenuItem centerXItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.CENTERX));
+ JMenuItem centerYItem = new JMenuItem(PixelleBundle.getString(PixelleBundle.CENTERY));
+ posMenu.add(leftItem);
+ posMenu.add(topItem);
+ posMenu.add(rightItem);
+ posMenu.add(bottomItem);
+ posMenu.add(centerXItem);
+ posMenu.add(centerYItem);
+ menu.add(posMenu);
return menu;
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-07-18 03:59:06 UTC (rev 272)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2009-07-18 18:42:04 UTC (rev 273)
@@ -110,4 +110,12 @@
label.output_properties = Output Properties
label.pick_source = Select the input source window to use in the transformation
-label.shortcuts = ShortCuts
\ No newline at end of file
+label.shortcuts = ShortCuts
+
+label.positions = Positions
+label.left = Left
+label.top = Top
+label.right = Right
+label.bottom = Bottom
+label.centerx = Center.X
+label.centery = Center.Y
\ No newline at end of file
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties 2009-07-18 03:59:06 UTC (rev 272)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle_de.properties 2009-07-18 18:42:04 UTC (rev 273)
@@ -110,4 +110,12 @@
label.output_properties = Output-Eigenschaften
label.pick_source = W\xE4hlen Sie die Eingangsquelle Fenster zur Verwendung in der Transformation
-label.shortcuts = Schnellzugriffe
\ No newline at end of file
+label.shortcuts = Schnellzugriffe
+
+label.positions = Positionen
+label.left = Verlie\xDF
+label.top = Spitze
+label.right = Richtig
+label.bottom = Boden
+label.centerx = Center.X
+label.centery = Center.Y
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|