本文整理汇总了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;
}
}