List of usage examples for javafx.stage Screen equals
@Override public boolean equals(Object obj)
From source file:org.openbase.display.DisplayView.java
private Screen getScreen() { try {/* ww w .j a v a2 s .c o m*/ // setup display property JPOutput.Display display; try { display = JPService.getProperty(JPOutput.class).getValue(); } catch (JPServiceException ex) { ExceptionPrinter.printHistory(new CouldNotPerformException( "Could not detect output property! Try to use default display.", ex), logger); display = JPOutput.Display.PRIMARY; } // select screen switch (display) { case PRIMARY: return Screen.getPrimary(); case SECONDARY: for (Screen screen : Screen.getScreens()) { if (!screen.equals(Screen.getPrimary())) { return screen; } } throw new NotAvailableException(Screen.class, JPOutput.Display.SECONDARY.name()); default: return Screen.getScreens().get(display.getId()); } } catch (Exception ex) { ExceptionPrinter.printHistory( new CouldNotPerformException("Could not detect display! Use display 0 instead.", ex), logger); return Screen.getScreens().get(0); } }