Phase 2: Due 11/28/18: Additional code to add, move and remove vertices in response to user mouse clicks on the screen.

Similar documents
Phase 2: Due 05/02/18 The Gui now stores and displays a graph in response to user mouse clicks on the screen.

Programming Languages and Techniques (CIS120)

CS 2110 Fall Instructions. 1 Installing the code. Homework 4 Paint Program. 0.1 Grading, Partners, Academic Integrity, Help

Queen s University Faculty of Arts and Science School of Computing CISC 124 Final Examination December 2004 Instructor: M. Lamb

CS 231 Data Structures and Algorithms Fall Event Based Programming Lecture 06 - September 17, Prof. Zadia Codabux

CSC207 Week 4. Larry Zhang

Introduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008

Systems Programming. Bachelor in Telecommunication Technology Engineering Bachelor in Communication System Engineering Carlos III University of Madrid

be able to read, understand, and modify a program written by someone else utilize the Java Swing classes to implement a GUI

Handouts. 1 Handout for today! Recap. Homework #2 feedback. Last Time. What did you think? HW3a: ThreadBank. Today. Small assignment.

To gain experience using GUI components and listeners.

Announcements. 1. Forms to return today after class:

Programming Assignment 2 (PA2) - DraggingEmoji & ShortLongWords

C02: Overview of Software Development and Java

CS 463 Project 1 Imperative/OOP Fractals

DCS235 Software Engineering Exercise Sheet 2: Introducing GUI Programming

Adobe Flash CS3 Reference Flash CS3 Application Window

CSCI 585- Database Systems Spring 2008 Homework Assignment 2 Due: Tuesday, April

Programming Languages and Techniques (CIS120)

CSC 160 LAB 8-1 DIGITAL PICTURE FRAME. 1. Introduction

SE1021 Exam 2. When returning your exam, place your note-sheet on top. Page 1: This cover. Page 2 (Multiple choice): 10pts

CS 201 Advanced Object-Oriented Programming Lab 6 - Sudoku, Part 2 Due: March 10/11, 11:30 PM

There are several files including the start of a unit test and the method stubs in MindNumber.java. Here is a preview of what you will do:

Programming Standards: You must conform to good programming/documentation standards. Some specifics:

3. When you process a largest recent earthquake query, you should print out:

Java. GUI building with the AWT

Graphical User Interface (GUI)

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG

Programming Languages and Techniques (CIS120)

1.00/1.001 Introduction to Computers and Engineering Problem Solving Spring Quiz 2

Swing from A to Z Some Simple Components. Preface

Introduction to Data Structures

Example Programs. COSC 3461 User Interfaces. GUI Program Organization. Outline. DemoHelloWorld.java DemoHelloWorld2.java DemoSwing.

Instructions PLEASE READ (notice bold and underlined phrases)

1 Using the NetBeans IDE

CS 241 Data Organization using C

GUI Program Organization. Sequential vs. Event-driven Programming. Sequential Programming. Outline

Our second exam is Thursday, November 10. Note that it will not be possible to get all the homework submissions graded before the exam.

San José State University Department of Computer Science CS151, Object Oriented Design, Section 04, Fall, 2016 (42968)

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Distributed Collaboration - Assignment 1: Multi-View 1-User IM

KF5008 Program Design & Development. Lecture 1 Usability GUI Design and Implementation

Summer Assignment for the School Year

Tutorials. Tutorial every Friday at 11:30 AM in Toldo 204 * discuss the next lab assignment

Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently.

The JFrame Class Frame Windows GRAPHICAL USER INTERFACES. Five steps to displaying a frame: 1) Construct an object of the JFrame class

Intensive Introduction to Computer Science. Course Overview Programming in Scratch

You will need to download the Java software development kit from

Contents. The Anatomy of a Moodle Classroom. Course Description:

CMPSC 111 Introduction to Computer Science I Fall 2016 Lab 2 Assigned: September 7, 2016 Due: Wednesday, September 14, 2016 by 2:30 pm

CS2110 Fall 2015 Assignment A5: Treemaps 1

AP CS Unit 11: Graphics and Events

CS252 Advanced Programming Language Principles. Prof. Tom Austin San José State University Fall 2013

Hanley s Survival Guide for Visual Applications with NetBeans 2.0 Last Updated: 5/20/2015 TABLE OF CONTENTS

CMSC 201 Fall 2016 Homework 6 Functions

