Applied some more suggestions from code review.

This commit is contained in:
Maximilian P. Käfer 2020-08-26 17:53:53 +02:00
parent e5b0643b90
commit 997d40fc0a
3 changed files with 3 additions and 22 deletions

View File

@ -3,7 +3,7 @@ package envoy.client.event;
import envoy.event.Event.Valueless; import envoy.event.Event.Valueless;
/** /**
* This event serves the purpose to trigger the tab change to tab 1 in {@link ChatScene}.<p> * This event serves the purpose to trigger the tab change to tab 0 in {@link ChatScene}.<p>
* *
* Project: <strong>client</strong><br> * Project: <strong>client</strong><br>
* File: <strong>BackEvent.java</strong><br> * File: <strong>BackEvent.java</strong><br>
@ -15,10 +15,4 @@ import envoy.event.Event.Valueless;
public class BackEvent extends Valueless{ public class BackEvent extends Valueless{
private static final long serialVersionUID = 0L; private static final long serialVersionUID = 0L;
/**
* @since Envoy Client v0.2-beta
*/
public BackEvent() { super(); }
} }

View File

@ -184,8 +184,7 @@ public final class ChatScene implements Restorable {
contactSearchTab.setContent(FXMLLoader.load(new File("src/main/resources/fxml/ContactSearchTab.fxml").toURI().toURL())); contactSearchTab.setContent(FXMLLoader.load(new File("src/main/resources/fxml/ContactSearchTab.fxml").toURI().toURL()));
groupCreationTab.setContent(FXMLLoader.load(new File("src/main/resources/fxml/GroupCreationTab.fxml").toURI().toURL())); groupCreationTab.setContent(FXMLLoader.load(new File("src/main/resources/fxml/GroupCreationTab.fxml").toURI().toURL()));
} catch (Exception e2) { } catch (Exception e2) {
logger.log(Level.SEVERE, "An error occured when attempting to load the tabs!"); logger.log(Level.SEVERE, "An error occured when attempting to load the tabs!", e2);
e2.printStackTrace();
} }
} else { } else {
contactSearchTab.setContent(createOfflineNote()); contactSearchTab.setContent(createOfflineNote());
@ -193,7 +192,6 @@ public final class ChatScene implements Restorable {
} }
}); });
//Listen to backEvents //Listen to backEvents
eventBus.register(BackEvent.class, e -> tabPane.getSelectionModel().select(0)); eventBus.register(BackEvent.class, e -> tabPane.getSelectionModel().select(0));
@ -504,18 +502,6 @@ public final class ChatScene implements Restorable {
} }
} }
/**
* Rotates every element in our application by (at most 4 *) 360° in at most
* 2.75s.
*
* @since Envoy Client v0.1-beta
*/
@FXML
private void doABarrelRoll() {
final var random = new Random();
doABarrelRoll(random.nextInt(3) + 1, random.nextDouble() * 3 + 1);
}
/** /**
* Rotates every element in our application by {@code rotations}*360° in * Rotates every element in our application by {@code rotations}*360° in
* {@code an}. * {@code an}.

View File

@ -133,6 +133,7 @@ public class GroupCreationTab {
} else { } else {
createGroup(name); createGroup(name);
eventBus.dispatch(new BackEvent()); eventBus.dispatch(new BackEvent());
// Restoring the original design as tabs will always be reused
setErrorMessageLabelSize(0); setErrorMessageLabelSize(0);
groupNameField.clear(); groupNameField.clear();
} }