下面列出了javafx.scene.Scene#getCursor ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public void fillAt(final double x, final double y, final long fill)
{
if (!isVisible.getAsBoolean())
{
LOG.info("Selected source is not visible -- will not fill");
return;
}
final int level = 0;
final int time = 0;
final MaskInfo<UnsignedLongType> maskInfo = new MaskInfo<>(time, level, new UnsignedLongType(fill));
final Scene scene = viewer.getScene();
final Cursor previousCursor = scene.getCursor();
scene.setCursor(Cursor.WAIT);
try
{
final Mask<UnsignedLongType> mask = source.generateMask(maskInfo, FOREGROUND_CHECK);
final Interval affectedInterval = fillMaskAt(x, y, this.viewer, mask, source, assignment, FILL_VALUE, this.fillDepth.get());
requestRepaint.run();
source.applyMask(mask, affectedInterval, FOREGROUND_CHECK);
} catch (final MaskInUse e)
{
LOG.debug(e.getMessage());
} finally
{
scene.setCursor(previousCursor);
}
}
@Override
public void mouseEntered(CircuitManager manager, CircuitState state) {
Scene scene = manager.getSimulatorWindow().getScene();
prevCursor = scene.getCursor();
scene.setCursor(Cursor.TEXT);
entered = true;
}
/**
* Sets the given {@link Cursor} as the mouse cursor for the {@link Scene}
* of the host visual. Note that this method does not store the original
* mouse cursor.
*
* @param cursor
* The new mouse {@link Cursor}.
* @see #storeAndReplaceCursor(Cursor)
* @see #restoreCursor()
*/
public void setCursor(Cursor cursor) {
Scene scene = getAdaptable().getRootPart().getVisual().getScene();
if (cursor != scene.getCursor()) {
scene.setCursor(cursor);
}
}