Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.visualization.svg
Class PrettyMarkers

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.visualization.svg.PrettyMarkers
All Implemented Interfaces:
MarkerLibrary

public class PrettyMarkers
extends Object
implements MarkerLibrary

Marker library achieving a larger number of styles by combining different shapes with different colors. Uses object ID management by SVGPlot.

Author:
Erich Schubert

Field Summary
private  ColorLibrary colors
          Color library
private static String DEFAULT_PREFIX
          Default prefix to use.
private  String prefix
          Prefix for the IDs generated.
 
Constructor Summary
PrettyMarkers()
          Constructor without arguments, will use DEFAULT_PREFIX as prefix.
PrettyMarkers(String prefix)
          Constructor
 
Method Summary
 void plotMarker(Document document, Element parent, double x, double y, int style, double size)
          Draw an marker used in scatter plots.
 Element useMarker(SVGPlot plot, Element parent, double x, double y, int style, double size)
          Insert a marker at the given coordinates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

colors

private ColorLibrary colors
Color library


DEFAULT_PREFIX

private static final String DEFAULT_PREFIX
Default prefix to use.

See Also:
Constant Field Values

prefix

private String prefix
Prefix for the IDs generated.

Constructor Detail

PrettyMarkers

public PrettyMarkers(String prefix)
Constructor

Parameters:
prefix - Prefix to use.

PrettyMarkers

public PrettyMarkers()
Constructor without arguments, will use DEFAULT_PREFIX as prefix.

Method Detail

plotMarker

public void plotMarker(Document document,
                       Element parent,
                       double x,
                       double y,
                       int style,
                       double size)
Draw an marker used in scatter plots. If you intend to use the markers multiple times, you should consider using the useMarker(de.lmu.ifi.dbs.elki.visualization.svg.SVGPlot, org.w3c.dom.Element, double, double, int, double) method instead, which exploits the SVG features of symbol definition and use

Parameters:
document - containing document
parent - parent node
x - position
y - position
style - marker style (enumerated)
size - size

useMarker

public Element useMarker(SVGPlot plot,
                         Element parent,
                         double x,
                         double y,
                         int style,
                         double size)
Description copied from interface: MarkerLibrary
Insert a marker at the given coordinates. Markers will be defined in the defs part of the document, and then SVG-"use"d at the given coordinates. This supposedly is more efficient and significantly reduces file size. Symbols will be named "s0", "s1" etc.; these names must not be used by other elements in the SVG document!

Specified by:
useMarker in interface MarkerLibrary
Parameters:
plot - Plot to draw on
parent - parent node
x - coordinate
y - coordinate
style - style (enumerated)
size - size
Returns:
Element node generated.

Release 0.2.1 (2009-07-13_1605)