Revision: 18266
          http://sourceforge.net/p/gate/code/18266
Author:   markagreenwood
Date:     2014-08-21 10:13:44 +0000 (Thu, 21 Aug 2014)
Log Message:
-----------
added support for exporting GATE documents in the twitter inspired json format

Added Paths:
-----------
    gate/trunk/plugins/Twitter/src/gate/corpora/export/
    gate/trunk/plugins/Twitter/src/gate/corpora/export/GATEJsonExporter.java
    gate/trunk/plugins/Twitter/src/gate/resources/img/svg/GATEJSON.svg
    gate/trunk/plugins/Twitter/src/gate/resources/img/svg/GATEJSONIcon.java

Added: gate/trunk/plugins/Twitter/src/gate/corpora/export/GATEJsonExporter.java
===================================================================
--- gate/trunk/plugins/Twitter/src/gate/corpora/export/GATEJsonExporter.java    
                        (rev 0)
+++ gate/trunk/plugins/Twitter/src/gate/corpora/export/GATEJsonExporter.java    
2014-08-21 10:13:44 UTC (rev 18266)
@@ -0,0 +1,87 @@
+package gate.corpora.export;
+
+/*
+ *  Copyright (c) 1995-2014, The University of Sheffield. See the file
+ *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
+ *
+ *  This file is part of GATE (see http://gate.ac.uk/), and is free
+ *  software, licenced under the GNU Library General Public License,
+ *  Version 2, June 1991 (in the distribution as file licence.html,
+ *  and also available at http://gate.ac.uk/gate/licence.html).
+ *
+ *  Mark A. Greenwood 17/07/2014
+ *
+ */
+
+import gate.Annotation;
+import gate.AnnotationSet;
+import gate.Document;
+import gate.DocumentExporter;
+import gate.FeatureMap;
+import gate.corpora.DocumentJsonUtils;
+import gate.creole.metadata.AutoInstance;
+import gate.creole.metadata.CreoleParameter;
+import gate.creole.metadata.CreoleResource;
+import gate.creole.metadata.Optional;
+import gate.creole.metadata.RunTime;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+@CreoleResource(name = "GATE JSON Exporter", tool = true, autoinstances = 
@AutoInstance, icon = "GATEJSON")
+public class GATEJsonExporter extends DocumentExporter {
+
+  private static final long serialVersionUID = -8087536348560365618L;
+
+  private String annotationSetName;
+  
+  private Set<String> annotationTypes;
+
+  public String getAnnotationSetName() {
+    return annotationSetName;
+  }
+
+  @RunTime
+  @Optional
+  @CreoleParameter
+  public void setAnnotationSetName(String annotationSetName) {
+    this.annotationSetName = annotationSetName;
+  }
+
+  public Set<String> getAnnotationTypes() {
+    return annotationTypes;
+  }
+
+  @RunTime
+  @CreoleParameter
+  public void setAnnotationTypes(Set<String> annotationTypes) {
+    this.annotationTypes = annotationTypes;
+  }
+
+  public GATEJsonExporter() {
+    super("GATE JSON", "json","application/json");
+  }
+
+  @SuppressWarnings("unchecked")
+  @Override
+  public void export(Document doc, OutputStream out, FeatureMap options)
+    throws IOException {
+
+    AnnotationSet annots =
+      doc.getAnnotations((String)options.get("annotationSetName"));
+    
+    Collection<String> types = 
(Collection<String>)options.get("annotationTypes");
+    
+    Map<String,Collection<Annotation>> annotationsMap = new 
HashMap<String,Collection<Annotation>>();
+    
+    for (String type : types) {
+      annotationsMap.put(type, annots.get(type));
+    }
+
+    DocumentJsonUtils.writeDocument(doc, annotationsMap, out);
+  }
+}

Added: gate/trunk/plugins/Twitter/src/gate/resources/img/svg/GATEJSON.svg
===================================================================
--- gate/trunk/plugins/Twitter/src/gate/resources/img/svg/GATEJSON.svg          
                (rev 0)
