[Pixelle-commit] SF.net SVN: pixelle: [144] trunk/pixelle/src/com/mebigfatguy/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-07-06 21:08:22
|
Revision: 144
http://pixelle.svn.sourceforge.net/pixelle/?rev=144&view=rev
Author: dbrosius
Date: 2008-07-06 14:08:20 -0700 (Sun, 06 Jul 2008)
Log Message:
-----------
start adding saved algorithm sets
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xml
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xsd
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java 2008-07-06 21:08:20 UTC (rev 144)
@@ -0,0 +1,54 @@
+/*
+ * pixelle - Graphics algorithmic editor
+ * Copyright (C) 2008 Dave Brosius
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package com.mebigfatguy.pixelle;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.swing.JPopupMenu;
+
+public class AlgorithmArchiver {
+
+ private static AlgorithmArchiver archiver = new AlgorithmArchiver();
+
+ private Map<String, Map<String, Map<PixelleComponent, String>>> systemAlgorithms;
+ private Map<String, Map<String, Map<PixelleComponent, String>>> userAlgorithms;
+
+ private AlgorithmArchiver() {
+ systemAlgorithms = new HashMap<String, Map<String, Map<PixelleComponent, String>>>();
+ userAlgorithms = new HashMap<String, Map<String, Map<PixelleComponent, String>>>();
+
+ }
+
+ public static AlgorithmArchiver getArchiver() {
+ return archiver;
+ }
+
+ public JPopupMenu getAlgorithmDisplayPopup() {
+ return new JPopupMenu(PixelleBundle.getString(PixelleBundle.PIXEL_ALGORITHM));
+ }
+
+ public void addAlgorithm(String group, String name, Map<PixelleComponent, String> algorithm) {
+
+ }
+
+ public void removeAlgorithm(String group, String name) {
+
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/AlgorithmArchiver.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xml
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xml (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xml 2008-07-06 21:08:20 UTC (rev 144)
@@ -0,0 +1,43 @@
+<!--
+/*
+ * pixelle - Graphics algorithmic editor
+ * Copyright (C) 2008 Dave Brosius
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+-->
+<algorithms xmlns="http://pixelle.mebigfatguy.com/0.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.w3schools.com note.xsd">
+ <group name="Blends">
+ <algorithm name="simple">
+ <component name="red">
+ x
+ </component>
+ <component name="green">
+ y
+ </component>
+ <component name="blue">
+ width-x
+ </component>
+ <component name="transparency">
+ 255
+ </component>
+ <component name="selection">
+ 0
+ </component>
+ </algorithm>
+ </group>
+</algorithms>
\ No newline at end of file
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xsd
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xsd (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xsd 2008-07-06 21:08:20 UTC (rev 144)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://pixelle.mebigfatguy.com/0.1.0"
+ xmlns="http://pixelle.mebigfatguy.com/0.1.0"
+ elementFormDefault="qualified">
+ <xsd:complexType name="AlgorithmsClass">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="1" name="group" type="GroupClass"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="GroupClass">
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="algorithm" type="AlgorithmClass"/>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required"/>
+ </xsd:complexType>
+ <xsd:complexType name="AlgorithmClass">
+ <xsd:sequence>
+ <xsd:element maxOccurs="5" minOccurs="5" name="component" type="ComponentClass"/>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required"/>
+ </xsd:complexType>
+ <xsd:complexType name="ComponentClass">
+ <xsd:attribute name="name" type="NameClass" use="required"/>
+ </xsd:complexType>
+ <xsd:simpleType name="NameClass">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="transparency"/>
+ <xsd:enumeration value="red"/>
+ <xsd:enumeration value="blue"/>
+ <xsd:enumeration value="selection"/>
+ <xsd:enumeration value="green"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ <xsd:element name="algorithms" type="AlgorithmsClass"/>
+</xsd:schema>
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/algorithms.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|