當前位置: 首頁>>代碼示例>>Java>>正文


Java ContainerEvent.getChild方法代碼示例

本文整理匯總了Java中java.awt.event.ContainerEvent.getChild方法的典型用法代碼示例。如果您正苦於以下問題:Java ContainerEvent.getChild方法的具體用法?Java ContainerEvent.getChild怎麽用?Java ContainerEvent.getChild使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.event.ContainerEvent的用法示例。


在下文中一共展示了ContainerEvent.getChild方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
@Override
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!
	}
}
 
開發者ID:MyersResearchGroup,項目名稱:iBioSim,代碼行數:26,代碼來源:CloseTabPaneUI.java

示例2: componentRemoved

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
@Override
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);
		}
	}
}
 
開發者ID:MyersResearchGroup,項目名稱:iBioSim,代碼行數:22,代碼來源:CloseTabPaneUI.java

示例3: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
/**
 * 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);
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:29,代碼來源:BasicToolBarUI.java

示例4: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
public void componentAdded(ContainerEvent evt) {
            Component c = evt.getChild();

            if (toolBarFocusListener != null) {
                c.addFocusListener(toolBarFocusListener);
            }

            if (isRolloverBorders()) {
                setBorderToRollover(c);
            } 
            else 
            {
                setBorderToNonRollover(c);
            }
            
            //## Bug FIX:Issue 51(https://code.google.com/p/beautyeye/issues/detail?id=51)
            //* 由Jack Jiang201210-12日注釋掉:它樣做將導致各種放入的組
            //* 件(如文本框)等都將透明,從而不繪製該 組件的背景,那就錯誤了哦
            //* 其實以下代碼原本是為了解決放入到JToggleButton的白色背景問題,現在它
            //* 已經在BEToolgleButtonUI裏解決了,此處就不需要了,也不應該要!
//            //* 隻有它一行是由jb2011加的
//            if(c instanceof JComponent)
//            	((JComponent)c).setOpaque(false);
        }
 
開發者ID:JackJiang2011,項目名稱:beautyeye,代碼行數:25,代碼來源:BEToolBarUI.java

示例5: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
/**
    * 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);
   }
 
開發者ID:nmldiegues,項目名稱:jvm-stm,代碼行數:29,代碼來源:BasicToolBarUI.java

示例6: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
public void componentAdded(ContainerEvent e) {
   if (e.getChild() instanceof WizardPage) {
      WizardPage wp = (WizardPage)e.getChild();
      JButton b;
      b = wp.getNextButton();
      if (b != null) {
         b.addActionListener(nextListener);
      }
      b = wp.getPreviousButton();
      if (b != null) {
         b.addActionListener(previousListener);
      }
      b = wp.getFinishButton();
      if (b != null) {
         b.addActionListener(finishListener);
      }
      b = wp.getCancelButton();
      if (b != null) {
         b.addActionListener(cancelListener);
      }
      b = wp.getHelpButton();
      if (b != null) {
         b.addActionListener(helpListener);
      }
   }
}
 
開發者ID:tn5250j,項目名稱:tn5250j,代碼行數:27,代碼來源:Wizard.java

示例7: componentRemoved

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
public void componentRemoved(ContainerEvent e) {
   if (e.getChild() instanceof WizardPage) {
      WizardPage wp = (WizardPage)e.getChild();
      JButton b;
      b = wp.getNextButton();
      if (b != null) {
         b.removeActionListener(nextListener);
      }
      b = wp.getPreviousButton();
      if (b != null) {
         b.removeActionListener(previousListener);
      }
      b = wp.getFinishButton();
      if (b != null) {
         b.removeActionListener(finishListener);
      }
      b = wp.getCancelButton();
      if (b != null) {
         b.removeActionListener(cancelListener);
      }
      b = wp.getHelpButton();
      if (b != null) {
         b.removeActionListener(helpListener);
      }
   }
}
 
開發者ID:tn5250j,項目名稱:tn5250j,代碼行數:27,代碼來源:Wizard.java

示例8: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
public void componentAdded(ContainerEvent evt) {
            Component c = evt.getChild();


			if (toolBarFocusListener != null) {
				c.addFocusListener(toolBarFocusListener);
			}

			if (isRolloverBorders()) {
				setBorderToRollover(c);
			} else {
				setBorderToNonRollover(c);
			}

			//## Bug FIX:Issue 51(https://code.google.com/p/beautyeye/issues/detail?id=51)
			//* 由Jack Jiang201210-12日注釋掉:它樣做將導致各種放入的組
			//* 件(如文本框)等都將透明,從而不繪製該 組件的背景,那就錯誤了哦
			//* 其實以下代碼原本是為了解決放入到JToggleButton的白色背景問題,現在它
			//* 已經在BEToolgleButtonUI裏解決了,此處就不需要了,也不應該要!
//            //* 隻有它一行是由jb2011加的
//            if(c instanceof JComponent)
//            	((JComponent)c).setOpaque(false);
        }
 
開發者ID:Jakegogo,項目名稱:concurrent,代碼行數:24,代碼來源:BEToolBarUI.java

示例9: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
@Override
public void componentAdded(ContainerEvent e) {
    Component c = e.getChild();
    while(((c = c.getParent()) != null)) {
        if(c instanceof TopComponent) {
            RequestProcessor.Task t = (RequestProcessor.Task) ((TopComponent)c).getClientProperty(REGISTER_TASK);
            if(t != null) {
                t.schedule(1000);
            } 
            break;
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:UndoRedoSupport.java

示例10: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
public void componentAdded(ContainerEvent e) {
    JMenu menu = (JMenu) e.getContainer();
    JComponent item = (JComponent) e.getChild();
    //Mark the child as belonging to the parent container context
    String containerContext = getContainerContext(menu);
    
    item.putClientProperty (KEY_CONTAINERCONTEXT, containerContext);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:AbstractMenuFactory.java

示例11: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
public void componentAdded(ContainerEvent e) {
    if (e.getChild() instanceof JTextComponent) {
        e.getChild().addFocusListener(this);
        viewportViewHasFocus = e.getChild().isFocusOwner();
        scrollpane.repaint();
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:8,代碼來源:SynthScrollPaneUI.java

示例12: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
public void componentAdded(ContainerEvent e) {
  JButtonBar container = (JButtonBar)e.getContainer();
  if (e.getChild() instanceof AbstractButton) {
    ((ButtonBarUI)container.ui).installButtonBarUI(
      (AbstractButton)e.getChild());
    ((AbstractButton)e.getChild()).addPropertyChangeListener(
      "UI",
      JButtonBar.uiUpdater);
  }
}
 
開發者ID:mstritt,項目名稱:orbit-image-analysis,代碼行數:11,代碼來源:JButtonBar.java

示例13: componentRemoved

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
@Override
public final void componentRemoved(final ContainerEvent e){
  Component removedChild=e.getChild();
  if(getNearestFocusableComponent() !=null&&SwingUtilities.isDescendingFrom(getNearestFocusableComponent(),removedChild)){
    setNearestFocusableComponent(null);
  }
  if(getFocusedComponent() !=null&&SwingUtilities.isDescendingFrom(getFocusedComponent(),removedChild)){
    setNearestFocusableComponent(e.getContainer());
  }
  deinstall(removedChild, e);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:FocusWatcher.java

示例14: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
/**
 * Records the addition of a window to the desktop.
 * 
 * @see java.awt.event.ContainerListener#componentAdded(java.awt.event.ContainerEvent)
 */
public void componentAdded(ContainerEvent e) {
  if ((this.windowPositioner != null) && (e.getChild() instanceof JInternalFrame)) {
    JInternalFrame frame = (JInternalFrame) e.getChild();
    Point position = this.windowPositioner.getPosition(frame, getAllVisibleFrames());
    frame.setLocation(position);
  }
  updateWindowsList();
}
 
開發者ID:pgdurand,項目名稱:jGAF,代碼行數:14,代碼來源:JWindowsMenu.java

示例15: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
/**
 * Receives notification when a child component is added to the
 * JComponent and fires a PropertyChangeEvent on listeners registered
 * with the AccessibleJComponent with a property name of
 * {@link AccessibleContext#ACCESSIBLE_CHILD_PROPERTY}.
 *
 * @param event the container event
 */
public void componentAdded(ContainerEvent event)
{
  Component c = event.getChild();
  if (c != null && c instanceof Accessible)
    {
      AccessibleContext childCtx = c.getAccessibleContext();
      AccessibleJComponent.this.firePropertyChange
        (AccessibleContext.ACCESSIBLE_CHILD_PROPERTY, null, childCtx);
    }
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:19,代碼來源:JComponent.java


注:本文中的java.awt.event.ContainerEvent.getChild方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。