CMPE212 – Reminders Assignment 5, a JavaFX GUI, due this Friday.

Slides:



Advertisements
Similar presentations
Interaction Design: Visio
Advertisements

Microsoft Word 2010 Lesson 1: Introduction to Word.
Microsoft PowerPoint ® 2003 Carl B. Struck Presentation Graphics n Educational, business, sales and other presentations (slide shows) n Combination of.
Copyright 2007, Paradigm Publishing Inc. POWERPOINT 2007 CHAPTER 1 BACKNEXTEND 1-1 LINKS TO OBJECTIVES Create Presentation Open, Save, Run, Print, Close,Delete.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 4 1 Microsoft Office FrontPage 2003 Tutorial 4 – Using Shared Borders and Themes.
Lehigh University Introduction to Flash MX Sharmeen Mecklai.
XP Tutorial 1 Introduction to Macromedia Flash MX 2004.
University of Sunderland CDM105 Session 6 Dreamweaver and Multimedia Fireworks MX 2004 Creating Menus and Button images.
PowerPoint Lesson 3 Working with Visual Elements
Laboratory Exercise # 9 – Inserting Graphics to Documents Office Productivity Tools 1 Laboratory Exercise # 9 Inserting Graphics to Documents Objectives:
By: Ms. Fatima Shannag Ms. Essra Al-Mousa 1. PowerPoint web app 2 PowerPoint Web App is a limited version of PowerPoint, enabling you to display information.
Learning the Basics of ArcMap 3.3 Updated 4/27/2010 Using Arc/View pt. 1 1.
Notices Assn 4 posted. Due last day of class. Note that Exercise 10 contains the JavaFX code for three simple GUI programs. Winter 2016CMPE212 - Prof.
>>0 >>1 >> 2 >> 3 >> 4 >>
Notices Assn 3 is posted – due tomorrow. Quiz marking underway (still – sigh…). Alternate solution code was added on Tuesday to the assignment 3 statement.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
Notices Assn 4 posted. Due last day of class. Last quiz this week in Moodle, in the lab. Would the student doing the USATS please get them from Emily Crawford.
Fundamentals of Windows Mouse n 4 Basic Operations: –Pointing –Clicking –Double Clicking –Dragging.
Introducing Macromedia Flash 8
Microsoft Word Basics.
Java FX: Scene Builder.
Creating Oracle Business Intelligence Interactive Dashboards
Microsoft Office PowerPoint 2003
Microsoft Access 2007 – Level 2
Chapter 1: An Introduction to Visual Basic 2015
Learn Animations in Fireworks
Flash Interface, Commands and Functions
Chapter 2 – Introduction to the Visual Studio .NET IDE
Program and Graphical User Interface Design
By: Ms. Fatima Shannag Ms. Essra Al-Mousa
CISC124 Quiz 2 grading underway.
CISC124 Quiz 3 grading underway, still... Assn 5 due tomorrow.
CMPE212 – Stuff… Marking finished for Quiz 3.
Chap 7. Building Java Graphical User Interfaces
Enhancing a Document Part 1
CISC101 Reminders Grading of Quiz 4 underway.
Graphical User Interfaces -- Introduction
Smart Graphic Layout TOPIC statement
به نام مهربانترین In the name of the most compassionate
CMPE212 – Stuff… Assn 3 sample solution is posted.
Project title Scheduled dates Team members JAN FEB MAR APR MAY JUN
Recall: Timeline Class
Chapter 2 Adding Web Pages, Links, and Images
Enhancing a Document Part 1
Farming: An example of a system
Economist Report (Advanced)
AWT Components and Containers
Fly-in marquee lights at picture entrance (Intermediate)
CISC124 Last Quiz this week. Topics listed in last Tuesday’s lecture.
CISC124 Last Quiz this week. Topics listed in last Tuesday’s lecture.
Windows xp PART 1 DR.WAFAA SHRIEF.
TAB ONE TAB TWO TAB THREE TAB FOUR TAB FIVE
1.
Tutorial 6 Creating Dynamic Pages
DREAMWEAVER MX 2004 Chapter 3 Working with Tables
Citation Map Visualizing citation data in the Web of Science
CISC124 Last Quiz next week. Topics listed in Tuesday’s lecture.
Learning the Basics of ArcMap 3.3 Updated 4/27/2010
1 2 3 Marketing 2 Jan Reminders Essential Question Agenda
Working with Symbols and Interactivity
Introduction to PowerPoint
POWER POINT WHY HAVE WE USE THIS PROGRAM? TO SHOW YOUR STUDY..
CISC124 Quiz 3 marking underway, still. Assn 5 due Friday, still.
CISC124 Quiz 3 marking underway. Assn 5 due Friday. Fall 2018
Topics Graphical User Interfaces Using the tkinter Module
Autodesk Inventor Tips and Tricks for New Users
对 话 无 界 限 “对话是两个集合出现交集的一个刹那。” “对话是发现共同点的捷径。”.
Smart Graphic Layout TOPIC statement
CMPE212 – Reminders Assignment 5, a JavaFX GUI, due next Friday.
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

