本文整理匯總了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();
}
示例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();
}
示例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();
}
}
示例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();
}
示例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(); }
}
示例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;
}
}