SlideShare a Scribd company logo
1 of 19
Download to read offline
Adapting to Tablets & Desktops - Part II
private FormDelegate formDelegate;
private Container cnt;
private Container decoratedContainer;
private static UIAbstraction currentUI;
public UIAbstraction(String title, Layout l) {
initUI(title, l);
}
protected void initUI(String title, Layout l) {
if(Display.getInstance().isTablet()) {
cnt = new Container(l);
if(!(l instanceof BorderLayout)) {
cnt.setScrollableY(true);
}
cnt.putClientProperty("uiabstraction", this);
decoratedContainer = cnt;
if(hasOKBack()) {
decoratedContainer = BorderLayout.center(cnt);
okButton = new Button("OK", "GreenButton");
Button cancelButton = new Button("Cancel", "GreenButton");
FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK);
FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL);
UIAbstraction
private FormDelegate formDelegate;
private Container cnt;
private Container decoratedContainer;
private static UIAbstraction currentUI;
public UIAbstraction(String title, Layout l) {
initUI(title, l);
}
protected void initUI(String title, Layout l) {
if(Display.getInstance().isTablet()) {
cnt = new Container(l);
if(!(l instanceof BorderLayout)) {
cnt.setScrollableY(true);
}
cnt.putClientProperty("uiabstraction", this);
decoratedContainer = cnt;
if(hasOKBack()) {
decoratedContainer = BorderLayout.center(cnt);
okButton = new Button("OK", "GreenButton");
Button cancelButton = new Button("Cancel", "GreenButton");
FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK);
FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL);
UIAbstraction
private FormDelegate formDelegate;
private Container cnt;
private Container decoratedContainer;
private static UIAbstraction currentUI;
public UIAbstraction(String title, Layout l) {
initUI(title, l);
}
protected void initUI(String title, Layout l) {
if(Display.getInstance().isTablet()) {
cnt = new Container(l);
if(!(l instanceof BorderLayout)) {
cnt.setScrollableY(true);
}
cnt.putClientProperty("uiabstraction", this);
decoratedContainer = cnt;
if(hasOKBack()) {
decoratedContainer = BorderLayout.center(cnt);
okButton = new Button("OK", "GreenButton");
Button cancelButton = new Button("Cancel", "GreenButton");
FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK);
FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL);
UIAbstraction
private FormDelegate formDelegate;
private Container cnt;
private Container decoratedContainer;
private static UIAbstraction currentUI;
public UIAbstraction(String title, Layout l) {
initUI(title, l);
}
protected void initUI(String title, Layout l) {
if(Display.getInstance().isTablet()) {
cnt = new Container(l);
if(!(l instanceof BorderLayout)) {
cnt.setScrollableY(true);
}
cnt.putClientProperty("uiabstraction", this);
decoratedContainer = cnt;
if(hasOKBack()) {
decoratedContainer = BorderLayout.center(cnt);
okButton = new Button("OK", "GreenButton");
Button cancelButton = new Button("Cancel", "GreenButton");
FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK);
FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL);
UIAbstraction
private FormDelegate formDelegate;
private Container cnt;
private Container decoratedContainer;
private static UIAbstraction currentUI;
public UIAbstraction(String title, Layout l) {
initUI(title, l);
}
protected void initUI(String title, Layout l) {
if(Display.getInstance().isTablet()) {
cnt = new Container(l);
if(!(l instanceof BorderLayout)) {
cnt.setScrollableY(true);
}
cnt.putClientProperty("uiabstraction", this);
decoratedContainer = cnt;
if(hasOKBack()) {
decoratedContainer = BorderLayout.center(cnt);
okButton = new Button("OK", "GreenButton");
Button cancelButton = new Button("Cancel", "GreenButton");
FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK);
FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL);
UIAbstraction
private FormDelegate formDelegate;
private Container cnt;
private Container decoratedContainer;
private static UIAbstraction currentUI;
public UIAbstraction(String title, Layout l) {
initUI(title, l);
}
protected void initUI(String title, Layout l) {
if(Display.getInstance().isTablet()) {
cnt = new Container(l);
if(!(l instanceof BorderLayout)) {
cnt.setScrollableY(true);
}
cnt.putClientProperty("uiabstraction", this);
decoratedContainer = cnt;
if(hasOKBack()) {
decoratedContainer = BorderLayout.center(cnt);
okButton = new Button("OK", "GreenButton");
Button cancelButton = new Button("Cancel", "GreenButton");
FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK);
FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL);
UIAbstraction
private FormDelegate formDelegate;
private Container cnt;
private Container decoratedContainer;
private static UIAbstraction currentUI;
public UIAbstraction(String title, Layout l) {
initUI(title, l);
}
protected void initUI(String title, Layout l) {
if(Display.getInstance().isTablet()) {
cnt = new Container(l);
if(!(l instanceof BorderLayout)) {
cnt.setScrollableY(true);
}
cnt.putClientProperty("uiabstraction", this);
decoratedContainer = cnt;
if(hasOKBack()) {
decoratedContainer = BorderLayout.center(cnt);
okButton = new Button("OK", "GreenButton");
Button cancelButton = new Button("Cancel", "GreenButton");
FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK);
FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL);
UIAbstraction
private FormDelegate formDelegate;
private Container cnt;
private Container decoratedContainer;
private static UIAbstraction currentUI;
public UIAbstraction(String title, Layout l) {
initUI(title, l);
}
protected void initUI(String title, Layout l) {
if(Display.getInstance().isTablet()) {
cnt = new Container(l);
if(!(l instanceof BorderLayout)) {
cnt.setScrollableY(true);
}
cnt.putClientProperty("uiabstraction", this);
decoratedContainer = cnt;
if(hasOKBack()) {
decoratedContainer = BorderLayout.center(cnt);
okButton = new Button("OK", "GreenButton");
Button cancelButton = new Button("Cancel", "GreenButton");
FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK);
FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL);
UIAbstraction
private FormDelegate formDelegate;
private Container cnt;
private Container decoratedContainer;
private static UIAbstraction currentUI;
public UIAbstraction(String title, Layout l) {
initUI(title, l);
}
protected void initUI(String title, Layout l) {
if(Display.getInstance().isTablet()) {
cnt = new Container(l);
if(!(l instanceof BorderLayout)) {
cnt.setScrollableY(true);
}
cnt.putClientProperty("uiabstraction", this);
decoratedContainer = cnt;
if(hasOKBack()) {
decoratedContainer = BorderLayout.center(cnt);
okButton = new Button("OK", "GreenButton");
Button cancelButton = new Button("Cancel", "GreenButton");
FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK);
FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL);
UIAbstraction
decoratedContainer.add(BorderLayout.SOUTH,
GridLayout.encloseIn(2, cancelButton, okButton));
decoratedContainer.putClientProperty("uiabstraction", this);
UIAbstraction previous = currentUI;
okButton.addActionListener(e -> {
onOK();
previous.showBack();
});
cancelButton.addActionListener(e -> {
onBack();
previous.showBack();
});
}
} else {
formDelegate = new FormDelegate(title, l);
formDelegate.putClientProperty("uiabstraction", this);
cnt = formDelegate;
}
}
UIAbstraction
decoratedContainer.add(BorderLayout.SOUTH,
GridLayout.encloseIn(2, cancelButton, okButton));
decoratedContainer.putClientProperty("uiabstraction", this);
UIAbstraction previous = currentUI;
okButton.addActionListener(e -> {
onOK();
previous.showBack();
});
cancelButton.addActionListener(e -> {
onBack();
previous.showBack();
});
}
} else {
formDelegate = new FormDelegate(title, l);
formDelegate.putClientProperty("uiabstraction", this);
cnt = formDelegate;
}
}
UIAbstraction
decoratedContainer.add(BorderLayout.SOUTH,
GridLayout.encloseIn(2, cancelButton, okButton));
decoratedContainer.putClientProperty("uiabstraction", this);
UIAbstraction previous = currentUI;
okButton.addActionListener(e -> {
onOK();
previous.showBack();
});
cancelButton.addActionListener(e -> {
onBack();
previous.showBack();
});
}
} else {
formDelegate = new FormDelegate(title, l);
formDelegate.putClientProperty("uiabstraction", this);
cnt = formDelegate;
}
}
UIAbstraction
public void show() {
if(formDelegate != null) {
formDelegate.show();
} else {
TabletUI.getInstance().showContainer(decoratedContainer, true);
currentUI = this;
}
}
public void showBack() {
if(formDelegate != null) {
formDelegate.showBack();
} else {
TabletUI.getInstance().showContainer(decoratedContainer, true);
currentUI = this;
}
}
public Container add(Object con, Component cmp) {
return cnt.add(con, cmp);
}
public Container add(Component cmp) {
return cnt.add(cmp);
}
UIAbstraction
public void show() {
if(formDelegate != null) {
formDelegate.show();
} else {
TabletUI.getInstance().showContainer(decoratedContainer, true);
currentUI = this;
}
}
public void showBack() {
if(formDelegate != null) {
formDelegate.showBack();
} else {
TabletUI.getInstance().showContainer(decoratedContainer, false);
currentUI = this;
}
}
public Container add(Object con, Component cmp) {
return cnt.add(con, cmp);
}
public Container add(Component cmp) {
return cnt.add(cmp);
}
UIAbstraction
public void show() {
if(formDelegate != null) {
formDelegate.show();
} else {
TabletUI.getInstance().showContainer(decoratedContainer, true);
currentUI = this;
}
}
public void showBack() {
if(formDelegate != null) {
formDelegate.showBack();
} else {
TabletUI.getInstance().showContainer(decoratedContainer, false);
currentUI = this;
}
}
public Container add(Object con, Component cmp) {
return cnt.add(con, cmp);
}
public Container add(Component cmp) {
return cnt.add(cmp);
}
UIAbstraction
protected boolean shouldPaintStatusBar() {
return UIManager.getInstance().isThemeConstant("paintsTitleBarBool", false);
}
public Container getContainer() {
return cnt;
}
public void bindFab(FloatingActionButton fab) {
if(formDelegate != null) {
fab.bindFabToContainer(formDelegate.getContentPane());
} else {
decoratedContainer = fab.bindFabToContainer(decoratedContainer);
decoratedContainer.putClientProperty("uiabstraction", this);
}
}
public void bindFabTopRight(FloatingActionButton fab) {
if(formDelegate != null) {
fab.bindFabToContainer(formDelegate.getContentPane(), RIGHT, TOP);
} else {
decoratedContainer = fab.bindFabToContainer(decoratedContainer, RIGHT,
TOP);
decoratedContainer.putClientProperty("uiabstraction", this);
}
}
UIAbstraction
public void setLayout(Layout newLayout) {
cnt.setLayout(newLayout);
}
public static UIAbstraction getUIAbstraction(Container parent) {
return (UIAbstraction)parent.getClientProperty("uiabstraction");
}
protected void initToolbar(Toolbar tb) {
}
protected void onOK() {
}
protected void onBack() {
}
protected boolean hasOKBack() {
return false;
}
protected void setScrollableY(boolean b) {
cnt.setScrollableY(b);
}
protected void addSubmitButton(Validator val) {
if(okButton != null) {
val.addSubmitButtons(okButton);
}
}
UIAbstraction
public void setLayout(Layout newLayout) {
cnt.setLayout(newLayout);
}
public static UIAbstraction getUIAbstraction(Container parent) {
return (UIAbstraction)parent.getClientProperty("uiabstraction");
}
protected void initToolbar(Toolbar tb) {
}
protected void onOK() {
}
protected void onBack() {
}
protected boolean hasOKBack() {
return false;
}
protected void setScrollableY(boolean b) {
cnt.setScrollableY(b);
}
protected void addSubmitButton(Validator val) {
if(okButton != null) {
val.addSubmitButtons(okButton);
}
}
UIAbstraction

