From 37ec129f36097f41ed0d45cbccd7a93e493e2bb9 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 17 Feb 2015 07:30:34 +0100 Subject: Bug 1130 - Add Mapping from AWT Component -> NEWT [Screen, MonitorDevice] The mapping AWT Component -> NEWT [Screen, MonitorDevice] shall allow generic AWT applications to utilize NEWT's MonitorDevice information like physical monitor-size and DPI. - AWT-Component -> NEWT-Display: - NewtFactoryAWT.createDisplay - AWT-Component -> NEWT-Screen: - NewtFactoryAWT.createScreen - AWT-Component -> NEWT-MonitorMode: - NewtFactoryAWT.getMonitorDevice - NewtFactoryAWT.getMonitorDevice - If OSX, utilizing OSX's AWT Component -> MonitorDevice-Index mapping - Otherwise using the coverage to identify MonitorDevice See TestGearsES2GLJPanelAWT 'GetPixelScale', demonstrating the mapping while pressing 'p' (cached MonitorMode) and pressing SHIFT-'p' (non-cached MonitorMode). --- src/newt/classes/com/jogamp/newt/Screen.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/newt/classes/com/jogamp') diff --git a/src/newt/classes/com/jogamp/newt/Screen.java b/src/newt/classes/com/jogamp/newt/Screen.java index 0e6895d4b..b8f096fc3 100644 --- a/src/newt/classes/com/jogamp/newt/Screen.java +++ b/src/newt/classes/com/jogamp/newt/Screen.java @@ -238,6 +238,18 @@ public abstract class Screen { return monitors.get(0); } + public final MonitorDevice getMonitor(final int monitorId) { + final List monitors = getMonitorDevices(); + final int monitorCount = monitors.size(); + for(int i=0; i -- cgit v1.2.3