CISC124 Last Quiz this week. Topics listed in last Tuesday’s lecture.

Slides:



Advertisements
Similar presentations
1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
Advertisements

EXCEL Spreadsheet Basics
Intermediate Level Course. Text Format The text styles, bold, italics, underlining, superscript and subscript, can be easily added to selected text. Text.
PowerPoint. Getting Started with PowerPoint Objectives Start PowerPoint and open presentations Explore toolbars and menus Use the Office Assistant Work.
Using HTML Tables.
With Alex Conger – President of Webmajik.com FrontPage 2002 Level I (Intro & Training) FrontPage 2002 Level I (Intro & Training)
1 The Structure of a Web Table beginning of the table structure first row of three in the table end of the table structure table cells You do not need.
 Insert a picture from a file  Move and delete images  Use the Picture Tools tab  Add styles, effects, and captions to images  Resize photos  Use.
Laboratory Exercise # 13 – Font and Number Format Styles Office Productivity Tools 1 Laboratory Exercise # 13 Font and Number Format Styles Objectives:
Advanced CSS - Page Layout. Advanced CSS  Compound Selectors:  Is a Dreamweaver term, not a CSS term.  Describes more advanced types of selectors such.
Microsoft Word 2000 Presentation 5. Major Word Topics Columns Tables Lists.
Designing a Web Page with Tables. A text table: contains only text, evenly spaced on the Web page in rows and columns uses only standard word processing.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
1. Chapter 10 Managing and Printing Documents 3 Working with Files and Printing You can open multiple documents in Word. When multiple documents are.
1. Chapter 15 Creating Charts 3 Charting Data in Word A chart or graph presents data visually. A chart depicts numeric data in a graphical format. If.
Copyright 2007, Paradigm Publishing Inc. WORD 2007 Chapter 5 BACKNEXTEND 5-1 LINKS TO OBJECTIVES Section Breaks Columns Hyphenation Drop Caps Insert Symbols,
By: Ms. Abeer Helwa 1. CREATE A WORD DOCUMENT 2 Blank document Templates To create a new blank document: click the File tab and click Blank document.
Positioning Objects with CSS and Tables
XP IT INSTRUCTOR :AHMAD HIRZALLAH 1 Microsoft Office FrontPage 2003 Creating Tables and Frames.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
COMPSA Exam Prep Session by Paul Allison On: April 8th from 1:30-3:00 Location TBA Winter 2016CISC101 - Prof. McLeod1.
Notices Assn 3 is posted – due tomorrow. Quiz marking underway (still – sigh…). Alternate solution code was added on Tuesday to the assignment 3 statement.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 5 1 Microsoft Office FrontPage 2003 Tutorial 5 – Creating Tables and Frames.
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.
Laying out Elements with CSS
Creating a Presentation
Microsoft Office 2007-Illustrated Introductory, Windows Vista Edition
Java FX: Scene Builder.
Cascading Style Sheets Boxes
CSS Layouts CH 13.
CSS Layouts: Grouping Elements
Microsoft Access 2007 – Level 2
With Microsoft FrontPage 2000
Working with Tables: Module A: Table Basics
Chapter 1: An Introduction to Visual Basic 2015
Chapter 8: Writing Graphical User Interfaces
ASP.NET Web Controls.
Microsoft Office 2007-Illustrated Introductory, Windows Vista Edition
CISC124 Quiz 2 grading underway.
MODULE 6 Microsoft Excel 2010
CMPE212 – Stuff… Assn 3 due and Quiz 2 in the lab next week.
Chapter 14 JavaFX Basics Dr. Clincy - Lecture.
CMPE212 – Stuff… Assn 3 sample solution is posted.
Styles and the Box Model
Controlling Layout with Style Sheets
Chapter 2 – Introduction to the Visual Studio .NET IDE
CISC124 Last Quiz this week. Topics listed in last Tuesday’s lecture.
Tutorial 3 – Creating a Multiple-Page Report
CISC124 Last Quiz this week. Topics listed in last Tuesday’s lecture.
Tutorial 6 Creating Dynamic Pages
Fall 2018 CISC124 12/1/2018 CISC124 Note that the next assignment, on encapsulation, is due next Wednesday at 7pm – not Friday. The next Quiz is not until.
CMPE212 – Stuff… Assignment 4 due March 23 – this Friday.
Responsive Framework.
CISC101 Reminders Assn 3 due tomorrow, 7pm.
DREAMWEAVER MX 2004 Chapter 3 Working with Tables
CISC124 Last Quiz next week. Topics listed in Tuesday’s lecture.
CISC124 Assignment 3 due tomorrow at 7pm.
CISC124 Assignment 4 on Inheritance due next Friday.
POWER POINT WHY HAVE WE USE THIS PROGRAM? TO SHOW YOUR STUDY..
CISC124 Quiz 3 marking underway. Assn 5 due Friday. Fall 2018
Using Templates and Library Items
CISC124 Assignment 3 sample solution will be posted tonight after 7pm.
CMPE212 – Reminders Assignment 2 sample solution is posted.
CMPE212 – Reminders Assignment 2 due today, 7pm.
CMPE212 – Reminders Assignment 5, a JavaFX GUI, due this Friday.
CMPE212 – Reminders Assignment 5, a JavaFX GUI, due next Friday.
Key Applications Module Lesson 14 — Working with Tables
Positioning Boxes Using CSS
Presentation transcript:

