net.curre.prefcount.bean
Class TooltipLocationsMap
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<ScoreItem,java.util.Map<Place,java.awt.Shape>>
net.curre.prefcount.bean.TooltipLocationsMap
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.util.Map<ScoreItem,java.util.Map<Place,java.awt.Shape>>
public class TooltipLocationsMap
- extends java.util.HashMap<ScoreItem,java.util.Map<Place,java.awt.Shape>>
This is a map to hold the score item locations (shapes)
for the tooltip logic.
Created date: Jun 25, 2008
- Author:
- Yevgeny Nyden
- See Also:
- Serialized Form
|
Method Summary |
void |
addRectangleLocation(ScoreItem item,
Place place,
java.awt.Graphics2D g2,
java.awt.geom.Point2D.Double point,
java.lang.String str)
Helper method to compute and add a tooltip location
to the tooltip location map for the given data. |
void |
addShapeLocation(ScoreItem item,
Place place,
java.awt.Shape shape)
Adds a shape that represents a tooltip area to the map. |
java.util.Map<Place,java.awt.Shape> |
get(java.lang.Object item)
|
void |
removeLocation(Place place,
ScoreItem... items)
Clears a location for the given place and items. |
| Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
equals, hashCode |
TooltipLocationsMap
public TooltipLocationsMap()
get
public java.util.Map<Place,java.awt.Shape> get(java.lang.Object item)
-
- Specified by:
get in interface java.util.Map<ScoreItem,java.util.Map<Place,java.awt.Shape>>- Overrides:
get in class java.util.HashMap<ScoreItem,java.util.Map<Place,java.awt.Shape>>
removeLocation
public void removeLocation(Place place,
ScoreItem... items)
- Clears a location for the given place and items.
- Parameters:
place - player's place.items - score items.
addShapeLocation
public void addShapeLocation(ScoreItem item,
Place place,
java.awt.Shape shape)
- Adds a shape that represents a tooltip area to the map.
- Parameters:
item - score board item.place - player's place.shape - shpae to add.
addRectangleLocation
public void addRectangleLocation(ScoreItem item,
Place place,
java.awt.Graphics2D g2,
java.awt.geom.Point2D.Double point,
java.lang.String str)
- Helper method to compute and add a tooltip location
to the tooltip location map for the given data. Note,
that this method adds rectangular tooltip bounds.
- Parameters:
item - score board item.place - player's place.g2 - graphics context.point - point where the string is drawn.str - string for which the tooltip location is recorded.
Copyright © 2008. All Rights Reserved.