use of java.awt.Cursor in project processing by processing.
the class JavaTextAreaPainter method updateCursor.
private void updateCursor(int mouseX, int mouseY) {
int currentTab = getCurrentCodeIndex();
for (Handle n : handles.get(currentTab)) {
if (n.pick(mouseX, mouseY)) {
cursorType = Cursor.W_RESIZE_CURSOR;
setCursor(new Cursor(cursorType));
return;
}
}
for (ColorControlBox colorBox : colorBoxes.get(currentTab)) {
if (colorBox.pick(mouseX, mouseY)) {
cursorType = Cursor.HAND_CURSOR;
setCursor(new Cursor(cursorType));
return;
}
}
if (cursorType == Cursor.W_RESIZE_CURSOR || cursorType == Cursor.HAND_CURSOR || cursorType == -1) {
cursorType = Cursor.DEFAULT_CURSOR;
setCursor(new Cursor(cursorType));
}
}
use of java.awt.Cursor in project libgdx by libgdx.
the class LwjglAWTInput method showCursor.
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());
}
}
use of java.awt.Cursor in project voltdb by VoltDB.
the class Grid method mouseMove.
/**
* Method declaration
*
*
* @param e
* @param x
* @param y
*/
public boolean mouseMove(Event e, int x, int y) {
if (y <= iRowHeight) {
int xb = x;
x += iX - iGridWidth;
int i = iColCount - 1;
for (; i >= 0; i--) {
if (x > -7 && x < 7) {
break;
}
x += iColWidth[i];
}
if (i >= 0) {
if (!bDrag) {
setCursor(new Cursor(Cursor.E_RESIZE_CURSOR));
bDrag = true;
iXDrag = xb - iColWidth[i];
iColDrag = i;
}
return true;
}
}
return mouseExit(e, x, y);
}
use of java.awt.Cursor in project voltdb by VoltDB.
the class Grid method mouseExit.
/**
* Method declaration
*
*
* @param e
* @param x
* @param y
*/
public boolean mouseExit(Event e, int x, int y) {
if (bDrag) {
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
bDrag = false;
}
return true;
}
use of java.awt.Cursor in project adempiere by adempiere.
the class PDFViewerBean method print.
public void print() {
PrinterJob printJob = PrinterJob.getPrinterJob();
//decoder.enableScaledPrinting(false);
printJob.setPageable(decoder);
final PageFormat pf = printJob.defaultPage();
decoder.setPageFormat(pf);
decoder.setTextPrint(PdfDecoder.TEXTGLYPHPRINT);
printJob.setPrintable(decoder, pf);
if (printJob.printDialog()) {
final Cursor oldCursor = getCursor();
try {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
printJob.print();
} catch (PrinterException e) {
e.printStackTrace();
} finally {
setCursor(oldCursor);
}
}
}
Aggregations