Why are GUI-windows called 'Stage' and not 'Window'?
Do they have anything in common?
Trying to understand from this site: https://docs.oracle.com/javase/8/javafx/api/javafx/stage/Stage.html
Appreciate your help, folks!
Stage is a specific sort of Window , with some shared methods and parameters. Thought, Stage got things that Window don't. As the Window Javadoc explains it, a top level window within which a scene is hosted, and with which the user interacts. A Window might be a Stage, PopupWindow, or other such top level.
Stage classes provide the opportunity for children to learn and socialise with classmates who may be older or younger than them. This reflects more of life outside of school and allows for peer mentoring, peer assistance and modelling in class activities.
You can add a Scene object to the stage using the method setScene() of the class named Stage.
setTitle("New Title!"); O primaryStage = "New Title!; O primary Stage.
It's a metaphor. There are lots of metaphors used in user interface design or object oriented programming. A desktop Window is a not a real window but is a metaphor for looking at something through a clipped viewport. Similarly, a file in a folder in a file system on a computer is a metaphor that equates the computer system with a physical cabinet based filing system for papers. A metaphor often used in interface design is the Desktop metaphor.
The particular metaphor used here is known as a "theater metaphor". The theater metaphor has been around some time. For example, here is a description of a 1984 Smalltalk based system called rehearsal, which was developed by scientists at Xerox Parc. Original systems based upon this idea used the metaphor more extensively. For example, there was a Stage, which we usually think of as as a Window today and Performers on the stage, which we would think of as controls or nodes in a scene graph, and Cues given to performers, which we would think of as messages or method calls sent to nodes in the scene graph.
The target developers of software for these systems were non-professional developers, such as teachers, in a world where graphical user interfaces for computers were not wide-spread. So these metaphors were developed to aid the target developers in relating the aspects of interactive multimedia systems to something they might understand in the "real world".
The lineage of this stuff is, roughly, that these systems were developed at Parc as part of the Learning Research Group to build graphical based educational software. Some of the ideas were carried forward into Macromedia which based their learning tools such as Director on the theater or film metaphor, using ideas such as scenes and stages and adding additional ideas such as timelines and keyframes for animation within their custom language named Lingo. The same ideas were used when Macromedia created Flash, and a stage is a component of today's Flash API. Then, the early JavaFX team used the same concepts when developing the JavaFX scripting language, probably because it was quite flash-like and the metaphors had met with some success for Flash developers. The JavaFX 2 Java based version of JavaFX, kept the metaphorical names Stage and Scene which had been used in the JavaFX 1 FXScript.
Keeping the same metaphor across different systems may assist developers to transition between technologies as they can relate to a concept learnt earlier.
The JavaFX system is a kind of mixed metaphor with both Windows from the desktop metaphor and Stages from the theater metaphor, where stages inherit from windows. It is only very loosely based upon the theater metaphor, with just stages and scenes being the surviving names from that metaphor.
This StackOverflow answer describes one way to think about applying the theater metaphor in JavaFX.
Stage
extends Window
, following the inheritance process. Stage
is a specific sort of Window
, with some shared methods and parameters. Thought, Stage
got things that Window
don't.
As the Window
Javadoc explains it, a top level window within which a scene is hosted, and with which the user interacts. A Window might be a Stage, PopupWindow, or other such top level. A Window is used also for browser plug-in based deployments.
You can compare both of them, thinking to a parent-child relationship.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With