本文整理了Java中java.awt.Cursor.getDefaultCursor()
方法的一些代码示例,展示了Cursor.getDefaultCursor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cursor.getDefaultCursor()
方法的具体详情如下:
包路径:java.awt.Cursor
类名称:Cursor
方法名:getDefaultCursor
[英]Return the system default cursor.
[中]返回系统默认光标。
代码示例来源: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: libgdx/libgdx
private void showCursor (boolean visible) {
if (!visible) {
Toolkit t = Toolkit.getDefaultToolkit();
Image i = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
Cursor noCursor = t.createCustomCursor(i, new Point(0, 0), "none");
JFrame frame = findJFrame(canvas);
frame.setCursor(noCursor);
} else {
JFrame frame = findJFrame(canvas);
frame.setCursor(Cursor.getDefaultCursor());
}
}
代码示例来源:origin: libgdx/libgdx
private void showCursor (boolean visible) {
if (!visible) {
Toolkit t = Toolkit.getDefaultToolkit();
Image i = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
Cursor noCursor = t.createCustomCursor(i, new Point(0, 0), "none");
JFrame frame = findJFrame(canvas);
frame.setCursor(noCursor);
} else {
JFrame frame = findJFrame(canvas);
frame.setCursor(Cursor.getDefaultCursor());
}
}
代码示例来源: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 dragExit(DropTargetEvent dte) {
dte.getDropTargetContext().getComponent()
.setCursor(Cursor.getDefaultCursor());
}
代码示例来源:origin: igniterealtime/Openfire
trayIcon.setImage(offIcon.getImage());
frame.setCursor(Cursor.getDefaultCursor());
browserButton.setEnabled(false);
startButton.setEnabled(true);
代码示例来源:origin: wiztools/rest-client
@Override
public void drop(DropTargetDropEvent evt) {
final int action = evt.getDropAction();
evt.acceptDrop(action);
try {
Transferable data = evt.getTransferable();
if (data.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
java.util.List<File> list = (java.util.List<File>) data.getTransferData(
DataFlavor.javaFileListFlavor);
for(DndAction a: actions) {
a.onDrop(list);
}
}
}
catch (UnsupportedFlavorException | IOException e) {
LOG.log(Level.WARNING, null, e);
}
finally {
evt.dropComplete(true);
evt.getDropTargetContext().getComponent()
.setCursor(Cursor.getDefaultCursor());
}
}
代码示例来源:origin: geotools/geotools
/**
* Get the cursor for this tool. Sub-classes should override this method to provide a custom
* cursor.
*
* @return the default cursor
*/
public Cursor getCursor() {
return Cursor.getDefaultCursor();
}
代码示例来源:origin: runelite/runelite
frame.getLayeredPane().setCursor(Cursor.getDefaultCursor()); // Prevent substance from using a resize cursor for pointing
frame.setLocationRelativeTo(frame.getOwner());
frame.setResizable(true);
代码示例来源:origin: ron190/jsql-injection
/**
* Main constructor to create a ComponentBorder.
* @param component the component to be added in the Border area
* @param edge a valid Edge enum of TOP, LEFT, BOTTOM, RIGHT
* @param alignment the alignment of the component along the
* specified Edge. Must be in the range 0 - 1.0.
*/
public ComponentBorder(JComponent component, Edge edge, float alignment) {
this.component = component;
component.setSize(component.getPreferredSize());
component.setCursor(Cursor.getDefaultCursor());
this.setEdge(edge);
this.setAlignment(alignment);
}
代码示例来源:origin: nodebox/nodebox
public void mouseReleased(MouseEvent e) {
if (!isEnabled()) return;
isDragging = false;
SwingUtilities.getRootPane(this).setCursor(Cursor.getDefaultCursor());
if (oldValue != value)
fireStateChanged();
}
代码示例来源:origin: geotools/geotools
/** {@inheritDoc} */
@Override
public void setCursorTool(CursorTool tool) {
paramsLock.writeLock().lock();
try {
if (currentCursorTool != null) {
mouseEventDispatcher.removeMouseListener(currentCursorTool);
}
currentCursorTool = tool;
if (currentCursorTool == null) {
setCursor(Cursor.getDefaultCursor());
dragBox.setEnabled(false);
} else {
setCursor(currentCursorTool.getCursor());
dragBox.setEnabled(currentCursorTool.drawDragBox());
currentCursorTool.setMapPane(this);
mouseEventDispatcher.addMouseListener(currentCursorTool);
}
} finally {
paramsLock.writeLock().unlock();
}
}
代码示例来源:origin: apache/pdfbox
setCursor(Cursor.getDefaultCursor());
代码示例来源:origin: igvteam/igv
@Override
protected void done() {
runButton.setEnabled(true);
setCursor(Cursor.getDefaultCursor());
}
};
代码示例来源:origin: org.swinglabs.swingx/swingx-core
@Override
public void mouseReleased(MouseEvent e) {
if (e.getButton() != MouseEvent.BUTTON1) {
return;
}
setCursor(Cursor.getDefaultCursor());
}
}
代码示例来源:origin: igvteam/igv
@Override
protected void done() {
runButton.setEnabled(true);
setCursor(Cursor.getDefaultCursor());
updateTextArea("Done");
}
}
代码示例来源:origin: jawi/ols
@Override
public void mouseExited( final MouseEvent aEvent )
{
if ( isEnabled() )
{
aEvent.getComponent().setCursor( Cursor.getDefaultCursor() );
}
}
} );
代码示例来源:origin: apache/felix
public void mouseMoved(MouseEvent e) {
String link = getDataLink(e.getPoint());
if (link != null)
table.setCursor(handCursor);
else
table.setCursor(Cursor.getDefaultCursor());
}
代码示例来源:origin: onyxbits/Raccoon
@Override
protected void done() {
try {
callback.updateEntry(get());
SwingUtilities.windowForComponent(callback).setCursor(Cursor.getDefaultCursor());
}
catch (Exception e) {
// There is no reason why we should end here
e.printStackTrace();
return;
}
}
代码示例来源:origin: freeplane/freeplane
public void setSearchingDefaultCursor()
{
RootPaneContainer root = (RootPaneContainer)getTopLevelAncestor();
root.getGlassPane().setCursor(Cursor.getDefaultCursor());
root.getGlassPane().setVisible(false);
}
内容来源于网络,如有侵权,请联系作者删除!