/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Windows rendition of the component.
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is appropriate
* for short term storage or RMI between applications running the same
* version of Swing. A future release of Swing will provide support for
* long term persistence.
*
* @author Igor Kushnirskiy
*/
new StringUIClientPropertyKey("GUTTER_OFFSET_KEY");
return new WindowsPopupMenuUI();
}
public void installListeners() {
super.installListeners();
mnemonicListener == null) {
mnemonicListener = new MnemonicListener();
}
}
/**
* Returns the <code>Popup</code> that will be responsible for
* displaying the <code>JPopupMenu</code>.
*
* @param popupMenu JPopupMenu requesting Popup
* @param x Screen x location Popup is to be shown at
* @param y Screen y location Popup is to be shown at.
* @return Popup that will show the JPopupMenu
* @since 1.4
*/
}
if(!WindowsLookAndFeel.isMnemonicHidden()) {
// menu was canceled -- hide mnemonics
if (repaintRoot != null) {
}
}
} else {
}
}
}
/**
* Returns offset for the text.
* BasicMenuItemUI sets max text offset on the JPopupMenuUI.
* @param c PopupMenu to return text offset for.
* @return text offset for the component
*/
int rv = -1;
if (maxTextOffset instanceof Integer) {
/*
* this is in JMenuItem coordinates.
* Let's assume all the JMenuItem have the same offset along X.
*/
int menuItemOffset = 0;
}
rv += menuItemOffset;
}
return rv;
}
/**
* Returns span before gutter.
* used only on Vista.
* @return span before gutter
*/
static int getSpanBeforeGutter() {
return 3;
}
/**
* Returns span after gutter.
* used only on Vista.
* @return span after gutter
*/
static int getSpanAfterGutter() {
return 3;
}
/**
* Returns gutter width.
* used only on Vista.
* @return width of the gutter
*/
static int getGutterWidth() {
int rv = 2;
}
return rv;
}
/**
* Checks if PopupMenu is leftToRight
* The orientation is derived from the children of the component.
* It is leftToRight if all the children are leftToRight
*
* @param c component to return orientation for
* @return true if all the children are leftToRight
*/
boolean leftToRight = true;
}
return leftToRight;
}
if (WindowsMenuItemUI.isVistaPainting()) {
int textOffset = getTextOffset(c);
if (textOffset >= 0
/* paint gutter only for leftToRight case */
&& isLeftToRight(c)) {
int gutterWidth = getGutterWidth();
int gutterOffset =
} else {
}
}
} else {
super.paint(g, c);
}
}
}