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.

Slides:



Advertisements
Similar presentations
Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
Advertisements

© Anselm Spoerri Lecture 11 Flash –Build Flash Website with Animated Navigation Structure –Decide on Overall Navigation Layout, Import Images & Organize.
1 of 7 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 Flash Programming Introduction Script Assist. 2 Course Description This course concentrates on the teaching of Actionscript, the programming language.
Tutorial 3: Adding and Formatting Text. 2 Objectives Session 3.1 Type text into a page Copy text from a document and paste it into a page Check for spelling.
Written by Liron Blecher
Microsoft ® Word Templates and Accessibility. 1 What is a Word template? File with a.dot (document template) extension Can define the following:  Paragraph.
Exercise : Animated Navigation Structure in Flash 1.Develop Answers to “What did you learn in ITI program?” “What do you have to offer?” “What are your.
Topics Introduction Scene Graphs
Computer Science I Programming in Java (programming using Processing IN Java, using IntelliJ IDE) Classwork/Homework: copy your Processing projects over.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
Winter 2016CMPE212 - Prof. McLeod1 CMPE212 Object Oriented Programming for Engineers Course Web Site: Lecture.
GOOGLE SITES HOW TO USE GOOGLE SITES TO CREATE A WEBSITE FOR CORNERS, STUDENT GROUPS, YOUTH CLUBS, YALI STEPHEN PERRY, IRO, GHANA OCTOBER 2014.
Building the CarryDrop simulation in Eclipse Creating a new project with existing code from John Murphy’s RePast tutorial.
Intoduction to Andriod studio Environment With a hello world program.
Flag Quiz Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
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.
Winter 2016CISC101 - Prof. McLeod1 CISC101 Reminders Quiz 3 next week. See next slide. Both versions of assignment 3 are posted. Due today.
Notices Assn 3 is posted – due tomorrow. Quiz marking underway (still – sigh…). Alternate solution code was added on Tuesday to the assignment 3 statement.
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
Web Design Principles 5 th Edition Chapter 3 Writing HTML for the Modern Web.
Notices Assn 2 is due tomorrow, 7pm. Moodle quiz next week – written in the lab as before. Everything up to and including today’s lecture: Big Topics are.
Prof. Anselm SpoerriMultimedia Production Rutgers Lecture 11 Flash –Build Flash Website with Animated Navigation Structure –Decide on Overall.
Today Enumerated Types - Summary. Start Nested Classes: Inner Classes, Local Classes, Anonymous Classes, Lambda Functions Next: Interfaces, Abstract Classes.
Notices Assn 2 is due Friday, 7pm. Moodle quiz next week – written in the lab as before. Everything up to and including Thursday’s lecture: Big Topics.
Fall 2016CISC124 - Prof. McLeod1 CISC124 “Introduction to Computing Science II” Course Web Site: Lecture notes,
Product Training Program
Java FX: Scene Builder.
ASP.NET Forms.
Objective % Select and utilize tools to design and develop websites.
About SharePoint Server 2007 My Sites
Single Sample Registration
Objective % Select and utilize tools to design and develop websites.
CISC124 Quiz 2 grading underway.
Introduction With TimeCard users can tag SharePoint events with information that converts them into time sheets. This way they can report.
CMPE212 – Stuff… Marking finished for Quiz 3.
CMPE212 – Stuff… Assn 3 due and Quiz 2 in the lab next week.
Winter 2018 CMPE212 9/21/2018 CMPE212 – Stuff…
ALEPH Version 22 Beginning Cataloging
EE 422C Java FX.
CMPE212 – Stuff… Exercises 4, 5 and 6 are all fair game now.
Winter 2018 CMPE212 11/11/2018 CMPE212 – Section 001
CMPE212 – Stuff… Assn 3 sample solution is posted.
Winter 2018 CMPE212 11/12/2018 CMPE212 – Stuff…
CISC124 Last Quiz this week. Topics listed in last Tuesday’s lecture.
CISC124 Last Quiz this week. Topics listed in last Tuesday’s lecture.
CISC124 Last Quiz this week. Topics listed in last Tuesday’s lecture.
CMPE212 – Stuff… Assignment 4 due March 23 – this Friday.
CISC124 Last Quiz next week. Topics listed in Tuesday’s lecture.
Electronics II Physics 3620 / 6620
CISC124 Assignment 3 due tomorrow at 7pm.
CISC124 Assignment 4 on Inheritance due next Friday.
CISC124 Quiz 3 marking underway. Assn 5 due Friday. Fall 2018
CISC124 Assignment 3 sample solution will be posted tonight after 7pm.
CMPE212 – Reminders Assignment 2 sample solution is posted.
CMPE212 Welcome! Object Oriented Programming for Engineers
CMPE212 – Reminders Assignment 3 due next Friday.
Winter 2019 CMPE212 4/20/2019 CMPE212 – Reminders
Planning a Group Policy Management and Implementation Strategy
First Window Builder Program
Winter 2019 CMPE212 5/3/2019 CMPE212 – Reminders
CMPE212 – Reminders Assignment 2 due today, 7pm.
Winter 2019 CMPE212 5/25/2019 CMPE212 – Reminders
CMPE212 – Reminders Assignment 5, a JavaFX GUI, due this Friday.
CMPE212 – Reminders Assignment 5, a JavaFX GUI, due next Friday.
CMPE212 – Reminders Assignment 2 due next Friday.
Exercise : Animated Navigation Structure in Animate (= Flash)
Chapter 12 JavaFX Graphical User Interfaces: Part 1
Unit J: Creating a Database
Exercise : Animated Navigation Structure in Flash
Presentation transcript:

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 at Winter 2016CMPE212 - Prof. McLeod1