You must pass the final exam to pass the course.

We encourage you to send your ad contract and payment early to reserve your page. Photos and text must be received by Friday, February 10.

Project #1 Computer Science 2334 Fall 2008

SacCT Creating a Turnitin Assignment How to Guide

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

St. Paul s Convent School (Secondary Section) ELMO Student User Guide

Midterm assessment - MAKEUP Fall 2010

CIS 101 Orientation Document Fall 2017

Foundation Scholarship Application Tips

CSE115 Lab 9 Fall 2016

CS3114 (Fall 2013) PROGRAMMING ASSIGNMENT #2 Due Tuesday, October 11:00 PM for 100 points Due Monday, October 11:00 PM for 10 point bonus

Low fidelity: omits details High fidelity: more like finished product. Breadth: % of features covered. Depth: degree of functionality

Release Date:!4/12/1434 H (Wed 9/10/2013) Due Date:!! 18/12/1434 H (Wed 23/10/2013)

Swing - JLabel. Adding a text (and HTML) labels to a GUI

Final Assignment for CS-0401

CSE115 Lab 4 Fall 2016

Programming Assignment 2 ( 100 Points )

CS 100: Programming Assignment P1

CS 2223 B15 Term. Homework 1 (100 pts.)

CS 051 Homework Laboratory #2

Lab Assignment. Lab 1, Part 1: Stretches. Assignment Preparation. The Task. .. Spring 2008 CSC/CPE 365: Database Systems Alexander Dekhtyar..

Graphics User Defined Forms, Part I

To gain experience using recursion and recursive data structures.

CS Problem Solving and Object-Oriented Programming

Students Guide to Desire2Learn

ICOM 4015 Advanced Programming Laboratory. Chapter 1 Introduction to Eclipse, Java and JUnit

Fall 2013 Program/Homework Assignment #2 (100 points) -(Corrected Version)

CS108, Stanford Handout #22. Thread 3 GUI

Welcome to Technology Class. 7 th Grade: Web Design 8 th Grade: Digital Animation

GBACH Website Tutorial. Table of Contents

CSCI 161: Introduction to Programming I Lab 1b: Hello, World (Eclipse, Java)

How to complete the SPC Clinical Faculty Evaluation Form Summer 2016 Spring 2017

Multimedia Programming

6.170 Laboratory in Software Engineering Fall 2005 Problem Set 5: Stata Center Navigation and Analysis Due Date: Oct 20, 2005

Lecture 5: Java Graphics

MIT AITI Swing Event Model Lecture 17

(Incomplete) History of GUIs

CSE wi Final Exam 3/12/18. Name UW ID#

ecampus Submission Process

CSCI 320 Group Project

COMP1406 Tutorial 1. Objectives: Getting Started:

CSCI455: Introduction to Programming System Design

Control Flow: Overview CSE3461. An Example of Sequential Control. Control Flow: Revisited. Control Flow Paradigms: Reacting to the User

CS 3270 Mobile Development for Android Syllabus

Global Gomoku Lab 4 in D0010E

Transcription:

Fall 2018 CS313 Project Implementation of a GUI to work with Graphs. Reminder: This is a pass/fail assignment. If you fail the assignment you will lose half a grade from your course grade. If you pass the assignment and complete a fully working version of the project you will gain a half grade adjustment to your course grade, You do not have to do a perfect job to pass the assignment, but you must submit something that compiles and creates a GUI that performs most of the required tasks. The surest way to fail this assignment is to use code written by somebody else (in or outside of the class) or to share code with another student. I will use an automated system that detects similarity between different pieces of code. The final deadline for this project is Wednesday 12/12/2018. However there are preliminary milestones that you should try to achieve. You should submit preliminary versions of the project to check that you have achieved them. The deadlines for these milestones are as follows: Phase 1: Due 11/21/18: Code to show a Gui screen with required buttons. The help button should work. Also pressing any button should release all other radio buttons. Phase 2: Due 11/28/18: Additional code to add, move and remove vertices in response to user mouse clicks on the screen. Phase 3: Due 12/05/18: Additional code to add and remove edges and display graphs on the screen. Phase 4: Due 12/12/18: Complete code which will now show connected components of a graph in different colors and highlight any cut vertices. This is the version that will receive a grade. I advise you to try to submit work for the preliminary phases. This is optional, but it is a way for me to give you feedback about whether you are on track with the project. If your project does not complete the first three phases it will not pass. When you submit any version of your project (preliminary or final) you should submit only one file named GGxxxx.java where xxxx is changed to be the last 4 digits of your 8 digit ID number. For example, if your id number was 31415926 you would submit a file called GG5926.java. The main class in this file must be a public class GG5926 but no other classes that you use can be public (because only one public class is allowed in a file). Although this is not an ideal way to organize code it simplifies my task in grading. I will not accept any other type of submission either for the final version or the earlier milestones. Submit the homework by emailing your one file as an attachment from your own Queens College email account to Alexander.Ryba@qc.cuny.edu. The subject for your email must be: CS313 Project Phase X, where X is the phase corresponding to your file. Late work will 1

