From 52c0f6ec60465f106beb03554a35197e89fc9b61 Mon Sep 17 00:00:00 2001 From: Joe Wegner Date: Wed, 18 Sep 2019 09:47:54 -0400 Subject: [PATCH 1/3] Add a TitledBorder to panels in bord manager. This really helps the screen reader users. --- .../ContributedPlatformTableCellJPanel.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java index d59538823f7..e10ca46cc58 100644 --- a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java +++ b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java @@ -32,20 +32,11 @@ import static processing.app.I18n.format; import static processing.app.I18n.tr; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Insets; - -import javax.swing.Box; -import javax.swing.BoxLayout; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JTable; -import javax.swing.JTextPane; +import java.awt.*; + +import javax.swing.*; import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; import javax.swing.event.HyperlinkEvent; import javax.swing.text.Document; import javax.swing.text.html.HTMLDocument; @@ -196,6 +187,9 @@ void update(JTable parentTable, Object value, boolean isSelected, } ContributedPlatform selected = releases.getSelected(); + TitledBorder titledBorder = BorderFactory.createTitledBorder(selected.getName()); + titledBorder.setTitleFont(getFont().deriveFont(Font.BOLD)); + this.setBorder(titledBorder); ContributedPlatform installed = releases.getInstalled(); boolean removable, installable, upgradable; @@ -221,7 +215,7 @@ void update(JTable parentTable, Object value, boolean isSelected, removeButtonPlaceholder.setVisible(!removable); String desc = ""; - desc += "" + selected.getName() + ""; +// desc += "" + selected.getName() + ""; if (installed != null && installed.isBuiltIn()) { desc += " Built-In "; } From b9265a42b12004df150637e952b63a1362b85ff4 Mon Sep 17 00:00:00 2001 From: Joe Wegner Date: Fri, 27 Sep 2019 10:29:19 -0400 Subject: [PATCH 2/3] Add boarders to the teble items so screen readers will read while walking through the table --- .../ui/ContributedLibraryTableCellJPanel.java | 18 ++++++------------ .../ui/ContributedPlatformTableCellJPanel.java | 4 ++-- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java b/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java index 865de577630..1c8b2d78c7f 100644 --- a/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java +++ b/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java @@ -3,21 +3,12 @@ import static processing.app.I18n.format; import static processing.app.I18n.tr; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Insets; +import java.awt.*; import java.util.Optional; -import javax.swing.Box; -import javax.swing.BoxLayout; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JTable; -import javax.swing.JTextPane; +import javax.swing.*; import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; import javax.swing.event.HyperlinkEvent; import javax.swing.text.Document; import javax.swing.text.html.HTMLDocument; @@ -128,6 +119,9 @@ public ContributedLibraryTableCellJPanel(JTable parentTable, Object value, return; ContributedLibrary selected = releases.getSelected(); + TitledBorder titledBorder = BorderFactory.createTitledBorder(selected.getName()); + titledBorder.setTitleFont(getFont().deriveFont(Font.BOLD)); + setBorder(titledBorder); Optional mayInstalled = releases.getInstalled(); boolean installable, upgradable; diff --git a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java index e10ca46cc58..3136c5045d9 100644 --- a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java +++ b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java @@ -189,7 +189,7 @@ void update(JTable parentTable, Object value, boolean isSelected, ContributedPlatform selected = releases.getSelected(); TitledBorder titledBorder = BorderFactory.createTitledBorder(selected.getName()); titledBorder.setTitleFont(getFont().deriveFont(Font.BOLD)); - this.setBorder(titledBorder); + setBorder(titledBorder); ContributedPlatform installed = releases.getInstalled(); boolean removable, installable, upgradable; @@ -215,7 +215,7 @@ void update(JTable parentTable, Object value, boolean isSelected, removeButtonPlaceholder.setVisible(!removable); String desc = ""; -// desc += "" + selected.getName() + ""; + desc += "" + selected.getName() + ""; if (installed != null && installed.isBuiltIn()) { desc += " Built-In "; } From 227bae4f6d4e0045bafb27ab2e44b10170ed5683 Mon Sep 17 00:00:00 2001 From: Joe Wegner Date: Tue, 1 Oct 2019 08:06:41 -0400 Subject: [PATCH 3/3] Remove the board name from the cell, only in the title. --- .../libraries/ui/ContributedLibraryTableCellJPanel.java | 2 +- .../packages/ui/ContributedPlatformTableCellJPanel.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java b/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java index 1c8b2d78c7f..665b83a9574 100644 --- a/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java +++ b/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java @@ -156,7 +156,7 @@ public ContributedLibraryTableCellJPanel(JTable parentTable, Object value, String desc = ""; // Library name... - desc += format("{0}", name); +// desc += format("{0}", name); if (mayInstalled.isPresent() && mayInstalled.get().isIDEBuiltIn()) { desc += " Built-In "; } diff --git a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java index 3136c5045d9..6051ec98cd5 100644 --- a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java +++ b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java @@ -215,7 +215,7 @@ void update(JTable parentTable, Object value, boolean isSelected, removeButtonPlaceholder.setVisible(!removable); String desc = ""; - desc += "" + selected.getName() + ""; +// desc += "" + selected.getName() + ""; if (installed != null && installed.isBuiltIn()) { desc += " Built-In "; }