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
Modifier and TypeClassDescriptionclass
The Warning class provides methods for displaying alerts and notifications. -
Constructor Summary
ConstructorDescriptionPassPort
(javafx.stage.Stage stage, Services services, Translator translator) Creates an instance of aPassPort
record class.Constructs a PassPort controller with the given services. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.services()
Returns the value of theservices
record component.javafx.stage.Stage
stage()
Gets the current stage of the application.void
toEventPurchase
(Event event) Opens the event purchase popup for the specified event.void
toEventReview
(Event event) Opens the event review popup for the specified event.void
toMain()
Navigates to the main window.void
Opens the profile editing window.void
toPurchaseOf
(Event event) Opens the purchase window for the specified event.void
toScene
(javafx.scene.Scene scene) Sets the specified scene on the current stage.final String
toString()
Returns a string representation of this record class.void
Navigates to the welcome window.Returns the value of thetranslator
record 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 aPassPort
record class.- Parameters:
stage
- the value for thestage
record componentservices
- the value for theservices
record componenttranslator
- the value for thetranslator
record 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 thetranslator
record component.- Returns:
- the value of the
translator
record component
-