当前位置: 首页>>代码示例>>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;未经允许,请勿转载。