java.awt.Window.getCursor()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中java.awt.Window.getCursor()方法的一些代码示例,展示了Window.getCursor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.getCursor()方法的具体详情如下:
包路径:java.awt.Window
类名称:Window
方法名:getCursor

Window.getCursor介绍

暂无

代码示例

代码示例来源:origin: com.github.insubstantial/substance

@Override
public void mouseEntered(MouseEvent ev) {
  Window w = (Window) ev.getSource();
  if (cursorState == CursorState.EXITED
      || cursorState == CursorState.NIL) {
    // fix for defect 107
    SubstanceRootPaneUI.this.lastCursor = w.getCursor();
  }
  cursorState = CursorState.ENTERED;
  this.mouseMoved(ev);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf

public void mouseEntered(MouseEvent ev) {
 java.awt.Window w = translateSource(ev);
 if (!mouseAlreadyEntered) {
   lastCursor = w.getCursor();
 }
 mouseAlreadyEntered = true;
 mouseMoved(ev);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

public void mouseEntered(MouseEvent ev)
{
  Window w = (Window) ev.getSource();
  lastCursor = w.getCursor();
  mouseMoved(ev);
}

代码示例来源:origin: khuxtable/seaglass

/**
 * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
 */
public void mouseEntered(MouseEvent ev) {
  Window w = (Window) ev.getSource();
  lastCursor = w.getCursor();
  mouseMoved(ev);
}

代码示例来源:origin: com.jidesoft/jide-oss

public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
  // change to busy cursor
  Window window = SwingUtilities.getWindowAncestor(BasicFileSystemTree.this);
  if (window != null) {
    oldCursor = window.getCursor();
    window.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
  }
}

代码示例来源:origin: org.java.net.substance/substance

public void mouseEntered(MouseEvent ev) {
  Window w = (Window) ev.getSource();
  if (cursorState == CursorState.EXITED
      || cursorState == CursorState.NIL) {
    // fix for defect 107
    SubstanceRootPaneUI.this.lastCursor = w.getCursor();
  }
  cursorState = CursorState.ENTERED;
  this.mouseMoved(ev);
}

代码示例来源:origin: com.jidesoft/jide-oss

private void setWaitCursor(boolean isWait) {
  Window parentWindow = SwingUtilities.getWindowAncestor(_folderChooser);
  if (isWait) {
    Cursor hourglassCursor = new Cursor(Cursor.WAIT_CURSOR);
    m_oldCursor = parentWindow.getCursor();
    parentWindow.setCursor(hourglassCursor);
  }
  else {
    if (m_oldCursor != null) {
      parentWindow.setCursor(m_oldCursor);
      m_oldCursor = null;
    }
  }
}

代码示例来源:origin: de.sciss/scisslib

public void mousePressed(MouseEvent e) {
  reFire = false;
  if (!isEnabled()) return;
  requestFocus();
  final Window w = SwingUtilities.getWindowAncestor(Jog.this);
  if (w != null) {
    savedCursor = w.getCursor();
    w.setCursor(dragCursor);
  }
  processMouse(e, false);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-profiler

public LoadedSnapshot takeSnapshot() {
  CommonUtils.runInEventDispatchThreadAndWait(new Runnable() {
      public void run() {
        mainWindow = WindowManager.getDefault().getMainWindow();
      }
    });
  final Cursor cursor = mainWindow.getCursor();
  mainWindow.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
  try {
    LoadedSnapshot snapshot = prepareSnapshot();
    if (snapshot != null) {
      loadedSnapshots.add(snapshot);
      fireSnapshotTaken(snapshot);
      return snapshot;
    }
  } finally {
    mainWindow.setCursor(cursor);
  }
  return null;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-core

private static boolean isWaitCursorOnWindow(Window w) {
  if (w.getCursor().getType() == Cursor.WAIT_CURSOR) {
    return true;
  }
  if (w instanceof JFrame) {
    JRootPane root = ((JFrame)w).getRootPane();
    if (null != root) {
      Component glass = root.getGlassPane();
      if (null != glass && glass.getCursor().getType() == Cursor.WAIT_CURSOR) {
        return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: com.jtattoo/JTattoo

public void installClientDecorations(JRootPane root) {
  installBorder(root);
  if (titlePane == null) {
    setTitlePane(root, createTitlePane(root));
  }
  installWindowListeners(root, root.getParent());
  installLayout(root);
  if (window != null) {
    savedCursor = window.getCursor();
    root.revalidate();
    root.repaint();
  }
}

代码示例来源:origin: net.sf.cuf/cuf-swing

mLastCursor    = target.getCursor();
target.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
glassPane.setVisible(true);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-profiler

public void run() {
  final Cursor cursor = mainWindow.getCursor();
  mainWindow.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

相关文章

Window类方法