More Related Content

Similar to Adapting to Tablets and Desktops - Part 2.pdf

The Ring programming language version 1.8 book - Part 74 of 202
The Ring programming language version 1.8 book - Part 74 of 202The Ring programming language version 1.8 book - Part 74 of 202
The Ring programming language version 1.8 book - Part 74 of 202Mahmoud Samir Fayed
 
Creating a Facebook Clone - Part XXXVII.pdf
Creating a Facebook Clone - Part XXXVII.pdfCreating a Facebook Clone - Part XXXVII.pdf
Creating a Facebook Clone - Part XXXVII.pdfShaiAlmog1
 
Creating an Uber Clone - Part IX.pdf
Creating an Uber Clone - Part IX.pdfCreating an Uber Clone - Part IX.pdf
Creating an Uber Clone - Part IX.pdfShaiAlmog1
 
The Ring programming language version 1.7 book - Part 72 of 196
The Ring programming language version 1.7 book - Part 72 of 196The Ring programming language version 1.7 book - Part 72 of 196
The Ring programming language version 1.7 book - Part 72 of 196Mahmoud Samir Fayed
 
Getting started with GUI programming in Java_2
Getting started with GUI programming in Java_2Getting started with GUI programming in Java_2
Getting started with GUI programming in Java_2Muhammad Shebl Farag
 
