SlideShare uma empresa Scribd logo
1 de 22
Baixar para ler offline
Intro to Rich Web Applications

and UI Frameworks Development

(GWT + HTML Canvas)
by Iaroslav Kobyliukh
Who we are?
Animatron Wave
Universal animation maker for small
businesses and agencies
Incredibly easy to use online video maker for
creating marketing and social videos in minutes
Animatron Studio
What we do?
▪ Tween based vector animation editor
▪ Rich vector tools
▪ Import (images, audio, video, SVG)
▪ Export (HTML5, GIF, Video, SVG+SMIL)
▪ Share (Facebook, Twitter, YouTube, Dropbox,
etc.)
▪ Collaborative editing
Architecture
Website
Editor
Player
Backend
Rich Web Applications: Editors
Wave Editor Studio Editor
What is Rich Web Application?
Rich Web application (or rich
Internet application (RIA)) is a Web
application designed to deliver the
same features and functions normally
associated with desktop applications.
Creating GWT UI
▪ Create UI Binding Template
▪ Write UI Java code
▪ Hand it over to CSS + HTML guy
▪ The guy styles it
▪ Next day you get it (at best)
▪ Roundtrips to fix browser’s
problems
Everything is Canvas
Canvas Based Widgets
Are You F**ing Crazy???
Canvas Based Widgets
▪ Write only Java code
▪ No CSS + HTML guy
▪ No roundtrips
▪ No browser inconsistencies
Canvas Based Widgets
▪ This is NOT Swing
▪ Much simpler than Swing
▪ Much easier than Swing
▪ Exactly one look and feel
▪ Everything is pure Java code
▪ Many components on the one
canvas
Examples
public class DemoPanel extends TPanel.BorderLayout {
public DemoPanel() {
super(20);
TLabel.Ui title = new TLabel.Ui("Demo Panel");
title.setHAlignment(Alignment.H.center);
TTextField.Ui.ForString field = new TTextField.Ui.ForString("");
TTextArea textArea = new TTextArea("");
textArea.setPlaceholder(“Type something”);
TLink.Ui.BroserUrl link = new TLink.Ui.BrowserUrl("GWTCon17", "http://www.gwtcon.org");
TPanel.FlowLayout flowLayout = new TPanel.FlowLayout(Direction.vertical, 10);
flowLayout.add(field);
flowLayout.add(textArea);
flowLayout.add(link);
north(title);
center(flowLayout);
}
}
Examples
Standard Component
Painting Components
TButton.Ui button = new TButton.Ui("Please click on me");
button.onMouseDown(new AMouseDownEvent.Handler() {

@Override

public void process(AMouseDownEvent event) {

button.setText("Awesome!");
button.revalidate();
button.repaint(); 

}

});
protected void paintComponent(ACanvas canvas);
public final void invalidate();
public final TComponent revalidate();
public final void repaint();
public class CustomComponent extends TComponent.Ui {
@Override

protected void paintComponent(ACanvas canvas) {

Rectangle rectangle = new Rectangle(0, 0, 100, 50);
Fill red = new Fill("red");

canvas.fillRect(rectangle, red);
}
}
Sizes & Dimensions
TPanel.BorderLayout layout = new TPanel.BorderLayout();
layout.setMaximumSize(new Dimension(640, 480));
layout.setMinimumSize(new Dimension(32, 32));
public final Rectangle getBounds();
public final Rectangle getAbsoluteBounds();
public final Rectangle getContentBounds();
public final Dimension getPrefferedSize();
public <C extends TComponent> C setPrefferedSize(Dimension size);
public <C extends TComponent> C setMaximumSize(Dimension size);
public <C extends TComponent> C setMinimumSize(Dimension size);
public class CustomComponent extends TComponent.Ui {
@Override

protected void paintComponent(ACanvas canvas) {

Rectangle rectangle = getContentBounds();
Fill green = new Fill("green");

canvas.fillRect(rectangle, green);
}
}
Lists & Grids
List<String> someList = Arrays.asList("one", "two", "three");
TList.Model.Simple<String> simpleModel = new TList.Model.Simple<>(someList);
TList.Ui<String> uiList = new TList.Ui<>(simpleModel);
uiList.getSelectionModel().setSelection("two");
String selectedItem = uiList.getSelectionModel().getSelected();
someList.add("four");
uiList.getModel().fireModelChanged();
List<CustomObject> someList = getCustomObjects();
TList.Model.Simple<CustomObject> simpleModel = new TList.Model.Simple<>(someList);
TGrid.Ui<String> uiGrid = new TGrid.Ui<>(simpleModel);
uiGrid.setColumns(2);
uiGrid.setRenderer(new CustomRenderer());
class CustomRenderer extends TLabel.Ui implements TFlyweight.Renderer.Active<CustomObject> {
@Override

public void prepareToRender(CustomObject object, boolean selected) {
setText(object.getName());
}
}
Viewports
List<String> someList = Arrays.asList("one", "two", "three");
TList.Model.Simple<String> simpleModel = new TList.Model.Simple<>(someList);
TList.Ui<String> uiList = new TList.Ui<>(simpleModel);
TViewport.Ui viewport = new TViewport.Ui(uiList);
viewport.setViewWidthTracksViewport(true);
viewport.setViewHeightTracksViewport(true);
TPanel.BorderLayout layout = new TPanel.BorderLayout();
layout.center(viewport);
layout.setPreferredSize(new Dimension(640, 320));
Styling
interface Button extends TLook {
TLookKey<Boolean> OPAQUE = new TLookKey<>("button.opaque", false);
TLookKey<Fill> BG = new TLookKey<>("button.background", new Fill("#FFFFFF");
TLookKey<Fill> FG = new TLookKey<>("button.foreground", new Fill("#000000");
TLookKey<Fill> BG_PRESSED = new TLookKey<>("button.background.pressed", BG);
TLookKey<Fill> FG_PRESSED = new TLookKey<>("button.foreground.pressed", FG);
TLookKey<Fill> BG_HOVERED = new TLookKey<>("button.background.hovered", BG);
TLookKey<Fill> FG_HOVERED = new TLookKey<>("button.foreground.hovered", FG);
TLookKey<TFont> FONT = new TLookKey<>("button.font", new TFont("Lato", 10);
}
TButton.Ui button = new TButton.Ui("Click");
button.getLook().set(Button.FG, new Fill("red"));
TPanel.FlowLayout flowLayout = new TPanel.FlowLayout(Direction.vertical, 10);
flowLayout.add(field);
flowLayout.getLook().set(Button.FONT, new TFont("Consolas", 12));
public interface THasLook {
TLookSet getLook();
<C extends TComponent> C setLook(TLookSet lookSet);
}
Mouse Events
/**

* Handler interface for {@link MouseDownEvent} events.

*/
public interface MouseDownHandler extends EventHandler {

/**

* Called when MouseDown is fired.

* @param event the {@link MouseDownEvent} that was fired

*/

void onMouseDown(MouseDownEvent event);

}
TButton.Ui button = new TButton.Ui("Click");
button.onMouseDown(new AMouseDownEvent.Handler() {

@Override

public void process(AMouseDownEvent event) {

//TODO: actions

}

});
public final <C extends TComponent> C onMouseDown(new AMouseDownEvent.Handler());
public final <C extends TComponent> C onMouseUp(new AMouseUpEvent.Handler());
public final <C extends TComponent> C onMouseMove(new AMouseMoveEvent.Handler());
public final <C extends TComponent> C onMouseWheel(new AMouseWheelEvent.Handler());
public final <C extends TComponent> C onMouseDoubleClick(new AMouseDoubleClickEvent.Handler());
Canvas Based Widgets
▪ Core framework development
takes time
▪ Hard to create automated tests
▪ Everything is done manually
▪ Big Canvas can be slow
▪ Text rendering can cause problems
▪ Sometimes require special hacks
Questions?

Mais conteúdo relacionado

Semelhante a UI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh

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
 
Reactive UI in android - Gil Goldzweig Goldbaum, 10bis
Reactive UI in android - Gil Goldzweig Goldbaum, 10bisReactive UI in android - Gil Goldzweig Goldbaum, 10bis
Reactive UI in android - Gil Goldzweig Goldbaum, 10bisDroidConTLV
 
mobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkelingmobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkelingDevnology
 
Extracting ui Design - part 6 - transcript.pdf
Extracting ui Design - part 6 - transcript.pdfExtracting ui Design - part 6 - transcript.pdf
Extracting ui Design - part 6 - transcript.pdfShaiAlmog1
 
MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentanistar sung
 
The Ring programming language version 1.4.1 book - Part 12 of 31
The Ring programming language version 1.4.1 book - Part 12 of 31The Ring programming language version 1.4.1 book - Part 12 of 31
The Ring programming language version 1.4.1 book - Part 12 of 31Mahmoud Samir Fayed
 
Writing videogames with titanium appcelerator
Writing videogames with titanium appceleratorWriting videogames with titanium appcelerator
Writing videogames with titanium appceleratorAlessio Ricco
 
The Ring programming language version 1.4 book - Part 12 of 30
The Ring programming language version 1.4 book - Part 12 of 30The Ring programming language version 1.4 book - Part 12 of 30
The Ring programming language version 1.4 book - Part 12 of 30Mahmoud Samir Fayed
 
Paris js extensions
Paris js extensionsParis js extensions
Paris js extensionserwanl
 
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
 
The Ring programming language version 1.8 book - Part 19 of 202
The Ring programming language version 1.8 book - Part 19 of 202The Ring programming language version 1.8 book - Part 19 of 202
The Ring programming language version 1.8 book - Part 19 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 15 of 184
The Ring programming language version 1.5.3 book - Part 15 of 184The Ring programming language version 1.5.3 book - Part 15 of 184
The Ring programming language version 1.5.3 book - Part 15 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 48 of 202
The Ring programming language version 1.8 book - Part 48 of 202The Ring programming language version 1.8 book - Part 48 of 202
The Ring programming language version 1.8 book - Part 48 of 202Mahmoud Samir Fayed
 
wcmc_practicals
wcmc_practicalswcmc_practicals
wcmc_practicalsMannMehta7
 
Роман Иовлев «Open Source UI Automation Tests on C#»
Роман Иовлев «Open Source UI Automation Tests on C#»Роман Иовлев «Open Source UI Automation Tests on C#»
Роман Иовлев «Open Source UI Automation Tests on C#»SpbDotNet Community
 

Semelhante a UI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh (20)

Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
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
 
Reactive UI in android - Gil Goldzweig Goldbaum, 10bis
Reactive UI in android - Gil Goldzweig Goldbaum, 10bisReactive UI in android - Gil Goldzweig Goldbaum, 10bis
Reactive UI in android - Gil Goldzweig Goldbaum, 10bis
 
mobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkelingmobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkeling
 
Extracting ui Design - part 6 - transcript.pdf
Extracting ui Design - part 6 - transcript.pdfExtracting ui Design - part 6 - transcript.pdf
Extracting ui Design - part 6 - transcript.pdf
 
mobl
moblmobl
mobl
 
MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app development
 
Day 5
Day 5Day 5
Day 5
 
The Ring programming language version 1.4.1 book - Part 12 of 31
The Ring programming language version 1.4.1 book - Part 12 of 31The Ring programming language version 1.4.1 book - Part 12 of 31
The Ring programming language version 1.4.1 book - Part 12 of 31
 
Appcelerator titanium
Appcelerator titaniumAppcelerator titanium
Appcelerator titanium
 
Writing videogames with titanium appcelerator
Writing videogames with titanium appceleratorWriting videogames with titanium appcelerator
Writing videogames with titanium appcelerator
 
The Ring programming language version 1.4 book - Part 12 of 30
The Ring programming language version 1.4 book - Part 12 of 30The Ring programming language version 1.4 book - Part 12 of 30
The Ring programming language version 1.4 book - Part 12 of 30
 
Paris js extensions
Paris js extensionsParis js extensions
Paris js extensions
 
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
 
The Ring programming language version 1.8 book - Part 19 of 202
The Ring programming language version 1.8 book - Part 19 of 202The Ring programming language version 1.8 book - Part 19 of 202
The Ring programming language version 1.8 book - Part 19 of 202
 
Qt Workshop
Qt WorkshopQt Workshop
Qt Workshop
 
The Ring programming language version 1.5.3 book - Part 15 of 184
The Ring programming language version 1.5.3 book - Part 15 of 184The Ring programming language version 1.5.3 book - Part 15 of 184
The Ring programming language version 1.5.3 book - Part 15 of 184
 
The Ring programming language version 1.8 book - Part 48 of 202
The Ring programming language version 1.8 book - Part 48 of 202The Ring programming language version 1.8 book - Part 48 of 202
The Ring programming language version 1.8 book - Part 48 of 202
 
wcmc_practicals
wcmc_practicalswcmc_practicals
wcmc_practicals
 
Роман Иовлев «Open Source UI Automation Tests on C#»
Роман Иовлев «Open Source UI Automation Tests on C#»Роман Иовлев «Open Source UI Automation Tests on C#»
Роман Иовлев «Open Source UI Automation Tests on C#»
 

Mais de GWTcon

"Jclays, A global solution for application design and automatic GWT code gene...
"Jclays, A global solution for application design and automatic GWT code gene..."Jclays, A global solution for application design and automatic GWT code gene...
"Jclays, A global solution for application design and automatic GWT code gene...GWTcon
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James NelsonGWTcon
 
In defense of GWT-RPC By Colin Alworth
In defense of GWT-RPC By Colin AlworthIn defense of GWT-RPC By Colin Alworth
In defense of GWT-RPC By Colin AlworthGWTcon
 
DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
DIY: Split GWT Applications using TURDUCKEN approach By Alberto ManciniDIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
DIY: Split GWT Applications using TURDUCKEN approach By Alberto ManciniGWTcon
 
Unirex Lean tools By Dario Carotenuto
Unirex Lean tools By Dario CarotenutoUnirex Lean tools By Dario Carotenuto
Unirex Lean tools By Dario CarotenutoGWTcon
 
The future of GWT 2.x - By Colin Alworth
The future of GWT 2.x - By Colin AlworthThe future of GWT 2.x - By Colin Alworth
The future of GWT 2.x - By Colin AlworthGWTcon
 
Web components with java by Haijian Wang
Web components with java by Haijian WangWeb components with java by Haijian Wang
Web components with java by Haijian WangGWTcon
 
Best Practices - By Lofi Dewanto
Best Practices - By Lofi DewantoBest Practices - By Lofi Dewanto
Best Practices - By Lofi DewantoGWTcon
 
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald Pehl"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald PehlGWTcon
 
GWT Development for Handheld Devices
GWT Development for Handheld DevicesGWT Development for Handheld Devices
GWT Development for Handheld DevicesGWTcon
 
GWT vs CSS3
GWT vs CSS3GWT vs CSS3
GWT vs CSS3GWTcon
 
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...GWTcon
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serializationGWTcon
 
GWTcon 2014 - Apertura
GWTcon 2014 - AperturaGWTcon 2014 - Apertura
GWTcon 2014 - AperturaGWTcon
 
GWT videocall: power-up your mobile & web app with WebRTC
GWT videocall:  power-up your mobile & web app with WebRTCGWT videocall:  power-up your mobile & web app with WebRTC
GWT videocall: power-up your mobile & web app with WebRTCGWTcon
 

Mais de GWTcon (15)

"Jclays, A global solution for application design and automatic GWT code gene...
"Jclays, A global solution for application design and automatic GWT code gene..."Jclays, A global solution for application design and automatic GWT code gene...
"Jclays, A global solution for application design and automatic GWT code gene...
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson
 
In defense of GWT-RPC By Colin Alworth
In defense of GWT-RPC By Colin AlworthIn defense of GWT-RPC By Colin Alworth
In defense of GWT-RPC By Colin Alworth
 
DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
DIY: Split GWT Applications using TURDUCKEN approach By Alberto ManciniDIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
 
Unirex Lean tools By Dario Carotenuto
Unirex Lean tools By Dario CarotenutoUnirex Lean tools By Dario Carotenuto
Unirex Lean tools By Dario Carotenuto
 
The future of GWT 2.x - By Colin Alworth
The future of GWT 2.x - By Colin AlworthThe future of GWT 2.x - By Colin Alworth
The future of GWT 2.x - By Colin Alworth
 
Web components with java by Haijian Wang
Web components with java by Haijian WangWeb components with java by Haijian Wang
Web components with java by Haijian Wang
 
Best Practices - By Lofi Dewanto
Best Practices - By Lofi DewantoBest Practices - By Lofi Dewanto
Best Practices - By Lofi Dewanto
 
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald Pehl"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
 
GWT Development for Handheld Devices
GWT Development for Handheld DevicesGWT Development for Handheld Devices
GWT Development for Handheld Devices
 
GWT vs CSS3
GWT vs CSS3GWT vs CSS3
GWT vs CSS3
 
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serialization
 
GWTcon 2014 - Apertura
GWTcon 2014 - AperturaGWTcon 2014 - Apertura
GWTcon 2014 - Apertura
 
GWT videocall: power-up your mobile & web app with WebRTC
GWT videocall:  power-up your mobile & web app with WebRTCGWT videocall:  power-up your mobile & web app with WebRTC
GWT videocall: power-up your mobile & web app with WebRTC
 

Último

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
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
 
#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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Último (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
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
 
#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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

UI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh

  • 1. Intro to Rich Web Applications
 and UI Frameworks Development
 (GWT + HTML Canvas) by Iaroslav Kobyliukh
  • 2. Who we are? Animatron Wave Universal animation maker for small businesses and agencies Incredibly easy to use online video maker for creating marketing and social videos in minutes Animatron Studio
  • 3. What we do? ▪ Tween based vector animation editor ▪ Rich vector tools ▪ Import (images, audio, video, SVG) ▪ Export (HTML5, GIF, Video, SVG+SMIL) ▪ Share (Facebook, Twitter, YouTube, Dropbox, etc.) ▪ Collaborative editing
  • 5. Rich Web Applications: Editors Wave Editor Studio Editor
  • 6. What is Rich Web Application? Rich Web application (or rich Internet application (RIA)) is a Web application designed to deliver the same features and functions normally associated with desktop applications.
  • 7. Creating GWT UI ▪ Create UI Binding Template ▪ Write UI Java code ▪ Hand it over to CSS + HTML guy ▪ The guy styles it ▪ Next day you get it (at best) ▪ Roundtrips to fix browser’s problems
  • 9. Canvas Based Widgets Are You F**ing Crazy???
  • 10. Canvas Based Widgets ▪ Write only Java code ▪ No CSS + HTML guy ▪ No roundtrips ▪ No browser inconsistencies
  • 11. Canvas Based Widgets ▪ This is NOT Swing ▪ Much simpler than Swing ▪ Much easier than Swing ▪ Exactly one look and feel ▪ Everything is pure Java code ▪ Many components on the one canvas
  • 12. Examples public class DemoPanel extends TPanel.BorderLayout { public DemoPanel() { super(20); TLabel.Ui title = new TLabel.Ui("Demo Panel"); title.setHAlignment(Alignment.H.center); TTextField.Ui.ForString field = new TTextField.Ui.ForString(""); TTextArea textArea = new TTextArea(""); textArea.setPlaceholder(“Type something”); TLink.Ui.BroserUrl link = new TLink.Ui.BrowserUrl("GWTCon17", "http://www.gwtcon.org"); TPanel.FlowLayout flowLayout = new TPanel.FlowLayout(Direction.vertical, 10); flowLayout.add(field); flowLayout.add(textArea); flowLayout.add(link); north(title); center(flowLayout); } }
  • 15. Painting Components TButton.Ui button = new TButton.Ui("Please click on me"); button.onMouseDown(new AMouseDownEvent.Handler() {
 @Override
 public void process(AMouseDownEvent event) {
 button.setText("Awesome!"); button.revalidate(); button.repaint(); 
 }
 }); protected void paintComponent(ACanvas canvas); public final void invalidate(); public final TComponent revalidate(); public final void repaint(); public class CustomComponent extends TComponent.Ui { @Override
 protected void paintComponent(ACanvas canvas) {
 Rectangle rectangle = new Rectangle(0, 0, 100, 50); Fill red = new Fill("red");
 canvas.fillRect(rectangle, red); } }
  • 16. Sizes & Dimensions TPanel.BorderLayout layout = new TPanel.BorderLayout(); layout.setMaximumSize(new Dimension(640, 480)); layout.setMinimumSize(new Dimension(32, 32)); public final Rectangle getBounds(); public final Rectangle getAbsoluteBounds(); public final Rectangle getContentBounds(); public final Dimension getPrefferedSize(); public <C extends TComponent> C setPrefferedSize(Dimension size); public <C extends TComponent> C setMaximumSize(Dimension size); public <C extends TComponent> C setMinimumSize(Dimension size); public class CustomComponent extends TComponent.Ui { @Override
 protected void paintComponent(ACanvas canvas) {
 Rectangle rectangle = getContentBounds(); Fill green = new Fill("green");
 canvas.fillRect(rectangle, green); } }
  • 17. Lists & Grids List<String> someList = Arrays.asList("one", "two", "three"); TList.Model.Simple<String> simpleModel = new TList.Model.Simple<>(someList); TList.Ui<String> uiList = new TList.Ui<>(simpleModel); uiList.getSelectionModel().setSelection("two"); String selectedItem = uiList.getSelectionModel().getSelected(); someList.add("four"); uiList.getModel().fireModelChanged(); List<CustomObject> someList = getCustomObjects(); TList.Model.Simple<CustomObject> simpleModel = new TList.Model.Simple<>(someList); TGrid.Ui<String> uiGrid = new TGrid.Ui<>(simpleModel); uiGrid.setColumns(2); uiGrid.setRenderer(new CustomRenderer()); class CustomRenderer extends TLabel.Ui implements TFlyweight.Renderer.Active<CustomObject> { @Override
 public void prepareToRender(CustomObject object, boolean selected) { setText(object.getName()); } }
  • 18. Viewports List<String> someList = Arrays.asList("one", "two", "three"); TList.Model.Simple<String> simpleModel = new TList.Model.Simple<>(someList); TList.Ui<String> uiList = new TList.Ui<>(simpleModel); TViewport.Ui viewport = new TViewport.Ui(uiList); viewport.setViewWidthTracksViewport(true); viewport.setViewHeightTracksViewport(true); TPanel.BorderLayout layout = new TPanel.BorderLayout(); layout.center(viewport); layout.setPreferredSize(new Dimension(640, 320));
  • 19. Styling interface Button extends TLook { TLookKey<Boolean> OPAQUE = new TLookKey<>("button.opaque", false); TLookKey<Fill> BG = new TLookKey<>("button.background", new Fill("#FFFFFF"); TLookKey<Fill> FG = new TLookKey<>("button.foreground", new Fill("#000000"); TLookKey<Fill> BG_PRESSED = new TLookKey<>("button.background.pressed", BG); TLookKey<Fill> FG_PRESSED = new TLookKey<>("button.foreground.pressed", FG); TLookKey<Fill> BG_HOVERED = new TLookKey<>("button.background.hovered", BG); TLookKey<Fill> FG_HOVERED = new TLookKey<>("button.foreground.hovered", FG); TLookKey<TFont> FONT = new TLookKey<>("button.font", new TFont("Lato", 10); } TButton.Ui button = new TButton.Ui("Click"); button.getLook().set(Button.FG, new Fill("red")); TPanel.FlowLayout flowLayout = new TPanel.FlowLayout(Direction.vertical, 10); flowLayout.add(field); flowLayout.getLook().set(Button.FONT, new TFont("Consolas", 12)); public interface THasLook { TLookSet getLook(); <C extends TComponent> C setLook(TLookSet lookSet); }
  • 20. Mouse Events /**
 * Handler interface for {@link MouseDownEvent} events.
 */ public interface MouseDownHandler extends EventHandler {
 /**
 * Called when MouseDown is fired.
 * @param event the {@link MouseDownEvent} that was fired
 */
 void onMouseDown(MouseDownEvent event);
 } TButton.Ui button = new TButton.Ui("Click"); button.onMouseDown(new AMouseDownEvent.Handler() {
 @Override
 public void process(AMouseDownEvent event) {
 //TODO: actions
 }
 }); public final <C extends TComponent> C onMouseDown(new AMouseDownEvent.Handler()); public final <C extends TComponent> C onMouseUp(new AMouseUpEvent.Handler()); public final <C extends TComponent> C onMouseMove(new AMouseMoveEvent.Handler()); public final <C extends TComponent> C onMouseWheel(new AMouseWheelEvent.Handler()); public final <C extends TComponent> C onMouseDoubleClick(new AMouseDoubleClickEvent.Handler());
  • 21. Canvas Based Widgets ▪ Core framework development takes time ▪ Hard to create automated tests ▪ Everything is done manually ▪ Big Canvas can be slow ▪ Text rendering can cause problems ▪ Sometimes require special hacks