Applied some more suggestions from code review.
This commit is contained in:
parent
e7d85bd968
commit
b7ea7f0e85
@ -3,7 +3,7 @@ package envoy.client.event;
|
||||
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>
|
||||
* File: <strong>BackEvent.java</strong><br>
|
||||
@ -15,10 +15,4 @@ import envoy.event.Event.Valueless;
|
||||
public class BackEvent extends Valueless{
|
||||
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
/**
|
||||
* @since Envoy Client v0.2-beta
|
||||
*/
|
||||
public BackEvent() { super(); }
|
||||
|
||||
}
|
||||
|
@ -184,8 +184,7 @@ public final class ChatScene implements Restorable {
|
||||
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()));
|
||||
} catch (Exception e2) {
|
||||
logger.log(Level.SEVERE, "An error occured when attempting to load the tabs!");
|
||||
e2.printStackTrace();
|
||||
logger.log(Level.SEVERE, "An error occured when attempting to load the tabs!", e2);
|
||||
}
|
||||
} else {
|
||||
contactSearchTab.setContent(createOfflineNote());
|
||||
@ -193,7 +192,6 @@ public final class ChatScene implements Restorable {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//Listen to backEvents
|
||||
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
|
||||
* {@code an}.
|
||||
|
@ -133,6 +133,7 @@ public class GroupCreationTab {
|
||||
} else {
|
||||
createGroup(name);
|
||||
eventBus.dispatch(new BackEvent());
|
||||
// Restoring the original design as tabs will always be reused
|
||||
setErrorMessageLabelSize(0);
|
||||
groupNameField.clear();
|
||||
}
|
||||
|
Reference in New Issue
Block a user