Menu

FormLayout

Sahits GmbH

Form layout

< [Concepts]

In OpenPatrician two different layouts are used. On in the game itself and the other when used with game administration tasks (New game, load game, save game, options, ...). This page describes the latter layout.

These task are typically form related. Therefore the OpenPatrician Look&Feel is used. This Look&Feel differs evidently from the standard Java Look&Feels. The most prominent aspect is sizing which may pose problems when laying the components out. As OpenPatrician is a full screen game we must not be concerned with resizing. The only problem is "Are all components on the screen or not?". The problem with the OpenPatrician Look and Feel is that it does not scale. Therefore the components (or at least some of the components) have a fixed size. For these reasons the following approach is chosen:

  1. Put the component in ScrollPane
  2. Use a layout that does not resize the components

MaximalGridLayout

This is the layout to use for this purpose. Basically it is a GridLayout but with some distinctive differences:

  • The width of a column is defined by the width of the widest component in the column
  • The height of a row is defined by the height of the highest component in the row
  • The components are not resized to fill the whole grid cell
  • With a Layout constraint the component can have a defined anchor point (analog GridBagLayout) by default this is center.

Related

Wiki: Concepts
Wiki: Home

MongoDB Logo MongoDB