org.eesgmbh.gimv.shared.util
Class ImageEntity

java.lang.Object
  extended by org.eesgmbh.gimv.shared.util.ImageEntity
All Implemented Interfaces:
IsSerializable

public class ImageEntity
extends Object
implements IsSerializable

An entitity is some data of interest that is displayed on an image.

When displaying a time series chart an entitity is a single data point. In maps an entity is a feature e.g. a point of interest

An entity has a bounding box that describes its position within the image in pixel coordinates.

An entity can contain any number of HTML fragments that provide information about the entity. The respective HTML fragment can then be displayed under different circumstances, e.g. there is one html snippet that will be activated when user hovers over the entity and another one that will be displayed when the user clicks on the entity.
The HTML snippets are saved in a Map and three default keys are provided within this class: STATIC_HTML_FRAGMENT_KEY, HOVER_HTML_FRAGMENT_KEY, CLICK_HTML_FRAGMENT_KEY
The presenters and views that are reponsible for displaying tooltips should respect the different types of HTML fragments. If no HTML is defined, e.g. for #CLICK_HTML_SNIPPET_KEY no tooltip should be displayed when the user clicks on the entity.
Any number of application specific Tooltips can be defined here, who in turn will require application specific tooltip presenters.


Field Summary
static String CLICK_HTML_FRAGMENT_KEY
          The html fragment that is displayed when the user clicks on the area of the image entity
static String HOVER_HTML_FRAGMENT_KEY
          The html fragment that is displayed when the user hovers over the area of the image entity
static String STATIC_HTML_FRAGMENT_KEY
          The html fragment that is always being displayed
 
Constructor Summary
ImageEntity(Bounds bounds, String groupId)
           
 
Method Summary
 Bounds getBounds()
           
 String getClickHtmlFragment()
          convenience access.
 String getGroupId()
           
 String getHoverHtmlFragment()
          convenience access.
 HashMap<Object,String> getHtmlFragments()
           
 String getStaticHtmlFragment()
          convenience access.
 void putClickHtmlFragment(String html)
          convenience access.
 void putHoverHtmlFragment(String html)
          convenience access.
 void putStaticHtmlFragment(String html)
          convenience access.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATIC_HTML_FRAGMENT_KEY

public static final String STATIC_HTML_FRAGMENT_KEY
The html fragment that is always being displayed

See Also:
Constant Field Values

HOVER_HTML_FRAGMENT_KEY

public static final String HOVER_HTML_FRAGMENT_KEY
The html fragment that is displayed when the user hovers over the area of the image entity

See Also:
Constant Field Values

CLICK_HTML_FRAGMENT_KEY

public static final String CLICK_HTML_FRAGMENT_KEY
The html fragment that is displayed when the user clicks on the area of the image entity

See Also:
Constant Field Values
Constructor Detail

ImageEntity

public ImageEntity(Bounds bounds,
                   String groupId)
Method Detail

getBounds

public Bounds getBounds()

getGroupId

public String getGroupId()

getHtmlFragments

public HashMap<Object,String> getHtmlFragments()

getStaticHtmlFragment

public String getStaticHtmlFragment()
convenience access.

Returns:
the html fragment to be displayed at all times

putStaticHtmlFragment

public void putStaticHtmlFragment(String html)
convenience access.

Parameters:
html - the html fragment to be displayed at all times

getHoverHtmlFragment

public String getHoverHtmlFragment()
convenience access.

Returns:
the html fragment to be displayed with on hover

putHoverHtmlFragment

public void putHoverHtmlFragment(String html)
convenience access.

Parameters:
html - the html fragment to be displayed with on hover

getClickHtmlFragment

public String getClickHtmlFragment()
convenience access.

Returns:
the html fragment to be displayed with on click

putClickHtmlFragment

public void putClickHtmlFragment(String html)
convenience access.

Parameters:
html - the html fragment to be displayed with on click


Copyright © 2010 - EES GmbH