Initial UI Mockup - Part 3.pdf
Initial UI Mockup - Part 3.pdfInitial UI Mockup - Part 3.pdf
Initial UI Mockup - Part 3.pdfShaiAlmog1
 
Creating a Facebook Clone - Part XII.pdf
Creating a Facebook Clone - Part XII.pdfCreating a Facebook Clone - Part XII.pdf
Creating a Facebook Clone - Part XII.pdfShaiAlmog1
 
Tic Tac Toe game with GUI written in java.SolutionAnswerimp.pdf
Tic Tac Toe game with GUI written in java.SolutionAnswerimp.pdfTic Tac Toe game with GUI written in java.SolutionAnswerimp.pdf
Tic Tac Toe game with GUI written in java.SolutionAnswerimp.pdfinfomalad
 
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdfPLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdfmohammedfootwear
 
I hope the below code is helpful to you, please give me rewards.im.pdf
I hope the below code is helpful to you, please give me rewards.im.pdfI hope the below code is helpful to you, please give me rewards.im.pdf
I hope the below code is helpful to you, please give me rewards.im.pdfapexelectronices01
 
10 awt event model
10 awt event model10 awt event model
10 awt event modelBayarkhuu
 
Tic Tac Toe game with GUI please dont copy and paste from google. .pdf
Tic Tac Toe game with GUI please dont copy and paste from google. .pdfTic Tac Toe game with GUI please dont copy and paste from google. .pdf
Tic Tac Toe game with GUI please dont copy and paste from google. .pdfformaxekochi
 
Creating a Facebook Clone - Part VII.pdf
Creating a Facebook Clone - Part VII.pdfCreating a Facebook Clone - Part VII.pdf
Creating a Facebook Clone - Part VII.pdfShaiAlmog1
 
The Ring programming language version 1.7 book - Part 65 of 196
The Ring programming language version 1.7 book - Part 65 of 196The Ring programming language version 1.7 book - Part 65 of 196
The Ring programming language version 1.7 book - Part 65 of 196Mahmoud Samir Fayed
 
bai giai de LTWINForm.docx
bai giai de LTWINForm.docxbai giai de LTWINForm.docx
bai giai de LTWINForm.docxVnThanh292761
 
Applet 2 container and action_listener
Applet 2 container and action_listenerApplet 2 container and action_listener
Applet 2 container and action_listenerNitigan Nakjuatong
 
Model-Driven Software Development - Context-Sensitive Transformation
Model-Driven Software Development - Context-Sensitive TransformationModel-Driven Software Development - Context-Sensitive Transformation
Model-Driven Software Development - Context-Sensitive TransformationEelco Visser
 

Similar to Adapting to Tablets and Desktops - Part 2.pdf (20)

The Ring programming language version 1.8 book - Part 74 of 202
The Ring programming language version 1.8 book - Part 74 of 202The Ring programming language version 1.8 book - Part 74 of 202
The Ring programming language version 1.8 book - Part 74 of 202
 
Creating a Facebook Clone - Part XXXVII.pdf
Creating a Facebook Clone - Part XXXVII.pdfCreating a Facebook Clone - Part XXXVII.pdf
Creating a Facebook Clone - Part XXXVII.pdf
 
