use of com.ait.lienzo.client.core.event.AbstractNodeHumanInputEvent in project lienzo-core by ahome-it.
the class LienzoHandlerManager method doCheckEnterExitShape.
// This will also return the shape under the cursor, for some optimization on Mouse Move
@SuppressWarnings("unchecked")
private final Shape<?> doCheckEnterExitShape(final INodeXYEvent event) {
final int x = event.getX();
final int y = event.getY();
final Shape<?> shape = findShapeAtPoint(x, y);
if (shape != null) {
final IPrimitive<?> prim = shape.asPrimitive();
if (null != m_over_prim) {
if (prim != m_over_prim) {
if (m_over_prim.isEventHandled(NodeMouseExitEvent.getType())) {
if (event instanceof AbstractNodeHumanInputEvent) {
m_over_prim.fireEvent(new NodeMouseExitEvent(((AbstractNodeHumanInputEvent<MouseEvent<?>, ?>) event).getHumanInputEvent(), x, y));
} else {
m_over_prim.fireEvent(new NodeMouseExitEvent(null, x, y));
}
}
}
}
if (prim != m_over_prim) {
if ((null != prim) && (prim.isEventHandled(NodeMouseEnterEvent.getType()))) {
if (event instanceof AbstractNodeHumanInputEvent) {
prim.fireEvent(new NodeMouseEnterEvent(((AbstractNodeHumanInputEvent<MouseEvent<?>, ?>) event).getHumanInputEvent(), x, y));
} else {
prim.fireEvent(new NodeMouseEnterEvent(null, x, y));
}
}
m_over_prim = prim;
}
} else {
doCancelEnterExitShape(event);
}
return shape;
}
Aggregations