21.07.2013 Views

User Interface Design and Ergonomics - National Open University of ...

User Interface Design and Ergonomics - National Open University of ...

User Interface Design and Ergonomics - National Open University of ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.2 LAYOUT MANAGERS<br />

Layout Managers are s<strong>of</strong>tware tools for specifying <strong>and</strong> designing the appropriate layout<br />

for a job. They are also called geometry managers <strong>and</strong> are used to represent a bundle <strong>of</strong><br />

constraint equations.<br />

Also called geometry managers(Tk, Motif)<br />

Abstract<br />

Respresents a bundle <strong>of</strong> constraint equations<br />

Local<br />

Involve only the children <strong>of</strong> one container in the view hierarchy<br />

Layout Propagation Algorithm<br />

Layout (Container parent, Rectangle parentSize)<br />

For each child in parent,<br />

Get child’s size request<br />

Apply layout constraints to fit children into parentSize<br />

For each child,<br />

Set child’s size <strong>and</strong> position<br />

3.3 KINDS OF LAYOUT MANAGERS<br />

Packing<br />

One dimensional<br />

Tk: pack<br />

Java: BorderLayout, FlowLayout, BoxLayout<br />

Gridding<br />

Two dimensional<br />

Tk:grid<br />

Java: GridLayout, GridBagLayout, TableLayout<br />

General<br />

Java: SpringLayout<br />

3.4 HINTS FOR LAYOUT<br />

Use packing layouts when alignments are 1D<br />

Borders for top-level<br />

Nested boxes for internal<br />

Reserve gridding layouts for 2D alignment<br />

Unfortunately common when fields have captions!<br />

TableLayout is easier than GridBag<br />

149

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!