Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code style #5772

Merged
merged 1 commit into from
Dec 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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