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 and a default PropertiesBasedStyleLibrary as style library.
PrettyMarkers(String prefix)
          Constructor without a a ColorLibrary, will use a default PropertiesBasedStyleLibrary as style library.
PrettyMarkers(String prefix, StyleLibrary style)
          Constructor
PrettyMarkers(StyleLibrary style)
          Constructor without prefix argument, will use DEFAULT_PREFIX as prefix.
 
Method Summary
 void plotMarker(SVGPlot plot, Element parent, double x, double y, int style, double size)
          Draw an marker used in scatter plots.
 void setStyleLibrary(StyleLibrary style)
          Set the style library for this marker library.
 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,
                     StyleLibrary style)
Constructor

Parameters:
prefix - prefix to use.
style - style library to use

PrettyMarkers

public PrettyMarkers(StyleLibrary style)
Constructor without prefix argument, will use DEFAULT_PREFIX as prefix.

Parameters:
style - Style library to use

PrettyMarkers

public PrettyMarkers(String prefix)
Constructor without a a ColorLibrary, will use a default PropertiesBasedStyleLibrary as style library.

Parameters:
prefix - prefix to use.

PrettyMarkers

public PrettyMarkers()
Constructor without arguments, will use DEFAULT_PREFIX as prefix and a default PropertiesBasedStyleLibrary as style library.

Method Detail

plotMarker

public void plotMarker(SVGPlot plot,
                       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:
plot - containing plot
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.

setStyleLibrary

public void setStyleLibrary(StyleLibrary style)
Description copied from interface: MarkerLibrary
Set the style library for this marker library.

Specified by:
setStyleLibrary in interface MarkerLibrary
Parameters:
style - New style library to use.

Release 0.3 (2010-03-31_1612)