New Form and List: Unterschied zwischen den Versionen

Aus apemap Wiki
Zur Navigation springen Zur Suche springen
imported>Mkurz
Die Seite wurde neu angelegt: „* The existing Form and List classes have been renamed to ListLegacy and FormLegacy. * 2 new classes have been created List and Form. * For the moment both ext…“
 
imported>Mkurz
Keine Bearbeitungszusammenfassung
Zeile 4: Zeile 4:
* The new classes Form and List can not be used with Display.setCurrent, if used an exception is thrown.
* The new classes Form and List can not be used with Display.setCurrent, if used an exception is thrown.
* The methods showDisplayable and hideDisplayable do not affect the the Display.getCurrent state.
* The methods showDisplayable and hideDisplayable do not affect the the Display.getCurrent state.
== Sample usages of the new class ==
Form and List offer the same constructor and the same showDisplayable/hideDisplayable semantics.
=== Form as Overlay ===
<pre>
public class MyOverlayForm extends Form {
    public MyOverlayForm() {
        super("MyTitle", VisualisationMode.DisplayAsOverlay
              .configAnimation(new AnimationParameters(AnimationParameters.AnimationType.ShiftFromTop)));
    }
    public void showHideSample(){
        // Showing an overlay from top requires a displable and a top offset.
        final Displayable disp = null; // Some displayable used for the 0,0 of the top position.
        this.showDisplayable(new ShowAsOverlayTopParameter(disp, 20));
        // hide the thing again.
        this.hideDisplayable();
    }     
}
</pre>

Version vom 21. Juni 2016, 18:58 Uhr

  • The existing Form and List classes have been renamed to ListLegacy and FormLegacy.
  • 2 new classes have been created List and Form.
  • For the moment both extend the legacy classes and offer a cleaner type safe constructor and showDisplayable and hideDisplayable methods.
  • The new classes Form and List can not be used with Display.setCurrent, if used an exception is thrown.
  • The methods showDisplayable and hideDisplayable do not affect the the Display.getCurrent state.


Sample usages of the new class

Form and List offer the same constructor and the same showDisplayable/hideDisplayable semantics.

Form as Overlay

public class MyOverlayForm extends Form {
    public MyOverlayForm() {
        super("MyTitle", VisualisationMode.DisplayAsOverlay
              .configAnimation(new AnimationParameters(AnimationParameters.AnimationType.ShiftFromTop)));
    }

    public void showHideSample(){
        // Showing an overlay from top requires a displable and a top offset.
        final Displayable disp = null; // Some displayable used for the 0,0 of the top position.
        this.showDisplayable(new ShowAsOverlayTopParameter(disp, 20));


        // hide the thing again.
        this.hideDisplayable();
    }       
}