Tabnine Logo
MonitorDevice.getViewportInWindowUnits
Code IndexAdd Tabnine to your IDE (free)

How to use
getViewportInWindowUnits
method
in
com.jogamp.newt.MonitorDevice

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

origin: ch.unibas.cs.gravis/scalismo-native-stub

/**
 * Returns the {@link MonitorDevice} with the highest {@link MonitorDevice#getViewportInWindowUnits() viewport}
 * {@link RectangleImmutable#coverage(RectangleImmutable) coverage} of the given rectangle in window units.
 * <p>
 * If no coverage is detected the first {@link MonitorDevice} is returned.
 * </p>
 * @param r arbitrary rectangle in window units
 */
public final MonitorDevice getMainMonitor(final RectangleImmutable r) {
  MonitorDevice res = null;
  float maxCoverage = Float.MIN_VALUE;
  final List<MonitorDevice> monitors = getMonitorDevices();
  for(int i=monitors.size()-1; i>=0; i--) {
    final MonitorDevice monitor = monitors.get(i);
    final float coverage = monitor.getViewportInWindowUnits().coverage(r);
    if( coverage > maxCoverage ) {
      maxCoverage = coverage;
      res = monitor;
    }
  }
  if( maxCoverage > 0.0f && null != res ) {
    return res;
  }
  return monitors.get(0);
}
origin: org.jogamp.jogl/jogl-all-noawt

/**
 * Returns the {@link MonitorDevice} with the highest {@link MonitorDevice#getViewportInWindowUnits() viewport}
 * {@link RectangleImmutable#coverage(RectangleImmutable) coverage} of the given rectangle in window units,
 * which is not a {@link MonitorDevice#isClone() clone}.
 * <p>
 * If no coverage is detected the first {@link MonitorDevice} is returned.
 * </p>
 * @param r arbitrary rectangle in window units
 */
public final MonitorDevice getMainMonitor(final RectangleImmutable r) {
  MonitorDevice res = null;
  float maxCoverage = Float.MIN_VALUE;
  final List<MonitorDevice> monitors = getMonitorDevices();
  final int monitorCount = monitors.size();
  for(int i=0; i<monitorCount; i++) {
    final MonitorDevice monitor = monitors.get(i);
    if( !monitor.isClone() ) {
      final float coverage = monitor.getViewportInWindowUnits().coverage(r);
      if( coverage > maxCoverage ) {
        maxCoverage = coverage;
        res = monitor;
      }
    }
  }
  if( maxCoverage > 0.0f && null != res ) {
    return res;
  }
  return monitors.get(0);
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

final RectangleImmutable viewWU = monitors.get(i).getViewportInWindowUnits();
x1WU = Math.min(x1WU, viewWU.getX());
x2WU = Math.max(x2WU, viewWU.getX() + viewWU.getWidth());
origin: org.jogamp.jogl/jogl-all-noawt

final RectangleImmutable viewWU = monitors.get(i).getViewportInWindowUnits();
x1WU = Math.min(x1WU, viewWU.getX());
x2WU = Math.max(x2WU, viewWU.getX() + viewWU.getWidth());
origin: ch.unibas.cs.gravis/scalismo-native-stub

data[idx++] = monitorDevice.getViewport().getWidth();
data[idx++] = monitorDevice.getViewport().getHeight();
data[idx++] = monitorDevice.getViewportInWindowUnits().getX();
data[idx++] = monitorDevice.getViewportInWindowUnits().getY();
data[idx++] = monitorDevice.getViewportInWindowUnits().getWidth();
data[idx++] = monitorDevice.getViewportInWindowUnits().getHeight();
data[idx++] = monitorDevice.getCurrentMode().getId();
data[idx++] = monitorDevice.getCurrentMode().getRotation();
origin: org.jogamp.jogl/jogl-all-noawt

data[idx++] = monitorDevice.getViewport().getWidth();
data[idx++] = monitorDevice.getViewport().getHeight();
data[idx++] = monitorDevice.getViewportInWindowUnits().getX();
data[idx++] = monitorDevice.getViewportInWindowUnits().getY();
data[idx++] = monitorDevice.getViewportInWindowUnits().getWidth();
data[idx++] = monitorDevice.getViewportInWindowUnits().getHeight();
data[idx++] = monitorDevice.getCurrentMode().getId();
data[idx++] = monitorDevice.getCurrentMode().getRotation();
com.jogamp.newtMonitorDevicegetViewportInWindowUnits

Javadoc

Returns the current RectangleImmutable portion of the rotated virtual Screen size in window units represented by this monitor, i.e. top-left origin and size.

Popular methods of MonitorDevice

  • getCurrentMode
    Returns the cached current MonitorMode w/o native query. The returned MonitorMode is element of the
  • getSupportedModes
    Returns a list of immutable MonitorModes supported by this monitor. The list is ordered in descendin
  • setCurrentMode
    Set the current com.jogamp.newt.MonitorMode.This method is lifecycle heavy [Window.html#lifecycleHea
  • getId
  • getOriginalMode
    Returns the immutable original com.jogamp.newt.MonitorMode, as used at NEWT initialization. The retu
  • getPixelsPerMM
    Returns the pixels per millimeter value according to the current MonitorMode's SurfaceSize#getResolu
  • getSizeMM
  • getViewport
    Returns the RectangleImmutable portion of the rotated virtual Screen size in pixel units represented
  • isModeChangedByUs
    Returns true if the MonitorModehas been changed programmatic via this API only, otherwise false. Not
  • isOriginalMode
  • toString
  • unionOfViewports
    Calculates the union of the given monitor's #getViewport() in pixel- and window units.
  • toString,
  • unionOfViewports,
  • getScreen,
  • isClone,
  • isPrimary,
  • queryCurrentMode

Popular in Java

  • Finding current android device location
  • setContentView (Activity)
  • findViewById (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Option (scala)
  • Top plugins for WebStorm
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