Skip to content

Commit

Permalink
Fix code style (#5772)
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor authored and Siedlerchr committed Dec 20, 2019
1 parent 6431099 commit 9b0dd5d
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/main/java/org/jabref/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private void openWindow(Stage mainStage) {
mainStage.setWidth(Globals.prefs.getDouble(JabRefPreferences.SIZE_X));
mainStage.setHeight(Globals.prefs.getDouble(JabRefPreferences.SIZE_Y));
}
printWindowState(mainStage);
debugLogWindowState(mainStage);

// We create a decoration pane ourselves for performance reasons
// (otherwise it has to be injected later, leading to a complete redraw/relayout of the complete scene)
Expand Down Expand Up @@ -204,33 +204,34 @@ private void saveWindowState(Stage mainStage) {
Globals.prefs.putDouble(JabRefPreferences.POS_Y, mainStage.getY());
Globals.prefs.putDouble(JabRefPreferences.SIZE_X, mainStage.getWidth());
Globals.prefs.putDouble(JabRefPreferences.SIZE_Y, mainStage.getHeight());
printWindowState(mainStage);
debugLogWindowState(mainStage);
}

/**
* outprints the Data from the Screen
* (only in debug mode)
* outprints the Data from the Screen (only in debug mode)
*
* @param mainStage
*/
private void printWindowState(Stage mainStage) {
StringBuilder bob = new StringBuilder();
bob.append("SCREEN DATA:");
bob.append("mainStage.WINDOW_MAXIMISED: " + mainStage.isMaximized() + "\n");
bob.append("mainStage.POS_X: " + mainStage.getX() + "\n");
bob.append("mainStage.POS_Y: " + mainStage.getY() + "\n");
bob.append("mainStage.SIZE_X: " + mainStage.getWidth() + "\n");
bob.append("mainStages.SIZE_Y: " + mainStage.getHeight() + "\n");
LOGGER.debug(bob.toString());
private void debugLogWindowState(Stage mainStage) {
if (LOGGER.isDebugEnabled()) {
StringBuilder debugLogString = new StringBuilder();
debugLogString.append("SCREEN DATA:");
debugLogString.append("mainStage.WINDOW_MAXIMISED: " + mainStage.isMaximized() + "\n");
debugLogString.append("mainStage.POS_X: " + mainStage.getX() + "\n");
debugLogString.append("mainStage.POS_Y: " + mainStage.getY() + "\n");
debugLogString.append("mainStage.SIZE_X: " + mainStage.getWidth() + "\n");
debugLogString.append("mainStages.SIZE_Y: " + mainStage.getHeight() + "\n");
LOGGER.debug(debugLogString.toString());
}
}

/**
* Tests if the window coordinates are out of the mainscreen
*
* @return outbounds
*/
private boolean isWindowPositionOutOfBounds() {

return !Screen.getPrimary().getBounds().contains(Globals.prefs.getDouble(JabRefPreferences.POS_X) , Globals.prefs.getDouble(JabRefPreferences.POS_Y));

return !Screen.getPrimary().getBounds().contains(Globals.prefs.getDouble(JabRefPreferences.POS_X), Globals.prefs.getDouble(JabRefPreferences.POS_Y));
}

private void openLastEditedDatabases() {
Expand Down

0 comments on commit 9b0dd5d

Please sign in to comment.