/** * @param props * @exception IllegalArgumentException */ public synchronized void copyFrom(Dictionary props) throws IllegalArgumentException { Enumeration keys = props.keys(); Enumeration values = props.elements(); while (keys.hasMoreElements()) { put(keys.nextElement(), values.nextElement()); } }
public java.util.Enumeration elements() { java.util.Dictionary dict = getDictionaryValue(); if (dict != null) { return dict.elements(); } else { return null; } }
private void updateLabelSizes() { Dictionary labelTable = getLabelTable(); if (labelTable != null) { Enumeration labels = labelTable.elements(); while (labels.hasMoreElements()) { JComponent component = (JComponent) labels.nextElement(); component.setSize(component.getPreferredSize()); } } }
/** * Creates a wrapper for the given delegatee dictionary providing read only access to the data. */ public ReadOnlyDictionary(final Dictionary delegatee) { if (delegatee instanceof Hashtable) { this.m_delegatee = (Hashtable) delegatee; } else { this.m_delegatee = new Hashtable(); for (Enumeration ke = delegatee.elements(); ke.hasMoreElements(); ) { Object key = ke.nextElement(); this.m_delegatee.put(key, delegatee.get(key)); } } }
/** * {@inheritDoc} * * @since 1.7 */ public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) { if (!isShowing()) { return false; } // Check that there is a label with such image Enumeration elements = labelTable.elements(); while (elements.hasMoreElements()) { Component component = (Component) elements.nextElement(); if (component instanceof JLabel) { JLabel label = (JLabel) component; if (SwingUtilities.doesIconReferenceImage(label.getIcon(), img) || SwingUtilities.doesIconReferenceImage(label.getDisabledIcon(), img)) { return super.imageUpdate(img, infoflags, x, y, w, h); } } } return false; }
public Enumeration<String> elements() { return headers.elements(); }
public static <E, F> List<F> getDictValues(Dictionary<E, F> dict) { return Collections.list(dict.elements()); }