Java 类java.beans.Visibility 实例源码

项目:OpenJSharp    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:OpenJSharp    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:jdk8u-jdk    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:jdk8u-jdk    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:openjdk-jdk10    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator<Object> i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:openjdk-jdk10    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator<Object> i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:openjdk9    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator<Object> i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:openjdk9    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator<Object> i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:Java8CN    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:Java8CN    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:jdk8u_jdk    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:jdk8u_jdk    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:VarJ    文件:BeanContextSupport.java   
/**
    * notify this instance that it may no longer render a GUI.
    */

   public synchronized void dontUseGui() {
if (okToUseGui) {
    okToUseGui = false;

    // lets also tell the Children that can that they may not use their GUI's
    synchronized(children) {
        for (Iterator i = children.keySet().iterator(); i.hasNext();) {
        Visibility v = getChildVisibility(i.next());

        if (v != null) v.dontUseGui();
       }
    }
}
   }
项目:VarJ    文件:BeanContextSupport.java   
/**
    * Notify this instance that it may now render a GUI
    */

   public synchronized void okToUseGui() {
if (!okToUseGui) {
    okToUseGui = true;

    // lets also tell the Children that can that they may use their GUI's
    synchronized(children) {
        for (Iterator i = children.keySet().iterator(); i.hasNext();) {
        Visibility v = getChildVisibility(i.next());

        if (v != null) v.okToUseGui();
        }
    }
}
   }
项目:fiscevm    文件:BeanContextSupport.java   
/**
 * Returns true if this context or its children needs GUI to work properly.
 * <p>
 * The implementation checks the peer and all the children that implement
 * <code>Visibility</code> to see if any of their <code>needsGui()</code> 
 * returns true, and if any of the children extends 
 * <code>java.awt.Component</code>.</p>
 * 
 * @see java.beans.Visibility#needsGui()
 */
public boolean needsGui() {
    if (inNeedsGui) {
        return false;
    }
    inNeedsGui = true;

    try {
        if (getBeanContextPeer() != this) {
            if (getBeanContextPeer().needsGui()) {
                return true;
            }
        }
        Object childs[] = copyChildren();
        for (int i = 0; i < childs.length; i++) {
            Visibility v = getChildVisibility(childs[i]);
            if (v != null && v.needsGui()) {
                return true;
            }
        }
        return false;
    } finally {
        inNeedsGui = false;
    }
}
项目:jdk-1.7-annotated    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:jdk-1.7-annotated    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:infobip-open-jdk-8    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:infobip-open-jdk-8    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:jdk8u-dev-jdk    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:jdk8u-dev-jdk    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:jdk7-jdk    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:jdk7-jdk    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:openjdk-source-code-learn    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:openjdk-source-code-learn    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:OLD-OpenJDK8    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:OLD-OpenJDK8    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:openjdk-jdk7u-jdk    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:openjdk-jdk7u-jdk    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:freeVM    文件:BeanContextSupport.java   
public synchronized boolean needsGui() {
    // BeanContext needs GUI if at least one its children needs it.
    // We may check it by trying to cast each child to Visibility
    // and see it needs GUI.
    // A child definitely needs GUI if it implements Component
    for (Iterator it = iterator(); it.hasNext();) {
        Object next = it.next();
        Visibility vis = getChildVisibility(next);

        if (vis != null) {
            if (vis.needsGui()) {
                return true;
            }
        }

        if (next instanceof java.awt.Component) {
            return true;
        }
    }

    return false;
}
项目:openjdk-icedtea7    文件:BeanContextSupport.java   
/**
 * notify this instance that it may no longer render a GUI.
 */

public synchronized void dontUseGui() {
    if (okToUseGui) {
        okToUseGui = false;

        // lets also tell the Children that can that they may not use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.dontUseGui();
           }
        }
    }
}
项目:openjdk-icedtea7    文件:BeanContextSupport.java   
/**
 * Notify this instance that it may now render a GUI
 */

