- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {BufferedReader b =
InputStream in;new BufferedReader(new InputStreamReader(in))
Reader in;new BufferedReader(in)
File file;new BufferedReader(new FileReader(file))
- Smart code suggestions by Codota
}
@Override public void setTitle(final String title) { display.getEDTUtil().invoke(false, new Runnable() { @Override public void run() { window.setTitle(title); } }); }
public void showCursor() { display.getEDTUtil().invoke(false, new Runnable() { @Override public void run() { window.setPointerVisible(true); } }); }
@Override public void setAlwaysOnTop(final boolean always) { display.getEDTUtil().invoke(false, new Runnable() { @Override public void run() { window.setAlwaysOnTop(always); } }); }
@Override public void setResizable(final boolean resizable) { display.getEDTUtil().invoke(false, new Runnable() { @Override public void run() { window.setResizable(resizable); } }); }
public void requestFocus() { display.getEDTUtil().invoke(false, new Runnable() { @Override public void run() { window.requestFocus(); } }); }
@Override public void setVisible(final boolean visible) { display.getEDTUtil().invoke(false, new Runnable() { @Override public void run() { window.setVisible(visible); } }); }
public void setLocation(final int x, final int y) { display.getEDTUtil().invoke(false, new Runnable() { @Override public void run() { window.setTopLevelPosition(x, y); } }); }
public void hideCursor() { display.getEDTUtil().invoke(false, new Runnable() { @Override public void run() { window.setPointerVisible(false); } }); } }
public void runOnEDTIfAvail(final boolean wait, final Runnable task) { final EDTUtil _edtUtil = edtUtil; if( !_edtUtil.isRunning() ) { // start EDT if not running yet synchronized( this ) { if( !_edtUtil.isRunning() ) { // // volatile dbl-checked-locking OK if( DEBUG ) { System.err.println("Info: EDT start "+Thread.currentThread().getName()+", "+this); ExceptionUtils.dumpStack(System.err); } _edtUtil.start(); } } } if( !_edtUtil.isCurrentThreadEDT() ) { if( _edtUtil.invoke(wait, task) ) { return; // done } if( DEBUG ) { System.err.println("Warning: invoke(wait "+wait+", ..) on EDT failed .. invoke on current thread "+Thread.currentThread().getName()); ExceptionUtils.dumpStack(System.err); } } task.run(); }
public void runOnEDTIfAvail(final boolean wait, final Runnable task) { final EDTUtil _edtUtil = edtUtil; if( !_edtUtil.isRunning() ) { // start EDT if not running yet synchronized( this ) { if( !_edtUtil.isRunning() ) { // // volatile dbl-checked-locking OK if( DEBUG ) { System.err.println("Info: EDT start "+Thread.currentThread().getName()+", "+this); Thread.dumpStack(); } _edtUtil.start(); } } } if( !_edtUtil.isCurrentThreadEDT() ) { if( _edtUtil.invoke(wait, task) ) { return; // done } if( DEBUG ) { System.err.println("Warning: invoke(wait "+wait+", ..) on EDT failed .. invoke on current thread "+Thread.currentThread().getName()); Thread.dumpStack(); } } task.run(); }
public void setCursor(PImage image, int hotspotX, int hotspotY) { Display disp = window.getScreen().getDisplay(); BufferedImage bimg = (BufferedImage)image.getNative(); DataBufferInt dbuf = (DataBufferInt)bimg.getData().getDataBuffer(); int[] ipix = dbuf.getData(); ByteBuffer pixels = ByteBuffer.allocate(ipix.length * 4); pixels.asIntBuffer().put(ipix); PixelFormat format = PixelFormat.ARGB8888; final Dimension size = new Dimension(bimg.getWidth(), bimg.getHeight()); PixelRectangle pixelrect = new PixelRectangle.GenericPixelRect(format, size, 0, false, pixels); final PointerIcon pi = disp.createPointerIcon(pixelrect, hotspotX, hotspotY); display.getEDTUtil().invoke(false, new Runnable() { @Override public void run() { window.setPointerVisible(true); window.setPointerIcon(pi); } }); }