Beruflich Dokumente
Kultur Dokumente
Peter Blanchfield
Slide
Peter Blanchfield
Slide
Objects
Peter Blanchfield
Slide
Objects
The Frame!
What has it got? Title Close, minimize, maximize
Peter Blanchfield
Slide
Objects
The Panel
This is where things are drawn It has a way to draw itself That includes its background image It goes in the frame
Peter Blanchfield
Slide
Objects
Come from
Peter Blanchfield
Slide
Diagram
We can diagram a class First we have a box with the name Let us start with the Frame
SpaceFrame
Peter Blanchfield
Slide
JFrame
JFrame
Peter Blanchfield
Slide
Panel
AlienLandingPanel
Peter Blanchfield
Slide
It is our drawing canvas It is added to the JFrame We use the add(object) method of the JFrame class We divide our class model with two lines SpaceFrame One section will hold the attributes alienLandingPanel The other the methods
add(Object)
Peter Blanchfield
Slide
10
Inheritance
The SpaceFrame will inherit from the JFrame Creating a new more special version of JFrame We can override JFrame methods Or use them direct
For example the JFrame constructor has a form with a title This can be called from the SpaceFrame constructor
super(name);
In both these cases name is a string that you have assigned the actual name to. Might be an SpaceFrame constructor parameter
Introduction to Software Engineering Monday, 20 February 2012 Slide
Peter Blanchfield
11
Model Parameter
SpaceFrame
SpaceFrame(name:String)
Peter Blanchfield
Slide
12
The relationship
The AlienLandingPanel is not inherited from the SpaceFrame But they are related One AlienLandingPanel will be added to the SpaceFrame
SpaceFrame AlienLandingPanel
Contains
Is In
Peter Blanchfield
Slide
13
Multiplicity
Contains
Peter Blanchfield
Slide
14