CISC124 Last Quiz this week. Topics listed in last Tuesday’s lecture. Fall 2018 CISC124 11/26/2018 CISC124 Last Quiz this week. Topics listed in last Tuesday’s lecture. Assn 4 sample solution posted. Fall 2018 CISC124 - Prof. McLeod Prof. Alan McLeod

Assignment 5, Getting Started Have you installed e(fx)clipse and Scenebuilder? You can design your window and think about how it will work without doing any coding. What nodes will you need (labels, buttons, text boxes, radio buttons, list boxes?) and where will they go? And what will they do? How will you prevent illegal choices just through the design and operation of your window? To get ahead – look at the code supplied for Exercise 11. Fall 2018 CISC124 - Prof. McLeod

Today Continue: JavaFX Layout Panes. Using the style sheet. Fall 2018 CISC124 - Prof. McLeod

Pane Objects In order to design your window you need to understand how the different Pane objects work. From the JavaFX API Tree: Fall 2018 CISC124 - Prof. McLeod

Aside – Running JavaFX Lecture Notes Code Create a blank JavaFX project. Remove any files in the application folder. In a file browser, unzip the archive (*.zip) file to the application folder of the project. At the moment this is just Main.java and some also have application.css. Back in eclipse, use <F5> to refresh the project listing. Fall 2018 CISC124 - Prof. McLeod

Aside - Component Sizing Padding Border Margin Unless you define a preferred size the calculated size is based on the size of the rendered label plus a default padding size between the label and the border. You can also change the size of the margin in code. Fall 2018 CISC124 - Prof. McLeod

AnchorPane Components are anchored at a specified distance from the edge of the Pane using the static methods: “value” is in pixels as a distance from the border of the pane. Why a double? Fall 2018 CISC124 - Prof. McLeod

AnchorPane, Cont. See FXProjectAnchorPane. Here is the interesting part: AnchorPane root = new AnchorPane(); Button leftTopButton = new Button("Left Top"); leftTopButton.setFont(new Font("Consolas", 20)); Button rightBottomButton = new Button("Right Bottom"); rightBottomButton.setFont(new Font("System", 18)); Label leftBottomLabel = new Label("Left Bottom"); leftBottomLabel.setFont(new Font("Times New Roman", 22)); AnchorPane.setLeftAnchor(leftTopButton, 10.0); AnchorPane.setTopAnchor(leftTopButton, 10.0); AnchorPane.setRightAnchor(rightBottomButton, 10.0); AnchorPane.setTopAnchor(rightBottomButton, 10.0); AnchorPane.setBottomAnchor(rightBottomButton, 10.0); AnchorPane.setLeftAnchor(leftBottomLabel, 80.0); AnchorPane.setBottomAnchor(leftBottomLabel, 80.0); root.getChildren().addAll(leftTopButton, leftBottomLabel, rightBottomButton);

AnchorPane, Cont. Note the effect of window re-sizing. Note how two or more anchors can combine to change the size of the control away from its calculated/preferred size. This is another relatively crude layout manager that might be best used to lay panes out in a window. Fall 2018 CISC124 - Prof. McLeod

Aside – Pane “Children” Nodes added to a pane are also called “Children”. Add nodes to a pane by invoking the .add() or .addAll() methods on the children collection owned by the pane. The .addAll() method can also accept a Collection<? extends Node> object. The .getChildren() method of the pane object “exposes” its children collection. Fall 2018 CISC124 - Prof. McLeod

FlowPane Piles children into the pane in the order in which they are added from left to right (by default). The children wrap around if the available space is full. See FXProjectFlowPane. See what happens when you re-size the window. Play with gaps, padding, default sizes and alignment. Note the use of an ArrayList<Button> to hold buttons. Why are some buttons larger than others? Fall 2018 CISC124 - Prof. McLeod

GridPane Possibly the hardest Pane to use but it offers the most control. Grid based – you need to choose which position in the grid you will use for your component. A column is sized to the widest component in that column. Similarly the height of a row is determined by the tallest component in the row. Fall 2018 CISC124 - Prof. McLeod

