Package java.awt

Examples of java.awt.FocusTraversalPolicy


            if (log.isLoggable(PlatformLogger.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.FINE)) log.fine("### FTP returned " + beforeComp);
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

            : 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

        {
            comp = rootAncestor;
            rootAncestor = comp.getFocusCycleRootAncestor();
        }
        if (rootAncestor != null) {
            FocusTraversalPolicy policy =
                rootAncestor.getFocusTraversalPolicy();
            Component toFocus = policy.getComponentAfter(rootAncestor, comp);
           
            while(toFocus!=null && set.contains(toFocus)==false) {
              set.add(toFocus);
                toFocus = policy.getComponentAfter(rootAncestor, toFocus);
            }
           
            toFocus = policy.getComponentBefore(rootAncestor, comp);
           
            while(toFocus!=null && set.contains(toFocus)==false) {
              set.add(toFocus);
                toFocus = policy.getComponentBefore(rootAncestor, toFocus);
            }
        }
    return set;
  }
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

            Container ancestor = desktop.getFocusCycleRootAncestor();
            if (ancestor == null) {
                return;
            }

            FocusTraversalPolicy policy = ancestor.getFocusTraversalPolicy();
            if (!(policy instanceof SortingFocusTraversalPolicy)) {
                return;
            }

            SortingFocusTraversalPolicy sortingPolicy = (SortingFocusTraversalPolicy)policy;

            boolean implicitEnabled = sortingPolicy.getImplicitDownCycleTraversal();
            sortingPolicy.setImplicitDownCycleTraversal(false);

            Component result = null;
            String action = (String)getValue(NAME);
            if ("navigateNext".equals(action)) {
                result = policy.getComponentAfter(ancestor, desktop);
            } else if ("navigatePrevious".equals(action)) {
                result = policy.getComponentBefore(ancestor, desktop);
            }

            sortingPolicy.setImplicitDownCycleTraversal(implicitEnabled);

            if (result != null) {
View Full Code Here

            Container ancestor = desktop.getFocusCycleRootAncestor();
            if (ancestor == null) {
                return;
            }

            FocusTraversalPolicy policy = ancestor.getFocusTraversalPolicy();
            if (!(policy instanceof SortingFocusTraversalPolicy)) {
                return;
            }

            SortingFocusTraversalPolicy sortingPolicy = (SortingFocusTraversalPolicy)policy;

            boolean implicitEnabled = sortingPolicy.getImplicitDownCycleTraversal();
            sortingPolicy.setImplicitDownCycleTraversal(false);

            Component result = null;
            String action = (String)getValue(NAME);
            if ("navigateNext".equals(action)) {
                result = policy.getComponentAfter(ancestor, desktop);
            } else if ("navigatePrevious".equals(action)) {
                result = policy.getComponentBefore(ancestor, desktop);
            }

            sortingPolicy.setImplicitDownCycleTraversal(implicitEnabled);

            if (result != null) {
View Full Code Here

            return KeyboardFocusManager.getCurrentKeyboardFocusManager().getCurrentFocusCycleRoot();
        } else {
            Panel panel = orderedListPanels.get(index - 1);
            View wrappedManifestation = panel.getWrappedManifestation();
            if (wrappedManifestation.isFocusTraversalPolicyProvider()) {
                FocusTraversalPolicy focusTraversalPolicy = wrappedManifestation.getFocusTraversalPolicy();
                return focusTraversalPolicy.getLastComponent(wrappedManifestation);
            }
            visitedPanels.add(panel);
            return panel;
        }
    }
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.