예제 #1
0
 public void componentAdded(ContainerEvent e) {
   if (e.getChild() instanceof JTextComponent) {
     e.getChild().addFocusListener(this);
     viewportViewHasFocus = e.getChild().isFocusOwner();
     scrollpane.repaint();
   }
 }
예제 #2
0
 public void componentRemoved(ContainerEvent e) {
   if (extListener != null && extListener.accept(e.getChild())) {
     extListener.stopListeningTo(e.getChild());
     listenedTo.remove(e.getChild());
   } else if (accept(e.getChild())) {
     detachFrom(e.getChild());
   }
 }
예제 #3
0
    /**
     * This method is responsible for giving the child components their original borders when they
     * are removed.
     *
     * @param e The ContainerEvent.
     */
    public void componentRemoved(ContainerEvent e) {
      setBorderToNormal(e.getChild());
      cachedBounds = toolBar.getPreferredSize();
      cachedOrientation = toolBar.getOrientation();

      Component c = e.getChild();
      if (toolBarFocusListener != null) c.removeFocusListener(toolBarFocusListener);
    }
예제 #4
0
    /**
     * This method is responsible for setting rollover or non rollover for new buttons added to the
     * JToolBar.
     *
     * @param e The ContainerEvent.
     */
    public void componentAdded(ContainerEvent e) {
      if (e.getChild() instanceof JButton) {
        JButton b = (JButton) e.getChild();

        if (b.getBorder() != null) borders.put(b, b.getBorder());
      }

      if (isRolloverBorders()) setBorderToRollover(e.getChild());
      else setBorderToNonRollover(e.getChild());

      cachedBounds = toolBar.getPreferredSize();
      cachedOrientation = toolBar.getOrientation();

      Component c = e.getChild();
      if (toolBarFocusListener != null) c.addFocusListener(toolBarFocusListener);
    }
예제 #5
0
 public void componentAdded(ContainerEvent e) {
   //        if (extListener != null && extListener.accept(e.getChild())) {
   //            extListener.startListeningTo(e.getChild(), extNotifier);
   //            listenedTo.add (e.getChild());
   //        } else if (accept(e.getChild())) {
   if (accept(e.getChild())) {
     attachTo(e.getChild());
   }
 }
예제 #6
0
 /**
  * 组件删除
  *
  * @param e 容器事件
  */
 @Override
 public void componentRemoved(ContainerEvent e) {
   if (isRefreshing) {
     return;
   }
   XWidgetCreator xwc = ((XWidgetCreator) e.getChild());
   Widget wgt = xwc.toData();
   WTitleLayout wlayout = this.toData();
   wlayout.removeWidget(wgt);
 }
    public void componentRemoved(ContainerEvent e) {
      JTabbedPane tp = (JTabbedPane) e.getContainer();
      Component child = e.getChild();
      if (child instanceof UIResource) {
        return;
      }

      // NOTE 4/15/2002 (joutwate):
      // This fix is implemented using client properties since there is
      // currently no IndexPropertyChangeEvent. Once
      // IndexPropertyChangeEvents have been added this code should be
      // modified to use it.
      Integer indexObj = (Integer) tp.getClientProperty("__index_to_remove__");
      if (indexObj != null) {
        int index = indexObj.intValue();
        if (htmlViews != null && htmlViews.size() >= index) {
          htmlViews.removeElementAt(index);
        }
      }
    }
