當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。