本文整理汇总了Java中javax.swing.JComponent.invalidate方法的典型用法代码示例。如果您正苦于以下问题:Java JComponent.invalidate方法的具体用法?Java JComponent.invalidate怎么用?Java JComponent.invalidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JComponent
的用法示例。
在下文中一共展示了JComponent.invalidate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyFlatterLaF
import javax.swing.JComponent; //导入方法依赖的package包/类
public void applyFlatterLaF(JComponent c)
{
try
{
UIManager.setLookAndFeel(flatterLaF);
SwingUtilities.updateComponentTreeUI(c);
c.invalidate();
c.updateUI();
UIManager.setLookAndFeel(currentLaF);
}
catch( Exception ex )
{
LOGGER.error("Could not apply Flatter LaF to component: " + c.toString(), ex);
}
}
示例2: setControlsVisible
import javax.swing.JComponent; //导入方法依赖的package包/类
/** Set visibility of individual clazz controls; hides other filters.
* @param visible true to show clazz parameter controls, false to hide this clazz's controls and to show all filters in chain.
*/
public void setControlsVisible(boolean visible) {
controlsVisible = visible;
setBorderActive(visible);
for (JComponent p : controls) {
p.setVisible(visible);
p.invalidate();
}
invalidate();
}
示例3: resizeContainer
import javax.swing.JComponent; //导入方法依赖的package包/类
final void resizeContainer() {
JComponent c = ( JComponent ) container.getParent();
c.invalidate();
c.revalidate();
c.doLayout();
}
示例4: setControlsVisible
import javax.swing.JComponent; //导入方法依赖的package包/类
/** Set visibility of individual filter controls; hides other filters.
* @param visible true to show filter parameter controls, false to hide this filter's controls and to show all filters in chain.
*/
public void setControlsVisible(boolean visible) {
controlsVisible = visible;
// getControllable().setSelected(visible); // exposing controls 'selects' this filter
setBorderActive(visible);
for (JComponent p : controls) {
p.setVisible(visible);
p.invalidate();
}
invalidate();
Container c = getTopLevelAncestor();
if (c == null) {
return;
}
// TODO fix bug here with enclosed filters not showing up if they are enclosed in enclosed filter, unless they are declared as enclosed
// if (!getControllable().isEnclosed() && c instanceof Window) {
// if (c instanceof FilterFrame) {
// // hide all filters except one that is being modified, *unless* we are an enclosed filter
// FilterFrame<GeneralController> ff = (FilterFrame) c;
// for (GeneralController f : ff.filterPanels) {
// if (f == this) { // for us and if !visible
// f.setVisible(true); // always set us visible in chain since we are the one being touched
// continue;
// }
//
// f.setVisible(!visible); // hide / show other filters
// }
//
// }
// ((Window) c).pack();
// }
if (c instanceof Window) {
((Window) c).pack();
}
// if(!getControllable().isEnclosed()){ // store last selected top level filter
// if (visible) {
// getControllable().getChip().getPrefs().put(FilterFrame.LAST_FILTER_SELECTED_KEY, getControllable().getClass().toString());
// } else {
// getControllable().getChip().getPrefs().put(FilterFrame.LAST_FILTER_SELECTED_KEY, "");
// }
// }
showControlsToggleButton.setSelected(visible);
}
示例5: setControlsVisible
import javax.swing.JComponent; //导入方法依赖的package包/类
/**
* Set visibility of individual filter controls; hides other filters.
*
* @param visible true to show filter parameter controls, false to hide this
* filter's controls and to show all filters in chain.
*/
public void setControlsVisible(boolean visible) {
controlsVisible = visible;
getFilter().setSelected(visible); // exposing controls 'selects' this filter
setBorderActive(visible);
for (JComponent p : controls) {
p.setVisible(visible);
p.invalidate();
}
boolean globalEnable = false; // For compatibility with new version
invalidate();
Container c = getTopLevelAncestor();
if (c == null) {
return;
} else if (c instanceof GlobalViewer) // Added for compatibility with multi-input mode
{
c = ((GlobalViewer) c).getFilterPane();
globalEnable = true;
}
// TODO fix bug here with enclosed filters not showing up if they are enclosed in enclosed filter, unless they are declared as enclosed
if (!getFilter().isEnclosed() && ((c instanceof Window) || globalEnable)) {
if (c instanceof FilterFrame) {
// hide all filters except one that is being modified, *unless* we are an enclosed filter
FilterFrame<FilterPanel> ff = (FilterFrame) c;
for (FilterPanel f : ff.filterPanels) {
if (f == this) { // for us and if !visible
f.setVisible(true); // always set us visible in chain since we are the one being touched
continue;
}
f.setVisible(!visible); // hide / show other filters
}
}
// if (c instanceof Window) // Redundant
// ((Window) c).pack();
}
if (controlPanel != null) {
controlPanel.setVisible(visible);
}
// if (c instanceof Window) {
// ((Window) c).pack();
// }
if (!getFilter().isEnclosed()) { // store last selected top level filter
if (visible) {
getFilter().getChip().getPrefs().put(FilterFrame.LAST_FILTER_SELECTED_KEY, getFilter().getClass().toString());
} else {
getFilter().getChip().getPrefs().put(FilterFrame.LAST_FILTER_SELECTED_KEY, "");
}
}
if (visible) {
// Show only controls.
showControlsToggleButton.setSelected(true);
showControlsToggleButton.setText("Back to filters list");
} else {
showControlsToggleButton.setSelected(false);
showControlsToggleButton.setText("Controls");
}
}