当前位置: 首页>>代码示例>>Java>>正文


Java Container.invalidate方法代码示例

本文整理汇总了Java中java.awt.Container.invalidate方法的典型用法代码示例。如果您正苦于以下问题:Java Container.invalidate方法的具体用法?Java Container.invalidate怎么用?Java Container.invalidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.Container的用法示例。


在下文中一共展示了Container.invalidate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: activateFilter

import java.awt.Container; //导入方法依赖的package包/类
public void activateFilter() {
    JComponent panel = getBottomPanel();
    
    if (filterPanel == null) {
        filterPanel = FilterUtils.createFilterPanel(getResultsComponent(), getExcludesFilter(), getFilterOptions());
        panel.add(filterPanel);
        Container parent = panel.getParent();
        parent.invalidate();
        parent.revalidate();
        parent.repaint();
    }
    
    panel.setVisible(true);
    
    filterPanel.setVisible(true);
    filterPanel.requestFocusInWindow();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:DataView.java

示例2: activateSearch

import java.awt.Container; //导入方法依赖的package包/类
public void activateSearch() {
    JComponent panel = getBottomPanel();
    
    if (searchPanel == null) {
        SearchUtils.TreeHelper searchHelper = getSearchHelper();
        if (searchHelper == null) searchPanel = SearchUtils.createSearchPanel(getResultsComponent(), getSearchOptions());
        else searchPanel = SearchUtils.createSearchPanel((ProfilerTreeTable)getResultsComponent(), searchHelper, getSearchOptions());
        panel.add(searchPanel);
        Container parent = panel.getParent();
        parent.invalidate();
        parent.revalidate();
        parent.repaint();
    }
    
    panel.setVisible(true);
    
    searchPanel.setVisible(true);
    searchPanel.requestFocusInWindow();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:DataView.java

示例3: alloyRepaint

import java.awt.Container; //导入方法依赖的package包/类
/** Repaint this component. */
public void alloyRepaint() {
	Container c = getParent();
	while (c != null) {
		if (c instanceof JViewport)
			break;
		else
			c = c.getParent();
	}
	setSize((int) (graph.getTotalWidth() * scale), (int) (graph.getTotalHeight() * scale));
	if (c != null) {
		c.invalidate();
		c.repaint();
		c.validate();
	} else {
		invalidate();
		repaint();
		validate();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:21,代码来源:GraphViewer.java

示例4: revalidateGrid

import java.awt.Container; //导入方法依赖的package包/类
/**
 * Forces revalidation of the grid managed by the specified manager.
 *
 * @param manager manager of the grid that we want to revalidate.
 */
public static void revalidateGrid(GridManager manager) {
    Container cont = manager.getContainer();
    Container parent = cont.getParent();
    parent.invalidate();
    parent.doLayout();
    cont.invalidate();
    cont.doLayout();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:GridUtils.java

示例5: alloyRepaint

import java.awt.Container; //导入方法依赖的package包/类
/** Repaint this component. */
public void alloyRepaint() {
    Container c=getParent();
    while(c!=null) { if (c instanceof JViewport) break; else c=c.getParent(); }
    setSize((int)(graph.getTotalWidth()*scale), (int)(graph.getTotalHeight()*scale));
    if (c!=null) { c.invalidate(); c.repaint(); c.validate(); } else { invalidate(); repaint(); validate(); }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:8,代码来源:GraphViewer.java

示例6: layoutContainer

import java.awt.Container; //导入方法依赖的package包/类
/**
 * Lays out the container using the FlowLayout. If the components as laid
 * out do not fit in the size of then cause tree to be layout again unless
 * this is a recursive call.
 */
@Override
public void layoutContainer(final Container target) {
  super.layoutContainer(target);

  /*
   * Now see how big a container is needed to hold all components
   */
  int maxX = 0;
  int maxY = 0;

  for (int i = 0; i < target.getComponentCount(); i++) {
    final Component cmp = target.getComponent(i);
    if (!cmp.isVisible()) {
      continue;
    }

    final Rectangle b = cmp.getBounds();

    if (b.x + b.width > maxX) {
      maxX = b.x + b.width;
    }

    if (b.y + b.height > maxY) {
      maxY = b.y + b.height;
    }
  }

  final Dimension size = target.getSize();

  if (maxX > size.width || maxY > size.height) {
    if (recursing) {
      return;
    }

    recursing = true;
    target.invalidate();

    if (target instanceof JComponent) {
      ((JComponent)target).revalidate();
    }

    recursing = false;
  }
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:50,代码来源:WrapLayout.java


注:本文中的java.awt.Container.invalidate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。