From: Markus Koschany Date: Thu, 10 Dec 2020 17:38:45 +0100 Subject: Don't use functions from jtouchbar Forwarded: not-needed JTouchBar is only usable on some Macbooks and uses functions from the jtouchbar library which isn't packaged yet in Debian. We can ignore this code for now. --- app/src/processing/app/EditorToolbar.java | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/src/processing/app/EditorToolbar.java b/app/src/processing/app/EditorToolbar.java index a2a9b80..c0d25bc 100644 --- a/app/src/processing/app/EditorToolbar.java +++ b/app/src/processing/app/EditorToolbar.java @@ -27,9 +27,9 @@ import javax.imageio.ImageIO; import javax.swing.*; import javax.swing.event.MouseInputListener; -import com.thizzer.jtouchbar.JTouchBar; -import com.thizzer.jtouchbar.item.TouchBarItem; -import com.thizzer.jtouchbar.item.view.TouchBarButton; +//import com.thizzer.jtouchbar.JTouchBar; +//import com.thizzer.jtouchbar.item.TouchBarItem; +//import com.thizzer.jtouchbar.item.view.TouchBarButton; import cc.arduino.contributions.VersionComparator; import processing.app.helpers.OSUtils; @@ -106,13 +106,13 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key private final Color bgcolor; private static Image[][] buttonImages; - private static com.thizzer.jtouchbar.common.Image[][] touchBarImages; +// private static com.thizzer.jtouchbar.common.Image[][] touchBarImages; private int currentRollover; private JPopupMenu popup; private final JMenu menu; - private JTouchBar touchBar; - private TouchBarButton[] touchBarButtons; +// private JTouchBar touchBar; +// private TouchBarButton[] touchBarButtons; private int buttonCount; private int[] state = new int[BUTTON_COUNT]; @@ -153,11 +153,11 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key if (OSUtils.isMacOS() && VersionComparator.greaterThanOrEqual(OSUtils.version(), "10.12")) { editor.addWindowListener(new WindowAdapter() { public void windowActivated(WindowEvent e) { - if (touchBar == null) { +/* if (touchBar == null) { buildTouchBar(); touchBar.show(editor); - } + } */ } }); } @@ -167,7 +167,7 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this); } - private void buildTouchBar() { +/* private void buildTouchBar() { if (touchBarImages == null) { loadTouchBarImages(); } @@ -203,7 +203,7 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key touchBar.addItem(touchBarItem); } - } + } */ private void loadButtons() { Image allButtons = Theme.getThemeImage("buttons", this, @@ -229,7 +229,7 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key Image allButtonsRetina = Theme.getThemeImage("buttons", this, BUTTON_IMAGE_SIZE * BUTTON_COUNT * 2, BUTTON_IMAGE_SIZE * 3 * 2); - touchBarImages = new com.thizzer.jtouchbar.common.Image[BUTTON_COUNT][3]; +// touchBarImages = new com.thizzer.jtouchbar.common.Image[BUTTON_COUNT][3]; for (int i = 0; i < BUTTON_COUNT; i++) { for (int state = 0; state < 3; state++) { @@ -247,7 +247,7 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key try { ImageIO.write(image, "PNG", pngStream); - touchBarImages[i][state] = new com.thizzer.jtouchbar.common.Image(pngStream.toByteArray()); +// touchBarImages[i][state] = new com.thizzer.jtouchbar.common.Image(pngStream.toByteArray()); } catch (IOException e) { // ignore errors } @@ -403,14 +403,14 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key repaint(); } - if (touchBarButtons != null) { +/* if (touchBarButtons != null) { if (newState == INACTIVE) { // use ROLLOVER state when INACTIVE newState = ROLLOVER; } touchBarButtons[slot].setImage(touchBarImages[slot][newState]); - } + } */ }