All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----sgraphics.GlyphImpl | +----sgraphics.MonoGlyph | +----sgraphics.wrapper.HitGlyph
It is useful when a ancestor glyph needs to know about a glyph that is the ancestor of another glyph. For example, an editor may have a vbox full of hboxes that are in turn full of FigLabels. When a FigLabel is hit, the parent of the vbox may need to know which hbox contained the hit FigLabel to determine which row it was in. In this case, each hbox can be wrapped in a HitGlyph. (You must make sure there is no Viewer between HitGlyph and the FigLabel.)
The parent glyph of the vbox would store the FigLabel reference when the event reaches it. Then when the event from the HitGlyph reaches it, it could use its reference to determine the row, and the saved FigLabel reference to determine the position in the row.
This is an alternative approach to building glyphs that have knowledge of their row and column. While the latter works, it means updating their state after scrolling, etc. Using the HitGlyph approach means looking through a list to find the glyph index, possibly with a hash table for speed.
public HitGlyph(Glyph glyph)
public void pick(Picker pick)
All Packages Class Hierarchy This Package Previous Next Index