New Form and List

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(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…“)
 
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, 20: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();
    }       
}
Meine Werkzeuge
Namensräume
Varianten
Aktionen
Navigation
Werkzeuge
Translate