public synchronized void okToUseGui() {
    if (!okToUseGui) {
        okToUseGui = true;

        // lets also tell the Children that can that they may use their GUI's
        synchronized(children) {
            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
                Visibility v = getChildVisibility(i.next());

                if (v != null) v.okToUseGui();
            }
        }
    }
}
项目:OpenJSharp    文件:BeanContextSupport.java   
/**
 * <p>
 * This method is typically called from the environment in order to determine
 * if the implementor "needs" a GUI.
 * </p>
 * <p>
 * The algorithm used herein tests the BeanContextPeer, and its current children
 * to determine if they are either Containers, Components, or if they implement
 * Visibility and return needsGui() == true.
 * </p>
 * @return <tt>true</tt> if the implementor needs a GUI
 */
public synchronized boolean needsGui() {
    BeanContext bc = getBeanContextPeer();

    if (bc != this) {
        if (bc instanceof Visibility) return ((Visibility)bc).needsGui();

        if (bc instanceof Container || bc instanceof Component)
            return true;
    }

    synchronized(children) {
        for (Iterator i = children.keySet().iterator(); i.hasNext();) {
            Object c = i.next();

            try {
                    return ((Visibility)c).needsGui();
                } catch (ClassCastException cce) {
                    // do nothing ...
                }

                if (c instanceof Container || c instanceof Component)
                    return true;
        }
    }

    return false;
}
项目:OpenJSharp    文件:BeanContextSupport.java   
/**
 * Gets the Component (if any) associated with the specified child.
 * @param child the specified child
 * @return the Component (if any) associated with the specified child.
 */
protected static final Visibility getChildVisibility(Object child) {
    try {
        return (Visibility)child;
    } catch (ClassCastException cce) {
        return null;
    }
}
项目:jdk8u-jdk    文件:BeanContextSupport.java   
/**
 * <p>
 * This method is typically called from the environment in order to determine
 * if the implementor "needs" a GUI.
 * </p>
 * <p>
 * The algorithm used herein tests the BeanContextPeer, and its current children
 * to determine if they are either Containers, Components, or if they implement
 * Visibility and return needsGui() == true.
 * </p>
 * @return <tt>true</tt> if the implementor needs a GUI
 */
public synchronized boolean needsGui() {
    BeanContext bc = getBeanContextPeer();

    if (bc != this) {
        if (bc instanceof Visibility) return ((Visibility)bc).needsGui();

        if (bc instanceof Container || bc instanceof Component)
            return true;
    }

    synchronized(children) {
        for (Iterator i = children.keySet().iterator(); i.hasNext();) {
            Object c = i.next();

            try {
                    return ((Visibility)c).needsGui();
                } catch (ClassCastException cce) {
                    // do nothing ...
                }

                if (c instanceof Container || c instanceof Component)
                    return true;
        }
    }

    return false;
}
项目:jdk8u-jdk    文件:BeanContextSupport.java   
/**
 * Gets the Component (if any) associated with the specified child.
 * @param child the specified child
 * @return the Component (if any) associated with the specified child.
 */
protected static final Visibility getChildVisibility(Object child) {
    try {
        return (Visibility)child;
    } catch (ClassCastException cce) {
        return null;
    }
}
项目:openjdk-jdk10    文件:BeanContextSupport.java   
/**
 * <p>
 * This method is typically called from the environment in order to determine
 * if the implementor "needs" a GUI.
 * </p>
 * <p>
 * The algorithm used herein tests the BeanContextPeer, and its current children
 * to determine if they are either Containers, Components, or if they implement
 * Visibility and return needsGui() == true.
 * </p>
 * @return {@code true} if the implementor needs a GUI
 */
public synchronized boolean needsGui() {
    BeanContext bc = getBeanContextPeer();

    if (bc != this) {
        if (bc instanceof Visibility) return ((Visibility)bc).needsGui();

        if (bc instanceof Container || bc instanceof Component)
            return true;
    }

    synchronized(children) {
        for (Iterator<Object> i = children.keySet().iterator(); i.hasNext();) {
            Object c = i.next();

            try {
                    return ((Visibility)c).needsGui();
                } catch (ClassCastException cce) {
                    // do nothing ...
                }

                if (c instanceof Container || c instanceof Component)
                    return true;
        }
    }

    return false;
}
项目:openjdk-jdk10    文件:BeanContextSupport.java   
/**
 * Gets the Component (if any) associated with the specified child.
 * @param child the specified child
 * @return the Component (if any) associated with the specified child.
 */
protected static final Visibility getChildVisibility(Object child) {
    try {
        return (Visibility)child;
    } catch (ClassCastException cce) {
        return null;
    }
}