DOC PREVIEW
LETU COSC 2103 - ELEVATOR VIEW

This preview shows page 1-2-3-24-25-26-27-48-49-50 out of 50 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 50 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 50 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 50 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 50 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 50 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 50 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 50 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 50 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 50 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 50 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 50 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Appendix F – Elevator ViewF.1 IntroductionElevatorView.java ElevatorView displays the elevator simulation model. Lines 18-20 Lines 23-24ElevatorView.java ElevatorView displays the elevator simulation model. Line 30 Lines 33-36 Lines 39-40 Line 43 Lines 46-54ElevatorView.java ElevatorView displays the elevator simulation model. Lines 57-84ElevatorView.java ElevatorView displays the elevator simulation model. Lines 88-89 and 92-93 Lines 98-103 Line 104 Lines 107-111ElevatorView.java ElevatorView displays the elevator simulation model. Line 114 Lines 117-124 Line 127 Lines 130-135 Line 138ElevatorView.java ElevatorView displays the elevator simulation model. Line 141 Line 154 Lines 165-168ElevatorView.java ElevatorView displays the elevator simulation model. Line 171 Lines 179-180 Line 191 Lines 194-195ElevatorView.java ElevatorView displays the elevator simulation model. Line 204 Line 212 Lines 219-220ElevatorView.java ElevatorView displays the elevator simulation model. Lines 226-228 Lines 231-232 Lines 242-243 Lines 250-251ElevatorView.java ElevatorView displays the elevator simulation model. Line 258 Line 271 Line 275ElevatorView.java ElevatorView displays the elevator simulation model. Lines 285-286 Line 296 Lines 305-314ElevatorView.java ElevatorView displays the elevator simulation model. Lines 316-319 Line 327 Lines 330-336ElevatorView.java ElevatorView displays the elevator simulation model. Lines 341-352 Lines 355-358 Lines 361-381 Lines 363-366ElevatorView.java ElevatorView displays the elevator simulation model. Lines 370-377 Line 388 Lines 393-407ElevatorView.java ElevatorView displays the elevator simulation model. Lines 401-406 Lines 410-428ElevatorView.java ElevatorView displays the elevator simulation model. Line 431 Lines 439-471ElevatorView.java ElevatorView displays the elevator simulation model. Lines 457-470 Lines 474-479ElevatorView.java ElevatorView displays the elevator simulation model. Lines 482-487 Line 492 Lines 495-496 Lines 502-509ElevatorView.java ElevatorView displays the elevator simulation model. Line 514 Lines 516-519 Lines 522-523 Lines 530-541ElevatorView.java ElevatorView displays the elevator simulation model. Lines 544-549 Lines 552-555 Lines 558-563ElevatorView.java ElevatorView displays the elevator simulation model. Line 573 Line 581 Line 584 Lines 589-592ElevatorView.java ElevatorView displays the elevator simulation model. Line 603 Line 606 Lines 611-612 Line 622 Line 625ElevatorView.java ElevatorView displays the elevator simulation model. Lines 627-642 Line 646 Line 649 Line 657ElevatorView.java ElevatorView displays the elevator simulation model. Lines 670-677 Line 684ElevatorView.java ElevatorView displays the elevator simulation model. Lines 687-691 Line 696 Line 699 Line 709ElevatorView.java ElevatorView displays the elevator simulation model. Line 717 Lines 724-726 Lines 729-730 Line 739 Lines 742-744ElevatorView.java ElevatorView displays the elevator simulation model. Lines 747-748 Line 753 Lines 756-757 Lines 760-763 Lines 768-771ElevatorView.java ElevatorView displays the elevator simulation model. Lines 774-777 Line 785 Lines 788-789 Lines 792-799ElevatorView.java ElevatorView displays the elevator simulation model. Lines 804-812 Lines 815-823ElevatorView.java ElevatorView displays the elevator simulation model. Line 828 Lines 830-833 Line 837 Lines 846-847 Lines 851-852ElevatorView.java ElevatorView displays the elevator simulation model. Line 857 Lines 866-867 Lines 871-872 Lines 877-880ElevatorView.java ElevatorView displays the elevator simulation model. Lines 883-892F.2 Class ObjectsF.2 Class Objects (cont.)Slide 37F.3 Class ConstantsF.4 Class ConstructorF.4 Class Constructor (cont.)F.5 Event HandlingF.5.1 ElevatorMoveEvent typesF.5.2 PersonMoveEvent typesF.5.3 DoorEvent typesF.5.4 ButtonEvent typesF.5.5 BellEvent typesF.5.6 LightEvent typesF.6 Artifacts RevisitedF.6 Component Diagrams Revisited (cont.)F.7 Conclusion 2003 Prentice Hall, Inc. All rights reserved.Appendix F – Elevator ViewOutlineF.1 IntroductionF.2 Class ObjectsF.3 Class ConstantsF.4 Class ConstructorF.5 Event HandlingF.5.1 ElevatorMoveEvent typesF.5.2 PersonMoveEvent typesF.5.3 DoorEvent typesF.5.4 ButtonEvent typesF.5.5 BellEvent typesF.5.6 LightEvent typesF.6 Artifacts RevisitedF.7 Conclusion 2003 Prentice Hall, Inc. All rights reserved.F.1 Introduction•Class ElevatorView–Graphical representation of elevator-simulation model–Largest class in simulation 2003 Prentice Hall, Inc.All rights reserved.OutlineElevatorView.javaElevatorView displays the elevator simulation model.Lines 18-20Lines 23-241 // ElevatorView.java2 // View for ElevatorSimulation3 package com.deitel.jhtp5.elevator.view;4 5 // Java core packages6 import java.awt.*;7 import java.awt.event.*;8 import java.util.*;9 import java.applet.*;10 11 // Java extension package12 import javax.swing.*;13 14 // Deitel packages15 import com.deitel.jhtp5.elevator.event.*;16 import com.deitel.jhtp5.elevator.ElevatorConstants;17 18 public class ElevatorView extends JPanel 19 implements ActionListener, ElevatorSimulationListener,20 ElevatorConstants {21 22 // ElevatorView dimensions23 private static final int VIEW_WIDTH = 800;24 private static final int VIEW_HEIGHT = 435;25 26 // offset for positioning Panels in ElevatorView27 private static final int OFFSET = 10;ElevatorView implements ElevatorSimulationListener, which inherits from all listener interfacesConstants for width and height of ElevatorView 2003 Prentice Hall, Inc.All rights reserved.OutlineElevatorView.javaElevatorView displays the elevator simulation model. Line 30 Lines 33-36Lines 39-40Line 43Lines 46-5428 29 // Elevator repaints components every 50 ms30 private static final int ANIMATION_DELAY = 50;31 32 // horizontal distance constants33 private static final int PERSON_TO_BUTTON_DISTANCE = 400;34 private static final int BUTTON_TO_ELEVATOR_DISTANCE = 50;35 private static final int PERSON_TO_ELEVATOR_DISTANCE = 36 PERSON_TO_BUTTON_DISTANCE + BUTTON_TO_ELEVATOR_DISTANCE;37 38 // times walking to Floor's Button and Elevator39 private static final int TIME_TO_BUTTON = 3000; // 3 seconds40 private static final int TIME_TO_ELEVATOR = 1000; // 1 second41 42 // time traveling in Elevator (5 seconds)43 private static final int ELEVATOR_TRAVEL_TIME = 5000;44


View Full Document

LETU COSC 2103 - ELEVATOR VIEW

Documents in this Course
Arrays

Arrays

16 pages

Templates

Templates

17 pages

Methods

Methods

22 pages

Methods

Methods

22 pages

Arrays

Arrays

11 pages

Load more
Download ELEVATOR VIEW
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view ELEVATOR VIEW and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view ELEVATOR VIEW 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?