项目:openjdk-jdk10
文件:DitherTest.java
@Override
protected void processEvent(AWTEvent evt) {
int id = evt.getID();
if (id != KeyEvent.KEY_TYPED) {
super.processEvent(evt);
return;
}
KeyEvent kevt = (KeyEvent) evt;
char c = kevt.getKeyChar();
// Digits,backspace,and delete are okay
// Note that the minus sign is not allowed (neither is decimal)
if (Character.isDigit(c) || (c == '\b') || (c == '\u007f')) {
super.processEvent(evt);
return;
}
Toolkit.getDefaultToolkit().beep();
kevt.consume();
}
项目:incubator-netbeans
文件:HintsUI.java
public void eventdispatched(java.awt.AWTEvent aWTEvent) {
if (aWTEvent instanceof MouseEvent) {
MouseEvent mv = (MouseEvent)aWTEvent;
if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
//#118828
if (! (aWTEvent.getSource() instanceof Component)) {
removePopup();
return;
}
Component comp = (Component)aWTEvent.getSource();
Container par1 = SwingUtilities.getAncestorNamed(POPUP_NAME,comp); //NOI18N
Container par2 = SwingUtilities.getAncestorNamed(SUB_POPUP_NAME,comp); //NOI18N
// Container barpar = SwingUtilities.getAncestorOfClass(PopupUtil.class,comp);
// if (par == null && barpar == null) {
if ( par1 == null && par2 == null ) {
removePopup();
}
}
}
}
/**
* dispatches {@code AWTEvent} to component passed in constructor. If
* {@code (getdispatchingModel & JemmyProperties.QUEUE_MODEL_MASK) == 0}
* dispatched event directly,otherwise uses
* {@code javax.swing.SwingUtilities.invokeAndWait(Runnable)}<BR>
*
* @param event AWTEvent instance to be dispatched.
* @throws ComponentIsNotVisibleException
* @throws ComponentIsNotFocusedException
*/
public void dispatchEvent(final AWTEvent event) {
// run in dispatch thread
String eventToString = queuetool.invokeSmoothly(
new Queuetool.QueueAction<String>("event.toString()") {
@Override
public String launch() {
return event.toString();
}
}
);
output.printLine("dispatch event " + eventToString);
output.printGolden("dispatch event " + event.getClass().toString());
dispatcher<Void> disp = new dispatcher<>(event);
queuetool.invokeAndWait(disp);
}
项目:openjdk-jdk10
文件:EventTool.java
private AWTEvent waitEvent(long eventMask,long waitTime,TestOut waiterOutput) {
EventWaiter waiter = new EventWaiter(eventMask);
waiter.setTimeouts(timeouts.cloneThis());
waiter.setoutput(waiterOutput);
waiter.getTimeouts().
setTimeout("Waiter.WaitingTime",waitTime);
waiter.getTimeouts().
setTimeout("Waiter.timedelta",timeouts.getTimeout("EventTool.EventCheckingDelta"));
try {
return waiter.waitaction(null);
} catch (InterruptedException e) {
output.printstacktrace(e);
return null;
}
}
项目:incubator-netbeans
文件:StatusLineComponent.java
public @Override void eventdispatched(java.awt.AWTEvent aWTEvent) {
if (aWTEvent instanceof MouseEvent) {
MouseEvent mv = (MouseEvent)aWTEvent;
if (mv.getClickCount() > 0) {
//#118828
if (! (aWTEvent.getSource() instanceof Component)) {
return;
}
Component comp = (Component)aWTEvent.getSource();
Container par = SwingUtilities.getAncestorNamed("progresspopup",comp); //NOI18N
Container barpar = SwingUtilities.getAncestorOfClass(StatusLineComponent.class,comp);
if (par == null && barpar == null) {
hidePopup();
}
}
}
}
public void show(Point location) {
Rectangle screenBounds = null;
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gds = ge.getScreenDevices();
for (GraphicsDevice device : gds) {
GraphicsConfiguration gc = device.getDefaultConfiguration();
screenBounds = gc.getBounds();
if (screenBounds.contains(location)) {
break;
}
}
// showing the popup tooltip
cp = new TooltipContentPanel(master.getTextComponent());
Window w = SwingUtilities.windowForComponent(master.getTextComponent());
contentwindow = new JWindow(w);
contentwindow.add(cp);
contentwindow.pack();
Dimension dim = contentwindow.getSize();
if (location.y + dim.height + SCREEN_BORDER > screenBounds.y + screenBounds.height) {
dim.height = (screenBounds.y + screenBounds.height) - (location.y + SCREEN_BORDER);
}
if (location.x + dim.width + SCREEN_BORDER > screenBounds.x + screenBounds.width) {
dim.width = (screenBounds.x + screenBounds.width) - (location.x + SCREEN_BORDER);
}
contentwindow.setSize(dim);
contentwindow.setLocation(location.x,location.y - 1); // slight visual adjustment
contentwindow.setVisible(true);
Toolkit.getDefaultToolkit().addAWTEventListener(this,AWTEvent.MOUSE_EVENT_MASK | AWTEvent.KEY_EVENT_MASK);
w.addWindowFocusListener(this);
contentwindow.addWindowFocusListener(this);
}
@Override
protected void processEvent(AWTEvent evt) {
int id = evt.getID();
if (id != KeyEvent.KEY_TYPED) {
super.processEvent(evt);
return;
}
KeyEvent kevt = (KeyEvent) evt;
char c = kevt.getKeyChar();
// Digits,and delete are okay
// Note that the minus sign is not allowed (neither is decimal)
if (Character.isDigit(c) || (c == '\b') || (c == '\u007f')) {
super.processEvent(evt);
return;
}
Toolkit.getDefaultToolkit().beep();
kevt.consume();
}
项目:incubator-netbeans
文件:ButtonPopupSwitcher.java
private void doSelect(JComponent owner) {
invokingComponent = owner;
invokingComponent.addMouseListener(this);
invokingComponent.addMouseMotionListener(this);
pTable.addMouseListener(this);
pTable.addMouseMotionListener(this);
pTable.getSelectionModel().addListSelectionListener( this );
displayer.getModel().addComplexListDataListener( this );
Toolkit.getDefaultToolkit().addAWTEventListener(this,AWTEvent.KEY_EVENT_MASK);
popup = new jpopupmenu();
popup.setBorderPainted( false );
popup.setBorder( BorderFactory.createEmptyBorder() );
popup.add( pTable );
popup.pack();
int locationX = x - (int) pTable.getPreferredSize().getWidth();
int locationY = y + 1;
popup.setLocation( locationX,locationY );
popup.setInvoker( invokingComponent );
popup.addPopupMenuListener( this );
popup.setVisible( true );
shown = true;
invocationTime = System.currentTimeMillis();
}
项目:incubator-netbeans
文件:PopupUtil.java
public void eventdispatched(java.awt.AWTEvent aWTEvent) {
if (aWTEvent instanceof MouseEvent) {
MouseEvent mv = (MouseEvent)aWTEvent;
if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
//#118828
if (! (aWTEvent.getSource() instanceof Component)) {
hidePopup();
return;
}
Component comp = (Component)aWTEvent.getSource();
Container par = SwingUtilities.getAncestorNamed(POPUP_NAME,comp);
// if (par == null && barpar == null) {
if ( par == null ) {
hidePopup();
}
}
}
}
项目:incubator-netbeans
文件:ButtonPopupSwitcher.java
@Override
public void eventdispatched(AWTEvent event) {
if (event.getSource() == this) {
return;
}
if (event instanceof KeyEvent) {
if (event.getID() == KeyEvent.KEY_pressed) {
if( !changeSelection( (KeyEvent)event ) ) {
Toolkit.getDefaultToolkit().removeAWTEventListener(this);
hideCurrentPopup();
} else {
((KeyEvent)event).consume();
}
}
}
}
项目:jdk8u-jdk
文件:SwingUtilities3.java
@SuppressWarnings("unchecked")
public EventQueueDelegateFromMap(Map<String,Map<String,Object>> objectMap) {
Map<String,Object> methodMap = objectMap.get("afterdispatch");
afterdispatchEventArgument = (AWTEvent[]) methodMap.get("event");
afterdispatchHandleArgument = (Object[]) methodMap.get("handle");
afterdispatchCallable = (Callable<Void>) methodMap.get("method");
methodMap = objectMap.get("beforedispatch");
beforedispatchEventArgument = (AWTEvent[]) methodMap.get("event");
beforedispatchCallable = (Callable<Object>) methodMap.get("method");
methodMap = objectMap.get("getNextEvent");
getNextEventEventQueueArgument =
(EventQueue[]) methodMap.get("eventQueue");
getNextEventCallable = (Callable<AWTEvent>) methodMap.get("method");
}
项目:incubator-netbeans
文件:ProfilerTableHover.java
public void eventdispatched(AWTEvent e) {
if (popup == null) return;
// Not a mouse event
if (!(e instanceof MouseEvent)) return;
MouseEvent me = (MouseEvent)e;
// Event not relevant
if (isIgnoreEvent(me)) return;
// Mouse moved over popup
if (me.getID() == MouseEvent.MOUSE_MOVED && overPopup(me)) return;
if (!overPopup(me)) {
// Mouse event outside of popup
hidePopup();
} else if (isForwardEvent(me)) {
// Mouse event on popup,to be forwarded to table
Point popupPoint = popupLocation;
hidePopup();
forwardEvent(me,popupPoint);
}
}
项目:incubator-netbeans
文件:KeyboardPopupSwitcher.java
/**
* Creates and shows the popup with given <code>items</code>. When user
* selects an item <code>SwitcherTableItem.Activatable.activate()</code> is
* called. So what exactly happens depends on the concrete
* <code>SwitcherTableItem.Activatable</code> implementation.
* Selection is made when user releases a <code>releaseKey</code> passed on
* as a parameter. If user releases the <code>releaseKey</code> before a
* specified time (<code>TIME_TO_SHOW</code>) expires the popup won't show
* at all and switch to the last used document will be performed
* immediately.
*
* A popup appears on <code>x</code>,<code>y</code> coordinates.
*/
public static void selectItem(SwitcherTableItem items[],int releaseKey,int triggerKey,boolean forward,boolean cancelOnFocusLost) {
// reject multiple invocations
if (invokerTimerRunning) {
return;
}
KeyboardPopupSwitcher.items = items;
KeyboardPopupSwitcher.releaseKey = releaseKey;
KeyboardPopupSwitcher.triggerKey = triggerKey;
KeyboardPopupSwitcher.cancelOnFocusLost = cancelOnFocusLost;
invokerTimer = new Timer(TIME_TO_SHOW,new PopupInvoker(forward));
invokerTimer.setRepeats(false);
invokerTimer.start();
invokerTimerRunning = true;
awtListener = new AWTListener();
Toolkit.getDefaultToolkit().addAWTEventListener(awtListener,AWTEvent.KEY_EVENT_MASK);
}
项目:incubator-netbeans
文件:ButtonPopupSwitcher.java
/**
* Popup should be closed under some circumstances. Namely when mouse is
* pressed or released outside of popup or when key is pressed during the
* time popup is visible.
*/
public void eventdispatched(AWTEvent event) {
if (event.getSource() == this) {
return;
}
if (event instanceof MouseEvent) {
if (event.getID() == MouseEvent.MOUSE_RELEASED) {
long time = System.currentTimeMillis();
// check if button was just slowly clicked
if (time - invocationTime > 500) {
if (!onSwitcherTable((MouseEvent) event)) {
// Don't take any chances
hideCurrentPopup();
}
}
} else if (event.getID() == MouseEvent.MOUSE_pressed) {
if (!onSwitcherTable((MouseEvent) event)) {
// Don't take any chances
if (event.getSource() != invokingComponent) {
// If it's the invoker,don't do anything - it will
// generate another call to invoke(),which will do the
// hiding - if we do it here,it will get shown again
// when the button processes the event
hideCurrentPopup();
}
}
}
} else if (event instanceof KeyEvent) {
if (event.getID() == KeyEvent.KEY_pressed) {
Toolkit.getDefaultToolkit().removeAWTEventListener(this);
hideCurrentPopup();
}
}
}
项目:rapidminer
文件:PanningManager.java
@Override
public void eventdispatched(AWTEvent e) {
if (e instanceof MouseEvent) {
MouseEvent me = (MouseEvent) e;
if (!SwingUtilities.isDescendingFrom(me.getComponent(),target)) {
return;
}
if (me.getID() == MouseEvent.MOUSE_RELEASED) {
// stop when mouse released
mouSEOnScreenPoint = null;
if (timer.isRunning()) {
timer.stop();
}
} else if (me.getID() == MouseEvent.MOUSE_DRAGGED && me.getComponent() == target) {
mouSEOnScreenPoint = me.getLocationOnScreen();
} else if (me.getID() == MouseEvent.MOUSE_pressed && me.getComponent() == target) {
mouSEOnScreenPoint = me.getLocationOnScreen();
timer.start();
}
}
}
@Override public void eventdispatched(AWTEvent event) {
if (ignoreMouseEvents) {
return;
}
Component root = SwingUtilities.getRoot((Component) event.getSource());
if (root instanceof IRecordingArtifact || root.getName().startsWith("###")) {
return;
}
if (!(event instanceof MouseEvent)) {
return;
}
MouseEvent mouseEvent = (MouseEvent) event;
mouseEvent.consume();
if (event.getID() == MouseEvent.MOUSE_pressed) {
dispoSEOverlay();
Component mouseComponent = SwingUtilities.getDeepestComponentAt(mouseEvent.getComponent(),mouseEvent.getX(),mouseEvent.getY());
if (mouseComponent == null) {
return;
}
mouseEvent = SwingUtilities.convertMouseEvent(mouseEvent.getComponent(),mouseEvent,mouseComponent);
setComponent(mouseComponent,mouseEvent.getPoint(),true);
return;
}
}
项目:jdk8u-jdk
文件:JFrame.java
/** Called by the constructors to init the <code>JFrame</code> properly. */
protected void frameInit() {
enableEvents(AWTEvent.KEY_EVENT_MASK | AWTEvent.WINDOW_EVENT_MASK);
setLocale( JComponent.getDefaultLocale() );
setRootPane(createRootPane());
setBackground(UIManager.getColor("control"));
setRootPaneCheckingEnabled(true);
if (JFrame.isDefaultLookAndFeelDecorated()) {
boolean supportsWindowdecorations =
UIManager.getLookAndFeel().getSupportsWindowdecorations();
if (supportsWindowdecorations) {
setUndecorated(true);
getRootPane().setwindowdecorationStyle(JRootPane.FRAME);
}
}
sun.awt.SunToolkit.checkAndSetPolicy(this);
}
项目:Neukoelln_SER316
文件:AppFrame.java
public AppFrame() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch (Exception e) {
new ExceptionDialog(e);
}
}
public AppFrame_AboutBox(Frame parent) {
super(parent);
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch(Exception e) {
e.printstacktrace();
}
setSize(400,500);
}
项目:VISNode
文件:MouseInterceptor.java
/**
* Returns the default implementation of the dispatcher
*
* @return MouseInterceptor
*/
public static MouseInterceptor get() {
if (instance == null) {
instance = new MouseInterceptor();
Toolkit.getDefaultToolkit().addAWTEventListener(instance,AWTEvent.MOUSE_EVENT_MASK);
Toolkit.getDefaultToolkit().addAWTEventListener(instance,AWTEvent.MOUSE_MOTION_EVENT_MASK);
Toolkit.getDefaultToolkit().addAWTEventListener(instance,AWTEvent.MOUSE_WHEEL_EVENT_MASK);
}
return instance;
}
项目:jdk8u-jdk
文件:X11InputMethod.java
/**
* Creates an input method event from the arguments given
* and posts it on the AWT event queue. For arguments,* see InputMethodEvent. Called by input method.
*
* @see java.awt.event.InputMethodEvent#InputMethodEvent
*/
private void postInputMethodEvent(int id,AttributedCharacterIterator text,int committedCharacterCount,TextHitInfo caret,TextHitInfo visiblePosition,long when) {
Component source = getClientComponent();
if (source != null) {
InputMethodEvent event = new InputMethodEvent(source,id,when,text,committedCharacterCount,caret,visiblePosition);
SunToolkit.postEvent(SunToolkit.targetToAppContext(source),(AWTEvent)event);
}
}
public void eventdispatched(AWTEvent event) {
if (event instanceof MouseEvent) {
MouseEvent me = (MouseEvent) event;
Component mecmp = me.getComponent();
if (!SwingUtilities.isDescendingFrom(mecmp,(Component) rootPaneContainer)) {
return;
}
if ((me.getID() == MouseEvent.MOUSE_EXITED) && (mecmp == rootPaneContainer)) {
highcmp = null;
point = null;
} else {
MouseEvent converted = SwingUtilities.convertMouseEvent(mecmp,me,this);
point = converted.getPoint();
Component parent = mecmp;
Rectangle rect = new Rectangle();
rect.width = mecmp.getWidth();
rect.height = mecmp.getHeight();
Rectangle parentBounds = new Rectangle();
while ((parent != null) && (parent != this.getRootPane()) && (parent != rootPaneContainer)) {
parent.getBounds(parentBounds);
rect.x += parentBounds.x;
rect.y += parentBounds.y;
parent = parent.getParent();
}
highcmp = rect;
}
repaint();
}
}
项目:jdk8u-jdk
文件:BasicPopupMenuUI.java
void grabWindow(MenuElement[] newPath) {
// A grab needs to be added
final Toolkit tk = Toolkit.getDefaultToolkit();
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<Object>() {
public Object run() {
tk.addAWTEventListener(MouseGrabber.this,AWTEvent.MOUSE_EVENT_MASK |
AWTEvent.MOUSE_MOTION_EVENT_MASK |
AWTEvent.MOUSE_WHEEL_EVENT_MASK |
AWTEvent.WINDOW_EVENT_MASK | sun.awt.SunToolkit.GRAB_EVENT_MASK);
return null;
}
}
);
Component invoker = newPath[0].getComponent();
if (invoker instanceof jpopupmenu) {
invoker = ((jpopupmenu)invoker).getInvoker();
}
grabbedWindow = invoker instanceof Window?
(Window)invoker :
SwingUtilities.getwindowAncestor(invoker);
if(grabbedWindow != null) {
if(tk instanceof sun.awt.SunToolkit) {
((sun.awt.SunToolkit)tk).grab(grabbedWindow);
} else {
grabbedWindow.addComponentListener(this);
grabbedWindow.addWindowListener(this);
}
}
}
项目:incubator-netbeans
文件:RemoteAWTService.java
static String startHierarchyListener() {
if (hierarchyListener == null) {
hierarchyListener = new RemoteAWTHierarchyListener();
try {
Toolkit.getDefaultToolkit().addAWTEventListener(hierarchyListener,AWTEvent.HIERARCHY_EVENT_MASK);
} catch (SecurityException se) {
hierarchyListener = null;
return "Toolkit.addAWTEventListener() threw "+se.toString();
}
}
return null;
}
public Call(String function,String state,boolean withCellInfo,AWTEvent event,String cellInfo) {
this.function = function;
this.state = state;
this.withCellInfo = withCellInfo;
this.event = event;
this.cellInfo = cellInfo;
}
项目:incubator-netbeans
文件:ExtTestCase.java
private static void dispatchEvent(EventQueue queue,AWTEvent evt) throws Exception {
if (queue == null) {
queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
}
Method m = EventQueue.class.getDeclaredMethod("dispatchEvent",new Class[] {AWTEvent.class});
m.setAccessible(true);
if (evt.getSource() instanceof JTextField) {
foo = System.currentTimeMillis();
}
m.invoke(queue,new Object[] {evt});
}
void grabWindow(MenuElement[] newPath) {
// A grab needs to be added
final Toolkit tk = Toolkit.getDefaultToolkit();
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<Object>() {
public Object run() {
tk.addAWTEventListener(MouseGrabber.this,AWTEvent.MOUSE_EVENT_MASK |
AWTEvent.MOUSE_MOTION_EVENT_MASK |
AWTEvent.MOUSE_WHEEL_EVENT_MASK |
AWTEvent.WINDOW_EVENT_MASK | sun.awt.SunToolkit.GRAB_EVENT_MASK);
return null;
}
}
);
Component invoker = newPath[0].getComponent();
if (invoker instanceof jpopupmenu) {
invoker = ((jpopupmenu)invoker).getInvoker();
}
grabbedWindow = invoker instanceof Window?
(Window)invoker :
SwingUtilities.getwindowAncestor(invoker);
if(grabbedWindow != null) {
if(tk instanceof sun.awt.SunToolkit) {
((sun.awt.SunToolkit)tk).grab(grabbedWindow);
} else {
grabbedWindow.addComponentListener(this);
grabbedWindow.addWindowListener(this);
}
}
}
项目:jdk8u-jdk
文件:JFileChooser.java
/**
* Performs common constructor initialization and setup.
*/
protected void setup(FileSystemView view) {
installShowFilesListener();
installHierarchyListener();
if(view == null) {
view = FileSystemView.getFileSystemView();
}
setFileSystemView(view);
updateUI();
if(isAcceptAllFileFilterUsed()) {
setFileFilter(getAcceptAllFileFilter());
}
enableEvents(AWTEvent.MOUSE_EVENT_MASK);
}
项目:powertext
文件:RTextAreaBase.java
/**
* Initializes this text area.
*/
protected void init() {
// Sets the UI. Note that setUI() is overridden in RTextArea to only
// update the popup menu; this method must be called to set the real
// UI. This is done because the look and feel of an RTextArea is
// independent of the installed Java look and feels.
setRTextAreaUI(createRTextAreaUI());
// So we get notified when the component is resized.
enableEvents(AWTEvent.COMPONENT_EVENT_MASK|AWTEvent.KEY_EVENT_MASK);
// Defaults for varIoUs properties.
setHighlightCurrentLine(true);
setCurrentLineHighlightColor(getDefaultCurrentLineHighlightColor());
setMarginLineEnabled(false);
setMarginLineColor(getDefaultMarginLineColor());
setMarginLinePosition(getDefaultMarginLinePosition());
setBackgroundobject(Color.WHITE);
setWrapStyleWord(true);// We only support wrapping at word boundaries.
setTabSize(5);
setForeground(Color.BLACK);
setTabsEmulated(false);
// Stuff needed by the caret listener below.
prevIoUsCaretY = currentCaretY = getInsets().top;
// Stuff to highlight the current line.
mouseListener = createMouseListener();
// Also acts as a focus listener so we can update our shared actions
// (cut,copy,etc. on the popup menu).
addFocusListener(mouseListener);
addCurrentLineHighlightListeners();
}
项目:openjdk-jdk10
文件:BasicLookAndFeel.java
public Object run() {
Toolkit tk = Toolkit.getDefaultToolkit();
if(invocator == null) {
tk.addAWTEventListener(this,AWTEvent.MOUSE_EVENT_MASK);
} else {
tk.removeAWTEventListener(invocator);
}
// Return value not used.
return null;
}
项目:openjdk-jdk10
文件:CompositionArea.java
CompositionArea() {
// create composition window with localized title
String windowTitle = Toolkit.getProperty("AWT.CompositionWindowTitle","Input Window");
compositionWindow =
(JFrame)InputMethodContext.createInputMethodWindow(windowTitle,null,true);
setopaque(true);
setBorder(LineBorder.createGrayLineBorder());
setForeground(Color.black);
setBackground(Color.white);
// if we get the focus,we still want to let the client's
// input context handle the event
enableInputMethods(true);
enableEvents(AWTEvent.KEY_EVENT_MASK);
compositionWindow.getContentPane().add(this);
compositionWindow.addWindowListener(new FrameWindowAdapter());
addInputMethodListener(this);
compositionWindow.enableInputMethods(false);
compositionWindow.pack();
Dimension windowSize = compositionWindow.getSize();
Dimension screenSize = (getToolkit()).getScreenSize();
compositionWindow.setLocation(screenSize.width - windowSize.width-20,screenSize.height - windowSize.height-100);
compositionWindow.setVisible(false);
}
项目:incubator-netbeans
文件:TimableEventQueue.java
项目:jdk8u-jdk
文件:SunDragSourceContextPeer.java
/**
* Filters out all mouse events that were on the java event queue when
* startDrag was called.
*/
public static boolean checkEvent(AWTEvent event) {
if (discardingMouseEvents && event instanceof MouseEvent) {
MouseEvent mouseEvent = (MouseEvent)event;
if (!(mouseEvent instanceof SunDropTargetEvent)) {
return false;
}
}
return true;
}
项目:incubator-netbeans
文件:TopComponentDragSupport.java
/**
* Performs common constructor initialization and setup.
*/
protected void setup(FileSystemView view) {
installShowFilesListener();
installHierarchyListener();
if(view == null) {
view = FileSystemView.getFileSystemView();
}
setFileSystemView(view);
updateUI();
if(isAcceptAllFileFilterUsed()) {
setFileFilter(getAcceptAllFileFilter());
}
enableEvents(AWTEvent.MOUSE_EVENT_MASK);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。