deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.io.mapinfoapi
Class MIFStyle2SLD

java.lang.Object
  extended by org.deegree.io.mapinfoapi.MIFStyle2SLD

public class MIFStyle2SLD
extends java.lang.Object

MIFStyle2SLD

Version:
$Revision:$, $Date:$
Author:
Andreas Schmitz, last edited by: $Author:$

Constructor Summary
MIFStyle2SLD(java.lang.String symbolFont)
           
MIFStyle2SLD(java.net.URL symbolFont)
           
 
Method Summary
static void appendIDFilter(java.lang.String id, org.w3c.dom.Element rule)
           
static XMLFragment getSLDTemplate(java.lang.String name)
           
 XMLFragment getStyle(java.util.Map<java.lang.String,java.util.HashSet<java.util.HashMap<java.lang.String,java.lang.String>>> styles, java.lang.String name)
           
static void insertBrushStyle(java.util.Map<java.lang.String,java.lang.String> map, XMLFragment doc, java.lang.String name)
           
static void insertPenStyle(java.util.Map<java.lang.String,java.lang.String> map, XMLFragment doc)
           
 void insertSymbolStyle(java.util.Map<java.lang.String,java.lang.String> map, XMLFragment doc)
           
static void insertTextStyle(java.util.Map<java.lang.String,java.lang.String> map, XMLFragment doc)
           
static java.lang.String multiplyPattern(java.lang.String pattern, int mult)
           
static java.awt.image.BufferedImage renderSVGImage(XMLFragment doc, int size)
           
static java.awt.image.BufferedImage symbolFromFont(java.awt.Font font, char theChar, int size, java.awt.Color color)
           
static java.awt.image.BufferedImage symbolFromTwoChars(java.awt.Font font, char theChar1, char theChar2, int size, java.awt.Color color1, java.awt.Color color2)
           
static java.lang.String toHexColor(java.awt.Color col)
           
static void updateFillPatternSVG(XMLFragment doc, java.lang.String foreground, java.lang.String background)
           
static void updateSVGColors(XMLFragment doc, java.lang.String fill, java.lang.String stroke)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MIFStyle2SLD

public MIFStyle2SLD(java.lang.String symbolFont)
             throws java.awt.FontFormatException,
                    java.io.IOException
Parameters:
symbolFont -
Throws:
java.awt.FontFormatException
java.io.IOException

MIFStyle2SLD

public MIFStyle2SLD(java.net.URL symbolFont)
             throws java.awt.FontFormatException,
                    java.io.IOException
Parameters:
symbolFont -
Throws:
java.awt.FontFormatException
java.io.IOException
Method Detail

getSLDTemplate

public static XMLFragment getSLDTemplate(java.lang.String name)
Parameters:
name - the layer name
Returns:
an empty SLD document

appendIDFilter

public static void appendIDFilter(java.lang.String id,
                                  org.w3c.dom.Element rule)
Parameters:
id -
rule -

insertSymbolStyle

public void insertSymbolStyle(java.util.Map<java.lang.String,java.lang.String> map,
                              XMLFragment doc)
                       throws org.w3c.dom.DOMException,
                              java.io.IOException,
                              XMLParsingException,
                              org.xml.sax.SAXException
Parameters:
map -
doc -
Throws:
org.w3c.dom.DOMException
java.io.IOException
XMLParsingException
org.xml.sax.SAXException

multiplyPattern

public static java.lang.String multiplyPattern(java.lang.String pattern,
                                               int mult)
Parameters:
pattern - a pattern like "1 2 1 2"
mult -
Returns:
the new pattern with each value multiplied by mult

insertPenStyle

public static void insertPenStyle(java.util.Map<java.lang.String,java.lang.String> map,
                                  XMLFragment doc)
                           throws java.net.MalformedURLException,
                                  java.io.IOException,
                                  org.xml.sax.SAXException,
                                  XMLParsingException
Parameters:
map -
doc -
Throws:
XMLParsingException
org.xml.sax.SAXException
java.io.IOException
java.net.MalformedURLException

insertBrushStyle

public static void insertBrushStyle(java.util.Map<java.lang.String,java.lang.String> map,
                                    XMLFragment doc,
                                    java.lang.String name)
                             throws java.net.MalformedURLException,
                                    java.io.IOException,
                                    org.xml.sax.SAXException,
                                    XMLParsingException
Parameters:
map -
doc -
name -
Throws:
org.xml.sax.SAXException
java.io.IOException
java.net.MalformedURLException
XMLParsingException

insertTextStyle

public static void insertTextStyle(java.util.Map<java.lang.String,java.lang.String> map,
                                   XMLFragment doc)
                            throws XMLParsingException
Parameters:
map -
doc -
Throws:
XMLParsingException

getStyle

public XMLFragment getStyle(java.util.Map<java.lang.String,java.util.HashSet<java.util.HashMap<java.lang.String,java.lang.String>>> styles,
                            java.lang.String name)
Parameters:
styles -
name - the layer name
Returns:
a SLD document with temporary file references for point symbols

renderSVGImage

public static java.awt.image.BufferedImage renderSVGImage(XMLFragment doc,
                                                          int size)
Parameters:
doc -
size -
Returns:
an SVG image with black colors overwritten with the given colors

toHexColor

public static java.lang.String toHexColor(java.awt.Color col)
Parameters:
col -
Returns:
a #rrggbb string

updateSVGColors

public static void updateSVGColors(XMLFragment doc,
                                   java.lang.String fill,
                                   java.lang.String stroke)
                            throws XMLParsingException
Parameters:
doc -
stroke -
fill -
Throws:
XMLParsingException

updateFillPatternSVG

public static void updateFillPatternSVG(XMLFragment doc,
                                        java.lang.String foreground,
                                        java.lang.String background)
                                 throws XMLParsingException
Parameters:
doc -
foreground -
background -
Throws:
XMLParsingException

symbolFromFont

public static java.awt.image.BufferedImage symbolFromFont(java.awt.Font font,
                                                          char theChar,
                                                          int size,
                                                          java.awt.Color color)
Parameters:
font -
theChar -
size -
color -
Returns:
an image the char has been written onto

symbolFromTwoChars

public static java.awt.image.BufferedImage symbolFromTwoChars(java.awt.Font font,
                                                              char theChar1,
                                                              char theChar2,
                                                              int size,
                                                              java.awt.Color color1,
                                                              java.awt.Color color2)
Parameters:
font -
theChar1 -
theChar2 -
size -
color1 -
color2 -
Returns:
an image with the second char written over the first one

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org