+++ gate/trunk/plugins/Twitter/src/gate/resources/img/svg/GATEJSON.svg  
2014-08-21 10:13:44 UTC (rev 18266)
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="48.000355"
+   height="48"
+   style="fill-opacity:1;fill-rule:evenodd;stroke:none"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="GATEXML.svg">
+  <metadata
+     id="metadata80">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="2048"
+     inkscape:window-height="1128"
+     id="namedview78"
+     showgrid="false"
+     fit-margin-top="4"
+     fit-margin-left="4"
+     fit-margin-right="4"
+     fit-margin-bottom="4"
+     inkscape:zoom="1.5104"
+     inkscape:cx="52.830414"
+     inkscape:cy="-10.891349"
+     inkscape:window-x="0"
+     inkscape:window-y="24"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg2" />
+  <defs
+     id="defs4">
+    <linearGradient
+       id="gr1">
+      <stop
+         offset="0"
+         style="stop-color:#000000;stop-opacity:0.1"
+         id="stop7" />
+      <stop
+         offset="1"
+         style="stop-color:#000000;stop-opacity:0"
+         id="stop9" />
+    </linearGradient>
+    <linearGradient
+       id="gr2"
+       xlink:href="#gr1"
+       x1="0.052000001"
+       y1="0.977"
+       x2="0.78299999"
+       y2="0" />
+    <linearGradient
+       id="gr3">
+      <stop
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:1"
+         id="stop13" />
+      <stop
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:0"
+         id="stop15" />
+    </linearGradient>
+    <linearGradient
+       id="gr4"
+       xlink:href="#gr3"
+       x1="1.557"
+       y1="-0.55299997"
+       x2="0.063000001"
+       y2="0.54699999" />
+    <linearGradient
+       id="gr5">
+      <stop
+         offset="0"
+         style="stop-color:#dadada;stop-opacity:1"
+         id="stop19" />
+      <stop
+         offset="0.35"
+         style="stop-color:#f1f1f1;stop-opacity:1"
+         id="stop21" />
+      <stop
+         offset="1"
+         style="stop-color:#f0f0f0;stop-opacity:1"
+         id="stop23" />
+    </linearGradient>
+    <linearGradient
+       id="gr6"
+       xlink:href="#gr5"
+       x1="0.88"
+       y1="0.211"
+       x2="0.085000001"
+       y2="1.1799999" />
+    <linearGradient
+       id="gr7"
+       xlink:href="#gr5"
+       x1="0.63200003"
+       y1="0.32800001"
+       x2="-0.37599999"
+       y2="1.3279999" />
+    <path
+       id="pathTagXML"
+       d="m 4.2424884,2.9393196 2.9238281,0 1.5234375,2.6425781 
1.476563,-2.6425781 2.894531,0 -2.671875,4.1601563 2.923828,4.4296871 
-2.982422,0 -1.6933594,-2.7597653 -1.6992187,2.7597653 -2.9648438,0 L 
6.9378009,7.0526009 4.2424884,2.9393196 z m 9.8906246,0 3.492188,0 
1.347656,5.2265625 1.341797,-5.2265625 3.480469,0 0,8.5898434 -2.167969,0 
0,-6.5507809 -1.681641,6.5507809 -1.96289,0 -1.675781,-6.5507809 0,6.5507809 
-2.173829,0 0,-8.5898434 z m 11.34961,0 2.654297,0 0,6.4746094 4.142578,0 
0,2.115234 -6.796875,0 0,-8.5898434 z"
+       inkscape:connector-curvature="0" />
+    <linearGradient
+       x1="-666.11664"
+       y1="413.04492"
+       x2="-553.2699"
+       y2="525.90759"
+       id="linearGradient3005"
+       xlink:href="#linearGradient8385"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.99884,0,0,0.998699,689.00774,-388.84375)" />
+    <linearGradient
+       id="linearGradient8385">
+      <stop
+         id="stop8387"
+         style="stop-color:#000000;stop-opacity:1"
+         offset="0" />
+      <stop
+         id="stop8389"
+         style="stop-color:#ffffff;stop-opacity:1"
+         offset="1" />
+    </linearGradient>
+    <linearGradient
+       x1="-553.26971"
+       y1="525.90778"
+       x2="-666.11639"
+       y2="413.0452"
+       id="linearGradient3002"
+       xlink:href="#linearGradient8385"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.99884,0,0,0.998699,689.00774,-388.84375)" />
+    <linearGradient
+       id="linearGradient3009">
+      <stop
+         id="stop3011"
+         style="stop-color:#000000;stop-opacity:1"
+         offset="0" />
+      <stop
+         id="stop3013"
+         style="stop-color:#ffffff;stop-opacity:1"
+         offset="1" />
+    </linearGradient>
+    <linearGradient
+       y2="413.0452"
+       x2="-666.11639"
+       y1="525.90778"
+       x1="-553.26971"
+       gradientTransform="matrix(0.99884,0,0,0.998699,689.00774,-388.84375)"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient3018"
+       xlink:href="#linearGradient8385"
+       inkscape:collect="always" />
+  </defs>
+  <g
+     id="g3120"
+     transform="matrix(0.85000001,0,0,0.85000001,4,-2.7999991)">
+    <path
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="zccz"
+       id="path2107"
+       d="M 39.186288,27.999989 C 39.320816,51.410986 0.81336001,46.822825 
0.81336001,46.822825 l 0,-37.645664 c 0,0 38.23841599,-4.5881373 
38.37292799,18.822828 z"
+       
style="fill:#ffffff;fill-opacity:1;stroke:#008000;stroke-width:1.62672007;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
 />
