java.awt.Cursor.getPredefinedCursor()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(279)

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

Cursor.getPredefinedCursor介绍

[英]Returns a cursor object with the specified predefined type.
[中]返回具有指定预定义类型的游标对象。

代码示例

代码示例来源:origin: libgdx/libgdx

add(titlePanel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
  new Insets(3, 0, 3, 0), 0, 0));
titlePanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

代码示例来源:origin: libgdx/libgdx

add(titlePanel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
  new Insets(3, 0, 3, 0), 0, 0));
titlePanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

代码示例来源:origin: skylot/jadx

protected void loadStartCommon() {
  setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
  progressPane.setIndeterminate(true);
  progressPane.setVisible(true);
  resultsTable.setEnabled(false);
  warnLabel.setVisible(false);
}

代码示例来源:origin: hsz/idea-gitignore

@Override
public void mouseMoved(MouseEvent e) {
  Cursor cursor = (e.getPoint().getY() <= DRAG_OFFSET) ?
      Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR) : Cursor.getDefaultCursor();
  panel.setCursor(cursor);
}

代码示例来源:origin: osmdroid/osmdroid

private void unFreezeUI() {
  this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
  this.mBtnStartBatch.setEnabled(true);
  this.mTxtBatchItems.setEnabled(true);
}

代码示例来源:origin: osmdroid/osmdroid

private void freezeUI() {
  this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
  this.mBtnStartBatch.setEnabled(false);
  this.mTxtBatchItems.setEnabled(false);
}

代码示例来源:origin: libgdx/libgdx

add(titlePanel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
  new Insets(3, 0, 3, 0), 0, 0));
titlePanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

代码示例来源:origin: libgdx/libgdx

add(titlePanel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
  new Insets(3, 0, 3, 0), 0, 0));
titlePanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

代码示例来源:origin: plantuml/plantuml

private void updateLinkColor(final Color newLink) {
  if (link != newLink) {
    link = newLink;
    this.setCursor(link == LINK_NORMAL ? Cursor.getDefaultCursor() : Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    repaint();
  }
}

代码示例来源:origin: wiztools/rest-client

@Override
public void dragOver(DropTargetDragEvent dtde) {
  dtde.getDropTargetContext().getComponent()
      .setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
}

代码示例来源:origin: wiztools/rest-client

@Override
public void dragEnter(DropTargetDragEvent dtde) {
  dtde.getDropTargetContext().getComponent()
      .setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
}

代码示例来源:origin: org.netbeans.api/org-openide-util

public static Cursor createCustomCursor(Component component, Image icon, String name) {
  Toolkit t = component.getToolkit();
  Dimension d = t.getBestCursorSize(16, 16);
  Image i = icon;
  if (d.width != icon.getWidth(null)) {
    if (((d.width) == 0) && (d.height == 0)) {
      // system doesn't support custom cursors, falling back
      return Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
    }
    // need to resize the icon
    Image empty = ImageUtilities.createBufferedImage(d.width, d.height);
    i = ImageUtilities.mergeImages(icon, empty, 0, 0);
  }
  return t.createCustomCursor(i, new Point(1, 1), name);
}

代码示例来源:origin: igniterealtime/Openfire

@Override
public void actionPerformed(ActionEvent e) {
  if ("Start".equals(e.getActionCommand())) {
    frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

代码示例来源:origin: stackoverflow.com

private final Cursor defCursor = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);
private final Cursor hndCursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
private final Point pp = new Point();
private JLabel image;

代码示例来源:origin: libgdx/libgdx

linkText.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
linkText.addMouseListener(new MouseAdapter() {
  public void mouseClicked (MouseEvent e) {

代码示例来源:origin: groovy/groovy-core

public void mouseEntered(MouseEvent me) {
  if (contains(me.getPoint())) {
    cursor = getCursor();
    Cursor curs = Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR);
    getRootPane().getLayeredPane().setCursor(curs);
  } else {
    getRootPane().getLayeredPane().setCursor(cursor);
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

/** Updates the splitter's cursor according to the current SplittedPanel settings. */
protected void setSplitterCursor() {
  if (dragable) {
    if (splitType == VERTICAL) {
      splitter.setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
    } else {
      splitter.setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
    }
  } else {
    splitter.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
  }
}

代码示例来源:origin: ron190/jsql-injection

private void clearDropLocationPaint(Component c) {
  if (c instanceof DnDTabbedPane) {
    DnDTabbedPane t = (DnDTabbedPane) c;
    t.setDropLocation(null, null, false);
    t.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
  }
}

代码示例来源:origin: ron190/jsql-injection

public void setSelected() {
  for (JLabel label: this.getGroup()) {
    if (this != label) {
      label.setFont(HelperUi.FONT_SEGOE);
    } else {
      this.action();
    }
  }
  this.setUnderlined();
  this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}

代码示例来源:origin: ron190/jsql-injection

@Override 
protected void exportDone(JComponent c, Transferable data, int action) {
  DnDTabbedPane src = (DnDTabbedPane) c;
  src.getRootPane().getGlassPane().setVisible(false);
  src.setDropLocation(null, null, false);
  src.repaint();
  src.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}

相关文章