예제 #8
0
 public void processContainerEvent(ContainerEvent event) {
   if (cntrListener != null) {
     switch (event.getID()) {
       case ContainerEvent.COMPONENT_ADDED:
         cntrListener.componentAdded(event);
         break;
       case ContainerEvent.COMPONENT_REMOVED:
         cntrListener.componentRemoved(event);
         break;
     }
   }
 }
 public void componentAdded(ContainerEvent e) {
   JTabbedPane tp = (JTabbedPane) e.getContainer();
   Component child = e.getChild();
   if (child instanceof UIResource) {
     return;
   }
   int index = tp.indexOfComponent(child);
   String title = tp.getTitleAt(index);
   boolean isHTML = BasicHTML.isHTMLString(title);
   if (isHTML) {
     if (htmlViews == null) { // Initialize vector
       htmlViews = createHTMLVector();
     } else { // Vector already exists
       View v = BasicHTML.createHTMLView(tp, title);
       htmlViews.insertElementAt(v, index);
     }
   } else { // Not HTML
     if (htmlViews != null) { // Add placeholder
       htmlViews.insertElementAt(null, index);
     } // else nada!
   }
 }
예제 #10
0
 /**
  * 组件增加
  *
  * @param e 容器事件
  */
 @Override
 public void componentAdded(ContainerEvent e) {
   if (isRefreshing) {
     return;
   }
   WTitleLayout layout = this.toData();
   XWidgetCreator creator = (XWidgetCreator) e.getChild();
   FRTitleLayout lay = (FRTitleLayout) getLayout();
   Object constraints = lay.getConstraints(creator);
   if (ComparatorUtils.equals(WTitleLayout.TITLE, constraints)) {
     layout.addTitle(creator.toData(), creator.getBounds());
   } else if (ComparatorUtils.equals(WTitleLayout.BODY, constraints)) {
     layout.addBody(creator.toData(), creator.getBounds());
   }
 }
예제 #11
0
 @Override
 public void componentAdded(ContainerEvent e) {
   if (isRefreshing) {
     return;
   }
   XWidgetCreator creator = (XWidgetCreator) e.getChild();
   WHorizontalBoxLayout wlayout = this.toData();
   Widget wgt = creator.toData();
   for (int i = 0, count = this.getComponentCount(); i < count; i++) {
     if (creator == this.getComponent(i)) {
       wlayout.addWidget(wgt, i);
       wlayout.setWidthAtWidget(wgt, creator.getWidth());
     }
   }
   this.recalculateChildrenPreferredSize();
 }
예제 #12
0
 public void componentRemoved(ContainerEvent paramContainerEvent) {
   if ((paramContainerEvent.getChild() == this.Target) && (getParent() != null))
     getParent().remove(this);
 }
예제 #13
0
 @Override
 public void componentRemoved(ContainerEvent evt) {
   componentRemoved(evt.getChild());
 }
예제 #14
0
 public void componentAdded(ContainerEvent e) {
   if (e.getChild() instanceof WizardPanel) {
     setWizardControllerOnPanel((WizardPanel) e.getChild());
     getWizardController().stateChanged(new ChangeEvent(e.getChild()));
   }
 }
예제 #15
0
 public void componentRemoved(ContainerEvent e) {
   if (e.getChild() instanceof JTextComponent) {
     e.getChild().removeFocusListener(this);
   }
 }
예제 #16
0
 public void componentRemoved(java.awt.event.ContainerEvent e) {
   uninstallListeners(e.getChild());
 };
  private void targetPanelComponentAdded(
      java.awt.event.ContainerEvent evt) { // GEN-FIRST:event_targetPanelComponentAdded

    dragParent.addDraggableComponent(evt.getChild());
  } // GEN-LAST:event_targetPanelComponentAdded
 public void componentRemoved(ContainerEvent e) {
   if (e.getChild() instanceof QueryResultPanel) {
     // finalize QueryResultPanel
     ((QueryResultPanel) e.getChild()).close();
   }
 }
예제 #19
0
 /*
  * (non-Javadoc)
  *
  * @see java.awt.event.ContainerListener#componentAdded(java.awt.event.ContainerEvent)
  */
 @Override
 public void componentAdded(final ContainerEvent e) {
   addKeyAndContainerListenerRecursively(e.getChild());
 }
예제 #20
0
 @Override
 public void componentRemoved(ContainerEvent e) {
   uninstallRecursively(e.getChild());
 }