< prev index next >

src/java.desktop/macosx/classes/com/apple/laf/ScreenMenu.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 65,75 **** private volatile Rectangle[] fItemBounds; private ScreenMenuPropertyListener fPropertyListener; // Array of child hashes used to see if we need to recreate the Menu. ! private int childHashArray[]; ScreenMenu(final JMenu invoker) { super(invoker.getText()); fInvoker = invoker; --- 65,75 ---- private volatile Rectangle[] fItemBounds; private ScreenMenuPropertyListener fPropertyListener; // Array of child hashes used to see if we need to recreate the Menu. ! private int[] childHashArray; ScreenMenu(final JMenu invoker) { super(invoker.getText()); fInvoker = invoker;
*** 83,93 **** /** * Determine if we need to tear down the Menu and re-create it, since the contents may have changed in the Menu opened listener and * we do not get notified of it, because EDT is busy in our code. We only need to update if the menu contents have changed in some * way, such as the number of menu items, the text of the menuitems, icon, shortcut etc. */ ! private static boolean needsUpdate(final Component items[], final int childHashArray[]) { if (items == null || childHashArray == null) { return true; } if (childHashArray.length != items.length) { return true; --- 83,93 ---- /** * Determine if we need to tear down the Menu and re-create it, since the contents may have changed in the Menu opened listener and * we do not get notified of it, because EDT is busy in our code. We only need to update if the menu contents have changed in some * way, such as the number of menu items, the text of the menuitems, icon, shortcut etc. */ ! private static boolean needsUpdate(final Component[] items, final int[] childHashArray) { if (items == null || childHashArray == null) { return true; } if (childHashArray.length != items.length) { return true;
< prev index next >