Quiz 3 Topics Main new topics from last quiz are: –ArrayList Collection Type. –Generics: Generic Classes & Methods, Use of Wildcards. The Class Object. –Lambda Functions. –Method References. –JavaFX Nodes in general, Pane Objects and how to use them. And older topics such as writing methods, loops, conditionals, arrays, encapsulation and inheritance are still fair game. Winter 2016CMPE212 - Prof. McLeod2

JavaFX That You Need for Assn 4 You don’t have to use the stylesheet and the fxml file, but it makes it easier and the code is much tidier: –Styling with the css file. –Using SceneBuilder to work with the fxml file and assist with the controller *.java file. Panes and layout managers. Obtaining and restricting user input. The Canvas object and how to draw to it using its GraphicContext object. Animation using Timeline, AnimationTimer, Duration and KeyFrame. Winter 2016CMPE212 - Prof. McLeod3

Today As of last night, two people have viewed yesterday’s video. So, how about quick review of what most of you have not been paying attention to? Continuing JavaFX: –Using SceneBuilder and the *.fxml file. –Using SceneBuilder to attach handlers to controls. –SceneBuilder links. Winter 2016CMPE212 - Prof. McLeod4

Using SceneBuilder Start by adding a.fxml file to your project: Winter 2016CMPE212 - Prof. McLeod5

Using SceneBuilder, Cont. Give the file a name and choose a Pane: Winter 2016CMPE212 - Prof. McLeod6

Using SceneBuilder, Cont. Not much in the file to start with: The language is xml or “Extensible Markup Language”, the “fxml” version! This can be edited manually, but SceneBuilder is much easier. Winter 2016CMPE212 - Prof. McLeod7

Using SceneBuilder, Cont. (Install SceneBuilder first!) Right-click on the file and choose “Open with SceneBuilder”. Winter 2016CMPE212 - Prof. McLeod8

SceneBuilder (after some work) Winter 2016CMPE212 - Prof. McLeod9

Using SceneBuilder, Cont. Choose the pane (GridPane in this case) and on the Properties tab at the right and choose the stylesheet (“application.css”) for your project. The css settings will override any settings made in the fxml file. You will see little blue boxes to show which properties have been dictated by the css file. You can also use the “CSS Analyzer” to display the hierarchy of css changes to any control. Winter 2016CMPE212 - Prof. McLeod10

Using SceneBuilder, Cont. Choose controls and drag them into the pane. Edit control properties using the “Properties” and “Layout” tabs. If you are using SceneBuilder, do not edit the fxml file directly. In SceneBuilder, save your changes, using s, and when you go back to eclipse, use to refresh the view of the.fxml file. You can also preview your window using “Preview” or p in SceneBuilder. Winter 2016CMPE212 - Prof. McLeod11

