|
|||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||
This is a client side hit test. The main functions are getHitInfo() and getOverlaps(). Both return a hit info object. There are some "static" methods like yfiles.client.tiles.HitTest.getHitIds() which return specific information contained in a hit info. An instance of this class is initialized for a specific graph a set of interesting graph elements. These parameters can be changed lateron using setEventTypes() and setGraphParameters(). An instance of this class fetches the data for answering hit test queries from the server. Answering the queries is performed on the basis of this data on the client side.
| Constructor Summary | |
|---|---|
HitTest(/*String*/ baseURL, /*String*/ path, /*GraphBounds*/ worldBounds, /*Boolean*/ nodeEvents, /*Boolean*/ edgeEvents, /*Boolean*/ nodeLabelEvents, /*Boolean*/ edgeLabelEvents, /*Boolean*/ paperEvents)
This is a client side hit test. |
|
| Method Summary | |
|---|---|
|
clear()
clears the hit test data. |
GraphBounds |
getBounds(/*Object*/ hitInfo)
returns the bounds of the first hit for the given hit info. |
GraphBounds |
getBoundsForId(/*String*/ id)
returns the bounds of the graph element with the given id. |
Object[] |
getControlPoints(/*String*/ edgeId)
returns the path of the edge with the given edgeId as an array of objects with x and y attributes. |
String |
getDescription(/*Object*/ hitInfo)
returns the URL of the first hit of the given hit info. |
String |
getElementType(/*Object || String*/ hitInfoOrId)
returns the type of graph element for the first hit of the given hit info or the given id. |
Object |
getEmptyHitInfo(/*Number*/ worldX, /*Number*/ worldY)
returns an empty hit info structure for the given world coordinates. |
Number |
getHitCount(/*Object*/ hitInfo)
returns the number of hits for the given hit info. |
String |
getHitId(/*Object*/ hitInfo)
returns the id of the first hit for the given hit info or null. |
String[] |
getHitIds(/*Object*/ hitInfo)
returns an array with all hit ids for the given graph info. |
Object |
getHitInfo(/*Number*/ worldX, /*Number*/ worldY, /*Boolean*/ firstHitOnly)
returns a hit info structure for the given world coordinates. |
Object |
getLabelInfo(/*String*/ labelId)
returns information on the label with the given id. |
Object |
getOverlaps(/*Number*/ x1, /*Number*/ y1, /*Number*/ x2, /*Number*/ y2)
returns a hit info structure for the graph elements overlapping the rectangular region with upper left corner (x1,y1) and lower right corner (x2,y2). |
String |
getUrl(/*Object*/ hitInfo)
returns the URL of the first hit of the given hit info. |
boolean |
isActive()
returns true, if at least one kind of graph elements is marked as relevant (see setEventTypes()). |
|
onNewData()
is called, if new hit test data for the current graph has been loaded. |
|
refresh()
refreshes the hit test data for the current graph. |
|
setCoords(/*Object*/ info, /*float*/ x, /*float*/ y)
sets the coordinates for the given hit info. |
|
setEdgeTestSensitivity(/*Number*/ sensitivity)
sets the edge test sensitivity in world units. |
|
setEventTypes(/*Boolean*/ nodeEvents, /*Boolean*/ edgeEvents, /*Boolean*/ nodeLabelEvents, /*Boolean*/ edgeLabelEvents, /*Boolean*/ paperEvents)
changes the set of relevant graph elements for this hit test. |
|
setGraphParameters(/*String?*/ baseURL, /*String?*/ path, /*GraphBounds?*/ worldBounds)
changes some parameters for this hit test. |
| Constructor Detail |
|---|
HitTest(/*String*/ baseURL, /*String*/ path, /*GraphBounds*/ worldBounds, /*Boolean*/ nodeEvents, /*Boolean*/ edgeEvents, /*Boolean*/ nodeLabelEvents, /*Boolean*/ edgeLabelEvents, /*Boolean*/ paperEvents)
baseURL - the base path for server requests (possibly relative to the current page, default ".")
path - the symbolic name of the graph
worldBounds - the bounds for which to answer hit queries in world coordinates
nodeEvents - whether nodes are relevant for this hit test
edgeEvents - whether edges are relevant for this hit test
nodeLabelEvents - whether node labels are relevant for this hit test
edgeLabelEvents - whether edge labels are relevant for this hit test
paperEvents - whether paper clicks are relevant for this hit test
| Method Detail |
|---|
clear()
GraphBounds getBounds(/*Object*/ hitInfo)
GraphBounds getBoundsForId(/*String*/ id)
Object[] getControlPoints(/*String*/ edgeId)
String getDescription(/*Object*/ hitInfo)
String getElementType(/*Object || String*/ hitInfoOrId)
Object getEmptyHitInfo(/*Number*/ worldX, /*Number*/ worldY)
Number getHitCount(/*Object*/ hitInfo)
String getHitId(/*Object*/ hitInfo)
String[] getHitIds(/*Object*/ hitInfo)
Object getHitInfo(/*Number*/ worldX, /*Number*/ worldY, /*Boolean*/ firstHitOnly)
worldX - x-coordinate of the hit test point in world coordinates
worldY - y-coordinate of the hit test point in world coordinates
firstHitOnly - whether to stop the hit test after the first hit has been found
Object getLabelInfo(/*String*/ labelId)
labelId - the id of a node label or an edge label
Object getOverlaps(/*Number*/ x1, /*Number*/ y1, /*Number*/ x2, /*Number*/ y2)
String getUrl(/*Object*/ hitInfo)
boolean isActive()
onNewData()
refresh()
setCoords(/*Object*/ info, /*float*/ x, /*float*/ y)
setEdgeTestSensitivity(/*Number*/ sensitivity)
setEventTypes(/*Boolean*/ nodeEvents, /*Boolean*/ edgeEvents, /*Boolean*/ nodeLabelEvents, /*Boolean*/ edgeLabelEvents, /*Boolean*/ paperEvents)
nodeEvents - whether nodes are relevant for this hit test
edgeEvents - whether edges are relevant for this hit test
nodeLabelEvents - whether node labels are relevant for this hit test
edgeLabelEvents - whether edge labels are relevant for this hit test
paperEvents - whether paper clicks are relevant for this hit test
setGraphParameters(/*String?*/ baseURL, /*String?*/ path, /*GraphBounds?*/ worldBounds)
baseURL - the base path for server requests (possibly relative to the current page, default ".")
path - the symbolic name of the graph
worldBounds - the bounds for which to answer hit queries in world coordinates