[Pixelle-commit] SF.net SVN: pixelle:[259] trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs /Algor
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2009-07-17 04:53:28
|
Revision: 259
http://pixelle.svn.sourceforge.net/pixelle/?rev=259&view=rev
Author: dbrosius
Date: 2009-07-17 04:53:24 +0000 (Fri, 17 Jul 2009)
Log Message:
-----------
an algorithm popup editor
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.java 2009-07-17 04:53:24 UTC (rev 259)
@@ -0,0 +1,91 @@
+/*
+ * 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.BorderLayout;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Point;
+
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+import com.mebigfatguy.pixelle.AlgorithmType;
+import com.mebigfatguy.pixelle.PixelleBundle;
+import com.mebigfatguy.pixelle.utils.GuiUtils;
+import com.mebigfatguy.pixelle.utils.GuiUtils.Sizing;
+
+/**
+ * an expanded popup dialog for editing algorithms
+ */
+public class AlgorithmEditor extends JDialog {
+ private static final long serialVersionUID = 7704059483753204128L;
+
+ private JEditorPane algo;
+ private JButton ok;
+ private JButton cancel;
+
+ public AlgorithmEditor(AlgorithmType algorithm, Point pt, Dimension dim) {
+
+ initComponents();
+ initListeners();
+
+ setTitle(algorithm.toString());
+ setLocation(pt);
+ setSize(dim);
+
+
+
+
+ }
+
+ 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);
+
+ JPanel p = new JPanel();
+ p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
+ p.add(Box.createHorizontalGlue());
+ p.add(ok);
+ p.add(Box.createHorizontalStrut(10));
+ p.add(cancel);
+ p.add(Box.createHorizontalStrut(20));
+
+ cp.add(p, BorderLayout.SOUTH);
+ }
+
+ private void initListeners() {
+
+ }
+ public String getText() {
+ return algo.getText();
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/AlgorithmEditor.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.
|