Using SceneBuilder, Cont. For each control that needs to interact with Java code, create an fx:id for that control in the “Code” tab. The name has to be unique to your project. Winter 2016CMPE212 - Prof. McLeod12

Using SceneBuilder, Cont. To associate a controller class with your fxml file, choose the “Controller” tab at the bottom, left. Provide a package and a class name here (“application.Project11DemoContr oller” in this case). Go back to eclipse and create the *.java file with the same name in the package (application, for example) that you specified. Winter 2016CMPE212 - Prof. McLeod13

Using SceneBuilder, Cont. In SceneBuilder, go “View”, then “Show Sample Controller Skeleton”. Choose “Full” and then “Copy”. Paste the code over your controller *.java file. Add code to the initialize() method. Note that SceneBuilder will not create or edit *.java files in your project. You can also add method skeletons for any of the events associated with the control. Winter 2016CMPE212 - Prof. McLeod14

Using SceneBuilder, Cont. In your Main.java file replace the declaration of “root” with (assuming you are using GridPane): GridPane root = (GridPane) FXMLLoader.load(getClass().getResource("../Project11.fxml")); You don’t need any control instantiations in Main.java or any of the code to do with the controls. No more layout or style code either!! Winter 2016CMPE212 - Prof. McLeod15

Order of Operations: The order is critical, especially if you have to interpret errors: 1.The application invokes main, which invokes launch, which invokes start, supplying it with the Stage object. 2.The start() method in Main.java identifies and then starts loading the fxml file as part of the creation of the root object. 3.The *.css file is located and loaded. 4.The controller class is located. Winter 2016CMPE212 - Prof. McLeod16

Order of Operations, Cont. 5.The rest of the fxml file is processed, creating and configuring the controls. Stylesheet changes are applied. 6.The controller class is instantiated. All controls with a fx:id are injected into the instance of the controller class everywhere there is annotation. 7.Events are attached to controls, if the fxml contains event tags. Winter 2016CMPE212 - Prof. McLeod17

Order of Operations, Cont. 8.When the injection process is complete the initialize() method in the controller class is invoked. 8.Back in the start method, the root object has been created and now contains the scene graph for the window. 9.The scene object is added to the Stage object. 10.The Stage object is shown. 11.Now containers and controls will have their actual sizes. Winter 2016CMPE212 - Prof. McLeod18

Event Handlers, Cont. In the video I showed you how to add the event handler using a lambda function in the initialize() method in the controller class: myButton.setOnAction(event -> { if (myLabel.getText().equals("Hello!")) myLabel.setText("Goodbye!"); else myLabel.setText("Hello!"); }); Winter 2016CMPE212 - Prof. McLeod19

Event Handlers, Cont. You can also attach a handler to a control in the fxml file. Using SceneBuilder with the control of interest: Winter 2016CMPE212 - Prof. McLeod20 Choose one of the possible events of interest and type in a name for the handler. “On Action” is the general purpose handler often used with buttons.

Event Hanlders, Cont. This adds “onAction="#myButtonAction" to the fxml tag for the button. Look in the “skeleton” void myButtonAction(ActionEvent event) { } Add this to your controller class and fill it in: Winter 2016CMPE212 - Prof. McLeod21

Event Hanlders, void myButtonAction(ActionEvent event) { if (myLabel.getText().equals("Hello!")) myLabel.setText("Goodbye!"); else myLabel.setText("Hello!"); } The code in controller is now outside initialize() and is even simpler than the lambda version. Winter 2016CMPE212 - Prof. McLeod22

SceneBuilder Links Using SceneBuilder in eclipse: 2/work-with-java-ides/sb-with-eclipse.htm For connecting code to fxml: enebuilder_edited_fxml_to Another example: started-tutorial/jfxsb-get_started.htm#JSBGS101 Winter 2016CMPE212 - Prof. McLeod23

SceneBuilder Links, Cont. User’s Guide: 2/user-guide/index.html Winter 2016CMPE212 - Prof. McLeod24