More Related Content Similar to Creating a Facebook Clone - Part III.pdf (20) More from ShaiAlmog1 (20) Creating a Facebook Clone - Part III.pdf3. public class UIController {
public static void showSplashScreen() {
Form splash = new Form(new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
UIController
4. public class UIController {
public static void showSplashScreen() {
Form splash = new Form(new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
UIController
5. public class UIController {
public static void showSplashScreen() {
Form splash = new Form(new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
UIController
6. public class UIController {
public static void showSplashScreen() {
Form splash = new Form(new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
UIController
7. public class UIController {
public static void showSplashScreen() {
Form splash = new Form(new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
UIController
8. public class UIController {
public static void showSplashScreen() {
Form splash = new Form(new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
UIController
9. splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
});
splash.show();
}
public static void showLoginForm() {
}
}
UIController
10. splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
});
splash.show();
}
public static void showLoginForm() {
}
}
UIController
12. public void start() {
if(current != null){
current.show();
return;
}
UIController.showSplashScreen();
}
FacebookClone