Package java.awt

Examples of java.awt.FocusTraversalPolicy


          public void propertyChange(final PropertyChangeEvent ev) {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                  Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
                  if (focusOwner != null && isChildComponentInvisible(splitPane, focusOwner)) {
                    FocusTraversalPolicy focusTraversalPolicy = getFocusTraversalPolicy();             
                    Component focusedComponent = focusTraversalPolicy.getComponentAfter(HomePane.this, focusOwner);
                    if (focusedComponent == null) {
                      focusedComponent = focusTraversalPolicy.getComponentBefore(HomePane.this, focusOwner);
                    }               
                    focusedComponent.requestFocusInWindow();             
                  }
                  controller.setVisualProperty(dividerLocationProperty, ev.getNewValue());
                }
View Full Code Here


        Container focusCycleRoot = getFocusCycleRootAncestor();
        if (focusCycleRoot == null) {
            return;
        }

        FocusTraversalPolicy newFocusTraversalPolicy =
            new BequestedFocusTraversalPolicy(focusCycleRoot.getFocusTraversalPolicy(),
                                              this,
                                              nextFocusableComponent);
        focusCycleRoot.setFocusTraversalPolicy(newFocusTraversalPolicy);
    }
View Full Code Here

        firePropertyChange(NEXT_FOCUSABLE_PROPERTY_NAME, oldComponent, nextFocusableComponent);
        Container focusCycleRoot = getFocusCycleRootAncestor();
        if (focusCycleRoot == null) {
            return;
        }
        FocusTraversalPolicy newFocusTraversalPolicy = new BequestedFocusTraversalPolicy(
                focusCycleRoot.getFocusTraversalPolicy(), this, nextFocusableComponent);
        focusCycleRoot.setFocusTraversalPolicy(newFocusTraversalPolicy);
    }
View Full Code Here

            : aContainer.getFocusCycleRootAncestor();

        // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's
        // traversal policy is non-legacy, then honor it.
        if (root != null) {
            FocusTraversalPolicy policy = root.getFocusTraversalPolicy();
            if (policy != gluePolicy) {
                return policy.getComponentBefore(root, aComponent);
            }

            comparator.setComponentOrientation(root.getComponentOrientation());
            return layoutPolicy.getComponentBefore(root, aComponent);
        }
View Full Code Here

            : aContainer.getFocusCycleRootAncestor();

        // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's
        // traversal policy is non-legacy, then honor it.
        if (root != null) {
            FocusTraversalPolicy policy = root.getFocusTraversalPolicy();
            if (policy != gluePolicy) {
                return policy.getFirstComponent(root);
            }

            comparator.setComponentOrientation(root.getComponentOrientation());
            return layoutPolicy.getFirstComponent(root);
        }
View Full Code Here

            : aContainer.getFocusCycleRootAncestor();

        // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's
        // traversal policy is non-legacy, then honor it.
        if (root != null) {
            FocusTraversalPolicy policy = root.getFocusTraversalPolicy();
            if (policy != gluePolicy) {
                return policy.getLastComponent(root);
            }

            comparator.setComponentOrientation(root.getComponentOrientation());
            return layoutPolicy.getLastComponent(root);
        }
View Full Code Here

            if (log.isLoggable(PlatformLogger.Level.FINE)) {
                log.fine("### Asking FTP " + provider + " for component after " + aComponent);
            }

            // FTP knows how to find component after the given. We don't.
            FocusTraversalPolicy policy = provider.getFocusTraversalPolicy();
            Component afterComp = policy.getComponentAfter(provider, aComponent);

            // Null result means that we overstepped the limit of the FTP's cycle.
            // In that case we must quit the cycle, otherwise return the component found.
            if (afterComp != null) {
                if (log.isLoggable(PlatformLogger.Level.FINE)) {
View Full Code Here

            if (log.isLoggable(PlatformLogger.Level.FINE)) {
                log.fine("### Asking FTP " + provider + " for component after " + aComponent);
            }

            // FTP knows how to find component after the given. We don't.
            FocusTraversalPolicy policy = provider.getFocusTraversalPolicy();
            Component beforeComp = policy.getComponentBefore(provider, aComponent);

            // Null result means that we overstepped the limit of the FTP's cycle.
            // In that case we must quit the cycle, otherwise return the component found.
            if (beforeComp != null) {
                if (log.isLoggable(PlatformLogger.Level.FINE)) {
View Full Code Here

    private static final String FORWARD = "moveSelectionForward";
    private static final String BACKWARD = "moveSelectionBackward";

    public void actionPerformed( ActionEvent e )
    {
      FocusTraversalPolicy ftp = JXButtonPanel.this.getFocusTraversalPolicy();

      if( ftp instanceof JXButtonPanelFocusTraversalPolicy )
      {
        JXButtonPanelFocusTraversalPolicy xftp = ( JXButtonPanelFocusTraversalPolicy )ftp;
View Full Code Here

      : aContainer.getFocusCycleRootAncestor();

  // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's
  // traversal policy is non-legacy, then honor it.
  if (root != null) {
      FocusTraversalPolicy policy = root.getFocusTraversalPolicy();
      if (policy != gluePolicy) {
    return policy.getComponentAfter(root, aComponent);
      }

      comparator.setComponentOrientation(root.getComponentOrientation());
      return layoutPolicy.getComponentAfter(root, aComponent);
  }
View Full Code Here

TOP

Related Classes of java.awt.FocusTraversalPolicy

Copyright © 2018 www.massapicom. 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.