SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Downloaden Sie, um offline zu lesen
Scaling SWT on high-res screens 
Christian Campo, ECE 2014
Overview 
• High resolution Displays 
• „Windows“ based Scaling 
• Desktop Applications based Scaling 
› Layout (Size, Gap) 
› Icons 
› SVG 
• Use Eclipse Riena as an example
Growing Resolutions 
* taken from Wikipedia 3840 x 2160
Growing Displaysizes 
* taken from Commons Wikimedia
Example Displaysizes 
24 
1920 x 1080 
13 
2560 x 1600 
27 
2560 x 1440 
30 
2560 x 1600
Resolution vs Size
Riena Example 
1300 x 800
Riena Example 
24 
1920 x 1080 
30 
2560 x 1600 
13 
2560 x 1600
Resolution 
› 3840*2160
Scaling Up 
• Smartphones 
› Scaling Up is very common 
› Same UI on different resolution / sizes 
• „Windows“ 
› no automatic scaling 
› Ability for the user to define a scaling
Scaling Up in „Windows“ 
• „Make text and other items larger or smaller“ 
• Applied after Logoff and Login 
• Change of „Logical DPI“ not „Physical DPI“ 
• 100 % = 96 DPI
Eclipse IDE - Resolution 
› 3840*2160– Skalierung 100 %
Eclipse IDE - Resolution 
› 3840*2160 – Skalierung 150 % (Standard)
Eclipse IDE - Resolution 
› 3840*2160 – Skalierung 200 %
Scaling Up in „Windows“ 
• Doesnt work well with all applications 
• Problems 
› Widgets or text are not scaled 
› Blury Icons, Images 
› Icons are upscaled
VLC 
100 % 150 % 
• Buttons DONT scale 
• Text scales
GLIPS 
100 % 150 % 
- Menu blurry (Icon, Text)
Adobe Reader
Notepad 
500 % 
Too small 
Gap Menu
Control Panel -> Display 
500 %
The Goal 
• Change „DPI“ in „Windows“ 
• Application should adapt Scaling: 
› Windows size 
› Navigationpanel size (if exists) 
› Icon size, Toolbars, Menus 
› Fonts, Textfield length 
› Tree 
› Etc.
SWT 
› SWT Standard-Widgets 
› native Widgets of the Operation System 
› Fonts are scaled 
› Sizes (mostly) correct ?? 
› Images are partially scaled 
› OS Images are scaled 
(e.g. Button with Arrow) 
› Custom Images (gif, png) are NOT scaled 
(e.g. Tree Images) 
› SWT Standard-Layouts 
(i.e. GridLayout, FormLayout etc.) 
› Uses information from the SWT Widgets 
› Sizes are not scaled 
› i.e. widthHint, horizontalIndent
Eclipse 
100 % 150 % 
- Size Icon in Tree 
- Size Toolbar Icon
Eclipse 
100 % 500 % 
Windows 7 Windows 8.1 
- Tree icons 
- Toolbar icons
Eclipse 
500 %
SWT 
› Eclipse
Eclipse 
150 %
Eclipse 
150 %
SWT 
› JFace 
› Dialog 
› convertHorizontalDLUsToPixels(int dlus) 
› PixelConverter 
› Uses static methods 
from Dialog class
SWT 
› Eclipse Riena 
› Framework for Enterprise Client/Server Application 
› Based on OSGi, RCP, SWT 
› Enduser Driven Navigation Concept 
› Navigationtree 
› Widgets / Ridgets Abstraktion
Riena (before) 
Image Size 
Width Textfield 
Width Text 
150 %
Step 1 (Utility) 
• SwtUtilities 
› Point getDpi() 
› Display.getDpi() 
› getDpiFactors() 
› convertXToDpi(int) 
› … 
• Converts absolute 
to DPI scaled
SWT (Utility) 
• DPI factors 
100 % = 96 DPI = 1.0. 
125 % = 120 DPI = 1.25 
133 % = 128 DPI = 1.33 
150 % = 144 DPI = 1.5 
200 % = 192 DPI = 2.0 
300 % = 288 DPI = 3.0 
Note: DPI Factors could be different for X and Y but the Windows 
API underneath always delivers the same values for X and Y.
Step 2 (Layout) 
• GridLayout 
› DpiGridLayout 
› Copy of GridLayout* 
› Scales values internally 
- widthHint 
- horizontalIndent 
- marginWidth 
- … 
› GridData 
(internally converted to DpiGridData) 
› Swap GridLayout with DpiGridLayout in Riena 
Applications 
› DpiGridLayoutFactory 
Note: *GridLayout is final -> Eclipse Bug #443008
Step 2 (Layout - example) 
setLayoutData(GridData data) 
• On „parent.layout()“ the DpiGridlayout converts GridData 
into DpiGridData and stores it with setData(..., DpiGridData x)
Step 2 (Layout) 
› Layout 
› Other scalable Layouts 
› DpiTableColumnLayout 
› AbstractDpiColumnLayout 
extends AbstractColumnLayout 
› DpiTableLayout 
extends TableLayout 
› Not yet implemented scaling 
› RowLayout 
› FormLayout 
› FillLayout 
› …
Layout
Step3 (Icons and Images) 
› Images 
› „Scaling“ 
› One Image – several Scaling Levels 
Skalierung Größe Suffix 
100 % 16x16 px 00 
125 % 20x20 px 01 
133 % 21x21 px 02 
150 % 24x24 px 03 
› One PNG per Level
Step3 (Icons and Images) 
• ImageStore.getImage(„0022a“); 
• getDpiFactor() -> 1 -> suffix = „00“ 
• Search for „0022a00.png“ 
• Return SWT Image object 
Note: ImageStore is a class in Riena 
// always „png“ if no extension is given
Step3 (Images „extended“) 
Actual image names can be more complex in Riena 
0022a_p_00.png 
0022 = image name 
a = image size(a=16x16, b=22x22 etc.) 
_p_ = image state (_p_= „pressed“, _d_ = „disabled“ 
00 = dpi scale factor (00 = 100% etc) 
id = iconManager.getIconID(„0022“, IconSize.A16, IconState.PRESSED); 
image = ImageStore.getInstance().getImage(id); 
// implicit adds dpi scale factor „00“
Riena (after) 
150 %
Riena internal 
› Width and Height of Shell 
› Width of Navigationtree 
› Checkboxes in tables (not in column 1) 
› Statusbar 
› PopupList with UIProcess (Jobs) 
› InfoFlyout
Step 4: More Scaling 
• DPI Factors get larger and larger 
• Many different images for the various levels 
• Use vector graphics and scale at runtime ? 
• SVG ?
Step 4: More Scaling 
• Image as SVG 
› Vectorgraphics – stepless – limitless 
› Not directly supported by SWT 
› Using SVG Salamander 
› https://svgsalamander.java.net/ 
› SVG -> AWT Image 
› AWT Image -> SWT Image 
› converted SWT Images are cached
Step 4: More Scaling 
• Image as SVG 
› Can be used for 
› Image Sizes (a,b,c,d,e,f) 
› Image Scaling (00,01,02,03) 
› ONE Image per State 
id = iconManager.getIconID(„cloud“, IconSize.A16); 
image = ImageStore.getInstance().getImage(id);
Pitfalls 
› Getting the DPI factor 
› Only in UI Thread 
› Rounding problems when scaling 
› Round up / down 
› Distinguish scaled numbers from 
unscaled numbers 
› E.g. Layout 
› GridData.widthHint 
› DpiGridLayout
Roundup 
SWTUtilities 
Riena 
Scaling 
Layouts 
Icons 
DpiGridLayout Images 
Scaling Levels 
SVG 
DpiTableColumnLayout 
ImageFactory 
Thank you

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 

Kürzlich hochgeladen (20)

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 

Empfohlen

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Empfohlen (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Scaling SWT on high-resolution screens

  • 1. Scaling SWT on high-res screens Christian Campo, ECE 2014
  • 2. Overview • High resolution Displays • „Windows“ based Scaling • Desktop Applications based Scaling › Layout (Size, Gap) › Icons › SVG • Use Eclipse Riena as an example
  • 3. Growing Resolutions * taken from Wikipedia 3840 x 2160
  • 4. Growing Displaysizes * taken from Commons Wikimedia
  • 5. Example Displaysizes 24 1920 x 1080 13 2560 x 1600 27 2560 x 1440 30 2560 x 1600
  • 8. Riena Example 24 1920 x 1080 30 2560 x 1600 13 2560 x 1600
  • 10. Scaling Up • Smartphones › Scaling Up is very common › Same UI on different resolution / sizes • „Windows“ › no automatic scaling › Ability for the user to define a scaling
  • 11. Scaling Up in „Windows“ • „Make text and other items larger or smaller“ • Applied after Logoff and Login • Change of „Logical DPI“ not „Physical DPI“ • 100 % = 96 DPI
  • 12. Eclipse IDE - Resolution › 3840*2160– Skalierung 100 %
  • 13. Eclipse IDE - Resolution › 3840*2160 – Skalierung 150 % (Standard)
  • 14. Eclipse IDE - Resolution › 3840*2160 – Skalierung 200 %
  • 15. Scaling Up in „Windows“ • Doesnt work well with all applications • Problems › Widgets or text are not scaled › Blury Icons, Images › Icons are upscaled
  • 16. VLC 100 % 150 % • Buttons DONT scale • Text scales
  • 17. GLIPS 100 % 150 % - Menu blurry (Icon, Text)
  • 19. Notepad 500 % Too small Gap Menu
  • 20. Control Panel -> Display 500 %
  • 21. The Goal • Change „DPI“ in „Windows“ • Application should adapt Scaling: › Windows size › Navigationpanel size (if exists) › Icon size, Toolbars, Menus › Fonts, Textfield length › Tree › Etc.
  • 22. SWT › SWT Standard-Widgets › native Widgets of the Operation System › Fonts are scaled › Sizes (mostly) correct ?? › Images are partially scaled › OS Images are scaled (e.g. Button with Arrow) › Custom Images (gif, png) are NOT scaled (e.g. Tree Images) › SWT Standard-Layouts (i.e. GridLayout, FormLayout etc.) › Uses information from the SWT Widgets › Sizes are not scaled › i.e. widthHint, horizontalIndent
  • 23. Eclipse 100 % 150 % - Size Icon in Tree - Size Toolbar Icon
  • 24. Eclipse 100 % 500 % Windows 7 Windows 8.1 - Tree icons - Toolbar icons
  • 29. SWT › JFace › Dialog › convertHorizontalDLUsToPixels(int dlus) › PixelConverter › Uses static methods from Dialog class
  • 30. SWT › Eclipse Riena › Framework for Enterprise Client/Server Application › Based on OSGi, RCP, SWT › Enduser Driven Navigation Concept › Navigationtree › Widgets / Ridgets Abstraktion
  • 31. Riena (before) Image Size Width Textfield Width Text 150 %
  • 32. Step 1 (Utility) • SwtUtilities › Point getDpi() › Display.getDpi() › getDpiFactors() › convertXToDpi(int) › … • Converts absolute to DPI scaled
  • 33. SWT (Utility) • DPI factors 100 % = 96 DPI = 1.0. 125 % = 120 DPI = 1.25 133 % = 128 DPI = 1.33 150 % = 144 DPI = 1.5 200 % = 192 DPI = 2.0 300 % = 288 DPI = 3.0 Note: DPI Factors could be different for X and Y but the Windows API underneath always delivers the same values for X and Y.
  • 34. Step 2 (Layout) • GridLayout › DpiGridLayout › Copy of GridLayout* › Scales values internally - widthHint - horizontalIndent - marginWidth - … › GridData (internally converted to DpiGridData) › Swap GridLayout with DpiGridLayout in Riena Applications › DpiGridLayoutFactory Note: *GridLayout is final -> Eclipse Bug #443008
  • 35. Step 2 (Layout - example) setLayoutData(GridData data) • On „parent.layout()“ the DpiGridlayout converts GridData into DpiGridData and stores it with setData(..., DpiGridData x)
  • 36. Step 2 (Layout) › Layout › Other scalable Layouts › DpiTableColumnLayout › AbstractDpiColumnLayout extends AbstractColumnLayout › DpiTableLayout extends TableLayout › Not yet implemented scaling › RowLayout › FormLayout › FillLayout › …
  • 38. Step3 (Icons and Images) › Images › „Scaling“ › One Image – several Scaling Levels Skalierung Größe Suffix 100 % 16x16 px 00 125 % 20x20 px 01 133 % 21x21 px 02 150 % 24x24 px 03 › One PNG per Level
  • 39. Step3 (Icons and Images) • ImageStore.getImage(„0022a“); • getDpiFactor() -> 1 -> suffix = „00“ • Search for „0022a00.png“ • Return SWT Image object Note: ImageStore is a class in Riena // always „png“ if no extension is given
  • 40. Step3 (Images „extended“) Actual image names can be more complex in Riena 0022a_p_00.png 0022 = image name a = image size(a=16x16, b=22x22 etc.) _p_ = image state (_p_= „pressed“, _d_ = „disabled“ 00 = dpi scale factor (00 = 100% etc) id = iconManager.getIconID(„0022“, IconSize.A16, IconState.PRESSED); image = ImageStore.getInstance().getImage(id); // implicit adds dpi scale factor „00“
  • 42. Riena internal › Width and Height of Shell › Width of Navigationtree › Checkboxes in tables (not in column 1) › Statusbar › PopupList with UIProcess (Jobs) › InfoFlyout
  • 43. Step 4: More Scaling • DPI Factors get larger and larger • Many different images for the various levels • Use vector graphics and scale at runtime ? • SVG ?
  • 44. Step 4: More Scaling • Image as SVG › Vectorgraphics – stepless – limitless › Not directly supported by SWT › Using SVG Salamander › https://svgsalamander.java.net/ › SVG -> AWT Image › AWT Image -> SWT Image › converted SWT Images are cached
  • 45. Step 4: More Scaling • Image as SVG › Can be used for › Image Sizes (a,b,c,d,e,f) › Image Scaling (00,01,02,03) › ONE Image per State id = iconManager.getIconID(„cloud“, IconSize.A16); image = ImageStore.getInstance().getImage(id);
  • 46. Pitfalls › Getting the DPI factor › Only in UI Thread › Rounding problems when scaling › Round up / down › Distinguish scaled numbers from unscaled numbers › E.g. Layout › GridData.widthHint › DpiGridLayout
  • 47. Roundup SWTUtilities Riena Scaling Layouts Icons DpiGridLayout Images Scaling Levels SVG DpiTableColumnLayout ImageFactory Thank you