CMPE212 – Reminders Assignment 5, a JavaFX GUI, due this Friday. Winter 2019 CMPE212 5/20/2019 CMPE212 – Reminders Assignment 5, a JavaFX GUI, due this Friday. Quiz 3 graded. Get e(fx)clipse from “Eclipse Marketplace”. Winter 2019 CMPE212 - Prof. McLeod Prof. Alan McLeod

Today JavaFX Text Input Nodes. JavaFX Dialogs. Sliders and Spinners. Winter 2019 CMPE212 5/20/2019 Today JavaFX Text Input Nodes. JavaFX Dialogs. Sliders and Spinners. Winter 2019 CMPE212 - Prof. McLeod Prof. Alan McLeod

Text Input Use TextField, TextArea, PasswordField controls. See FXTextInput. Note: Default Button, Cancel Button. Default text. Prompt text (don’t need a label!). Multi-line input – and scroll bar appearance. Obtaining the text. Clearing the fields. Change events. Restricting input. Winter 2019 CMPE212 - Prof. McLeod

Other TextField Properties Did you see the effect of pressing <enter> and <esc>? Did you see the difference between “Prompt Text” and “Text”? Test the effect of “Editable”, “Disable” and “Focus Traversable” properties. Winter 2019 CMPE212 - Prof. McLeod

Aside – The Tab Order Also called the “Focus Traversal Policy”… When using keyboard navigation, pressing <tab> moves you “forward” from node to node, providing the nodes accept the focus (they are “focus traversable”). <shift><tab> moves you “backwards”. How do you change the Tab Order of your nodes? Move the nodes around in the Scenebuilder hierarchy tab or move them around in the fxml file. Winter 2019 CMPE212 - Prof. McLeod

JavaFX Dialogs Include: Information, Warning and Error Alerts. Confirmation Dialogs. Text Input Dialogs. Choice Dialogs. By default these all act as Modal dialogs, which they should be. What does “Modal” mean? Also, see: http://code.makery.ch/blog/javafx-dialogs-official/ Winter 2019 CMPE212 - Prof. McLeod

JavaFX Dialogs, Cont. See FXDialogs The first dialog is jazzed up a bit, but the others just use defaults. Note use of dialogs.css to change style of a dialog and how this stylesheet is added. Note how to change the default graphic used in dialog by creating an ImageView object. Winter 2019 CMPE212 - Prof. McLeod

JavaFX Dialogs, Cont. Title Header Graphic Content Winter 2019 CMPE212 - Prof. McLeod

Other Built-In Windows FileChooser: http://docs.oracle.com/javafx/2/ui_controls/file-chooser.htm ColorPicker: http://docs.oracle.com/javafx/2/ui_controls/color-picker.htm DatePicker: http://docs.oracle.com/javase/8/javafx/user-interface-tutorial/date-picker.htm So easy to use! See FXFileAndColor project. Winter 2019 CMPE212 - Prof. McLeod

