ilog.views.servlet
Class IlvImageMapAreaGenerator

java.lang.Object
  extended by ilog.views.servlet.IlvImageMapAreaGenerator

public class IlvImageMapAreaGenerator
extends Object

An object used to generate an AREA element of an image map. The default implementation allows you to generate a rectangular area corresponding to the bounding box of a graphic object. No default HREF parameter is generated for an area; you must overwrite the method generateHREF to generate an HREF parameter. When an "image map" request is sent to the IlvManagerServlet, an area will be generated for a graphic object if the following conditions are true:

  • A property was set on the layer containing the object using: layer.setProperty(IlvManagerServlet.ImageMapAreaGeneratorProperty, Boolean.TRUE).
  • The graphic object will be visible in the generated image.
  • An image map generator was installed as a property of the graphic object using: obj.setProperty(IlvManagerServlet.ImageMapAreaGeneratorProperty, new IlvImageMapAreaGenerator()).
  • Since:
    JViews 3.5

    Field Summary
    static int CIRCLE_SHAPE
              CIRCLE AREA Shape
    static int POLYGON_SHAPE
              POLYGON AREA Shape
    static int RECTANGLE_SHAPE
              RECTANGLE AREA Shape
     
    Constructor Summary
    IlvImageMapAreaGenerator()
              Creates an Area generator.
     
    Method Summary
     String generateALT(IlvManagerView view, IlvGraphic obj)
              This method returns the ALT attribute of the area for the specified graphic object.
     String generateCOORDS(IlvManagerView view, IlvGraphic obj, IlvRect bounds, IlvTransformer t)
              This method returns the coordinates of the area for the specified graphic object.
     String generateHREF(IlvManagerView view, IlvGraphic obj)
              This method returns the HREF attribute of the area for the specified graphic object.
     String generateONMOUSEOUT(IlvManagerView view, IlvGraphic obj)
              This method returns the ONMOUSEOUT attribute of the area for the specified graphic object.
     String generateONMOUSEOVER(IlvManagerView view, IlvGraphic obj)
              This method returns the ONMOUSEOVER attribute of the area for the specified graphic object.
     String generateTARGET(IlvManagerView view, IlvGraphic obj)
              This method returns the TARGET attribute of the area for the specified graphic object.
     int getShape(IlvManagerView view, IlvGraphic obj, IlvTransformer t)
              This method returns the shape of the area for the specified graphic object.
     boolean isGenerateManagerArea()
              Returns true to generate areas for sub managers, false otherwise.
     void setGenerateManagerArea(boolean generateManagerArea)
              Specifies whether an area should be generated for sub managers.
     boolean shouldGenerate(IlvManagerView view, IlvGraphic obj, IlvTransformer t)
              This method returns true if an area should be generated for the specified graphic object.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    CIRCLE_SHAPE

    public static final int CIRCLE_SHAPE
    CIRCLE AREA Shape

    See Also:
    Constant Field Values

    RECTANGLE_SHAPE

    public static final int RECTANGLE_SHAPE
    RECTANGLE AREA Shape

    See Also:
    Constant Field Values

    POLYGON_SHAPE

    public static final int POLYGON_SHAPE
    POLYGON AREA Shape

    See Also:
    Constant Field Values
    Constructor Detail

    IlvImageMapAreaGenerator

    public IlvImageMapAreaGenerator()
    Creates an Area generator.

    Method Detail

    shouldGenerate

    public boolean shouldGenerate(IlvManagerView view,
                                  IlvGraphic obj,
                                  IlvTransformer t)

    This method returns true if an area should be generated for the specified graphic object. The default implementation returns a value that depends on the graphic object type:


    setGenerateManagerArea

    public void setGenerateManagerArea(boolean generateManagerArea)

    Specifies whether an area should be generated for sub managers.

    Note that this property doesn't affect the generation of the objects of a sub manager but the sub manager itself.

    Parameters:
    generateManagerArea - true to generate areas for sub managers, false otherwise.
    Since:
    JViews 7.5
    See Also:
    shouldGenerate(IlvManagerView, IlvGraphic, IlvTransformer), isGenerateManagerArea()

    isGenerateManagerArea

    public boolean isGenerateManagerArea()
    Returns true to generate areas for sub managers, false otherwise.

    Note that this property doesn't affect the generation of the objects of a sub manager but the sub manager itself.

    Since:
    JViews 7.5
    See Also:
    shouldGenerate(IlvManagerView, IlvGraphic, IlvTransformer), setGenerateManagerArea(boolean)

    getShape

    public int getShape(IlvManagerView view,
                        IlvGraphic obj,
                        IlvTransformer t)
    This method returns the shape of the area for the specified graphic object. The default implementation returns RECTANGLE_SHAPE.


    generateCOORDS

    public String generateCOORDS(IlvManagerView view,
                                 IlvGraphic obj,
                                 IlvRect bounds,
                                 IlvTransformer t)
    This method returns the coordinates of the area for the specified graphic object. The default implementation returns coordinates corresponding to the bounding box of the object.

    Parameters:
    view - The manager view
    obj - The graphic object
    bounds - The bounds of the view, in view coordinates
    t - The transformer to draw the object

    generateHREF

    public String generateHREF(IlvManagerView view,
                               IlvGraphic obj)
    This method returns the HREF attribute of the area for the specified graphic object. No default HREF is provided, so in this case the method returns null.


    generateALT

    public String generateALT(IlvManagerView view,
                              IlvGraphic obj)
    This method returns the ALT attribute of the area for the specified graphic object. No default value is provided, so in this case the method returns null.


    generateTARGET

    public String generateTARGET(IlvManagerView view,
                                 IlvGraphic obj)
    This method returns the TARGET attribute of the area for the specified graphic object. No default value is provided, so in this case the method returns null.


    generateONMOUSEOVER

    public String generateONMOUSEOVER(IlvManagerView view,
                                      IlvGraphic obj)
    This method returns the ONMOUSEOVER attribute of the area for the specified graphic object. No default value is provided, so in this case the method returns null.


    generateONMOUSEOUT

    public String generateONMOUSEOUT(IlvManagerView view,
                                     IlvGraphic obj)
    This method returns the ONMOUSEOUT attribute of the area for the specified graphic object. No default value is provided, so in this case the method returns null.



    Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.