|
EchoPoint API - 3.0.0b5 App Webcontainer |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnextapp.echo.app.Component
echopoint.internal.AbstractContainer
echopoint.internal.AbstractImage
echopoint.ImageMap
public class ImageMap
The ImageMap class provides a Component
that allows a user to click on region(s) within a provided region.
A series of MapSection instances are specified
that indicate what areas on the region should produce an
ActionEvent.
The MapSection instances are stored in a map
keyed by by their MapSection.actionCommand string.
This means that there can be at most one set of coordinates for a given
MapSection.actionCommand.
Note: Development of this component was sponsored by TCN Broadcasting. We are grateful for their support and sponsorship.
The following shows sample usage of this component:
import echopoint.ImageMap;
import echopoint.model.Point;
import echopoint.model.MapSection;
import echopoint.model.CircleSection;
import echopoint.model.RectangleSection;
...
final Column column = new Column();
final String url = "image/imagemap.gif";
final ImageMap map = new ImageMap( url );
map.addActionListener( ... );
final Collection<MapSection> sections = new ArrayList<MapSection>();
sections.add( new CircleSection( new Point( 10, 10 ), 25, "circle" );
sections.add( new RectangleSection( new Point( 10, 10 ),
new Point( 25, 25 ), "rectangle", "Rectangular area" );
map.addSections( sections );
column.add( map );
| Field Summary | |
|---|---|
protected String |
actionCommand
The action command that was triggered by user interaction with map. |
static String |
PROPERTY_SECTIONS
The map of MapSection
instances that represents the clickable sections in the map. |
| Fields inherited from class echopoint.internal.AbstractImage |
|---|
PROPERTY_ACTION_COMMAND, PROPERTY_CURSOR, PROPERTY_IMAGE, PROPERTY_TEXT, PROPERTY_TOOL_TIP_TEXT |
| Fields inherited from class echopoint.internal.AbstractContainer |
|---|
ACTION_COMMAND_PROPERTY, ACTION_LISTENERS_CHANGED_PROPERTY, INPUT_ACTION, PROPERTY_ALIGNMENT, PROPERTY_BACKGROUND_IMAGE, PROPERTY_BORDER, PROPERTY_HEIGHT, PROPERTY_INSETS, PROPERTY_WIDTH |
| Constructor Summary | |
|---|---|
ImageMap()
Default constructor. |
|
ImageMap(ImageReference image)
Create a new image map using the specified image to use as the region. |
|
ImageMap(String url)
Create a new image map using the image from the specified URL. |
|
| Method Summary | |
|---|---|
void |
addSection(MapSection section)
Add the specified clickable section to the image map. |
void |
addSections(Collection<MapSection> sections)
Add the specified collection of sections to the image map. |
Map<String,MapSection> |
getSections()
Return the value of the PROPERTY_SECTIONS property. |
void |
processInput(String name,
Object value)
|
void |
removeAllSections()
Remove all the clickable sections from the image map. |
void |
removeSection(MapSection section)
Remove the specified clickable section from the image map. |
void |
setSections(Map<String,MapSection> sections)
Set the value of the PROPERTY_SECTIONS property. |
| Methods inherited from class echopoint.internal.AbstractImage |
|---|
addActionListener, fireActionPerformed, getActionCommand, getCursor, getImage, getText, getToolTipText, hasActionListeners, removeActionListener, setActionCommand, setBackgroundImage, setCursor, setImage, setImage, setText, setToolTipText |
| Methods inherited from class echopoint.internal.AbstractContainer |
|---|
fireActionPerformed, getAlignment, getBackgroundImage, getBorder, getHeight, getInsets, getWidth, setAlignment, setBorder, setHeight, setInsets, setWidth |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROPERTY_SECTIONS
MapSection
instances that represents the clickable sections in the map. Note that
this property is to be treated as read-only.
protected String actionCommand
| Constructor Detail |
|---|
public ImageMap()
public ImageMap(ImageReference image)
image - The image to use as the map region.public ImageMap(String url)
url - The url to use as the source of the image to use in the map.| Method Detail |
|---|
public Map<String,MapSection> getSections()
PROPERTY_SECTIONS property.
public void setSections(Map<String,MapSection> sections)
PROPERTY_SECTIONS property.
sections - The image to use as the map region.addSections(java.util.Collection) ,
addSection(echopoint.model.MapSection)public void addSections(Collection<MapSection> sections)
sections - The collection of sections to be added.public void addSection(MapSection section)
section - The section that is to be added.public void removeSection(MapSection section)
section - The section that is to be deleted.public void removeAllSections()
public void processInput(String name,
Object value)
processInput in class AbstractImageAbstractImage.fireActionPerformed()
|
EchoPoint API - 3.0.0b5 App Webcontainer |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||