Spinners and Sliders (And Progress Bars!) See FXSliderSpinner For Sliders, using SceneBuilder: Set vertical or horizontal orientation. Set min, max and initial value. Choose major and minor tick units and which to label. Can choose “Snap To Ticks”. Winter 2019 CMPE212 - Prof. McLeod

Spinners and Sliders, Cont. For Spinners, you must set min, max and initial values in fxml file yourself: initialValue="0" max="20" min="-20“ Use change listeners with .valueProperty() to detect changes in slider or listener positions. Note how spinner works with arrow keys or mouse click. Winter 2019 CMPE212 - Prof. McLeod

Canvas Control See: http://docs.oracle.com/javafx/2/canvas/jfxpub-canvas.htm Canvas is a Node, is not visible by itself, but is not a Pane type Node so it cannot contain other nodes. Hint: Make sure the Canvas has a size and is where you think it is – otherwise you will not see anything! Winter 2019 CMPE212 - Prof. McLeod

Canvas Control, Cont. All drawing to the Canvas will take place through its GraphicsContext object: Canvas canvas = new Canvas(300, 250); // width, height GraphicsContext gc = canvas.getGraphicsContext2D(); (Also has an empty, default constructor.) Draw by setting colours first using: gc.setFill(Color.RED); // The fill colour gc.setStroke(Color.BLUE); // The line colour Winter 2019 CMPE212 - Prof. McLeod

Canvas Control, Cont. Set the line thickness using: gc.setLineWidth(5); // 5 pixels See the GraphicsContext API docs for all the drawing methods. A method starting with “stroke…” draws the outline of the shape. Starting with “fill…” draws a filled shape. Winter 2019 CMPE212 - Prof. McLeod

Canvas Control, Cont. For example: To draw a line from (x1, y1) to (x2, y2) in pixels as doubles: gc.strokeLine(x1, y1, x2, y2); Don’t forget that the (0, 0) pixel position of a Canvas is the top, left corner of the canvas. Winter 2019 CMPE212 - Prof. McLeod

Canvas Control, Cont. A filled oval: gc.fillOval(x, y, width, height); (x, y) is the upper left corner of a rectangle enclosing the oval of size width by height. (For a circle, width==height…) Winter 2019 CMPE212 - Prof. McLeod

Canvas Control, Cont. You can draw many other shapes and curves including Bezier curves. Can also draw text. Effects such as linear and radial colour gradients can be applied by supplying LinearGradient and RadialGradient objects to the setStroke and setFill objects instead of just a single colour. The Canvas object itself can be translated, rotated and otherwise transformed in any way you can imagine. Winter 2019 CMPE212 - Prof. McLeod

Canvas Control, Cont. Display images using .drawImage() – takes an Image object. Images can be in .bmp, .jpg, .gif or .png formats. You can load an image from a local file or from a URL. Use .getPixelWriter to obtain an object that will allow you to edit individual pixels. Winter 2019 CMPE212 - Prof. McLeod

Canvas Control, Cont. Drawings are often built and edited in layers. Each layer can be a separate Canvas object. Layer them using StackPane or just Pane. Draw to each layer using individual GraphicsContext objects. Use a method like .toFront() on the Canvas layer to move it to the top. Winter 2019 CMPE212 - Prof. McLeod

Canvas Control, Cont. Mouse/cursor interaction by adding an event handler to the Canvas object and listening for a MouseEvent: canvas.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent e) { gc.fillOval(e.getX(),e.getY(),20,20); } }); Winter 2019 CMPE212 - Prof. McLeod

Fireworks Case Study Use of a canvas, spinners, drawing and animation. Linked to the course web site as the “Fireworks Case Study”. Winter 2019 CMPE212 - Prof. McLeod