private @Nullable PropertyVetoException vetoFrom(@Nonnull UnexpectedException unexpected) {
   Throwable cause = unexpected.getCause();
   if (!(cause instanceof PropertyVetoException)) {
     return null;
   }
   return (PropertyVetoException) cause;
 }
示例#2
0
 void updateState(MouseEvent event) {
   if (isOld(event)) return;
   // childAt and locationOnScreenOf want the tree lock, so be careful not to use any additional
   // locks at the same time
   // to avoid deadlock.
   Point eventScreenLocation = null;
   // Determine the current mouse position in screen coordinates
   try {
     eventScreenLocation = locationOnScreenOf(event.getComponent());
   } catch (IllegalComponentStateException e) {
     // component might be hidden by the time we process this event
   } catch (UnexpectedException e) {
     if (!(e.getCause() instanceof IllegalComponentStateException)) throw e;
   }
   synchronized (this) {
     lastEventTime(event);
     dragDropInfo.update(event);
     mouseInfo.modifiers(modifiers);
     mouseInfo.update(event, eventScreenLocation);
     modifiers(mouseInfo.modifiers());
   }
 }