SE-1021 Software Engineering II

Slides:



Advertisements
Similar presentations
SE2811 Week 8 Monday (last drop day) The Command Pattern Lambda Expressions SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr.
Advertisements

Syntax & terminology review While the following slides are not exactly what we did on the board (object diagrams are not shown here) they cover most of.
SE-1021 Software Engineering II Week 5, Class SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick 1.
SE-1021 Software Engineering II Week 9, Class 3 Get ready for PollEverywhere! BlocksMania and File I/O Reading/Writing text in ASCII, Unicode, and UTF-8.
SE1011 Week 2, Class 3 Today Compiling and running Another example using Scanner Compile-time and Run-time errors Review for exam SE-1011 Slide design:
SE-1021 Software Engineering II Week 8, Class 1 Return Exam Producing UML diagrams automatically in EA Poll Everywhere Files Tomorrow Week 6 HW due (if.
SE-1021 Software Engineering II Week 5, Class 2 Why my computer crashed Layouts Multiple action listeners Single actionPerformed method – distinguishing.
Week 2, Day 2: The Factory Method Pattern Other good design principles Cohesion vs. Coupling Implementing the Strategy Pattern Changing strategies (behaviors)
SE-1021 Software Engineering II Week 5, Class 1 Learning Resources From inner classes to anonymous Inner Classes Additional GUI components Inheritance.
CS-2852 Data Structures Week 5, Class 1 – Testing and Stacks Return Exams & Labs  Package-level access  UML connectors for instance variables Announcement:
CS-2852 Data Structures Week 5, Class 2 – Testing and Stacks Announcement: Lab Demos - 2/3 & 4 on Friday Testing  Definitions, Example  (tentative) Testing.
2-Dec-15 Inner Classes. 2 Inner classes All the classes so far have been “top level” It is possible (and useful) to define a class inside another class.
1 GUIs, Layout, Drawing Rick Mercer. 2 Event-Driven Programming with Graphical user Interfaces  Most applications have graphical user interfaces (GUIs)
CS2852 Week 3, Class 2 Today Stacks Queues SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
CS-2852 Data Structures Week 10, Class 3 Final Announcement re. Final Choosing a Data Structure (Concluded) Poll Everywhere Survey & Results Conclusion.
SE-1021 Software Engineering II Week 1, Day 2 Attendance Survey results: Use powerpoint Safety Review Preparation for Lab 1 More on Java fundamentals…
SE1011 Week 6, Class 1 Today Return Half Exam 2 (cont.) Object Oriented Programming (cont.) Muddiest Point Next Half Exam: Week 7, Monday SE-1011 Slide.
SE1011 Week 6, Class 2 Today Return Half Exam 2 (cont.) Object Oriented Programming (cont.) UML class diagrams Muddiest Point Next Half Exam: Week 7, Monday.
SE1011 Week 3, Class 2 Today Sit down by someone you don't know Learn their name Find out who came farther to get to MSOE at the start of the quarter Designing.
CS2852 Week 7, Class 1 Today Binary Search Tree Implementing add Implementing find Return Quiz 4 (second attempt) Both sections are graded SE-2811 Slide.
Week 3, Day 3: Singleton Pattern Quiz Status Russia Opportunity Muddiest Points – Patterns SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick.
1 Event Driven Programs Rick Mercer. 2 So what happens next?  You can layout a real pretty GUI  You can click on buttons, enter text into a text field,
Week 7, Day 3 Half-Exam 2 A New Pattern SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
SE-1021 Software Engineering II Week 9, Class 1 ByteBuffer Tomorrow Get quizzes back from last week… Wednesday Quiz at start of lab 1.
CS-2852 Data Structures Week 10, Class 2 Announcement re. Final Choosing a Data Structure CS-2852 Dr. Josiah Yoder Slide style: Dr. Hornick 1.
Week 5, Day 3: Decorator Decorators Muddiest Point Tomorrow: Quiz on lab reading: web.msoe.edu/hasker/se2811/labs/5/ SE-2811 Slide design:
Week 5, Day 2: Decorator Decorators Muddiest Point Tomorrow: Quiz on lab reading: web.msoe.edu/hasker/se2811/labs/5/ SE-2811 Slide design:
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
CS2910 Week 8, Class 2 Today Return Quiz Look at Schedule TCP implementation! Week 8, Monday Quiz on SMTP May include some questions requiring you to interpret.
Week 6, Class 3: Composite Swing composites File composites Computer composites SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
CS-2852 Data Structures Week 5, Class 3 – Testing and Recursion Queue Implementing finite queues Binary Search Recursion Tomorrow – Quiz, Lab demos, Lab.
Inner Classes.
Topic: Inner Classes Course : JAVA PROGRAMMING Paper Code: ETCS-307 Faculty : Dr. Prabhjot Kaur Reader, Dept. of IT 1.
Inner Classes 27-Dec-17.
Slide design: Dr. Mark L. Hornick
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Week 2, Day 1: The Factory Method Pattern
SE-2811 Software Component Design
SE-1021 Software Engineering II
PC02 Term 1 Project Basic Messenger. PC02 Term 1 Project Basic Messenger.
Inner Classes 11/14/ Dec-04 inner_classes.ppt.
Week 6, Class 2: Observer Pattern
SE-2811 Software Component Design
SE-1021 Software Engineering II
PC02 Consolidation %WITTY_QUOTE%. PC02 Consolidation %WITTY_QUOTE%
Inner Classes 29-Nov-18.
JButton – Container Layout & Icons
SE-2811 Software Component Design
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1021 Software Engineering II
SE-2811 Software Component Design
Inner Classes 17-Apr-19.
Inner Classes 21-Apr-19.
SE-1021 Software Engineering II
Inner Classes 1-May-19.
SE-1021 Software Engineering II
CS-2852 Data Structures Week 1, Class 1 Data Structures Syllabus
Slide design: Dr. Mark L. Hornick
Inner Classes 11-May-19.
SE-1021 Software Engineering II
Inner Classes 18-May-19.
SE-1021 Software Engineering II
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1021 Software Engineering II
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Inner Classes 25-Oct-19.
SE-1021 Software Engineering II
Presentation transcript:

SE-1021 Software Engineering II 5/22/2019 SE-1021 Software Engineering II Week 5, Class 3 Completing the Calculator GUI layout SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick Dr. Josiah Yoder

How can we create this calculator layout? Modify the code below to put the operators above the buttons… 112344 5 + - * / 1 2 3 4 6 7 8 9 /// in the constructor… setLayout(new BorderLayout()); JPanel panel = createButtonPanel(); add(panel,BorderLayout.CENTER); public JPanel createOperationPanel() { JPanel panel = new JPanel(); panel.add(new JButton("+")); panel.add(new JButton("-")); panel.add(new JButton("*")); panel.add(new JButton("/")); return panel; } SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick

Get to know your classmates Turn to a neighbor, and find out who traveled farther over Christmas break When you have determined who traveled farther, that person should raise his hand SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick

What do we need to do to get our GUI to respond? In your groups of 2… Write a list of as many things that you can think of as possible to complete the GUI application. Favor quantity over quality SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick

Slide style: Dr. Hornick What is an inner class? An inner class is Declared inside of another class Usually declared private (needed by only one class) Has access to all variables of the top-level class Even instance variables! And so … _____________________________ Even private variables! And so … ______________________________ Dean & Dean, 2nd Ed. Pp 775-776 (Sec. 17.10) http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick

Slide style: Dr. Hornick Anonymous Inner Class This is a class that is DECLARED at the same place it is INSTANTIATED in the program Syntax: new InterfaceName () { ClassBody } Use: Use it where you would use the constructor of the class SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick

Slide style: Dr. Hornick Lambda Expression A lambda expression is an anonymous inner class with shorter syntax, for interfaces with just one method. Example: e -> myMethod(e) Use: Use it where you would use a constructor or an anonymous inner class. SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick

From the Horse’s Mouth* “Lambda expressions let you express instances of single-method classes more compactly.” http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html (emphasis added) * “straight from the Horse’s mouth” is an idiom saying to get something from an authoritative source. It refers to looking into a horse’s mouth to determine its age. SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick

Slide style: Dr. Hornick Answer this question Example lambda expression: e->System.out.println(e.getActionCommand()) Can a lambda expression use instance variables? How about instance methods? Think alone 1 minutes, discuss in pairs 1 minute SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick