SlideShare a Scribd company logo
1 of 18
Download to read offline
UI Design From Scratch - Part V
public class Dish implements PropertyBusinessObject {
public final Property<String, Dish> id = new Property<>("id");
public final DoubleProperty<Dish> price = new DoubleProperty<>("price");
public final Property<String, Dish> name = new Property<>("name");
public final Property<String, Dish> description = new Property<>("description");
public final Property<String, Dish> imageName = new Property<>("imageName");
public final Property<Image, Dish> thumbnail = new Property<Image, Dish>("thumbnail") {
public Image get() {
// snipped common code
}
};
public final Property<Image, Dish> fullSize = new Property<Image, Dish>("fullSize") {
public Image get() {
Image i = super.get();
if(i == null) {
i = fetchImage();
super.set(i);
}
return i;
}
};
private final PropertyIndex idx = new PropertyIndex(this, "Dish",
id, price, name, description, imageName, thumbnail, fullSize);
public PropertyIndex getPropertyIndex() {
return idx;
}
}
Dish
public class AboutForm extends BaseForm {
public AboutForm() {
super("About");
}
@Override
protected Container createContent() {
BrowserComponent cmp = new BrowserComponent();
try {
cmp.setURLHierarchy("/index.html");
} catch(IOException err) {
Log.e(err);
Log.sendLog();
}
return cmp;
}
@Override
protected void onSearch(String searchString) {
}
}
About
Container topArea = FlowLayout.encloseRight(createCartButton());
topArea.setUIID("TopBar");
tb.addComponentToSideMenu(topArea);
tb.addMaterialCommandToSideMenu("Menu",
FontImage.MATERIAL_RESTAURANT_MENU,
e -> new MainMenuForm().show());
tb.addMaterialCommandToSideMenu("About",
FontImage.MATERIAL_INFO,
e -> new AboutForm().show());
tb.addMaterialCommandToSideMenu("Contact Us",
FontImage.MATERIAL_MAP,
e -> new ContactUsForm().show());
//….
Component.setSameHeight(topArea, topBar);
Base Form
final static String[] PICKER_STRINGS = new String[100];
static {
PICKER_STRINGS[0] = "Delete";
for(int iter = 1 ; iter < 100 ; iter++) {
PICKER_STRINGS[iter] = iter + "x";
}
}
Picker quantityButton = new Picker();
quantityButton.setUIID("QuantityPicker");
quantityButton.setType(Display.PICKER_TYPE_STRINGS);
quantityButton.setStrings(PICKER_STRINGS);
quantityButton.setSelectedString(quantity + "x");
Container dishContainer = BoxLayout.encloseX(
FlowLayout.encloseMiddle(quantityButton),
new Label(dishMasked, "UnmarginedLabel"),
FlowLayout.encloseMiddle(
BoxLayout.encloseY(
new Label(title, "DishCheckoutTitle"),
new Label(L10NManager.getInstance().formatCurrency(price), "CheckoutPrice")
)
)
);
Checkout Form
final static String[] PICKER_STRINGS = new String[100];
static {
PICKER_STRINGS[0] = "Delete";
for(int iter = 1 ; iter < 100 ; iter++) {
PICKER_STRINGS[iter] = iter + "x";
}
}
Picker quantityButton = new Picker();
quantityButton.setUIID("QuantityPicker");
quantityButton.setType(Display.PICKER_TYPE_STRINGS);
quantityButton.setStrings(PICKER_STRINGS);
quantityButton.setSelectedString(quantity + "x");
Container dishContainer = BoxLayout.encloseX(
FlowLayout.encloseMiddle(quantityButton),
new Label(dishMasked, "UnmarginedLabel"),
FlowLayout.encloseMiddle(
BoxLayout.encloseY(
new Label(title, "DishCheckoutTitle"),
new Label(L10NManager.getInstance().formatCurrency(price), "CheckoutPrice")
)
)
);
Checkout Form
final static String[] PICKER_STRINGS = new String[100];
static {
PICKER_STRINGS[0] = "Delete";
for(int iter = 1 ; iter < 100 ; iter++) {
PICKER_STRINGS[iter] = iter + "x";
}
}
Picker quantityButton = new Picker();
quantityButton.setUIID("QuantityPicker");
quantityButton.setType(Display.PICKER_TYPE_STRINGS);
quantityButton.setStrings(PICKER_STRINGS);
quantityButton.setSelectedString(quantity + "x");
Container dishContainer = BoxLayout.encloseX(
FlowLayout.encloseMiddle(quantityButton),
new Label(dishMasked, "UnmarginedLabel"),
FlowLayout.encloseMiddle(
BoxLayout.encloseY(
new Label(title, "DishCheckoutTitle"),
new Label(L10NManager.getInstance().formatCurrency(price), "CheckoutPrice")
)
)
);
Checkout Form
final static String[] PICKER_STRINGS = new String[100];
static {
PICKER_STRINGS[0] = "Delete";
for(int iter = 1 ; iter < 100 ; iter++) {
PICKER_STRINGS[iter] = iter + "x";
}
}
Picker quantityButton = new Picker();
quantityButton.setUIID("QuantityPicker");
quantityButton.setType(Display.PICKER_TYPE_STRINGS);
quantityButton.setStrings(PICKER_STRINGS);
quantityButton.setSelectedString(quantity + "x");
Container dishContainer = BoxLayout.encloseX(
FlowLayout.encloseMiddle(quantityButton),
new Label(dishMasked, "UnmarginedLabel"),
FlowLayout.encloseMiddle(
BoxLayout.encloseY(
new Label(title, "DishCheckoutTitle"),
new Label(L10NManager.getInstance().formatCurrency(price), "CheckoutPrice")
)
)
);
Checkout Form
final static String[] PICKER_STRINGS = new String[100];
static {
PICKER_STRINGS[0] = "Delete";
for(int iter = 1 ; iter < 100 ; iter++) {
PICKER_STRINGS[iter] = iter + "x";
}
}
Picker quantityButton = new Picker();
quantityButton.setUIID("QuantityPicker");
quantityButton.setType(Display.PICKER_TYPE_STRINGS);
quantityButton.setStrings(PICKER_STRINGS);
quantityButton.setSelectedString(quantity + "x");
Container dishContainer = BoxLayout.encloseX(
FlowLayout.encloseMiddle(quantityButton),
new Label(dishMasked, "UnmarginedLabel"),
FlowLayout.encloseMiddle(
BoxLayout.encloseY(
new Label(title, "DishCheckoutTitle"),
new Label(L10NManager.getInstance().formatCurrency(price), "CheckoutPrice")
)
)
);
Checkout Form
quantityButton.addActionListener(e -> {
if(quantityButton.getSelectedString().equals(PICKER_STRINGS[0])) {
Display.getInstance().callSerially(() -> {
dishContainer.setX(Display.getInstance().getDisplayWidth());
Container p = dishContainer.getParent();
p.animateUnlayoutAndWait(250, 255);
dishContainer.remove();
p.animateLayout(200);
});
}
});
Checkout Form
Coord crd = new Coord(40.732030, -73.999872);
MapContainer map = new MapContainer(“key-from-google“);
map.addMarker(null, crd, "Blue Hill", "Description", null);
map.setCameraPosition(crd);
TextArea address = new TextArea("Blue Hill,n"
+ "Farm-to-table American fine diningn"
+ "75 Washington Pln"
+ "New York, NY 10011n"
+ "+1 212-539-1776");
address.setEditable(false);
address.setUIID("MapAddressText");
Button phone = new Button("", "ShoppingCart");
FontImage.setMaterialIcon(phone, FontImage.MATERIAL_CALL);
phone.addActionListener(e -> Display.getInstance().dial("+12125391776"));
Button navigate = new Button("", "ShoppingCart");
FontImage.setMaterialIcon(navigate, FontImage.MATERIAL_NAVIGATION);
navigate.addActionListener(e ->
Display.getInstance().openNativeNavigationApp(address));
Container addressContainer = BorderLayout.center(address);
addressContainer.add(BorderLayout.EAST,
GridLayout.encloseIn(1, phone, navigate));
addressContainer.setUIID("MapAddress");
Container lp = LayeredLayout.encloseIn(map,
BorderLayout.south(addressContainer));
return lp;
Contact Us
Coord crd = new Coord(40.732030, -73.999872);
MapContainer map = new MapContainer(“key-from-google“);
map.addMarker(null, crd, "Blue Hill", "Description", null);
map.setCameraPosition(crd);
TextArea address = new TextArea("Blue Hill,n"
+ "Farm-to-table American fine diningn"
+ "75 Washington Pln"
+ "New York, NY 10011n"
+ "+1 212-539-1776");
address.setEditable(false);
address.setUIID("MapAddressText");
Button phone = new Button("", "ShoppingCart");
FontImage.setMaterialIcon(phone, FontImage.MATERIAL_CALL);
phone.addActionListener(e -> Display.getInstance().dial("+12125391776"));
Button navigate = new Button("", "ShoppingCart");
FontImage.setMaterialIcon(navigate, FontImage.MATERIAL_NAVIGATION);
navigate.addActionListener(e ->
Display.getInstance().openNativeNavigationApp(address));
Container addressContainer = BorderLayout.center(address);
addressContainer.add(BorderLayout.EAST,
GridLayout.encloseIn(1, phone, navigate));
addressContainer.setUIID("MapAddress");
Container lp = LayeredLayout.encloseIn(map,
BorderLayout.south(addressContainer));
return lp;
Contact Us
Coord crd = new Coord(40.732030, -73.999872);
MapContainer map = new MapContainer(“key-from-google“);
map.addMarker(null, crd, "Blue Hill", "Description", null);
map.setCameraPosition(crd);
TextArea address = new TextArea("Blue Hill,n"
+ "Farm-to-table American fine diningn"
+ "75 Washington Pln"
+ "New York, NY 10011n"
+ "+1 212-539-1776");
address.setEditable(false);
address.setUIID("MapAddressText");
Button phone = new Button("", "ShoppingCart");
FontImage.setMaterialIcon(phone, FontImage.MATERIAL_CALL);
phone.addActionListener(e -> Display.getInstance().dial("+12125391776"));
Button navigate = new Button("", "ShoppingCart");
FontImage.setMaterialIcon(navigate, FontImage.MATERIAL_NAVIGATION);
navigate.addActionListener(e ->
Display.getInstance().openNativeNavigationApp(address));
Container addressContainer = BorderLayout.center(address);
addressContainer.add(BorderLayout.EAST,
GridLayout.encloseIn(1, phone, navigate));
addressContainer.setUIID("MapAddress");
Container lp = LayeredLayout.encloseIn(map,
BorderLayout.south(addressContainer));
return lp;
Contact Us
Coord crd = new Coord(40.732030, -73.999872);
MapContainer map = new MapContainer(“key-from-google“);
map.addMarker(null, crd, "Blue Hill", "Description", null);
map.setCameraPosition(crd);
TextArea address = new TextArea("Blue Hill,n"
+ "Farm-to-table American fine diningn"
+ "75 Washington Pln"
+ "New York, NY 10011n"
+ "+1 212-539-1776");
address.setEditable(false);
address.setUIID("MapAddressText");
Button phone = new Button("", "ShoppingCart");
FontImage.setMaterialIcon(phone, FontImage.MATERIAL_CALL);
phone.addActionListener(e -> Display.getInstance().dial("+12125391776"));
Button navigate = new Button("", "ShoppingCart");
FontImage.setMaterialIcon(navigate, FontImage.MATERIAL_NAVIGATION);
navigate.addActionListener(e ->
Display.getInstance().openNativeNavigationApp(address));
Container addressContainer = BorderLayout.center(address);
addressContainer.add(BorderLayout.EAST,
GridLayout.encloseIn(1, phone, navigate));
addressContainer.setUIID("MapAddress");
Container lp = LayeredLayout.encloseIn(map,
BorderLayout.south(addressContainer));
return lp;
Contact Us
super(actualDish.name.get(), new LayeredLayout());
ImageViewer iv = new ImageViewer();
iv.setImage(actualDish.fullSize.get());
add(iv);
iv.setImageInitialPosition(ImageViewer.IMAGE_FILL);
Toolbar tb = getToolbar();
tb.setUIID("TintToolbar");
Form previous = Display.getInstance().getCurrent();
tb.addMaterialCommandToLeftBar("",
FontImage.MATERIAL_CLOSE, ev -> previous.showBack());
tb.addMaterialCommandToRightBar("",
FontImage.MATERIAL_ADD_SHOPPING_CART, ev -> {});
TextArea description = new TextArea(actualDish.description.get());
description.setEditable(false);
description.setUIID("DishViewDescription");
add(BorderLayout.south(description));
Dish View
Label priceLabel = new Label(L10NManager.getInstance().
formatCurrency(actualDish.price.get()), "YourOrder");
priceLabel.getUnselectedStyle().setPaddingRight(6);
Image priceImage = Image.createImage(priceLabel.getPreferredW() -
Display.getInstance().convertToPixels(4),
priceLabel.getPreferredH(), 0);
priceLabel.setWidth(priceLabel.getPreferredW());
priceLabel.setHeight(priceLabel.getPreferredH());
priceLabel.paintComponent(priceImage.getGraphics(), false);
setGlassPane((g, rect) -> {
g.drawImage(priceImage,
getWidth() - priceImage.getWidth(), getHeight() / 5);
});
Dish View
What did we learn?
✦Design has common concepts with programming
but a different set of rules
✦We can’t replace a designer but we can fill in
gaps
✦Let existing design do the talking: Images, Maps
etc. should dominate the UI
Thank You!

More Related Content

Similar to UI Design From Scratch - Part 5.pdf

Creating an Uber Clone - Part VIII.pdf
Creating an Uber Clone - Part VIII.pdfCreating an Uber Clone - Part VIII.pdf
Creating an Uber Clone - Part VIII.pdfShaiAlmog1
 
JavaScript Objects and OOP Programming with JavaScript
JavaScript Objects and OOP Programming with JavaScriptJavaScript Objects and OOP Programming with JavaScript
JavaScript Objects and OOP Programming with JavaScriptLaurence Svekis ✔
 
Creating a Facebook Clone - Part VI.pdf
Creating a Facebook Clone - Part VI.pdfCreating a Facebook Clone - Part VI.pdf
Creating a Facebook Clone - Part VI.pdfShaiAlmog1
 
Creating an Uber Clone - Part XXII.pdf
Creating an Uber Clone - Part XXII.pdfCreating an Uber Clone - Part XXII.pdf
Creating an Uber Clone - Part XXII.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
 
Creating a Facebook Clone - Part XIV.pdf
Creating a Facebook Clone - Part XIV.pdfCreating a Facebook Clone - Part XIV.pdf
Creating a Facebook Clone - Part XIV.pdfShaiAlmog1
 
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docxbbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docxikirkton
 
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdfImport java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdfapexcomputer54
 
Creating an Uber Clone - Part XXIV.pdf
Creating an Uber Clone - Part XXIV.pdfCreating an Uber Clone - Part XXIV.pdf
Creating an Uber Clone - Part XXIV.pdfShaiAlmog1
 
Finishing the App - Part 2.pdf
Finishing the App - Part 2.pdfFinishing the App - Part 2.pdf
Finishing the App - Part 2.pdfShaiAlmog1
 
Creating a Facebook Clone - Part XLII.pdf
Creating a Facebook Clone - Part XLII.pdfCreating a Facebook Clone - Part XLII.pdf
Creating a Facebook Clone - Part XLII.pdfShaiAlmog1
 
Creating a Facebook Clone - Part XVI.pdf
Creating a Facebook Clone - Part XVI.pdfCreating a Facebook Clone - Part XVI.pdf
Creating a Facebook Clone - Part XVI.pdfShaiAlmog1
 
Creating a Facebook Clone - Part XV.pdf
Creating a Facebook Clone - Part XV.pdfCreating a Facebook Clone - Part XV.pdf
Creating a Facebook Clone - Part XV.pdfShaiAlmog1
 
Creating an Uber - Part VI.pdf
Creating an Uber - Part VI.pdfCreating an Uber - Part VI.pdf
Creating an Uber - Part VI.pdfShaiAlmog1
 
