Class BitmapVertexStyle

All Implemented Interfaces:
Style, Cloneable, SLDImporter.FillStyle, SLDImporter.SizedStrokeFillStyle, SLDImporter.SizedStyle, SLDImporter.StrokeFillStyle, SLDImporter.StrokeStyle

public class BitmapVertexStyle extends VertexStyle
BitmapVertexStyle
Version:
$Revision$, $Date: 2008-02-14 14:37:00 +0100 (Thu, 14 Feb 2008) $
Author:
Andreas Schmitz, last edited by: $Author$
  • Constructor Details

    • BitmapVertexStyle

      public BitmapVertexStyle()
    • BitmapVertexStyle

      public BitmapVertexStyle(String fileName)
      Parameters:
      fileName - the name of the file describing this BitmapVertexStyle
  • Method Details

    • paint

      public void paint(Graphics2D g, Point2D p)
      Overrides:
      paint in class VertexStyle
    • render

      protected void render(Graphics2D g)
      Overrides:
      render in class VertexStyle
    • getImage

      public Image getImage()
      Returns:
      the image
    • getFileName

      public String getFileName()
      Returns:
      the image
    • setFillColor

      public void setFillColor(Color c)
      Specified by:
      setFillColor in interface SLDImporter.FillStyle
      Overrides:
      setFillColor in class VertexStyle
      Parameters:
      c - a Color
    • setLineColor

      public void setLineColor(Color c)
      Specified by:
      setLineColor in interface SLDImporter.StrokeStyle
      Overrides:
      setLineColor in class VertexStyle
      Parameters:
      c - line Color
    • setSize

      public void setSize(int size)
      Specified by:
      setSize in interface SLDImporter.SizedStyle
      Overrides:
      setSize in class VertexStyle
      Parameters:
      size - size
    • toHexColor

      public static String toHexColor(Color color)
      Parameters:
      color - the color to encode
      Returns:
      a #rrggbb string
    • updateSVGColors

      public static StringBuffer updateSVGColors(File file, String stroke, String fill) throws IOException
      Parameters:
      file - the svg file
      stroke - hex value of the stroke color to use
      fill - hex value of the fill color to use
      Returns:
      the new svg code
      Throws:
      IOException - if an IOException occurs
    • getUpdatedSVGImage

      public static BufferedImage getUpdatedSVGImage(String fileName, String stroke, String fill, int size)
      Parameters:
      fileName - svg file name
      stroke - hex value of the stroke color to use
      fill - hex value of the fill color to use
      size - image size
      Returns:
      a SVG image with black colors overwritten with the given colors
    • setFileName

      public void setFileName(String fileName)
      Parameters:
      fileName - file name to use