getHandleCursor method
Returns the appropriate MouseCursor when hovering over a handle.
Implementation
MouseCursor getHandleCursor(int handleIndex) {
switch (tool) {
case DrawingTool.horizontalLine:
case DrawingTool.horizontalRay:
return SystemMouseCursors.resizeUpDown;
case DrawingTool.verticalLine:
return SystemMouseCursors.resizeLeftRight;
case DrawingTool.rectangle:
switch (handleIndex) {
case 0:
case 2:
return SystemMouseCursors.resizeUpLeftDownRight;
case 1:
case 3:
return SystemMouseCursors.resizeUpRightDownLeft;
case 4:
case 6:
return SystemMouseCursors.resizeUpDown;
case 5:
case 7:
return SystemMouseCursors.resizeLeftRight;
default:
return SystemMouseCursors.grab;
}
case DrawingTool.longPosition:
case DrawingTool.shortPosition:
switch (handleIndex) {
case 0:
case 1:
case 2:
return SystemMouseCursors.resizeUpDown;
case 3:
return SystemMouseCursors.resizeLeftRight;
default:
return SystemMouseCursors.grab;
}
case DrawingTool.trendline:
case DrawingTool.extendedTrendline:
case DrawingTool.ruler:
case DrawingTool.fibonacci:
case DrawingTool.parallelChannel:
case DrawingTool.arrow:
return SystemMouseCursors.grab;
case DrawingTool.textLabel:
case DrawingTool.pointer:
return SystemMouseCursors.basic;
}
}