+    <path
+       d="m 30.316798,39.760696 -15.276803,0 c -3.496545,0 
-6.3946732,-1.161601 -8.6944018,-3.484801 -2.2762645,-2.323201 
-3.4144007,-5.256529 -3.4144007,-8.800002 0,-3.519985 1.1264002,-6.359449 
3.3792007,-8.518402 2.2762646,-2.158912 5.1861288,-3.238377 8.7296018,-3.238401 
l 13.587203,0 0,4.188801 -13.587203,0 c -2.299744,1.6e-5 -4.200545,0.739216 
-5.702401,2.217601 -1.4784085,1.478416 -2.2176006,3.379208 -2.2176006,5.702401 
0,2.299744 0.7391921,4.165337 2.2176006,5.596801 1.501856,1.431472 
3.402657,2.147201 5.702401,2.147201 l 11.088003,0 0,-5.244801 -11.404803,0 
0,-3.836801 15.593603,0 0,13.270403"
+       
style="font-size:44px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:justify;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ff0000;fill-opacity:1;stroke:#800000;stroke-width:0.80000019;font-family:Good
 Times;-inkscape-font-specification:Good Times"
+       id="path3004"
+       inkscape:connector-curvature="0" />
+  </g>
+  <g
+     id="g2990"
+     transform="matrix(0.1375,0,0,0.1375,23.352755,23.226687)">
+    <path
+       inkscape:connector-curvature="0"
+       
style="color:#000000;fill:url(#linearGradient3005);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.5;marker:none;visibility:visible;display:inline;overflow:visible"
+       id="path7508"
+       d="m 79.8646,119.09957 c 35.39768,48.25534 70.03957,-13.46852 
69.98868,-50.58675 C 149.79308,24.62677 105.31237,0.09913 79.8356,0.09913 
38.94318,0.09913 0,33.89521 0,80.13502 c 0,51.396 44.64038,79.86497 
79.8356,79.86497 -7.96447,-1.14675 -34.5062,-6.83395 -34.86292,-67.96677 
-0.23987,-41.3466 13.48757,-57.86551 34.80527,-50.59905 0.47743,0.17707 
23.51392,9.26451 23.51392,38.95053 0,29.55992 -23.42727,38.71487 
-23.42727,38.71487 z" />
+    <path
+       inkscape:connector-curvature="0"
+       
style="color:#000000;fill:url(#linearGradient3018);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.5;marker:none;visibility:visible;display:inline;overflow:visible"
+       id="path7510"
+       d="M 79.82327,41.40081 C 56.43322,33.33893 27.78025,52.61662 
27.78025,91.22962 c 0,63.04798 46.72055,68.77037 52.38416,68.77037 C 
121.05683,159.99999 160,126.20391 160,79.9641 160,28.5681 115.35962,0.09913 
80.16441,0.09913 c 9.74811,-1.35 52.54087,10.54991 52.54087,69.0368 0,38.14117 
-31.95286,58.90496 -52.73547,50.03344 -0.47743,-0.17707 -23.51392,-9.26451 
-23.51392,-38.95053 0,-29.55992 23.36738,-38.81803 23.36738,-38.81803 z" />
+  </g>
+</svg>

