Packagecom.yworks.graph.drawing
Classpublic class StripeHitTestIterator
InheritanceStripeHitTestIterator Inheritance Object

Support class that allows to iterate over hits on table elements or subregions of table elements.



Public Methods
 MethodDefined By
  
Create a new instance for a specific table instance that use the order specified by tableRenderingOrder to determine the order of the hit test results.
StripeHitTestIterator
  
iterateHits(context:ICanvasContext, x:Number, y:Number, node:INode, subregion:StripeSubregion = null):Iterator
Return an iterator over the hits at the given location.
StripeHitTestIterator
Constructor Detail
StripeHitTestIterator()Constructor
public function StripeHitTestIterator(table:ITable, tableRenderingOrder:TableRenderingOrder)

Create a new instance for a specific table instance that use the order specified by tableRenderingOrder to determine the order of the hit test results.

Parameters
table:ITable — The table to use.
 
tableRenderingOrder:TableRenderingOrder — The drawing order.
Method Detail
iterateHits()method
public function iterateHits(context:ICanvasContext, x:Number, y:Number, node:INode, subregion:StripeSubregion = null):Iterator

Return an iterator over the hits at the given location.

This implementation returns the hits in the following order:

  1. First all IRows or IColumns at the given location, in the order specified by the tableRenderingOrder property.
  2. For each stripe type, the stripes are returned in bottom up order, i.e. children are returned before their parents.
  3. For each stripe, the subregions are returned in the order StripeSubregion.NEAR_BORDER, StripeSubregion.FAR_BORDER, StripeSubregion.LEADING_HEADER, StripeSubregion.TRAILING_HEADER, StripeSubregion.STRIPE, e.g. a header hit is always returned before a hit on the whole stripe.

Parameters

context:ICanvasContext — The canvas context to use.
 
x:Number — The x coordinate of the location in absolute coordinates.
 
y:Number — The y coordinate of the location in absolute coordinates.
 
node:INode — The node where the table instance is currently bound to.
 
subregion:StripeSubregion (default = null) — One or a combined subregion to which the hit tests are restricted. Specifying only the subregions of interest can improve the performance considerably. By default all subregions are tested.

Returns
Iterator — A collection of StripeSubregionDescriptors at the given location.