diff options
author | Sven Gothel <[email protected]> | 2013-06-30 03:52:16 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-06-30 03:52:16 +0200 |
commit | 1c717a781702b0decb0c4da71a9dadc2a8255d5b (patch) | |
tree | 34ec8f1e183f8fff339c5bc8e6bb2e27e195a635 /src/newt/classes/jogamp | |
parent | 95d3c4020f9871f3520e29d314c8ae6b3b42f9eb (diff) |
Add Comparable<?>: Point*, Dimension*, Rectangle*, SurfaceSize* and MonitorMode* ; Sort List<MonitorMode> in descending order to be well determined.
Add Comparable<?>: Point*, Dimension*, Rectangle*, SurfaceSize* and MonitorMode*:
- Compare square values
- See API doc for order of special semantics (flags, rotation, ..)
Sort List<MonitorMode> in descending order to be well determined:
- Removes order by native mode id, give user a reliable natural order.
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r-- | src/newt/classes/jogamp/newt/ScreenImpl.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/newt/classes/jogamp/newt/ScreenImpl.java b/src/newt/classes/jogamp/newt/ScreenImpl.java index f63d1499e..28f3e876c 100644 --- a/src/newt/classes/jogamp/newt/ScreenImpl.java +++ b/src/newt/classes/jogamp/newt/ScreenImpl.java @@ -52,6 +52,7 @@ import com.jogamp.newt.NewtFactory; import com.jogamp.newt.Screen; import com.jogamp.newt.event.MonitorEvent; import com.jogamp.newt.event.MonitorModeListener; +import com.jogamp.newt.util.MonitorModeUtil; public abstract class ScreenImpl extends Screen implements MonitorModeListener { protected static final boolean DEBUG_TEST_SCREENMODE_DISABLED = Debug.isPropertyDefined("newt.test.Screen.disableScreenMode", true); @@ -536,6 +537,11 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener { final MonitorDevice monitor = getVirtualMonitorDevice(cache, 0, mode); cache.monitorDevices.getOrAdd(monitor); } + // Sort MonitorModes (all and per device) in descending order - default! + MonitorModeUtil.sort(cache.monitorModes.getData(), false /* ascendingOrder*/); + for(Iterator<MonitorDevice> iMonitor=cache.monitorDevices.iterator(); iMonitor.hasNext(); ) { + MonitorModeUtil.sort(iMonitor.next().getSupportedModes(), false /* ascendingOrder*/); + } if(DEBUG) { int i=0; for(Iterator<MonitorMode> iMode=cache.monitorModes.iterator(); iMode.hasNext(); i++) { @@ -550,7 +556,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener { System.err.println("["+i+"]["+j+"]: "+iMode.next()); } } - } + } sms = new ScreenMonitorState(cache.monitorDevices, cache.monitorModes); ScreenMonitorState.mapScreenMonitorState(this.getFQName(), sms); } |