AMAPstudio

User Tools


Memorization strategy for dialogs size and location

Dialogs size

Generally, pack () or setSize () are ok to set the dialog's size. Size memorization may be used in specific cases when the size can be changed by the user and should be restored next time the dialog is opened (e.g. the ObjectViewers like the 3DViewer opening in a popup dialog).

AmapDialog subclasses may use the size memorization feature.

Activation: Dialogs size is memorized if activated only by calling activateSizeMemorization(String className) in the dialog constructor. Generally, the className to be passed is getClass ().getName ().

Action: The implementation is in AmapDialog.pack (). It will try to respect at least the width and height calculated by the original pack () implementation. It will also set size at least to 250 * 250 pixels if width AND height are less than these values (these values on 2.8.2010).

Bypass: If capsis is launched with the option -nows (sets to true the following Settings property: veto.dialog.size.memorization), this memorization is bypassed.

Dialogs location

The dialog location is set on setVisible () or show (). Both methods are redefined in AmapDialog to allow location memorization.

AmapDialog subclasses may use the location memorization feature.

Activation: Dialogs location is memorized if activated only by calling activateLocationMemorization(String className) in the dialog constructor. Generally, the className to be passed is getClass ().getName ().

Action: The implementation is in AmapDialog.locate (), itself called by setVisible () and show (). It will try to remember the past location and restore it. In case of trouble, it will try to center the dialog on its parent or on the screen.

Bypass: If capsis is launched with the option -nowl (sets to true the following Settings property: veto.dialog.location.memorization), this memorization is bypassed.

documentation/memorization_strategy_for_dialogs_size_and_location.txt · Last modified: 2013/05/23 08:25 (external edit)