public class IlvHitmapDefinition extends Object implements IlvHitmapConstants
IlvManagerServlet
for how to install customized hitinfo
manager.
This class is designed to be used in the following way:
init(IlvManagerView)
before rendering the
hitmap.addGraphic(IlvGraphic)
to add graphic objects their
hitmap information and tooltips will be generated.renderHitmap()
to render the hitmap for all the graphic
objects added.dispose()
to release resources allocated.getTooltip(IlvGraphic)
method to return the customized tooltip.
Since JViews 8.8, we introduce a new hitmap information structure, so we can
call registerHitmapInfoGenerator(String, IlvHitmapInfoGenerator)
to extend the hitmap information.
There is a default abstract hitmap infor implementation IlvAbstractHitmapInfoGenerator
.
We can define a subclass of IlvAbstractHitmapInfoGenerator
to customize hitmap information.COLON, CURSOR_TYPE, EXTENSIONS, GROUP_TYPE, HIT_INFO, JVIEWS_CURSOR_PROPERTY, JVIEWS_GROUP_PROPERTY, JVIEWS_HITINFOS, JViewsExtensions, JViewsTooltips, NAVIGATION_TYPE, REQUEST_TYPE, RIGHT_BRACE, TOOLTIP_TYPE
Constructor and Description |
---|
IlvHitmapDefinition()
Creates a hitmap definition.
|
Modifier and Type | Method and Description |
---|---|
void |
addGraphic(IlvGraphic graphic)
Adds a graphic object to the managed list.
|
protected IlvHitmapInfoGenerator |
createHitmapInfoGenerator(String infoType)
Returns the object that will build the hitmap information for the given
hitmap information type.
|
void |
dispose()
Releases the resources used when rendering the hitmap.
|
String |
getDefinition()
Deprecated.
|
String |
getDefinition(StringTokenizer typeToken)
Gets the hitmap definition, according to the type token to append the hitmap informations.
|
protected String |
getExtension(IlvGraphic graphic)
You can override this method to create javascript function,
this function will be called by tooltip mouse down event.
|
String |
getExtensions()
Returns the extensions for hitmap.
|
Vector<IlvGraphic> |
getGraphics()
Returns the vector of the managed graphic objects
|
String[] |
getHitmapLayers()
Gets the layers that will generate hitmap.
|
IlvManagerView |
getManagerView()
Returns the manager view.
|
protected String |
getTooltip(IlvGraphic graphic)
Deprecated.
|
void |
init(IlvManagerView view)
Initializes a hitmap definition for the given view.
|
void |
init(IlvManagerView view,
int dx,
int dy)
Initializes a hitmap definition for the given view
and delta X, delta Y.
|
void |
registerHitmapInfoGenerator(String infoType,
IlvHitmapInfoGenerator generator)
Registers a hitmap info generator to be used for a given hitmap
information type.
|
void |
renderHitmap()
Renders the hitmap for the graphic objects.
|
void |
renderHitmap(int deltaX,
int deltaY)
Renders the hitmap for the graphic objects with delta X and delta Y.
|
void |
setHitmapLayers(String[] hitmapLayers)
Sets the layers that will generate hitmap.
|
void |
setManagerView(IlvManagerView view)
Sets the manager view.
|
boolean |
shouldRender(IlvGraphic graphic)
Tells whether the hitmap should be rendered for a given graphic object.
|
void |
unregisterHitmapInfoGenerator(String infoType)
Remove the hitmap information handler according to
infoType |
public void registerHitmapInfoGenerator(String infoType, IlvHitmapInfoGenerator generator)
init
method of servlet.
Code example:
IlvHitmapDefinition hitmapDefinition = getServletSupport().getHitmapSupport().getHitmapDefinition(); hitmapDefinition.registerHitmapInfoGenerator(IlvHitmapConstants.TOOLTIP_TYPE, new MyTooltipInfoGenerator(hitmapDefinition));
infoType
- A hitmap information type, such as
IlvHitmapConstants.TOOLTIP_TYPE
,
IlvHitmapConstants.GROUP_TYPE
,
IlvHitmapConstants.CURSOR_TYPE
, or
IlvHitmapConstants.NAVIGATION_TYPE
.generator
- A hitmap info generator.unregisterHitmapInfoGenerator(String)
public void unregisterHitmapInfoGenerator(String infoType)
infoType
infoType
- The hitmap information type.registerHitmapInfoGenerator(String, IlvHitmapInfoGenerator)
public void init(IlvManagerView view)
view
- The manager view.public void init(IlvManagerView view, int dx, int dy)
view
- The IlvManagerView
object.dx
- The delta X pixel.dy
- The delta Y pixel.public void addGraphic(IlvGraphic graphic)
graphic
- The graphic object to add.public Vector<IlvGraphic> getGraphics()
public IlvManagerView getManagerView()
public void setManagerView(IlvManagerView view)
view
- The manager view.public boolean shouldRender(IlvGraphic graphic)
false
the hitmap support will simply imgnore
this graphic object. Nothing will be generated for this graphic object.
For example, it is not recommended to generate hitmap information for
background graphic objects.
This method will be called by the hitmap generator for each visible graphic object.The default inplementaion return always true. Programmers can override this method to tell whether the hitmap should be generated.
graphic
- The graphic object check.public void renderHitmap()
public void renderHitmap(int deltaX, int deltaY)
deltaX
- The delta X.deltaY
- The delta Y.@Deprecated public String getDefinition()
public String getDefinition(StringTokenizer typeToken)
typeToken
- The type token.String
object.protected IlvHitmapInfoGenerator createHitmapInfoGenerator(String infoType)
The default return value is null.
You can override this method when you add new hitmap information types.
For specifying the hitmap information generator that is used for a given
information type, you can use the
registerHitmapInfoGenerator(String, IlvHitmapInfoGenerator)
method.
infoType
- The hitmap information type.IlvHitmapInfoGenerator
object.public String getExtensions()
protected String getExtension(IlvGraphic graphic)
graphic
- The IlvGraphic
object.public void dispose()
@Deprecated protected String getTooltip(IlvGraphic graphic)
IlvTooltipInfoGenerator.getRegionInfo(ilog.views.IlvGraphic, java.lang.String)
graphic
object.graphic
- The graphic.IlvGraphic
object.public void setHitmapLayers(String[] hitmapLayers)
hitmapLayers
- The array of layers.public String[] getHitmapLayers()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.