Example #1
0
 /**
  * @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());
   }
 }
Example #2
0
 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());
     }
   }
 }
Example #3
0
  /**
   * {@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();
 }