Added: gate/trunk/plugins/Twitter/src/gate/resources/img/svg/GATEJSONIcon.java
===================================================================
--- gate/trunk/plugins/Twitter/src/gate/resources/img/svg/GATEJSONIcon.java     
                        (rev 0)
+++ gate/trunk/plugins/Twitter/src/gate/resources/img/svg/GATEJSONIcon.java     
2014-08-21 10:13:44 UTC (rev 18266)
@@ -0,0 +1,348 @@
+package gate.resources.img.svg;
+
+import java.awt.*;
+import java.awt.geom.*;
+import java.awt.image.*;
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import javax.imageio.ImageIO;
+
+/**
+ * This class has been automatically generated using <a
+ * 
href="http://englishjavadrinker.blogspot.com/search/label/SVGRoundTrip";>SVGRoundTrip</a>.
+ */
+@SuppressWarnings("unused")
+public class GATEJSONIcon implements
+               javax.swing.Icon {
+       /**
+        * Paints the transcoded SVG image on the specified graphics context. 
You
+        * can install a custom transformation on the graphics context to scale 
the
+        * image.
+        * 
+        * @param g
+        *            Graphics context.
+        */
+       public static void paint(Graphics2D g) {
+        Shape shape = null;
+        Paint paint = null;
+        Stroke stroke = null;
+        Area clip = null;
+         
+        float origAlpha = 1.0f;
+        Composite origComposite = g.getComposite();
+        if (origComposite instanceof AlphaComposite) {
+            AlphaComposite origAlphaComposite = 
+                (AlphaComposite)origComposite;
+            if (origAlphaComposite.getRule() == AlphaComposite.SRC_OVER) {
+                origAlpha = origAlphaComposite.getAlpha();
+            }
+        }
+        
+           Shape clip_ = g.getClip();
+AffineTransform defaultTransform_ = g.getTransform();
+//  is CompositeGraphicsNode
+float alpha__0 = origAlpha;
+origAlpha = origAlpha * 1.0f;
+g.setComposite(AlphaComposite.getInstance(3, origAlpha));
+Shape clip__0 = g.getClip();
+AffineTransform defaultTransform__0 = g.getTransform();
+g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
+clip = new Area(g.getClip());
+clip.intersect(new Area(new 
Rectangle2D.Double(0.0,0.0,48.0003547668457,48.0)));
+g.setClip(clip);
+// _0 is CompositeGraphicsNode
+float alpha__0_0 = origAlpha;
+origAlpha = origAlpha * 1.0f;
+g.setComposite(AlphaComposite.getInstance(3, origAlpha));
+Shape clip__0_0 = g.getClip();
+AffineTransform defaultTransform__0_0 = g.getTransform();
+g.transform(new AffineTransform(0.8500000238418579f, 0.0f, 0.0f, 
0.8500000238418579f, 4.0f, -2.7999989986419678f));
+// _0_0 is CompositeGraphicsNode
+float alpha__0_0_0 = origAlpha;
+origAlpha = origAlpha * 1.0f;
+g.setComposite(AlphaComposite.getInstance(3, origAlpha));
+Shape clip__0_0_0 = g.getClip();
+AffineTransform defaultTransform__0_0_0 = g.getTransform();
+g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
+// _0_0_0 is ShapeNode
+paint = new Color(255, 255, 255, 255);
+shape = new GeneralPath();
+((GeneralPath)shape).moveTo(39.186287, 27.999989);
+((GeneralPath)shape).curveTo(39.320816, 51.410988, 0.81336004, 46.822826, 
0.81336004, 46.822826);
+((GeneralPath)shape).lineTo(0.81336004, 9.177162);
+((GeneralPath)shape).curveTo(0.81336004, 9.177162, 39.051773, 4.589025, 
39.186287, 27.99999);
+((GeneralPath)shape).closePath();
+g.setPaint(paint);
+g.fill(shape);
+paint = new Color(0, 128, 0, 255);
+stroke = new BasicStroke(1.6267201f,0,0,4.0f,null,0.0f);
+shape = new GeneralPath();
+((GeneralPath)shape).moveTo(39.186287, 27.999989);
+((GeneralPath)shape).curveTo(39.320816, 51.410988, 0.81336004, 46.822826, 
0.81336004, 46.822826);
+((GeneralPath)shape).lineTo(0.81336004, 9.177162);
+((GeneralPath)shape).curveTo(0.81336004, 9.177162, 39.051773, 4.589025, 
39.186287, 27.99999);
+((GeneralPath)shape).closePath();
+g.setPaint(paint);
+g.setStroke(stroke);
+g.draw(shape);
+origAlpha = alpha__0_0_0;
+g.setTransform(defaultTransform__0_0_0);
+g.setClip(clip__0_0_0);
+float alpha__0_0_1 = origAlpha;
+origAlpha = origAlpha * 1.0f;
+g.setComposite(AlphaComposite.getInstance(3, origAlpha));
+Shape clip__0_0_1 = g.getClip();
+AffineTransform defaultTransform__0_0_1 = g.getTransform();
+g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
+// _0_0_1 is ShapeNode
+paint = new Color(255, 0, 0, 255);
+shape = new GeneralPath();
+((GeneralPath)shape).moveTo(30.316797, 39.760696);
+((GeneralPath)shape).lineTo(15.039994, 39.760696);
+((GeneralPath)shape).curveTo(11.543449, 39.760696, 8.645321, 38.599094, 
6.3455925, 36.275894);
+((GeneralPath)shape).curveTo(4.0693283, 33.952694, 2.9311917, 31.019365, 
2.9311917, 27.475891);
+((GeneralPath)shape).curveTo(2.9311917, 23.955906, 4.057592, 21.116442, 
6.3103924, 18.957489);
+((GeneralPath)shape).curveTo(8.586657, 16.798576, 11.496521, 15.719112, 
15.039994, 15.719088);
+((GeneralPath)shape).lineTo(28.627197, 15.719088);
+((GeneralPath)shape).lineTo(28.627197, 19.907888);
+((GeneralPath)shape).lineTo(15.039994, 19.907888);
+((GeneralPath)shape).curveTo(12.740251, 19.907904, 10.839449, 20.647104, 
9.337593, 22.12549);
+((GeneralPath)shape).curveTo(7.8591847, 23.603907, 7.1199923, 25.504698, 
7.1199923, 27.827892);
+((GeneralPath)shape).curveTo(7.1199923, 30.127636, 7.8591843, 31.993229, 
9.337593, 33.424694);
+((GeneralPath)shape).curveTo(10.839449, 34.856167, 12.74025, 35.571896, 
15.039994, 35.571896);
+((GeneralPath)shape).lineTo(26.127998, 35.571896);
+((GeneralPath)shape).lineTo(26.127998, 30.327095);
+((GeneralPath)shape).lineTo(14.723195, 30.327095);
+((GeneralPath)shape).lineTo(14.723195, 26.490294);
+((GeneralPath)shape).lineTo(30.3168, 26.490294);
+((GeneralPath)shape).lineTo(30.3168, 39.760696);
+g.setPaint(paint);
+g.fill(shape);
+paint = new Color(128, 0, 0, 255);
+stroke = new BasicStroke(0.8000002f,0,0,4.0f,null,0.0f);
+shape = new GeneralPath();
+((GeneralPath)shape).moveTo(30.316797, 39.760696);
+((GeneralPath)shape).lineTo(15.039994, 39.760696);
+((GeneralPath)shape).curveTo(11.543449, 39.760696, 8.645321, 38.599094, 
6.3455925, 36.275894);
+((GeneralPath)shape).curveTo(4.0693283, 33.952694, 2.9311917, 31.019365, 
2.9311917, 27.475891);
+((GeneralPath)shape).curveTo(2.9311917, 23.955906, 4.057592, 21.116442, 
6.3103924, 18.957489);
+((GeneralPath)shape).curveTo(8.586657, 16.798576, 11.496521, 15.719112, 
15.039994, 15.719088);
+((GeneralPath)shape).lineTo(28.627197, 15.719088);
+((GeneralPath)shape).lineTo(28.627197, 19.907888);
+((GeneralPath)shape).lineTo(15.039994, 19.907888);
+((GeneralPath)shape).curveTo(12.740251, 19.907904, 10.839449, 20.647104, 
9.337593, 22.12549);
+((GeneralPath)shape).curveTo(7.8591847, 23.603907, 7.1199923, 25.504698, 
7.1199923, 27.827892);
+((GeneralPath)shape).curveTo(7.1199923, 30.127636, 7.8591843, 31.993229, 
9.337593, 33.424694);
+((GeneralPath)shape).curveTo(10.839449, 34.856167, 12.74025, 35.571896, 
15.039994, 35.571896);
+((GeneralPath)shape).lineTo(26.127998, 35.571896);
+((GeneralPath)shape).lineTo(26.127998, 30.327095);
+((GeneralPath)shape).lineTo(14.723195, 30.327095);
+((GeneralPath)shape).lineTo(14.723195, 26.490294);
+((GeneralPath)shape).lineTo(30.3168, 26.490294);
+((GeneralPath)shape).lineTo(30.3168, 39.760696);
+g.setPaint(paint);
+g.setStroke(stroke);
+g.draw(shape);
+origAlpha = alpha__0_0_1;
+g.setTransform(defaultTransform__0_0_1);
+g.setClip(clip__0_0_1);
+origAlpha = alpha__0_0;
+g.setTransform(defaultTransform__0_0);
+g.setClip(clip__0_0);
+float alpha__0_1 = origAlpha;
+origAlpha = origAlpha * 1.0f;
+g.setComposite(AlphaComposite.getInstance(3, origAlpha));
+Shape clip__0_1 = g.getClip();
+AffineTransform defaultTransform__0_1 = g.getTransform();
+g.transform(new AffineTransform(0.13750000298023224f, 0.0f, 0.0f, 
0.13750000298023224f, 23.352754592895508f, 23.226686477661133f));
+// _0_1 is CompositeGraphicsNode
+float alpha__0_1_0 = origAlpha;
+origAlpha = origAlpha * 1.0f;
+g.setComposite(AlphaComposite.getInstance(3, origAlpha));
+Shape clip__0_1_0 = g.getClip();
+AffineTransform defaultTransform__0_1_0 = g.getTransform();
+g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
+// _0_1_0 is ShapeNode
+paint = new LinearGradientPaint(new Point2D.Double(-666.1166381835938, 
413.044921875), new Point2D.Double(-553.2698974609375, 525.9075927734375), new 
float[] {0.0f,1.0f}, new Color[] {new Color(0, 0, 0, 255),new Color(255, 255, 
255, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, 
MultipleGradientPaint.ColorSpaceType.SRGB, new 
AffineTransform(0.9988399744033813f, 0.0f, 0.0f, 0.9986990094184875f, 
689.0077514648438f, -388.84375f));
+shape = new GeneralPath();
+((GeneralPath)shape).moveTo(79.8646, 119.09957);
+((GeneralPath)shape).curveTo(115.26228, 167.35492, 149.90417, 105.63105, 
149.85327, 68.51282);
+((GeneralPath)shape).curveTo(149.79308, 24.62677, 105.31237, 0.09913, 79.8356, 
0.09913);
+((GeneralPath)shape).curveTo(38.94318, 0.09913, 0.0, 33.89521, 0.0, 80.13502);
+((GeneralPath)shape).curveTo(0.0, 131.53102, 44.64038, 159.99998, 79.8356, 
159.99998);
+((GeneralPath)shape).curveTo(71.87113, 158.85324, 45.329403, 153.16603, 
44.972683, 92.03322);
+((GeneralPath)shape).curveTo(44.732815, 50.68662, 58.46025, 34.16771, 
79.777954, 41.43417);
+((GeneralPath)shape).curveTo(80.25539, 41.61124, 103.29187, 50.69868, 
103.29187, 80.384705);
+((GeneralPath)shape).curveTo(103.29187, 109.944626, 79.8646, 119.09958, 
79.8646, 119.09958);
+((GeneralPath)shape).closePath();
+g.setPaint(paint);
+g.fill(shape);
+origAlpha = alpha__0_1_0;
+g.setTransform(defaultTransform__0_1_0);
+g.setClip(clip__0_1_0);
+float alpha__0_1_1 = origAlpha;
+origAlpha = origAlpha * 1.0f;
+g.setComposite(AlphaComposite.getInstance(3, origAlpha));
+Shape clip__0_1_1 = g.getClip();
+AffineTransform defaultTransform__0_1_1 = g.getTransform();
+g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
+// _0_1_1 is ShapeNode
+paint = new LinearGradientPaint(new Point2D.Double(-553.2697143554688, 
525.9077758789062), new Point2D.Double(-666.1163940429688, 413.0451965332031), 
new float[] {0.0f,1.0f}, new Color[] {new Color(0, 0, 0, 255),new Color(255, 
255, 255, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, 
MultipleGradientPaint.ColorSpaceType.SRGB, new 
AffineTransform(0.9988399744033813f, 0.0f, 0.0f, 0.9986990094184875f, 
689.0077514648438f, -388.84375f));
+shape = new GeneralPath();
+((GeneralPath)shape).moveTo(79.82327, 41.40081);
+((GeneralPath)shape).curveTo(56.43322, 33.33893, 27.78025, 52.61662, 27.78025, 
91.22962);
+((GeneralPath)shape).curveTo(27.78025, 154.2776, 74.5008, 160.0, 80.16441, 
160.0);
+((GeneralPath)shape).curveTo(121.05683, 159.99998, 160.0, 126.20391, 160.0, 
79.9641);
+((GeneralPath)shape).curveTo(160.0, 28.5681, 115.35962, 0.09913, 80.16441, 
0.09913);
+((GeneralPath)shape).curveTo(89.91252, -1.25087, 132.70529, 10.649039, 
132.70529, 69.135925);
+((GeneralPath)shape).curveTo(132.70529, 107.2771, 100.75243, 128.0409, 
79.96982, 119.169365);
+((GeneralPath)shape).curveTo(79.492386, 118.992294, 56.4559, 109.904854, 
56.4559, 80.218834);
+((GeneralPath)shape).curveTo(56.4559, 50.658913, 79.82328, 41.400803, 
79.82328, 41.400803);
+((GeneralPath)shape).closePath();
+g.setPaint(paint);
+g.fill(shape);
+origAlpha = alpha__0_1_1;
+g.setTransform(defaultTransform__0_1_1);
+g.setClip(clip__0_1_1);
+origAlpha = alpha__0_1;
+g.setTransform(defaultTransform__0_1);
+g.setClip(clip__0_1);
+origAlpha = alpha__0;
+g.setTransform(defaultTransform__0);
+g.setClip(clip__0);
+g.setTransform(defaultTransform_);
+g.setClip(clip_);
+
+       }
+       
+       public Image getImage() {
+               BufferedImage image =
+            new BufferedImage(getIconWidth(), getIconHeight(),
+                    BufferedImage.TYPE_INT_ARGB);
+       Graphics2D g = image.createGraphics();
+       paintIcon(null, g, 0, 0);
+       g.dispose();
+       return image;
+       }
+
+    /**
+     * Returns the X of the bounding box of the original SVG image.
+     * 
+     * @return The X of the bounding box of the original SVG image.
+     */
+    public static int getOrigX() {
+        return 4;
+    }
+
+    /**
+     * Returns the Y of the bounding box of the original SVG image.
+     * 
+     * @return The Y of the bounding box of the original SVG image.
+     */
+    public static int getOrigY() {
+        return 2;
+    }
+
+       /**
+        * Returns the width of the bounding box of the original SVG image.
+        * 
+        * @return The width of the bounding box of the original SVG image.
+        */
+       public static int getOrigWidth() {
+               return 48;
+       }
+
+       /**
+        * Returns the height of the bounding box of the original SVG image.
+        * 
+        * @return The height of the bounding box of the original SVG image.
+        */
+       public static int getOrigHeight() {
+               return 48;
+       }
+
+       /**
+        * The current width of this resizable icon.
+        */
+       int width;
+
+       /**
+        * The current height of this resizable icon.
+        */
+       int height;
+
+       /**
+        * Creates a new transcoded SVG image.
+        */
+       public GATEJSONIcon() {
+        this.width = getOrigWidth();
+        this.height = getOrigHeight();
+       }
+       
+       /**
+        * Creates a new transcoded SVG image with the given dimensions.
+        *
+        * @param size the dimensions of the icon
+        */
+       public GATEJSONIcon(Dimension size) {
+       this.width = size.width;
+       this.height = size.width;
+       }
+
+       public GATEJSONIcon(int width, int height) {
+       this.width = width;
+       this.height = height;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see javax.swing.Icon#getIconHeight()
+        */
+    @Override
+       public int getIconHeight() {
+               return height;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see javax.swing.Icon#getIconWidth()
+        */
+    @Override
+       public int getIconWidth() {
+               return width;
+       }
+
+       public void setDimension(Dimension newDimension) {
+               this.width = newDimension.width;
+               this.height = newDimension.height;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see javax.swing.Icon#paintIcon(java.awt.Component, 
java.awt.Graphics,
+        * int, int)
+        */
+    @Override
+       public void paintIcon(Component c, Graphics g, int x, int y) {
+               Graphics2D g2d = (Graphics2D) g.create();
+               g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                               RenderingHints.VALUE_ANTIALIAS_ON);
+               g2d.translate(x, y);
+                                               
+               Area clip = new Area(new Rectangle(0, 0, this.width, 
this.height));             
+               if (g2d.getClip() != null) clip.intersect(new 
Area(g2d.getClip()));             
+               g2d.setClip(clip);
+
+               double coef1 = (double) this.width / (double) getOrigWidth();
+               double coef2 = (double) this.height / (double) getOrigHeight();
+               double coef = Math.min(coef1, coef2);
+               g2d.scale(coef, coef);
+               paint(g2d);
+               g2d.dispose();
+       }
+}
+

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to