Extracting ui Design - part 5 - transcript.pdf
Extracting ui Design - part 5 - transcript.pdfExtracting ui Design - part 5 - transcript.pdf
Extracting ui Design - part 5 - transcript.pdfShaiAlmog1
 
Creating an Uber Clone - Part XXXIX.pdf
Creating an Uber Clone - Part XXXIX.pdfCreating an Uber Clone - Part XXXIX.pdf
Creating an Uber Clone - Part XXXIX.pdfShaiAlmog1
 
Adapting to Tablets and Desktops - Part 2.pdf
Adapting to Tablets and Desktops - Part 2.pdfAdapting to Tablets and Desktops - Part 2.pdf
Adapting to Tablets and Desktops - Part 2.pdfShaiAlmog1
 
Creating an Uber Clone - Part XXIII.pdf
Creating an Uber Clone - Part XXIII.pdfCreating an Uber Clone - Part XXIII.pdf
Creating an Uber Clone - Part XXIII.pdfShaiAlmog1
 
Miscellaneous Features - Part 2 - Transcript.pdf
Miscellaneous Features - Part 2 - Transcript.pdfMiscellaneous Features - Part 2 - Transcript.pdf
Miscellaneous Features - Part 2 - Transcript.pdfShaiAlmog1
 

Similar to UI Design From Scratch - Part 5.pdf (20)

