c omp 401 g raph vs. d ag vs. t ree o bject s tructures instructor: prasun dewan

26
COMP 401 GRAPH VS. DAG VS. TREE OBJECT STRUCTURES Instructor: Prasun Dewan

Upload: ashley-harvey

Post on 06-Jan-2018

223 views

Category:

Documents


2 download

DESCRIPTION

2 P REREQUISITE Composite Object Shapes

TRANSCRIPT

Slide 1Instructor: Prasun Dewan
int originX, originY;
}
public void setAxesLength(int anAxesLength) {
int originX, originY;
‹#›
X and Y axes not shown in Tree View
‹#›
Point
int
Location
Height
Width
int
Point
int
Height
Width
int
Location
XAxis
YAxis
XAxisLocation
YAxisLocation
‹#›
Parent
Parent
int
Each node has a single incoming edge
Cannot have multiple paths to a node
Each internal node roots a subtree in which no node has an edge to a node in any other subtree
Directed Acyclic Graph (DAG)
Can have multiple incoming edges to a node
But cannot return back to a node when one follows edges
Graph
A node can have multiple incoming edges to a node and thus can have multiple paths to a node
Can have cycles
How to display them textually?
Performance and implementation reasons.
What if we have a non tree logical structure?
‹#›
See X and Y points
‹#›
@Visible(false)
Tree Root
SubTree Root
‹#›
int
Height
Width
User Interface Structures
User interfaces are also structures; they consist of objects called windows or widgets or (UI) components
Root objects:
‹#›
leftPanel.add(textField);
rightPanel.add(button);
leftPanel.add(textField);
rightPanel.add(textField);
‹#›
leftPanel.add(textField);
rightPanel.add(splitPane);
Window vs. Other Structures
Both are object structures that can be trees, DAGs and arbitrary Graphs
Window structures describe components of the user interface
Non window object structures we have seen are mapped to window structures by ObjectEditor
Some window structures are Beans
JSplitPane has fixed number of left and right component of with getters and setters
Some are collections
‹#›
User Interface Structures
User interfaces are also structures; they consist of objects called windows or widgets or (UI) components
Root objects:
‹#›