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