JAVA FX INTRODUCTION Flashcards

1
Q

What is javaFX?

A

• JavaFX is a Java library used to build Rich Internet Applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the advantage of using javaFX?

A

• JavaFX includes Media, UI controls, Web, 2D and 3D, etc. all these
features in a single library.
• Allows access of existing features of a Java library such as Swings.
• Provides a rich set of graphics and media API’s and it leverages the
modern Graphical Processing Unit through hardware accelerated
graphics.
• Provides interfaces using which developers can combine graphics
animation and UI control.
• One can use JavaFX with JVM based technologies such as Java, Groovy
and JRuby.
• The applications written using this library can run consistently across
multiple platforms.
• The applications developed using JavaFX can run on various devices
such as Desktop Computers, Mobile Phones, TVs, Tablets, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Give 5 features of javaFX

A

• Written in Java:
• The JavaFX library is written in Java and is available for the languages that
can be executed on a JVM, which include – Java, Groovy and JRuby. These
JavaFX applications are also platform independent.

• FXML:
• JavaFX features a language known as FXML, which is a HTML like
declarative markup language. The sole purpose of this language is to
define a user Interface.

• Scene Builder:
• JavaFX provides an application named Scene Builder. On integrating this
application in IDE’s such as Eclipse and NetBeans, the users can access a
drag and drop design interface, which is used to develop FXML
applications (just like Swing Drag & Drop and DreamWeaver Applications).

• Swing Interoperability: In a JavaFX application, you can embed Swing
content using the Swing Node class. Similarly, you can update the
existing Swing applications with JavaFX features like embedded web
content and rich graphics media.

• Built-in UI controls: JavaFX library caters UI controls using which we can
develop a full-featured application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Give 5 features of javaFX(2)

A

• CSS like Styling: JavaFX provides a CSS like styling. By using this, you can
improve the design of your application with a simple knowledge of CSS.

• Canvas and Printing API: JavaFX provides Canvas, an immediate mode
style of rendering API. Within the package javafx.scene.canvas it holds a
set of classes for canvas, using which we can draw directly within an
area of the JavaFX scene. JavaFX also provides classes for Printing
purposes in the package javafx.print.

• Rich set of API’s: JavaFX library provides a rich set of API’s to develop GUI
applications, 2D and 3D graphics, etc. This set of API’s also includes
capabilities of Java platform. Therefore, using this API, you can access the
features of Java languages such as Generics, Annotations, Multithreading,
and Lambda Expressions. The traditional Java Collections library was
enhanced and concepts like observable lists and maps were included in it.
Using these, the users can observe the changes in the data models.

• Integrated Graphics library: JavaFX provides classes for 2d and 3d graphics.

• Graphics pipeline: JavaFX supports graphics based on the Hardware-
accelerated graphics pipeline known as Prism. When used with a supported

Graphic Card or GPU it offers smooth graphics. In case the system does not
support graphic card then prism defaults to the software rendering stack.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Give examples of important APIs used in javaFX

A

• javafx.animation: Contains classes to add transition based animations
such as fill, fade, rotate, scale and translation, to the JavaFX nodes.
• javafx.application: Contains a set of classes responsible for the JavaFX
application life cycle.
• javafx.css: Contains classes to add CSS–like styling to JavaFX GUI
applications.
• javafx.event: Contains classes and interfaces to deliver and handle
JavaFX events.
• javafx.geometry: Contains classes to define 2D objects and perform
operations on them.
• javafx.stage: This package holds the top level container classes for
JavaFX application.
• javafx.scene: This package provides classes and interfaces to support
the scene graph. In addition, it also provides sub-packages such as
canvas, chart, control, effect, image, input, layout, media, paint, shape,
text, transform, web, etc. There are several components that support
this rich API of JavaFX.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Draw a diagram showing JavaFX architecture

A

*See notes for pic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Briefly describe what a scene graph is

A

• A scene graph is a tree-like data structure (hierarchical) representing the
contents of a scene.
JavaFX GUI Applications are coded using a Scene Graph.
Scene Graph is the starting point of the construction of the GUI Application.
• It holds the (GUI) application primitives that are termed as nodes.
In general, a collection of nodes makes a scene graph. All these nodes are arranged in a
hierarchical order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a node and what are examples of types of nodes

