mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
move this method near the other menu methods
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user