In Lab 1 you learned Eclipse basics; today you'll learn about more advanced software development features:
We'll be working with Freemind, a medium-sized (50 KLOC) open source application. You will need 65 MB of available space (or find a partner who does). On the composer machines, you should have no more than 37000 KB used (quota -v
).
Setup instructions for composer machines (can be adapted to other OS's):
gunzip freemind-src-0.9.0_RC_4.tar.gz;
tar xvf freemind-src-0.9.0_RC_4.tar
)rm freemind-src-0.9.0_RC_4.tar
)eclipse &
)$USER_HOME/Desktop/freemind
)Freemind is mind mapping software often used for knowledge and content management. It's a hierarchical editor that supports “folding”–that is, collapsing and expanding sections of the hierarchy. Today we'll focus on understanding how the folding functionality is implemented.
The easiest way to understand the concept of folding is to try it out:
The call hierarchy shows calling relationships between methods in a program. For example:
toggleFolded(ListIterator listIterator)
in class freemind.modes.minmapmode.actions.ToggleFoldedAction
toggleFolded
& toggleFolded
again. Look at the callers of actionPerformed
.nameSetFolded
What information does the call hierarchy give you? Why is it useful for understanding a program?
The type hierarchy shows how types are related. For example:
ToggleFoldedAction
and select “Open Type Hierarchy”AbstractAction
and select “Focus On 'AbstractAction'”What information does the type hierarchy give you? Why is it useful for understanding a program?
Exercise: Show me an interesting call hierarchy and type hierarchy on your own project code (where “interesting” = more than 3 nodes)
What is refactoring? Why use it?
toggleFolded
and select “Refactor > Rename”toggleFolded
Why rename?
toggleFolded
, select the 3 statements (6 lines) starting with modeController.getAction…
Why extract methods?
What's debugging? What's a debugger?
Task: How does the UI toggle folding action (click, space, etc.) initiate the toggleFolded
implementation?
toggleFolded
, right click & select “Toggle Breakpoint”
Exercise: Show me a debugging trace for toggleFolded
. Which method calls in the trace do you think handle your input method (click, space, right click, etc.)?