Creating an Uber Clone - Part IX.pdf
Creating an Uber Clone - Part IX.pdfCreating an Uber Clone - Part IX.pdf
Creating an Uber Clone - Part IX.pdf
 
The Ring programming language version 1.7 book - Part 72 of 196
The Ring programming language version 1.7 book - Part 72 of 196The Ring programming language version 1.7 book - Part 72 of 196
The Ring programming language version 1.7 book - Part 72 of 196
 
Getting started with GUI programming in Java_2
Getting started with GUI programming in Java_2Getting started with GUI programming in Java_2
Getting started with GUI programming in Java_2
 
culadora cientifica en java
culadora cientifica en javaculadora cientifica en java
culadora cientifica en java
 
Oop lecture9 10
Oop lecture9 10Oop lecture9 10
Oop lecture9 10
 
Initial UI Mockup - Part 3.pdf
Initial UI Mockup - Part 3.pdfInitial UI Mockup - Part 3.pdf
Initial UI Mockup - Part 3.pdf
 
Creating a Facebook Clone - Part XII.pdf
Creating a Facebook Clone - Part XII.pdfCreating a Facebook Clone - Part XII.pdf
Creating a Facebook Clone - Part XII.pdf
 
Tic Tac Toe game with GUI written in java.SolutionAnswerimp.pdf
Tic Tac Toe game with GUI written in java.SolutionAnswerimp.pdfTic Tac Toe game with GUI written in java.SolutionAnswerimp.pdf
Tic Tac Toe game with GUI written in java.SolutionAnswerimp.pdf
 
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdfPLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
 
I hope the below code is helpful to you, please give me rewards.im.pdf
I hope the below code is helpful to you, please give me rewards.im.pdfI hope the below code is helpful to you, please give me rewards.im.pdf
I hope the below code is helpful to you, please give me rewards.im.pdf
 
10 awt event model
10 awt event model10 awt event model
10 awt event model
 
Tic Tac Toe game with GUI please dont copy and paste from google. .pdf
Tic Tac Toe game with GUI please dont copy and paste from google. .pdfTic Tac Toe game with GUI please dont copy and paste from google. .pdf
Tic Tac Toe game with GUI please dont copy and paste from google. .pdf
 
Creating a Facebook Clone - Part VII.pdf
Creating a Facebook Clone - Part VII.pdfCreating a Facebook Clone - Part VII.pdf
Creating a Facebook Clone - Part VII.pdf
 
Easy Button
Easy ButtonEasy Button
Easy Button
 
The Ring programming language version 1.7 book - Part 65 of 196
The Ring programming language version 1.7 book - Part 65 of 196The Ring programming language version 1.7 book - Part 65 of 196
The Ring programming language version 1.7 book - Part 65 of 196
 
bai giai de LTWINForm.docx
bai giai de LTWINForm.docxbai giai de LTWINForm.docx
bai giai de LTWINForm.docx
 
Applet 2 container and action_listener
Applet 2 container and action_listenerApplet 2 container and action_listener
Applet 2 container and action_listener
 
Model-Driven Software Development - Context-Sensitive Transformation
Model-Driven Software Development - Context-Sensitive TransformationModel-Driven Software Development - Context-Sensitive Transformation
Model-Driven Software Development - Context-Sensitive Transformation
 

More from ShaiAlmog1

The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...ShaiAlmog1
 
create-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfcreate-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfShaiAlmog1
 
create-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfcreate-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfShaiAlmog1
 
create-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfcreate-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfShaiAlmog1
 
create-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfcreate-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfShaiAlmog1
 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfShaiAlmog1
 
create-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfcreate-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfShaiAlmog1
 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfShaiAlmog1
 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfShaiAlmog1
 
create-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfcreate-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfShaiAlmog1
 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfShaiAlmog1
 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfShaiAlmog1
 
create-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfcreate-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfCreating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfCreating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfCreating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfCreating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfCreating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IX.pdf
Creating a Whatsapp Clone - Part IX.pdfCreating a Whatsapp Clone - Part IX.pdf
Creating a Whatsapp Clone - Part IX.pdfShaiAlmog1
 