A

A node is a visual/graphical object and it may include
i. Geometrical (Graphical) objects – (2D and 3D) such as circle, rectangle,
polygon, etc.
ii. UI controls – such as Button, Checkbox, Choice box, Text Area, etc.
iii. Containers – (layout panes) such as Border Pane, Grid Pane, Flow Pane, etc.
iv. Media elements – such as audio, video and image objects. In general, a
collection of nodes makes a scene graph. All these nodes are arranged in a
hierarchical order

  • A node instance can be added to a scene graph only once. The nodes
    of a scene graph can have Effects, Opacity, Transforms, Event
    Handlers, Application Specific States.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Define the terms parent, root node, branch node and leaf node in this context

A

• Each node in the scene graph has a single parent, and the node which
does not contain any parents is known as the root node.
• In the same way, every node has one or more children, and the node
without children is termed as leaf node; a node with children is
termed as a branch node.

*See notes for pic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe the quantam toolkit

A

• It is an abstraction over the low-level components of Prism,
Glass, Media Engine, and Web Engine.
• It ties Prism and GWT together and makes them available to
JavaFX.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe prism as used in graphics

A
  • A high performance hardware–accelerated graphical pipeline
  • Used to render the graphics in JavaFX.
  • Can render both 2-D and 3-D graphics.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When does prism use a software rendering path

A

• In case the hardware support for graphics on the system is not sufficient,
then Prism uses the software render path to process the graphics.
• When used with a supported Graphic Card or GPU, it offers smoother
graphics. Just in case the system does not support a graphic card, then Prism
defaults to the software rendering stack.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Describe GWT

A

Glass Windowing Toolkit (GWT) provides services to manage Windows, Timers, Surfaces and Event Queues.
• GWT connects the JavaFX Platform to the Native Operating System.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Briefly describe webview

A

• Using JavaFX, you can also embed HTML content in to a scene graph.
• WebView is the component of JavaFX which is used to process this content.
• It uses a technology called Web Kit, which is an internal open-source web
browser engine.
• This component supports different web technologies like HTML5, CSS,
JavaScript, DOM and SVG.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

List the different capabilities of WebView

A

i. Render HTML content from local or remote URL.
ii. Support history and provide Back and Forward navigation.
iii. Reload the content.
iv. Apply effects to the web component.
v. Edit the HTML content.
vi. Execute JavaScript commands.
vii. Handle events.
viii. In general, using WebView, you can control web content from Java.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Describe the javafx media engine

A

• The JavaFX media engine is based on an open-source engine known as a
Streamer.
• This media engine supports the playback of video and audio content.
• The JavaFX media engine provides support for audio for the following
file formats:
Audio- MP3, AIFF, WAV
Video- FLV

17
Q

How is media functionality achieved in javaFX

A

• The package javafx.scene.media contains the classes and interfaces to
provide media functionality in JavaFX.
• It is provided in the form of three components

i. Media Object: This represents a media file.
ii. Media Player: To play media content.
iii. Media View: To display media.

18
Q

Describe and illustrate the javaFX app structure

A

A JavaFX application has three major components Stage, Scene and
Nodes
*See notes for pic

19
Q

Briefly describe the stage(include parameters divisions etc

A

• Stage is a window and contains all the objects of a JavaFX application.
• It is represented by Stage class of the package javafx.stage.
• The primary stage is created by the platform itself.
• A stage has two parameters determining its position namely Width
and Height.
• It is divided as Content Area and Decorations (Title Bar and Borders).

20
Q

What are the methods used in relation to the stage?

A

• The created stage object is passed as an argument to the start()
method of the Application class
• You have to call the show() method to display the contents of a stage.

21
Q

What are the different types of stages in JavaFX?

A

i. Decorated- a stage with a solid white background and platform decorations.
ii. Undecorated- a stage with a solid white background and no decorations.
iii. Transparent- a stage with a transparent background and no decorations.
iv. Unified- Defines a Stage style with platform decorations and eliminates the border between client area and decorations.
v. Utility- a stage with a solid white background and minimal platform decorations.