Package java.awt

Examples of java.awt.Component.dispatchEvent()


            // target 上でのマウスイベントに変換
            MouseEvent event = SwingUtilities.convertMouseEvent((JPanel)e.getSource(), e, target);
            // 実際の位置に変換
            event.translatePoint(head.x - viewPos.x, head.y - viewPos.y);
            // target に対して event 発行
            target.dispatchEvent(event);
            // viewPosition がずれることがあるので補正
            SwingUtilities.invokeLater(new Runnable(){
                @Override
                public void run() {
                    //viewport.setViewPosition(viewPos);
View Full Code Here


            }

            if (target != null) {
                MouseEvent e1 = SwingUtilities.convertMouseEvent(
                        frame.getGlassPane(), e, target);
                target.dispatchEvent(e1);
            }
        }

        private void createAndDispatchMouseEvent(final Component target,
                                                 final int id,
View Full Code Here

            }

            if (target != null) {
                MouseEvent e1 = SwingUtilities.convertMouseEvent(
                        frame.getGlassPane(), e, target);
                target.dispatchEvent(e1);
            }
        }

        private void createAndDispatchMouseEvent(final Component target,
                                                 final int id,
View Full Code Here

            ((ActiveEvent)event).dispatch();
        } else {
            Object source = event.getSource();
            if (source instanceof Component) {
                Component comp = (Component)source;
                comp.dispatchEvent(event);
            } else if (source instanceof MenuComponent) {
                ((MenuComponent)source).dispatchEvent(event);
            }
        }
    }
View Full Code Here

            ((ActiveEvent)event).dispatch();
        } else {
            Object source = event.getSource();
            if (source instanceof Component) {
                Component comp = (Component)source;
                comp.dispatchEvent(event);
            } else if (source instanceof MenuComponent) {
                ((MenuComponent)source).dispatchEvent(event);
            }
        }
    }
View Full Code Here

        if (source != null) {
            InputMethodEvent event = new InputMethodEvent(source,
                    id, text, committedCharacterCount, caret, visiblePosition);

            if (haveActiveClient() && !useBelowTheSpotInput()) {
                source.dispatchEvent(event);
            } else {
                getCompositionAreaHandler(true).processInputMethodEvent(event);
            }
        }
    }
View Full Code Here

     
      if ( component != null ) {
        //Forward events over the check box.
        Point componentPoint = SwingUtilities.convertPoint( glassPane, glassPanePoint, component );
       
        component.dispatchEvent(new MouseEvent(component,
          e.getID(),
          e.getWhen(),
          e.getModifiers(),
          componentPoint.x,
          componentPoint.y,
View Full Code Here

    {
      final Component c = getWindow();
      if( c instanceof Window ) {
//        dispatchEvent( new AbstractWindow.Event( Frame.this,
//                                             AbstractWindow.Event.WINDOW_CLOSING )
        c.dispatchEvent( new WindowEvent( (Window) c, WindowEvent.WINDOW_CLOSING ));
      } else if( c instanceof JInternalFrame ) {
        c.dispatchEvent( new InternalFrameEvent( (JInternalFrame) c, InternalFrameEvent.INTERNAL_FRAME_CLOSING ));
//        ((JInternalFrame) c).dispatchEvent( e )
      } else {
        assert false : c.getClass();
View Full Code Here

      if( c instanceof Window ) {
//        dispatchEvent( new AbstractWindow.Event( Frame.this,
//                                             AbstractWindow.Event.WINDOW_CLOSING )
        c.dispatchEvent( new WindowEvent( (Window) c, WindowEvent.WINDOW_CLOSING ));
      } else if( c instanceof JInternalFrame ) {
        c.dispatchEvent( new InternalFrameEvent( (JInternalFrame) c, InternalFrameEvent.INTERNAL_FRAME_CLOSING ));
//        ((JInternalFrame) c).dispatchEvent( e )
      } else {
        assert false : c.getClass();
      }
    }
View Full Code Here

            menuBar, menuBarPoint.x, menuBarPoint.y);

        if (component != null) {
          Point componentPoint = SwingUtilities.convertPoint(
              glassPane, glassPanePoint, component);
          component.dispatchEvent(new MouseEvent(component,
              e.getID(), e.getWhen(), e.getModifiers(),
              componentPoint.x, componentPoint.y, e
                  .getClickCount(), e.isPopupTrigger()));
        }
        return;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.