public class ZiggyImapRenderer extends Object implements ImageMapRenderer, Serializable
ZiggyImapRenderer
is a decorator for
ZiggyFeatureRenderer
which adds the ability to create
HTML image map coordinates which correspond to the feature
rendering produced by the ZiggyFeatureRenderer
. These
coordinates correspond to the block regions of the image rather
than the "elbow" sections which join the locations.
Constructor and Description |
---|
ZiggyImapRenderer(ZiggyFeatureRenderer renderer,
ImageMap imageMap,
URLFactory urlFactory)
Creates a new
ZiggyImapRenderer . |
Modifier and Type | Method and Description |
---|---|
double |
getDepth(SequenceRenderContext context) |
ImageMap |
getImageMap()
getImageMap returns the current image map. |
FeatureHolder |
processMouseEvent(FeatureHolder holder,
SequenceRenderContext context,
MouseEvent mEvent) |
void |
renderFeature(Graphics2D g2,
Feature f,
SequenceRenderContext context) |
void |
renderImageMap(Graphics2D g2,
Feature f,
SequenceRenderContext context)
renderImageMap writes a set of image map
coordinates corresponding to the rectangle sections drawn by
the renderer. |
void |
setImageMap(ImageMap imageMap)
setImageMap sets the current image map. |
public ZiggyImapRenderer(ZiggyFeatureRenderer renderer, ImageMap imageMap, URLFactory urlFactory)
ZiggyImapRenderer
.renderer
- a ZiggyFeatureRenderer
.imageMap
- an ImageMap
.urlFactory
- an URLFactory
which should be
capable of creating a suitable URL from each
Feature
on the Sequence
to be
rendered.public ImageMap getImageMap()
getImageMap
returns the current image map.ImageMap
.public void setImageMap(ImageMap imageMap)
setImageMap
sets the current image map.imageMap
- an ImageMap
.public void renderImageMap(Graphics2D g2, Feature f, SequenceRenderContext context)
renderImageMap
writes a set of image map
coordinates corresponding to the rectangle sections drawn by
the renderer. All the block regions of the image receive the
same URL. The hotspots created by this method have the rendered
Feature
set as their user object.
This method is called by renderFeature
when
a raster image is rendered.
renderImageMap
in interface ImageMapRenderer
g2
- a Graphics2D
.f
- a Feature
.context
- a SequenceRenderContext
.public void renderFeature(Graphics2D g2, Feature f, SequenceRenderContext context)
renderFeature
in interface FeatureRenderer
public double getDepth(SequenceRenderContext context)
getDepth
in interface FeatureRenderer
public FeatureHolder processMouseEvent(FeatureHolder holder, SequenceRenderContext context, MouseEvent mEvent)
processMouseEvent
in interface FeatureRenderer
Copyright © 2014 BioJava. All rights reserved.