not be considered for any phase of the project. Email from addresses outside Queens College will not be accepted. The gui that you make should offer the features shown here. This screenshot has been made before any graph has been entered. Choosing the Help button should pop up another window with instructions about how to run your gui. In order to pick vertices, the user selects the radio button marked Add Vertex and selects positions of vertices in the right half of the gui by clicking the mouse. Each mouse click generates a vertex of the graph and these vertices are marked in red as they are added. 2

The radio button Remove Vertex allows the user to remove a vertex by clicking on it. Later when there are edges attached to a vertex, removing it should also remove these edges. The radio button Move Vertex should allow the user to select a vertex by clicking on it and then click at a new location to move the vertex. Of course any edges attached to the vertex must move with it. You need to make the gui accept mouse clicks that are reasonably close to a vertex since it is impossible for a user to click its exact pixel location. The user selects the radio button marked Add Edge to add edges. An edge is made by clicking close to the two vertices that specify its ends. After the first end vertex of an edge is selected it is highlighted in green until the second end has been selected too at which time the edge is added to the graph and drawn on the gui in blue. The user selects the radio button marked Remove Edge to remove edges. Once the button is selected, any click on or near an edge removes it (but leaves the vertices at its ends). The button marked Add All Edges is a shortcut that add in all possible edges between pairs of vertices. 3

The button Connected Components makes the gui show the different components of the graph in different colors. An example of how it should operate is shown here: The button Show Cut Vertices makes the gui highlight all cut vertices of the graph. An example of how it should operate is shown here: Although the first steps of this project just involve Gui code, later steps will require work with a Graph data structure. This is the topic of Chapter 14 of the text which you should read. You should also refer to the textbook for CS220 to look up standard terminology about graphs. You should probably plan to use a number of classes in your project. In addition to your main class GGxxxx which has the job of displaying the gui on screen, you might consider having a class Vertex, a class Edge, a class Graph, a class for the Help screen, listener classes for your Gui and a class that represents 4

the panel of the Gui in which the graph is displayed. The following code fragment could help you get started with an implementation that uses swing classes. public class GGxxxx extends JFrame { GraphPicturePanel picture; // you would have to make this class // to implement behavior of the picture public static void main(string args[]) { try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); catch (ClassNotFoundException InstantiationException IllegalAccessException UnsupportedLookAndFeelException e) { new GraphGui(); public GraphGui() { super("graph GUI"); setdefaultcloseoperation(jframe.exit_on_close); // code to layout gui components omitted public void paint(graphics g) { // method to be sure the // picture gets redrawn as it is modified // if you want to use this plan your GraphPicturePanel // needs a method with title line: // public void paintcomponent(graphics g) { super.paint(g); picture.repaint(); setvisible(true); // other gui code omitted You will also need a class that implements an ActionListener to respond to user selections of buttons and a class that extends MouseAdapter to detect mouse clicks in the picture panel. I will compile and run your program on venus. You should make sure that if you move your file GGxxxx.java to venus you can compile it with the command: javac GGxxxx.java If you use unusual packages and libraries this might be a problem. If you cannot find a work around for this you should come to discuss your project and 5

how you have implemented it with me. Do not wait until the final stage to do this. Running your GUI on venus can be a little tricky because you need to find a way to get it to show up on a local screen, but you should still be able to compile on venus. Some common issues that could prevent Phase 1 work from compiling on venus are: 1. An initial package line (inserted by eclipse) was left as the first line of the file. This should be removed because it refers to a particular eclipse set up and directory structure that will not be present on venus or other machines. 2. The file contains no public class. 3. The public class contains no main method. 4. The public class has a different name from the file. Also make sure to set a default close operation so that you program ends when the GUI is closed. 6