congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
com.jogamp.newt
Code IndexAdd Tabnine to your IDE (free)

How to use com.jogamp.newt

Best Java code snippets using com.jogamp.newt (Showing top 20 results out of 315)

origin: jMonkeyEngine/jmonkeyengine

protected void applySettings(AppSettings settings){
  active.set(true);
  canvas.addWindowListener(new WindowAdapter() {
    @Override
    public void windowDestroyNotify(WindowEvent e) {
  canvas.setSize(settings.getWidth(), settings.getHeight());
  canvas.setUndecorated(settings.isFullscreen());
  canvas.setFullscreen(settings.isFullscreen());
  Screen screen = canvas.getScreen();
  screen.addReference();
  if (settings.isFullscreen()) {
    List<MonitorMode> screenModes = canvas.getMainMonitor().getSupportedModes();
    screenModes = MonitorModeUtil.filterByResolution(screenModes, dimension);
    screenModes = MonitorModeUtil.getHighestAvailableBpp(screenModes);
    if (settings.getFrequency() > 0) {
      screenModes = MonitorModeUtil.filterByRate(screenModes, settings.getFrequency());
    } else {
      screenModes = MonitorModeUtil.getHighestAvailableRate(screenModes);
    canvas.getMainMonitor().setCurrentMode(screenModes.get(0));
  MonitorMode currentScreenMode = canvas.getMainMonitor().getCurrentMode();
  logger.log(Level.FINE, "Selected display mode: {0}x{1}x{2} @{3}",
      new Object[]{currentScreenMode.getRotatedWidth(),
             currentScreenMode.getRotatedHeight(),
             currentScreenMode.getSurfaceSize().getBitsPerPixel(),
origin: jMonkeyEngine/jmonkeyengine

  @Override
  public void setNativeCursor(JmeCursor cursor) {
    final ByteBuffer pixels = Buffers.copyIntBufferAsByteBuffer(cursor.getImagesData());
    final DimensionImmutable size = new Dimension(cursor.getWidth(), cursor.getHeight());
    final PixelFormat pixFormat = PixelFormat.RGBA8888;
    final PixelRectangle.GenericPixelRect rec = new PixelRectangle.GenericPixelRect(pixFormat, size, 0, true, pixels);
    final PointerIcon joglCursor = component.getScreen().getDisplay().createPointerIcon(rec, cursor.getXHotSpot(), cursor.getHeight() - cursor.getYHotSpot());
    component.setPointerIcon(joglCursor);
  }
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

private final int getHashCode() {
  // 31 * x == (x << 5) - x
  int hash = 31 + getId();
  hash = ((hash << 5) - hash) + sizeAndRRate.hashCode();
  hash = ((hash << 5) - hash) + getRotation();
  return hash;
}
origin: org.jogamp.jogl/jogl-all-noawt

/**
 * Calculates the union of all monitor's {@link MonitorDevice#getViewport() viewport} in pixel- and window units.
 * <p>
 * Should be equal to {@link #getX()}, {@link #getY()}, {@link #getWidth()} and {@link #getHeight()},
 * however, some native toolkits may choose a different virtual screen area.
 * </p>
 * @param viewport storage for result in pixel units, maybe null
 * @param viewportInWindowUnits storage for result in window units, maybe null
 */
public final void unionOfMonitorViewports(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
  MonitorDevice.unionOfViewports(viewport, viewportInWindowUnits, getMonitorDevices());
}
origin: org.jogamp.jogl/jogl-all-noawt

public static MonitorMode getByNativeSizeRateIdAndRotation(final List<MonitorMode> monitorModes, final MonitorMode.SizeAndRRate sizeAndRate, final int modeId, final int rotation) {
  if( null!=monitorModes && monitorModes.size()>0 ) {
    for (int i=0; i<monitorModes.size(); i++) {
      final MonitorMode mode = monitorModes.get(i);
      if( mode.getSizeAndRRate().equals(sizeAndRate) && mode.getId() == modeId && mode.getRotation() == rotation ) {
        return mode;
      }
    }
  }
  return null;
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

    @Override
    public void run() {
      if(newtChild.isVisible() != showing) {
        newtChild.setVisible(showing);
      }
    }});
}
origin: org.jogamp.jogl/jogl-all-noawt

/**
 *
 * @param type
 * @param name
 * @param fromIndex start index, then decreasing until found or end of list. -1 is interpreted as size - 1.
 * @param shared if true, only shared instances are found, otherwise also exclusive
 * @return
 */
public static Display getLastDisplayOf(final String type, final String name, final int fromIndex, final boolean shared) {
  return getDisplayOfImpl(type, name, fromIndex, -1, shared);
}
origin: org.jogamp.jogl/jogl-all-noawt

/** Returns the rotated screen width in pixel units,
 *  derived from <code>getMonitorMode().getSurfaceSize().getResolution()</code>
 *  and <code>getRotation()</code>
 */
public final int getRotatedWidth() {
  return getRotatedWH(true);
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

/* package */ void configureNewtChild(final boolean attach) {
  newtChildReady = attach;
  if( null != newtChild ) {
    newtChild.setKeyboardFocusHandler(null);
    if(attach) {
      newtChildCloseOp = newtChild.setDefaultCloseOperation(WindowClosingMode.DO_NOTHING_ON_CLOSE);
    } else {
      newtChild.setFocusAction(null);
      newtChild.setDefaultCloseOperation(newtChildCloseOp);
    }
  }
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

/**
 * Returns <code>true</true> if the {@link MonitorMode}
 * has been changed programmatic via this API <i>only</i>, otherwise <code>false</code>.
 * <p>
 * Note: We cannot guarantee that we won't interfere w/ another running
 * application's screen mode change or vice versa.
 * </p>
 */
public final boolean isModeChangedByUs() {
  return modeChanged && !isOriginalMode();
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

/**
 *
 * @param type
 * @param name
 * @param fromIndex start index, then decreasing until found or end of list. -1 is interpreted as size - 1.
 * @return
 */
public static Screen getLastScreenOf(final Display display, final int idx, final int fromIndex) {
  return getScreenOfImpl(display, idx, fromIndex, -1);
}
origin: org.jogamp.jogl/jogl-all-noawt

/** WARNING: must be synchronized with ScreenMode.h, native implementation */
private static MonitorMode streamInMonitorMode0(final MonitorMode.SizeAndRRate sizeAndRate, final int[] modeProperties, int offset) {
  final int id = modeProperties[offset++];
  final int rotation = modeProperties[offset++];
  return new MonitorMode(id, sizeAndRate, rotation);
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

  @Override
  public void run() {
    if( componentAdded && newtChild != null ) {
      newtChild.sendWindowEvent(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY);
    }
  }
} );
origin: org.jogamp.jogl/jogl-all-noawt

private final int getHashCode() {
  // 31 * x == (x << 5) - x
  int hash = 31 + getId();
  hash = ((hash << 5) - hash) + sizeAndRRate.hashCode();
  hash = ((hash << 5) - hash) + getRotation();
  return hash;
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

/**
 * Calculates the union of all monitor's {@link MonitorDevice#getViewport() viewport} in pixel- and window units.
 * <p>
 * Should be equal to {@link #getX()}, {@link #getY()}, {@link #getWidth()} and {@link #getHeight()},
 * however, some native toolkits may choose a different virtual screen area.
 * </p>
 * @param viewport storage for result in pixel units, maybe null
 * @param viewportInWindowUnits storage for result in window units, maybe null
 */
public final void unionOfMonitorViewports(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
  MonitorDevice.unionOfViewports(viewport, viewportInWindowUnits, getMonitorDevices());
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

/**
 *
 * @param type
 * @param name
 * @param fromIndex start index, then decreasing until found or end of list. -1 is interpreted as size - 1.
 * @param shared if true, only shared instances are found, otherwise also exclusive
 * @return
 */
public static Display getLastDisplayOf(final String type, final String name, final int fromIndex, final boolean shared) {
  return getDisplayOfImpl(type, name, fromIndex, -1, shared);
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

/** Returns the rotated screen width in pixel units,
 *  derived from <code>getMonitorMode().getSurfaceSize().getResolution()</code>
 *  and <code>getRotation()</code>
 */
public final int getRotatedWidth() {
  return getRotatedWH(true);
}
origin: org.jogamp.jogl/jogl-all-noawt

/**
 *
 * @param type
 * @param name
 * @param fromIndex start index, then increasing until found or end of list
 * @paran shared if true, only shared instances are found, otherwise also exclusive
 * @return
 */
public static Display getFirstDisplayOf(final String type, final String name, final int fromIndex, final boolean shared) {
  return getDisplayOfImpl(type, name, fromIndex, 1, shared);
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

/** Returns the rotated screen height in pixel units,
 *  derived from <code>getMonitorMode().getSurfaceSize().getResolution()</code>
 *  and <code>getRotation()</code>
 */
public final int getRotatedHeight() {
  return getRotatedWH(false);
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

/**
 *
 * @param type
 * @param name
 * @param fromIndex start index, then increasing until found or end of list
 * @paran shared if true, only shared instances are found, otherwise also exclusive
 * @return
 */
public static Display getFirstDisplayOf(final String type, final String name, final int fromIndex, final boolean shared) {
  return getDisplayOfImpl(type, name, fromIndex, 1, shared);
}
com.jogamp.newt

Most used classes

  • GLWindow
    An implementation of GLAutoDrawable and Window interface, using a delegated Window instance, which m
  • MouseEvent
    Pointer event of type PointerType. The historical misleading class name may change in the future to
  • NewtCanvasAWT
  • KeyEvent
    KEYEVENT DELIVERY Key events are delivered in the following order:#Event Type Constraints Notes1 #EV
  • Screen
    A screen may span multiple MonitorDevices representing their combined virtual size. All values of th
  • MonitorDevice,
  • MonitorMode,
  • NewtFactory,
  • Window,
  • MonitorModeUtil,
  • KeyListener,
  • MouseListener,
  • EDTUtil,
  • MonitorMode$SizeAndRRate,
  • NewtVersion,
  • Window$FocusRunnable,
  • DoubleTapScrollGesture,
  • GestureHandler$GestureEvent,
  • GestureHandler$GestureListener
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now