Record Class PassPort
java.lang.Object
java.lang.Record
passport.application.desktop.system.PassPort
- Record Components:
stage- The primary stage of the application.services- The services provided by the application.translator- The translator for handling multilingual support.
public record PassPort(javafx.stage.Stage stage, Services services, Translator translator)
extends Record
The PassPort class acts as a controller in the MVC architecture. It manages
the navigation and interaction between different views and the application's
services. The controller is passed to the view (instead of getting the view),
allowing the view to invoke controller methods for various actions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassThe Warning class provides methods for displaying alerts and notifications. -
Constructor Summary
ConstructorsConstructorDescriptionPassPort(javafx.stage.Stage stage, Services services, Translator translator) Creates an instance of aPassPortrecord class.Constructs a PassPort controller with the given services. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.services()Returns the value of theservicesrecord component.javafx.stage.Stagestage()Gets the current stage of the application.voidtoEventPurchase(Event event) Opens the event purchase popup for the specified event.voidtoEventReview(Event event) Opens the event review popup for the specified event.voidtoMain()Navigates to the main window.voidOpens the profile editing window.voidtoPurchaseOf(Event event) Opens the purchase window for the specified event.voidtoScene(javafx.scene.Scene scene) Sets the specified scene on the current stage.final StringtoString()Returns a string representation of this record class.voidNavigates to the welcome window.Returns the value of thetranslatorrecord component.warn()Gets the Warning instance for displaying alerts and notifications.withStage(javafx.stage.Stage stage) Returns a new PassPort instance with the specified stage.
-
Constructor Details
-
PassPort
Constructs a PassPort controller with the given services.- Parameters:
services- The services provided by the application.
-
PassPort
Creates an instance of aPassPortrecord class.- Parameters:
stage- the value for thestagerecord componentservices- the value for theservicesrecord componenttranslator- the value for thetranslatorrecord component
-
-
Method Details
-
withStage
Returns a new PassPort instance with the specified stage.- Parameters:
stage- The primary stage of the application.- Returns:
- A new PassPort instance with the specified stage.
-
stage
public javafx.stage.Stage stage()Gets the current stage of the application.- Returns:
- The current stage.
- Throws:
AssertionError- if the stage is null.
-
toMain
public void toMain()Navigates to the main window. -
toPurchaseOf
Opens the purchase window for the specified event.- Parameters:
event- The event to purchase tickets for.
-
toEventPurchase
Opens the event purchase popup for the specified event.- Parameters:
event- The event to purchase tickets for.
-
toEventReview
Opens the event review popup for the specified event.- Parameters:
event- The event to review.
-
toProfileEditing
public void toProfileEditing()Opens the profile editing window. -
toWelcome
public void toWelcome()Navigates to the welcome window. -
toScene
public void toScene(javafx.scene.Scene scene) Sets the specified scene on the current stage.- Parameters:
scene- The scene to set.
-
warn
Gets the Warning instance for displaying alerts and notifications.- Returns:
- The Warning instance.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
services
-
translator
Returns the value of thetranslatorrecord component.- Returns:
- the value of the
translatorrecord component
-