Package org.biojava.bio.gui.sequence
Class ZiggyImapRenderer
- java.lang.Object
-
- org.biojava.bio.gui.sequence.ZiggyImapRenderer
-
- All Implemented Interfaces:
Serializable
,FeatureRenderer
,ImageMapRenderer
public class ZiggyImapRenderer extends Object implements ImageMapRenderer, Serializable
ZiggyImapRenderer
is a decorator forZiggyFeatureRenderer
which adds the ability to create HTML image map coordinates which correspond to the feature rendering produced by theZiggyFeatureRenderer
. These coordinates correspond to the block regions of the image rather than the "elbow" sections which join the locations.- Since:
- 1.3
- Author:
- Keith James
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ZiggyImapRenderer(ZiggyFeatureRenderer renderer, ImageMap imageMap, URLFactory urlFactory)
Creates a newZiggyImapRenderer
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
ZiggyImapRenderer
public ZiggyImapRenderer(ZiggyFeatureRenderer renderer, ImageMap imageMap, URLFactory urlFactory)
Creates a newZiggyImapRenderer
.- Parameters:
renderer
- aZiggyFeatureRenderer
.imageMap
- anImageMap
.urlFactory
- anURLFactory
which should be capable of creating a suitable URL from eachFeature
on theSequence
to be rendered.
-
-
Method Detail
-
getImageMap
public ImageMap getImageMap()
getImageMap
returns the current image map.- Returns:
- an
ImageMap
.
-
setImageMap
public void setImageMap(ImageMap imageMap)
setImageMap
sets the current image map.- Parameters:
imageMap
- anImageMap
.
-
renderImageMap
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 renderedFeature
set as their user object.This method is called by
renderFeature
when a raster image is rendered.- Specified by:
renderImageMap
in interfaceImageMapRenderer
- Parameters:
g2
- aGraphics2D
.f
- aFeature
.context
- aSequenceRenderContext
.
-
renderFeature
public void renderFeature(Graphics2D g2, Feature f, SequenceRenderContext context)
- Specified by:
renderFeature
in interfaceFeatureRenderer
-
getDepth
public double getDepth(SequenceRenderContext context)
- Specified by:
getDepth
in interfaceFeatureRenderer
-
processMouseEvent
public FeatureHolder processMouseEvent(FeatureHolder holder, SequenceRenderContext context, MouseEvent mEvent)
- Specified by:
processMouseEvent
in interfaceFeatureRenderer
-
-