From a7f04ce23898d3fe35b2fac7121b34432a9dfc78 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Mon, 20 Jan 2020 14:48:23 -0500 Subject: [PATCH] move this method near the other menu methods --- app/src/processing/app/ui/Toolkit.java | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/src/processing/app/ui/Toolkit.java b/app/src/processing/app/ui/Toolkit.java index fef72f712..f1cbf56dc 100644 --- a/app/src/processing/app/ui/Toolkit.java +++ b/app/src/processing/app/ui/Toolkit.java @@ -501,6 +501,18 @@ public class Toolkit { } + static public int getMenuItemIndex(JMenu menu, JMenuItem item) { + int index = 0; + for (Component comp : menu.getMenuComponents()) { + if (comp == item) { + return index; + } + index++; + } + return -1; + } + + // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @@ -1135,16 +1147,4 @@ public class Toolkit { //return new TextLayout("H", font, frc).getBounds().getHeight(); return new TextLayout("H", g.getFont(), frc).getBounds().getHeight(); } - - - static public int getMenuItemIndex(JMenu menu, JMenuItem item) { - int index = 0; - for (Component comp : menu.getMenuComponents()) { - if (comp == item) { - return index; - } - index++; - } - return -1; - } }