Creating an Uber Clone - Part VIII.pdf
Creating an Uber Clone - Part VIII.pdfCreating an Uber Clone - Part VIII.pdf
Creating an Uber Clone - Part VIII.pdf
 
JavaScript Objects and OOP Programming with JavaScript
JavaScript Objects and OOP Programming with JavaScriptJavaScript Objects and OOP Programming with JavaScript
JavaScript Objects and OOP Programming with JavaScript
 
Applications
ApplicationsApplications
Applications
 
Creating a Facebook Clone - Part VI.pdf
Creating a Facebook Clone - Part VI.pdfCreating a Facebook Clone - Part VI.pdf
Creating a Facebook Clone - Part VI.pdf
 
Creating an Uber Clone - Part XXII.pdf
Creating an Uber Clone - Part XXII.pdfCreating an Uber Clone - Part XXII.pdf
Creating an Uber Clone - Part XXII.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
 
Creating a Facebook Clone - Part XIV.pdf
Creating a Facebook Clone - Part XIV.pdfCreating a Facebook Clone - Part XIV.pdf
Creating a Facebook Clone - Part XIV.pdf
 
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docxbbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
 
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdfImport java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
 
Creating an Uber Clone - Part XXIV.pdf
Creating an Uber Clone - Part XXIV.pdfCreating an Uber Clone - Part XXIV.pdf
Creating an Uber Clone - Part XXIV.pdf
 
Finishing the App - Part 2.pdf
Finishing the App - Part 2.pdfFinishing the App - Part 2.pdf
Finishing the App - Part 2.pdf
 
Creating a Facebook Clone - Part XLII.pdf
Creating a Facebook Clone - Part XLII.pdfCreating a Facebook Clone - Part XLII.pdf
Creating a Facebook Clone - Part XLII.pdf
 
Creating a Facebook Clone - Part XVI.pdf
Creating a Facebook Clone - Part XVI.pdfCreating a Facebook Clone - Part XVI.pdf
Creating a Facebook Clone - Part XVI.pdf
 
Creating a Facebook Clone - Part XV.pdf
Creating a Facebook Clone - Part XV.pdfCreating a Facebook Clone - Part XV.pdf
Creating a Facebook Clone - Part XV.pdf
 
Creating an Uber - Part VI.pdf
Creating an Uber - Part VI.pdfCreating an Uber - Part VI.pdf
Creating an Uber - Part VI.pdf
 
Extracting ui Design - part 5 - transcript.pdf
Extracting ui Design - part 5 - transcript.pdfExtracting ui Design - part 5 - transcript.pdf
Extracting ui Design - part 5 - transcript.pdf
 
Creating an Uber Clone - Part XXXIX.pdf
Creating an Uber Clone - Part XXXIX.pdfCreating an Uber Clone - Part XXXIX.pdf
Creating an Uber Clone - Part XXXIX.pdf
 
Adapting to Tablets and Desktops - Part 2.pdf
Adapting to Tablets and Desktops - Part 2.pdfAdapting to Tablets and Desktops - Part 2.pdf
Adapting to Tablets and Desktops - Part 2.pdf
 
Creating an Uber Clone - Part XXIII.pdf
Creating an Uber Clone - Part XXIII.pdfCreating an Uber Clone - Part XXIII.pdf
Creating an Uber Clone - Part XXIII.pdf
 
Miscellaneous Features - Part 2 - Transcript.pdf
Miscellaneous Features - Part 2 - Transcript.pdfMiscellaneous Features - Part 2 - Transcript.pdf
Miscellaneous Features - Part 2 - Transcript.pdf
 

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 V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfCreating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - 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
 

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 V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfCreating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - 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
 

Recently uploaded

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
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
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
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
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 

