Codota Logo
EDTUtil.invoke
Code IndexAdd Codota to your IDE (free)

How to use
invoke
method
in
com.jogamp.newt.util.EDTUtil

Best Java code snippets using com.jogamp.newt.util.EDTUtil.invoke (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: org.processing/core

@Override
public void setTitle(final String title) {
 display.getEDTUtil().invoke(false, new Runnable() {
  @Override
  public void run() {
   window.setTitle(title);
  }
 });
}
origin: org.processing/core

public void showCursor() {
 display.getEDTUtil().invoke(false, new Runnable() {
  @Override
  public void run() {
   window.setPointerVisible(true);
  }
 });
}
origin: org.processing/core

@Override
public void setAlwaysOnTop(final boolean always) {
 display.getEDTUtil().invoke(false, new Runnable() {
  @Override
  public void run() {
   window.setAlwaysOnTop(always);
  }
 });
}
origin: org.processing/core

@Override
public void setResizable(final boolean resizable) {
 display.getEDTUtil().invoke(false, new Runnable() {
  @Override
  public void run() {
   window.setResizable(resizable);
  }
 });
}
origin: org.processing/core

public void requestFocus() {
 display.getEDTUtil().invoke(false, new Runnable() {
  @Override
  public void run() {
   window.requestFocus();
  }
 });
}
origin: org.processing/core

@Override
public void setVisible(final boolean visible) {
 display.getEDTUtil().invoke(false, new Runnable() {
  @Override
  public void run() {
   window.setVisible(visible);
  }
 });
}
origin: org.processing/core

public void setLocation(final int x, final int y) {
 display.getEDTUtil().invoke(false, new Runnable() {
  @Override
  public void run() {
   window.setTopLevelPosition(x, y);
  }
 });
}
origin: org.processing/core

 public void hideCursor() {
  display.getEDTUtil().invoke(false, new Runnable() {
   @Override
   public void run() {
    window.setPointerVisible(false);
   }
  });
 }
}
origin: org.jogamp.jogl/jogl-all-noawt

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();
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

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();
}
origin: org.processing/core

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);
  }
 });
}
com.jogamp.newt.utilEDTUtilinvoke

Javadoc

Appends task to the EDT task queue if current thread is not EDT, otherwise execute task immediately.

Wait until execution is finished if wait == true.

Can be issued from within EDT, ie from within an enqueued task.

Popular methods of EDTUtil

  • isCurrentThreadEDT
    Returns true if the current thread is the event dispatch thread (EDT). The EDT is the platform speci
  • getPollPeriod
  • invokeStop
    Append the final task to the EDT task queue, signals EDT to stop. If wait is true methods blocks unt
  • isCurrentThreadEDTorNEDT
    Returns true if either #isCurrentThreadEDT() or #isCurrentThreadNEDT() is true, otherwise false.
  • isRunning
  • start
    Starts the EDT after it's creation or after #invokeStop(boolean,Runnable). If the EDT is running, it
  • waitUntilStopped
    Wait until EDT task is stopped. No stop action is performed, #invokeStop(boolean,java.lang.Runnable)

Popular in Java

  • Making http requests using okhttp
  • setScale (BigDecimal)
  • putExtra (Intent)
  • getSystemService (Context)
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • String (java.lang)
  • Notification (javax.management)
  • JFrame (javax.swing)
  • JLabel (javax.swing)
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now