Package java.awt

Examples of java.awt.Component.addKeyListener()


                  // Notify controller that active view changed
                  for (View view : focusableViews) {
                    if (view != null && SwingUtilities.isDescendingFrom(gainedFocusedComponent, (JComponent)view)) {
                      homePane.controller.focusedViewChanged(view);
 
                      gainedFocusedComponent.addKeyListener(homePane.specialKeysListener);
                     
                      // Update the component used by clipboard actions
                      homePane.lastFocusedComponent = (JComponent)gainedFocusedComponent;
                      break;
                    }
View Full Code Here


            };
            mini.addPropertyChangeListener(ColorPicker.SELECTED_COLOR_PROPERTY, p);
            mini.addPropertyChangeListener(ColorPicker.OPACITY_PROPERTY, p);
            for (int a = 0; a < mini.getComponentCount(); a++) {
                Component c = mini.getComponent(a);
                c.addKeyListener(commitListener);
            }
            add(mini);
        }

        public Component getFocusableComponent() {
View Full Code Here

  MouseManager14(Viewer viewer, ActionManager actionManager) {
    this.viewer = viewer;
    this.actionManager = actionManager;
    Component display = viewer.getDisplay();
    display.addKeyListener(this);
    display.addMouseListener(this);
    display.addMouseMotionListener(this);
    display.addMouseWheelListener(this);
  }
View Full Code Here

    public CoreComponent keypress(final int keyEvent, final KeyStroke handler) {
        for (int i = 0; i < size(); i++) {
            final Component component = get(i);
            if (component == null) continue;

            component.addKeyListener(new KeyListener() {

                @Override
                public void keyTyped(KeyEvent e) {
                      //
                }
View Full Code Here

      b.add(cancel);
      p.add(b);

      return p;
    }
    c.addKeyListener(this);
    return c;
  }

  public void keyPressed(KeyEvent arg0) {
    if (arg0.getKeyCode() == KeyEvent.VK_ESCAPE)
View Full Code Here

            b.add( cancel );
            p.add( b );

            return p;
        }
        c.addKeyListener( this );
        return c;
    }

    public void keyPressed(KeyEvent arg0) {
        if( arg0.getKeyCode() == KeyEvent.VK_ESCAPE )
View Full Code Here

      int width = colWidth[ col ] - colPadding;
      int y = rowHeight + ( rowHeight * row );
      int height = rowHeight;
      if ( ( row + 1 ) < model.getNumChildren() ) {
        Component c = (Component)Class.forName( components[ col ].toString().trim() ).newInstance();
        c.addKeyListener( this );
        c.setBounds( x, y, width, height );
        Container panel = owner.getComponentPanel();
        panel.add( c, 0 );
        currentComponent = c;
        XModel rowModel = ( XModel )model.get( row + 1 );
View Full Code Here

      int width = colWidth[ col ] - colPadding;
      int y = rowHeight + ( rowHeight * row );
      int height = rowHeight;
      if ( ( row + 1 ) < model.getNumChildren() ) {
        Component c = (Component)Class.forName( components[ col ].toString().trim() ).newInstance();
        c.addKeyListener( this );
        c.setBounds( x, y, width, height );
        Container panel = owner.getComponentPanel();
        panel.add( c, 0 );
        currentComponent = c;
        XModel rowModel = ( XModel )model.get( row + 1 );
View Full Code Here

    /** Assign ESCAPE/ENTER key for all focusable components recursively */
    private void assignGlobalKeyListener(Container comp) {
        Component[] comps = comp.getComponents();
        for (int i = 0; i < comps.length; i++) {
            Component item = comps[i];
            if (item.isFocusable()) item.addKeyListener(new KeyListener() {

                public void keyTyped(KeyEvent e) {
                }

                public void keyPressed(KeyEvent evt) {
View Full Code Here

    /** Assign ESCAPE/ENTER key for all focusable components recursively */
    private void assignGlobalKeyListener(Container comp) {
        Component[] comps = comp.getComponents();
        for (int i = 0; i < comps.length; i++) {
            Component item = comps[i];
            if (item.isFocusable()) item.addKeyListener(new KeyListener() {

                public void keyTyped(KeyEvent e) {
                }

                public void keyPressed(KeyEvent evt) {
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.