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


Java JComponent.invalidate方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:17,代码来源:ManagementDialog.java

示例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();

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:15,代码来源:ParameterControlPanel.java

示例3: resizeContainer

import javax.swing.JComponent; //导入方法依赖的package包/类
final void resizeContainer() {
    JComponent c = ( JComponent ) container.getParent();
    c.invalidate();
    c.revalidate();
    c.doLayout();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:TabLayoutManager.java

示例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);
    }
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:48,代码来源:ControlPanel.java

示例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");
        }
    }
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:72,代码来源:FilterPanel.java


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