GridPane, Cont. You can add internal gaps between rows and columns using .setHgap() and .setVgap(). Set gaps on the outside of the pane using .setPadding() and supply an Insets object. The pane has two .add() methods you can use, one at a time, to add components: .add(node, column#, row#) .add(node, column#, row#, columnspan, rowspan) Fall 2018 CISC124 - Prof. McLeod

GridPane, Cont. During development invoke .setGridLinesVisible(true) to see the lines in the grid. See FXProjectGridPane Play with grid positioning, gaps in the grid, column spanning and alignment. Fall 2018 CISC124 - Prof. McLeod

Using CSS I’m getting rather tired of setting the font and font size for every control individually! You can use the CSS – application.css – file to change the look of every component, the pane as well as making custom changes to individual components. All this style code can now be removed from the *.java file! Fall 2018 CISC124 - Prof. McLeod

Using CSS, Cont. See FXProjectGridPaneCSS You can change colours, background images, foreground colours and apply shading effects and many other fun things! And the *.css code is easy to port to other projects. You can define your own “skin” and apply it to all of your projects. See https://docs.oracle.com/javase/10/docs/api/javafx/scene/doc-files/cssref.html for a reference on css in javaFX. Fall 2018 CISC124 - Prof. McLeod

Using CSS, Cont. The “Unknown Property” warning and the lack of auto-complete features in the CSS editor seems to be a bug in the current version of e(fx)clipse. The CSS seems to have been properly applied anyways. Fall 2018 CISC124 - Prof. McLeod

Using CSS, Cont. See FXProjectGridPaneCSSAllOut for some other changes using the style sheet. It would also be nice to get rid of all the layout details as well. Later, we will use a *.fxml file and SceneBuilder for this. This will also allow us to lay out controls using a drag and drop visual editor. The css editor itself does help quite a bit! Use <Cntrl>Spacebar to get hints. Fall 2018 CISC124 - Prof. McLeod

HBox and VBox Panes Pretty straight-forward. Less annoying than FlowPane – no wrapping. See FXProjectHBox and FXProjectVBox. These would either be used for very simple designs or within a region of another layout. Fall 2018 CISC124 - Prof. McLeod

StackPane Pile controls on top of each other like a deck of cards. Useful if control has a transparency, or you are building a tabbed dialog. (No demo for this one!) Fall 2018 CISC124 - Prof. McLeod

TilePane Another grid based layout, but simpler than GridPane. More like FlowPane. Controls are laid down in the order in which they are added. You can specify a desired number of rows and/or columns, but the actual layout may change if needed. Column widths and row heights are fixed to the largest control in that column or row (like GridPane). No demo for this one either. Fall 2018 CISC124 - Prof. McLeod

TextFlow Supplies a means of combining Text objects into a single Pane along with “Rich Text” formatting options. The advantage (over something like FlowPane, for example) is that the TextFlow pane will still line up all the text regardless of fonts and font sizes, as well as carrying out some sensible wrapping, if needed. See FXProjectTextFlow. Fall 2018 CISC124 - Prof. McLeod

TextFlow, Cont. Note how the root is a Group object rather than the TextFlow object itself. TextFlow cannot be a root object for the Scene. You can also add other node objects to a TextFlow such as drawn shapes, buttons and images. Fall 2018 CISC124 - Prof. McLeod

Pane The root class for all the other pane classes. You can use this class, but it does not have a layout manager. All positioning is manual. You need to manually size (height, width) the component and specify the (x, y) positions. Ouch! Fall 2018 CISC124 - Prof. McLeod

Getting a Button to do Something Use the .setOnAction() mutators to add an event handler to the button. The handler for a mouse click event must implement EventHandler<ActionEvent>. Four ways of doing this: Another separate class. (we’ll skip this one…) A private inner class. An anonymous class. A Lambda function. Fall 2018 CISC124 - Prof. McLeod

Project11InnerClass The handler object can be private and is contained within the same class that defines the rest of the window. Fall 2018 CISC124 - Prof. McLeod

Project11AnonymousClass Gets rid of private inner class and the need for the Label object to be an attribute. But it has added some “bloat” to the start() method. (An anonymous class has to be short!) Fall 2018 CISC124 - Prof. McLeod

Project11Lambda Wow! That was easy! Button changeButton = new Button("Change Label"); changeButton.setOnAction(event -> { if (changeLabel.getText().equals("Hello!")) changeLabel.setText("Goodbye!"); else changeLabel.setText("Hello!"); }); Wow! That was easy! Fall 2018 CISC124 - Prof. McLeod

Project11Lambda, Cont. This works because the EventHandler<T extends Event> interface is a Functional Interface – an interface consisting of just a single abstract function: void handle (T event); Event is the parent class for many events, so this same handler can be used for a wide variety of event types. Fall 2018 CISC124 - Prof. McLeod