UI Design From Scratch - Part 5.pdf

  • 1. UI Design From Scratch - Part V
  • 2. public class Dish implements PropertyBusinessObject { public final Property<String, Dish> id = new Property<>("id"); public final DoubleProperty<Dish> price = new DoubleProperty<>("price"); public final Property<String, Dish> name = new Property<>("name"); public final Property<String, Dish> description = new Property<>("description"); public final Property<String, Dish> imageName = new Property<>("imageName"); public final Property<Image, Dish> thumbnail = new Property<Image, Dish>("thumbnail") { public Image get() { // snipped common code } }; public final Property<Image, Dish> fullSize = new Property<Image, Dish>("fullSize") { public Image get() { Image i = super.get(); if(i == null) { i = fetchImage(); super.set(i); } return i; } }; private final PropertyIndex idx = new PropertyIndex(this, "Dish", id, price, name, description, imageName, thumbnail, fullSize); public PropertyIndex getPropertyIndex() { return idx; } } Dish
  • 3. public class AboutForm extends BaseForm { public AboutForm() { super("About"); } @Override protected Container createContent() { BrowserComponent cmp = new BrowserComponent(); try { cmp.setURLHierarchy("/index.html"); } catch(IOException err) { Log.e(err); Log.sendLog(); } return cmp; } @Override protected void onSearch(String searchString) { } } About
  • 4. Container topArea = FlowLayout.encloseRight(createCartButton()); topArea.setUIID("TopBar"); tb.addComponentToSideMenu(topArea); tb.addMaterialCommandToSideMenu("Menu", FontImage.MATERIAL_RESTAURANT_MENU, e -> new MainMenuForm().show()); tb.addMaterialCommandToSideMenu("About", FontImage.MATERIAL_INFO, e -> new AboutForm().show()); tb.addMaterialCommandToSideMenu("Contact Us", FontImage.MATERIAL_MAP, e -> new ContactUsForm().show()); //…. Component.setSameHeight(topArea, topBar); Base Form
  • 5. final static String[] PICKER_STRINGS = new String[100]; static { PICKER_STRINGS[0] = "Delete"; for(int iter = 1 ; iter < 100 ; iter++) { PICKER_STRINGS[iter] = iter + "x"; } } Picker quantityButton = new Picker(); quantityButton.setUIID("QuantityPicker"); quantityButton.setType(Display.PICKER_TYPE_STRINGS); quantityButton.setStrings(PICKER_STRINGS); quantityButton.setSelectedString(quantity + "x"); Container dishContainer = BoxLayout.encloseX( FlowLayout.encloseMiddle(quantityButton), new Label(dishMasked, "UnmarginedLabel"), FlowLayout.encloseMiddle( BoxLayout.encloseY( new Label(title, "DishCheckoutTitle"), new Label(L10NManager.getInstance().formatCurrency(price), "CheckoutPrice") ) ) ); Checkout Form
  • 6. final static String[] PICKER_STRINGS = new String[100]; static { PICKER_STRINGS[0] = "Delete"; for(int iter = 1 ; iter < 100 ; iter++) { PICKER_STRINGS[iter] = iter + "x"; } } Picker quantityButton = new Picker(); quantityButton.setUIID("QuantityPicker"); quantityButton.setType(Display.PICKER_TYPE_STRINGS); quantityButton.setStrings(PICKER_STRINGS); quantityButton.setSelectedString(quantity + "x"); Container dishContainer = BoxLayout.encloseX( FlowLayout.encloseMiddle(quantityButton), new Label(dishMasked, "UnmarginedLabel"), FlowLayout.encloseMiddle( BoxLayout.encloseY( new Label(title, "DishCheckoutTitle"), new Label(L10NManager.getInstance().formatCurrency(price), "CheckoutPrice") ) ) ); Checkout Form
  • 7. final static String[] PICKER_STRINGS = new String[100]; static { PICKER_STRINGS[0] = "Delete"; for(int iter = 1 ; iter < 100 ; iter++) { PICKER_STRINGS[iter] = iter + "x"; } } Picker quantityButton = new Picker(); quantityButton.setUIID("QuantityPicker"); quantityButton.setType(Display.PICKER_TYPE_STRINGS); quantityButton.setStrings(PICKER_STRINGS); quantityButton.setSelectedString(quantity + "x"); Container dishContainer = BoxLayout.encloseX( FlowLayout.encloseMiddle(quantityButton), new Label(dishMasked, "UnmarginedLabel"), FlowLayout.encloseMiddle( BoxLayout.encloseY( new Label(title, "DishCheckoutTitle"), new Label(L10NManager.getInstance().formatCurrency(price), "CheckoutPrice") ) ) ); Checkout Form
  • 8. final static String[] PICKER_STRINGS = new String[100]; static { PICKER_STRINGS[0] = "Delete"; for(int iter = 1 ; iter < 100 ; iter++) { PICKER_STRINGS[iter] = iter + "x"; } } Picker quantityButton = new Picker(); quantityButton.setUIID("QuantityPicker"); quantityButton.setType(Display.PICKER_TYPE_STRINGS); quantityButton.setStrings(PICKER_STRINGS); quantityButton.setSelectedString(quantity + "x"); Container dishContainer = BoxLayout.encloseX( FlowLayout.encloseMiddle(quantityButton), new Label(dishMasked, "UnmarginedLabel"), FlowLayout.encloseMiddle( BoxLayout.encloseY( new Label(title, "DishCheckoutTitle"), new Label(L10NManager.getInstance().formatCurrency(price), "CheckoutPrice") ) ) ); Checkout Form
  • 9. final static String[] PICKER_STRINGS = new String[100]; static { PICKER_STRINGS[0] = "Delete"; for(int iter = 1 ; iter < 100 ; iter++) { PICKER_STRINGS[iter] = iter + "x"; } } Picker quantityButton = new Picker(); quantityButton.setUIID("QuantityPicker"); quantityButton.setType(Display.PICKER_TYPE_STRINGS); quantityButton.setStrings(PICKER_STRINGS); quantityButton.setSelectedString(quantity + "x"); Container dishContainer = BoxLayout.encloseX( FlowLayout.encloseMiddle(quantityButton), new Label(dishMasked, "UnmarginedLabel"), FlowLayout.encloseMiddle( BoxLayout.encloseY( new Label(title, "DishCheckoutTitle"), new Label(L10NManager.getInstance().formatCurrency(price), "CheckoutPrice") ) ) ); Checkout Form
  • 10. quantityButton.addActionListener(e -> { if(quantityButton.getSelectedString().equals(PICKER_STRINGS[0])) { Display.getInstance().callSerially(() -> { dishContainer.setX(Display.getInstance().getDisplayWidth()); Container p = dishContainer.getParent(); p.animateUnlayoutAndWait(250, 255); dishContainer.remove(); p.animateLayout(200); }); } }); Checkout Form
  • 11. Coord crd = new Coord(40.732030, -73.999872); MapContainer map = new MapContainer(“key-from-google“); map.addMarker(null, crd, "Blue Hill", "Description", null); map.setCameraPosition(crd); TextArea address = new TextArea("Blue Hill,n" + "Farm-to-table American fine diningn" + "75 Washington Pln" + "New York, NY 10011n" + "+1 212-539-1776"); address.setEditable(false); address.setUIID("MapAddressText"); Button phone = new Button("", "ShoppingCart"); FontImage.setMaterialIcon(phone, FontImage.MATERIAL_CALL); phone.addActionListener(e -> Display.getInstance().dial("+12125391776")); Button navigate = new Button("", "ShoppingCart"); FontImage.setMaterialIcon(navigate, FontImage.MATERIAL_NAVIGATION); navigate.addActionListener(e -> Display.getInstance().openNativeNavigationApp(address)); Container addressContainer = BorderLayout.center(address); addressContainer.add(BorderLayout.EAST, GridLayout.encloseIn(1, phone, navigate)); addressContainer.setUIID("MapAddress"); Container lp = LayeredLayout.encloseIn(map, BorderLayout.south(addressContainer)); return lp; Contact Us
  • 12. Coord crd = new Coord(40.732030, -73.999872); MapContainer map = new MapContainer(“key-from-google“); map.addMarker(null, crd, "Blue Hill", "Description", null); map.setCameraPosition(crd); TextArea address = new TextArea("Blue Hill,n" + "Farm-to-table American fine diningn" + "75 Washington Pln" + "New York, NY 10011n" + "+1 212-539-1776"); address.setEditable(false); address.setUIID("MapAddressText"); Button phone = new Button("", "ShoppingCart"); FontImage.setMaterialIcon(phone, FontImage.MATERIAL_CALL); phone.addActionListener(e -> Display.getInstance().dial("+12125391776")); Button navigate = new Button("", "ShoppingCart"); FontImage.setMaterialIcon(navigate, FontImage.MATERIAL_NAVIGATION); navigate.addActionListener(e -> Display.getInstance().openNativeNavigationApp(address)); Container addressContainer = BorderLayout.center(address); addressContainer.add(BorderLayout.EAST, GridLayout.encloseIn(1, phone, navigate)); addressContainer.setUIID("MapAddress"); Container lp = LayeredLayout.encloseIn(map, BorderLayout.south(addressContainer)); return lp; Contact Us
  • 13. Coord crd = new Coord(40.732030, -73.999872); MapContainer map = new MapContainer(“key-from-google“); map.addMarker(null, crd, "Blue Hill", "Description", null); map.setCameraPosition(crd); TextArea address = new TextArea("Blue Hill,n" + "Farm-to-table American fine diningn" + "75 Washington Pln" + "New York, NY 10011n" + "+1 212-539-1776"); address.setEditable(false); address.setUIID("MapAddressText"); Button phone = new Button("", "ShoppingCart"); FontImage.setMaterialIcon(phone, FontImage.MATERIAL_CALL); phone.addActionListener(e -> Display.getInstance().dial("+12125391776")); Button navigate = new Button("", "ShoppingCart"); FontImage.setMaterialIcon(navigate, FontImage.MATERIAL_NAVIGATION); navigate.addActionListener(e -> Display.getInstance().openNativeNavigationApp(address)); Container addressContainer = BorderLayout.center(address); addressContainer.add(BorderLayout.EAST, GridLayout.encloseIn(1, phone, navigate)); addressContainer.setUIID("MapAddress"); Container lp = LayeredLayout.encloseIn(map, BorderLayout.south(addressContainer)); return lp; Contact Us
  • 14. Coord crd = new Coord(40.732030, -73.999872); MapContainer map = new MapContainer(“key-from-google“); map.addMarker(null, crd, "Blue Hill", "Description", null); map.setCameraPosition(crd); TextArea address = new TextArea("Blue Hill,n" + "Farm-to-table American fine diningn" + "75 Washington Pln" + "New York, NY 10011n" + "+1 212-539-1776"); address.setEditable(false); address.setUIID("MapAddressText"); Button phone = new Button("", "ShoppingCart"); FontImage.setMaterialIcon(phone, FontImage.MATERIAL_CALL); phone.addActionListener(e -> Display.getInstance().dial("+12125391776")); Button navigate = new Button("", "ShoppingCart"); FontImage.setMaterialIcon(navigate, FontImage.MATERIAL_NAVIGATION); navigate.addActionListener(e -> Display.getInstance().openNativeNavigationApp(address)); Container addressContainer = BorderLayout.center(address); addressContainer.add(BorderLayout.EAST, GridLayout.encloseIn(1, phone, navigate)); addressContainer.setUIID("MapAddress"); Container lp = LayeredLayout.encloseIn(map, BorderLayout.south(addressContainer)); return lp; Contact Us
  • 15. super(actualDish.name.get(), new LayeredLayout()); ImageViewer iv = new ImageViewer(); iv.setImage(actualDish.fullSize.get()); add(iv); iv.setImageInitialPosition(ImageViewer.IMAGE_FILL); Toolbar tb = getToolbar(); tb.setUIID("TintToolbar"); Form previous = Display.getInstance().getCurrent(); tb.addMaterialCommandToLeftBar("", FontImage.MATERIAL_CLOSE, ev -> previous.showBack()); tb.addMaterialCommandToRightBar("", FontImage.MATERIAL_ADD_SHOPPING_CART, ev -> {}); TextArea description = new TextArea(actualDish.description.get()); description.setEditable(false); description.setUIID("DishViewDescription"); add(BorderLayout.south(description)); Dish View
  • 16. Label priceLabel = new Label(L10NManager.getInstance(). formatCurrency(actualDish.price.get()), "YourOrder"); priceLabel.getUnselectedStyle().setPaddingRight(6); Image priceImage = Image.createImage(priceLabel.getPreferredW() - Display.getInstance().convertToPixels(4), priceLabel.getPreferredH(), 0); priceLabel.setWidth(priceLabel.getPreferredW()); priceLabel.setHeight(priceLabel.getPreferredH()); priceLabel.paintComponent(priceImage.getGraphics(), false); setGlassPane((g, rect) -> { g.drawImage(priceImage, getWidth() - priceImage.getWidth(), getHeight() / 5); }); Dish View
  • 17. What did we learn? ✦Design has common concepts with programming but a different set of rules ✦We can’t replace a designer but we can fill in gaps ✦Let existing design do the talking: Images, Maps etc. should dominate the UI