More from ShaiAlmog1 (20)

The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...
 
create-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfcreate-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdf
 
create-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfcreate-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdf
 
create-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfcreate-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdf
 
create-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfcreate-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdf
 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdf
 
create-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfcreate-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdf
 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdf
 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdf
 
create-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfcreate-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdf
 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdf
 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdf
 
create-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfcreate-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdf
 
Creating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfCreating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdf
 
Creating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfCreating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdf
 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdf
 
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfCreating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdf
 
Creating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfCreating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdf
 
Creating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfCreating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdf
 
Creating a Whatsapp Clone - Part IX.pdf
Creating a Whatsapp Clone - Part IX.pdfCreating a Whatsapp Clone - Part IX.pdf
Creating a Whatsapp Clone - Part IX.pdf
 

Recently uploaded

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Recently uploaded (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

Adapting to Tablets and Desktops - Part 2.pdf

  • 1. Adapting to Tablets & Desktops - Part II
  • 2. private FormDelegate formDelegate; private Container cnt; private Container decoratedContainer; private static UIAbstraction currentUI; public UIAbstraction(String title, Layout l) { initUI(title, l); } protected void initUI(String title, Layout l) { if(Display.getInstance().isTablet()) { cnt = new Container(l); if(!(l instanceof BorderLayout)) { cnt.setScrollableY(true); } cnt.putClientProperty("uiabstraction", this); decoratedContainer = cnt; if(hasOKBack()) { decoratedContainer = BorderLayout.center(cnt); okButton = new Button("OK", "GreenButton"); Button cancelButton = new Button("Cancel", "GreenButton"); FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK); FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL); UIAbstraction
  • 3. private FormDelegate formDelegate; private Container cnt; private Container decoratedContainer; private static UIAbstraction currentUI; public UIAbstraction(String title, Layout l) { initUI(title, l); } protected void initUI(String title, Layout l) { if(Display.getInstance().isTablet()) { cnt = new Container(l); if(!(l instanceof BorderLayout)) { cnt.setScrollableY(true); } cnt.putClientProperty("uiabstraction", this); decoratedContainer = cnt; if(hasOKBack()) { decoratedContainer = BorderLayout.center(cnt); okButton = new Button("OK", "GreenButton"); Button cancelButton = new Button("Cancel", "GreenButton"); FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK); FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL); UIAbstraction
  • 4. private FormDelegate formDelegate; private Container cnt; private Container decoratedContainer; private static UIAbstraction currentUI; public UIAbstraction(String title, Layout l) { initUI(title, l); } protected void initUI(String title, Layout l) { if(Display.getInstance().isTablet()) { cnt = new Container(l); if(!(l instanceof BorderLayout)) { cnt.setScrollableY(true); } cnt.putClientProperty("uiabstraction", this); decoratedContainer = cnt; if(hasOKBack()) { decoratedContainer = BorderLayout.center(cnt); okButton = new Button("OK", "GreenButton"); Button cancelButton = new Button("Cancel", "GreenButton"); FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK); FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL); UIAbstraction
  • 5. private FormDelegate formDelegate; private Container cnt; private Container decoratedContainer; private static UIAbstraction currentUI; public UIAbstraction(String title, Layout l) { initUI(title, l); } protected void initUI(String title, Layout l) { if(Display.getInstance().isTablet()) { cnt = new Container(l); if(!(l instanceof BorderLayout)) { cnt.setScrollableY(true); } cnt.putClientProperty("uiabstraction", this); decoratedContainer = cnt; if(hasOKBack()) { decoratedContainer = BorderLayout.center(cnt); okButton = new Button("OK", "GreenButton"); Button cancelButton = new Button("Cancel", "GreenButton"); FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK); FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL); UIAbstraction
  • 6. private FormDelegate formDelegate; private Container cnt; private Container decoratedContainer; private static UIAbstraction currentUI; public UIAbstraction(String title, Layout l) { initUI(title, l); } protected void initUI(String title, Layout l) { if(Display.getInstance().isTablet()) { cnt = new Container(l); if(!(l instanceof BorderLayout)) { cnt.setScrollableY(true); } cnt.putClientProperty("uiabstraction", this); decoratedContainer = cnt; if(hasOKBack()) { decoratedContainer = BorderLayout.center(cnt); okButton = new Button("OK", "GreenButton"); Button cancelButton = new Button("Cancel", "GreenButton"); FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK); FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL); UIAbstraction
  • 7. private FormDelegate formDelegate; private Container cnt; private Container decoratedContainer; private static UIAbstraction currentUI; public UIAbstraction(String title, Layout l) { initUI(title, l); } protected void initUI(String title, Layout l) { if(Display.getInstance().isTablet()) { cnt = new Container(l); if(!(l instanceof BorderLayout)) { cnt.setScrollableY(true); } cnt.putClientProperty("uiabstraction", this); decoratedContainer = cnt; if(hasOKBack()) { decoratedContainer = BorderLayout.center(cnt); okButton = new Button("OK", "GreenButton"); Button cancelButton = new Button("Cancel", "GreenButton"); FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK); FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL); UIAbstraction
  • 8. private FormDelegate formDelegate; private Container cnt; private Container decoratedContainer; private static UIAbstraction currentUI; public UIAbstraction(String title, Layout l) { initUI(title, l); } protected void initUI(String title, Layout l) { if(Display.getInstance().isTablet()) { cnt = new Container(l); if(!(l instanceof BorderLayout)) { cnt.setScrollableY(true); } cnt.putClientProperty("uiabstraction", this); decoratedContainer = cnt; if(hasOKBack()) { decoratedContainer = BorderLayout.center(cnt); okButton = new Button("OK", "GreenButton"); Button cancelButton = new Button("Cancel", "GreenButton"); FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK); FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL); UIAbstraction
  • 9. private FormDelegate formDelegate; private Container cnt; private Container decoratedContainer; private static UIAbstraction currentUI; public UIAbstraction(String title, Layout l) { initUI(title, l); } protected void initUI(String title, Layout l) { if(Display.getInstance().isTablet()) { cnt = new Container(l); if(!(l instanceof BorderLayout)) { cnt.setScrollableY(true); } cnt.putClientProperty("uiabstraction", this); decoratedContainer = cnt; if(hasOKBack()) { decoratedContainer = BorderLayout.center(cnt); okButton = new Button("OK", "GreenButton"); Button cancelButton = new Button("Cancel", "GreenButton"); FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK); FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL); UIAbstraction
  • 10. private FormDelegate formDelegate; private Container cnt; private Container decoratedContainer; private static UIAbstraction currentUI; public UIAbstraction(String title, Layout l) { initUI(title, l); } protected void initUI(String title, Layout l) { if(Display.getInstance().isTablet()) { cnt = new Container(l); if(!(l instanceof BorderLayout)) { cnt.setScrollableY(true); } cnt.putClientProperty("uiabstraction", this); decoratedContainer = cnt; if(hasOKBack()) { decoratedContainer = BorderLayout.center(cnt); okButton = new Button("OK", "GreenButton"); Button cancelButton = new Button("Cancel", "GreenButton"); FontImage.setMaterialIcon(okButton, FontImage.MATERIAL_CHECK); FontImage.setMaterialIcon(cancelButton, FontImage.MATERIAL_CANCEL); UIAbstraction
  • 11. decoratedContainer.add(BorderLayout.SOUTH, GridLayout.encloseIn(2, cancelButton, okButton)); decoratedContainer.putClientProperty("uiabstraction", this); UIAbstraction previous = currentUI; okButton.addActionListener(e -> { onOK(); previous.showBack(); }); cancelButton.addActionListener(e -> { onBack(); previous.showBack(); }); } } else { formDelegate = new FormDelegate(title, l); formDelegate.putClientProperty("uiabstraction", this); cnt = formDelegate; } } UIAbstraction
  • 12. decoratedContainer.add(BorderLayout.SOUTH, GridLayout.encloseIn(2, cancelButton, okButton)); decoratedContainer.putClientProperty("uiabstraction", this); UIAbstraction previous = currentUI; okButton.addActionListener(e -> { onOK(); previous.showBack(); }); cancelButton.addActionListener(e -> { onBack(); previous.showBack(); }); } } else { formDelegate = new FormDelegate(title, l); formDelegate.putClientProperty("uiabstraction", this); cnt = formDelegate; } } UIAbstraction
  • 13. decoratedContainer.add(BorderLayout.SOUTH, GridLayout.encloseIn(2, cancelButton, okButton)); decoratedContainer.putClientProperty("uiabstraction", this); UIAbstraction previous = currentUI; okButton.addActionListener(e -> { onOK(); previous.showBack(); }); cancelButton.addActionListener(e -> { onBack(); previous.showBack(); }); } } else { formDelegate = new FormDelegate(title, l); formDelegate.putClientProperty("uiabstraction", this); cnt = formDelegate; } } UIAbstraction
  • 14. public void show() { if(formDelegate != null) { formDelegate.show(); } else { TabletUI.getInstance().showContainer(decoratedContainer, true); currentUI = this; } } public void showBack() { if(formDelegate != null) { formDelegate.showBack(); } else { TabletUI.getInstance().showContainer(decoratedContainer, true); currentUI = this; } } public Container add(Object con, Component cmp) { return cnt.add(con, cmp); } public Container add(Component cmp) { return cnt.add(cmp); } UIAbstraction
  • 15. public void show() { if(formDelegate != null) { formDelegate.show(); } else { TabletUI.getInstance().showContainer(decoratedContainer, true); currentUI = this; } } public void showBack() { if(formDelegate != null) { formDelegate.showBack(); } else { TabletUI.getInstance().showContainer(decoratedContainer, false); currentUI = this; } } public Container add(Object con, Component cmp) { return cnt.add(con, cmp); } public Container add(Component cmp) { return cnt.add(cmp); } UIAbstraction
  • 16. public void show() { if(formDelegate != null) { formDelegate.show(); } else { TabletUI.getInstance().showContainer(decoratedContainer, true); currentUI = this; } } public void showBack() { if(formDelegate != null) { formDelegate.showBack(); } else { TabletUI.getInstance().showContainer(decoratedContainer, false); currentUI = this; } } public Container add(Object con, Component cmp) { return cnt.add(con, cmp); } public Container add(Component cmp) { return cnt.add(cmp); } UIAbstraction
  • 17. protected boolean shouldPaintStatusBar() { return UIManager.getInstance().isThemeConstant("paintsTitleBarBool", false); } public Container getContainer() { return cnt; } public void bindFab(FloatingActionButton fab) { if(formDelegate != null) { fab.bindFabToContainer(formDelegate.getContentPane()); } else { decoratedContainer = fab.bindFabToContainer(decoratedContainer); decoratedContainer.putClientProperty("uiabstraction", this); } } public void bindFabTopRight(FloatingActionButton fab) { if(formDelegate != null) { fab.bindFabToContainer(formDelegate.getContentPane(), RIGHT, TOP); } else { decoratedContainer = fab.bindFabToContainer(decoratedContainer, RIGHT, TOP); decoratedContainer.putClientProperty("uiabstraction", this); } } UIAbstraction
  • 18. public void setLayout(Layout newLayout) { cnt.setLayout(newLayout); } public static UIAbstraction getUIAbstraction(Container parent) { return (UIAbstraction)parent.getClientProperty("uiabstraction"); } protected void initToolbar(Toolbar tb) { } protected void onOK() { } protected void onBack() { } protected boolean hasOKBack() { return false; } protected void setScrollableY(boolean b) { cnt.setScrollableY(b); } protected void addSubmitButton(Validator val) { if(okButton != null) { val.addSubmitButtons(okButton); } } UIAbstraction
  • 19. public void setLayout(Layout newLayout) { cnt.setLayout(newLayout); } public static UIAbstraction getUIAbstraction(Container parent) { return (UIAbstraction)parent.getClientProperty("uiabstraction"); } protected void initToolbar(Toolbar tb) { } protected void onOK() { } protected void onBack() { } protected boolean hasOKBack() { return false; } protected void setScrollableY(boolean b) { cnt.setScrollableY(b); } protected void addSubmitButton(Validator val) { if(okButton != null) { val.addSubmitButtons(okButton); } } UIAbstraction