This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
<class package="org.netbeans.api.visual.vmd" name="VMDColorScheme" link="yes"/>
<issue number="105929"/>
</change>
<change>
<api name="general"/>
<summary>Popup menu action could be invoked by Shift+F10 key</summary>
<version major="2" minor="6"/>
<date day="18" month="7" year="2007"/>
<author login="dkaspar"/>
<compatibility addition="yes"/>
<description>
Popup menu action (created by ActionFactory.createPopupMenuAction method) could be invoked by an user using Shift+F10 key.
</description>
<class package="org.netbeans.api.visual.action" name="ActionFactory" link="yes"/>
<issue number="108783"/>
</changes>
<htmlcontents>
Manifest-Version: 1.0
OpenIDE-Module: org.netbeans.api.visual
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/visual/resources/Bundle.properties
OpenIDE-Module-Specification-Version: 2.5
OpenIDE-Module-Specification-Version: 2.6
/**
* Creates a add-remove control point action with a default sensitivity. The action is assigned to a FreeConnectionWidget.
* @return the add-remove control point action
f * @return the add-remove control point action
*/
public static WidgetAction createAddRemoveControlPointAction () {
return createAddRemoveControlPointAction (3.0, 5.0);
* no popup menu will be displayed if this PopupMenuAction gets
* a valid popup trigger on the given Widget.
* @param widget the widget
* @param localLocation the local location where the popup menu was invoked
* @param localLocation the local location where the popup menu was invoked; if null, then popup menu is invoked by a keyboard
* @return The JPopupMenu to display for the given Widget.
* May be <code>null</code>.
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.InputEvent;
* @author William Headrick, David Kaspar
Scene scene = widget.getScene ();
Point point = scene.convertSceneToView (widget.convertLocalToScene (event.getPoint ()));
popupMenu.show (scene.getView (), point.x, point.y);
}
return State.CONSUMED;
return State.REJECTED;
public State keyPressed (Widget widget, WidgetKeyEvent event) {
if ((event.getModifiers () & InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK && event.getKeyCode () == KeyEvent.VK_F10) {
JPopupMenu popupMenu = provider.getPopupMenu (widget, null);
if (popupMenu != null) {
JComponent view = widget.getScene ().getView ();
if (view != null) {
Rectangle visibleRect = view.getVisibleRect ();
popupMenu.show (view, visibleRect.x + 10, visibleRect.y + 10);