當前位置: 首頁>>代碼示例>>Java>>正文


Java WindowUtils.installJComponentRepainterOnWindowFocusChanged方法代碼示例

本文整理匯總了Java中com.explodingpixels.widgets.WindowUtils.installJComponentRepainterOnWindowFocusChanged方法的典型用法代碼示例。如果您正苦於以下問題:Java WindowUtils.installJComponentRepainterOnWindowFocusChanged方法的具體用法?Java WindowUtils.installJComponentRepainterOnWindowFocusChanged怎麽用?Java WindowUtils.installJComponentRepainterOnWindowFocusChanged使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.explodingpixels.widgets.WindowUtils的用法示例。


在下文中一共展示了WindowUtils.installJComponentRepainterOnWindowFocusChanged方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: UnifiedToolBar

import com.explodingpixels.widgets.WindowUtils; //導入方法依賴的package包/類
/**
 * Creates a {@code UnifiedToolBar}.
 * 	 
 * @param forceSameWidth
 *            whether the two ends should have the same width to keep the center balanced.
 */
public UnifiedToolBar(boolean forceSameWidth) {
	
	fUnifiedToolBar = new TriAreaComponent(4, forceSameWidth);
	
	// TODO remove below call when Apple fixes bug in Java that doesn't
	// correctly paint the
	// TODO textured window.
	fixUnifiedToolBarOnMacIfNeccessary(fUnifiedToolBar);
	fUnifiedToolBar.getComponent().setBorder(
			Borders.createEmptyBorder("3dlu, 4dlu, 3dlu, 4dlu"));
	installUnifiedToolBarBorder(fUnifiedToolBar.getComponent());
	WindowUtils
			.installJComponentRepainterOnWindowFocusChanged(fUnifiedToolBar
					.getComponent());
}
 
開發者ID:mathieulegoc,項目名稱:SmartTokens,代碼行數:22,代碼來源:UnifiedToolBar.java

示例2: BottomBar

import com.explodingpixels.widgets.WindowUtils; //導入方法依賴的package包/類
/**
 * Creates a {@code BottomBar} of the given size.
 *
 * @param size the height of the {@code BottomBar}.
 */
public BottomBar(BottomBarSize size) {

	createAndInstallBackgroundPainter();
	createAndInstallBorder();

	fBottomBar.forceOuterAreasToHaveTheSameWidth();

	// TODO use the actual border insets instead of the hard-coded value 2.
	// calculate the height of the bottom bar. this includes adding two pixels to incorporate
	// the height of the line border.
	int height = size.getHeight() + 2;
	fBottomBar.getComponent().setPreferredSize(new Dimension(-1, height));

	// install a listener that will repaint this component when the parent window's focus state
	// changes.
	WindowUtils.installJComponentRepainterOnWindowFocusChanged(fBottomBar.getComponent());
}
 
開發者ID:mathieulegoc,項目名稱:SmartTokens,代碼行數:23,代碼來源:BottomBar.java

示例3: BottomBar

import com.explodingpixels.widgets.WindowUtils; //導入方法依賴的package包/類
/**
	 * Creates a {@code BottomBar} of the given size.
	 *
	 * @param size the height of the {@code BottomBar}.
	 */
	public BottomBar(BottomBarSize size) {

		createAndInstallBackgroundPainter();
		createAndInstallBorder();

//		fBottomBar.forceOuterAreasToHaveTheSameWidth();

		// TODO use the actual border insets instead of the hard-coded value 2.
		// calculate the height of the bottom bar. this includes adding two pixels to incorporate
		// the height of the line border.
		int height = size.getHeight() + 2;
		fBottomBar.getComponent().setPreferredSize(new Dimension(-1, height));

		// install a listener that will repaint this component when the parent window's focus state
		// changes.
		WindowUtils.installJComponentRepainterOnWindowFocusChanged(fBottomBar.getComponent());
	}
 
開發者ID:mediathekview,項目名稱:MediathekView,代碼行數:23,代碼來源:BottomBar.java

示例4: installListeners

import com.explodingpixels.widgets.WindowUtils; //導入方法依賴的package包/類
@Override
protected void installListeners() {
    super.installListeners();
    // give the ScrollBarSkin the decrement and increment MouseListeners so that it may attach
    // them to the appropriate components.
    fSkin.installMouseListenersOnButtons(new CustomArrowButtonListener(-1), new CustomArrowButtonListener(1));
    // repaint the scrollbar when the focus state of the parent window changes.
    WindowUtils.installJComponentRepainterOnWindowFocusChanged(scrollbar);
}
 
開發者ID:mathieulegoc,項目名稱:SmartTokens,代碼行數:10,代碼來源:SkinnableScrollBarUI.java

示例5: PreferencesTabBar

import com.explodingpixels.widgets.WindowUtils; //導入方法依賴的package包/類
public PreferencesTabBar() {
    Border b = BorderFactory.createEmptyBorder(0, 4, 0, 4);
    fPreferencesTabBar.getComponent().setBorder(b);
    UnifiedToolBar.installUnifiedToolBarBorder(fPreferencesTabBar.getComponent());
    fixUnifiedToolBarOnMacIfNeccessary(fPreferencesTabBar);
    WindowUtils.installJComponentRepainterOnWindowFocusChanged(fPreferencesTabBar.getComponent());
}
 
開發者ID:mathieulegoc,項目名稱:SmartTokens,代碼行數:8,代碼來源:PreferencesTabBar.java

示例6: installListeners

import com.explodingpixels.widgets.WindowUtils; //導入方法依賴的package包/類
@Override
protected void installListeners() {
    super.installListeners();
    // install a property change listener that repaints the JTree when the parent window's
    // focus state changes.
    WindowUtils.installJComponentRepainterOnWindowFocusChanged(tree);
}
 
開發者ID:mathieulegoc,項目名稱:SmartTokens,代碼行數:8,代碼來源:SourceListTreeUI.java

示例7: setDefaultLookAndFeel

import com.explodingpixels.widgets.WindowUtils; //導入方法依賴的package包/類
/**
     * This method sets the default look and feel before the components are
     * drawn. This is needed in case the user has changed the default look and
     * feel and we need to set something different than the usual default.
     */
    private void setDefaultLookAndFeel() {
        try {
            // System.setProperty("awt.useSystemAAFontSettings", "on");
            try { // Try to scale default font size according to screen resolution.
                Font fm = (Font) UIManager.getLookAndFeelDefaults().get("defaultFont");
                // check if laf supports default font
                if (fm != null) {
                    UIManager.getLookAndFeelDefaults().put("defaultFont", fm.deriveFont(fm.getSize2D() * Toolkit.getDefaultToolkit().getScreenResolution() / 96));
                }
            } catch (HeadlessException e) {
            }            
            // UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
            String laf = settings.getLookAndFeel();
            if (laf.equals(Constants.seaGlassLookAndFeelClassName)) {
                laf = "com.seaglasslookandfeel.SeaGlassLookAndFeel";
            }
            UIManager.setLookAndFeel(laf);
            // log info
            Constants.zknlogger.log(Level.INFO, "Using following LaF: {0}", settings.getLookAndFeel());
            // when we have mac os with aqua look and feel, set menubar to main-menubar at top of screen
            if (settings.isMacAqua()) {
                System.setProperty("apple.laf.useScreenMenuBar", "true");
                System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Zettelkasten");
                MacUtils.makeWindowLeopardStyle(ZettelkastenView.super.getFrame().getRootPane());
//                WindowUtils.createAndInstallRepaintWindowFocusListener(ZettelkastenView.super.getFrame());
                WindowUtils.installJComponentRepainterOnWindowFocusChanged(ZettelkastenView.super.getFrame().getRootPane());
            }
            if (settings.isSeaGlass()) {
                // ZettelkastenView.super.getFrame().getRootPane().putClientProperty("SeaGlass.UnifiedToolbarLook", Boolean.TRUE);
                ZettelkastenView.super.getFrame().getRootPane().setBackground(ColorUtil.colorSeaGlassGray);
            }
        } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
            Constants.zknlogger.log(Level.WARNING, ex.getLocalizedMessage());
        }
    }
 
開發者ID:sjPlot,項目名稱:Zettelkasten,代碼行數:41,代碼來源:ZettelkastenView.java

示例8: PreferencesTabBar

import com.explodingpixels.widgets.WindowUtils; //導入方法依賴的package包/類
public PreferencesTabBar() {
    Border b = BorderFactory.createEmptyBorder(0, 4, 0, 4);
    fPreferencesTabBar.getComponent().setBorder(b);
    UnifiedToolBar.installUnifiedToolBarBorder(fPreferencesTabBar.getComponent());
    fPreferencesTabBar.setBackgroundPainter(MacPainterFactory.createTexturedWindowWorkaroundPainter());
    WindowUtils.installJComponentRepainterOnWindowFocusChanged(fPreferencesTabBar.getComponent());
}
 
開發者ID:mediathekview,項目名稱:MediathekView,代碼行數:8,代碼來源:PreferencesTabBar.java

示例9: initialize

import com.explodingpixels.widgets.WindowUtils; //導入方法依賴的package包/類
protected void initialize()
{
       WindowUtils.installJComponentRepainterOnWindowFocusChanged(this);
}
 
開發者ID:mathieulegoc,項目名稱:SmartTokens,代碼行數:5,代碼來源:ActivePanel.java

示例10: CModifyDesktopEntry

import com.explodingpixels.widgets.WindowUtils; //導入方法依賴的package包/類
/**
 * 
 * @param parent
 * @param s
 * @param ak
 * @param st
 * @param acc
 * @param content 
 */
@SuppressWarnings("LeakingThisInConstructor")
public CModifyDesktopEntry(DesktopFrame parent, Settings s, AutoKorrektur ak, StenoData st, AcceleratorKeys acc, String content) {

    settingsObj = s;
    spellObj = ak;
    stenoObj = st;
    accKeys = acc;
    desktopframe = parent;

    // create brushed look for window, so toolbar and window-bar become a unit
    if (settingsObj.isMacAqua()) {
        MacUtils.makeWindowLeopardStyle(getRootPane());
        // WindowUtils.createAndInstallRepaintWindowFocusListener(this);
        WindowUtils.installJComponentRepainterOnWindowFocusChanged(this.getRootPane());
    }
    // init locale for the default-actions cut/copy/paste
    Tools.initLocaleForDefaultActions(org.jdesktop.application.Application.getInstance(de.danielluedecke.zettelkasten.ZettelkastenApp.class).getContext().getActionMap(CModifyDesktopEntry.class, this));
    initComponents();
    // set application icon
    setIconImage(Constants.zknicon.getImage());
    // init all our document, window, and component-listeners
    initBorders(settingsObj);
    initListeners();
    initActionMaps();
    // if we have mac os x with aqua/leopard-style make window look like native leopard
    if (settingsObj.isMacAqua()) {
        setupMacOSXLeopardStyle();
    }
    if (settingsObj.isSeaGlass()) {
        setupSeaGlassStyle();
    }
    // init default font-size for tables, lists and textfields...
    initDefaultFontSize();
    // init the accelerator table
    initActionMaps();
    // This method initialises the toolbar buttons. depending on the user-setting, we either
    // display small, medium or large icons as toolbar-icons.
    initToolbarIcons();
    // when we have an entry to edit, fill the textfields with content
    // else set probable selected text from entry as "pre-content"
    // the content of "content" is retrieved from text-selection from the main window.
    initFields(content);
    // scroll text to first line
    jTextArea1.setCaretPosition(0);
    // reset modified-state...
    setModified(false);
    // reset the undomanager, in case it stored any changes
    // from the text field initiation when editing new entries
    undomanager.discardAllEdits();
    modifiedEntry = "";
}
 
開發者ID:sjPlot,項目名稱:Zettelkasten,代碼行數:61,代碼來源:CModifyDesktopEntry.java

示例11: SearchResultsFrame

import com.explodingpixels.widgets.WindowUtils; //導入方法依賴的package包/類
/**
 * 
 * @param zkn
 * @param d
 * @param sr
 * @param desk
 * @param s
 * @param ak
 * @param syn
 * @param bib 
 */
@SuppressWarnings("LeakingThisInConstructor")
public SearchResultsFrame(ZettelkastenView zkn, Daten d, SearchRequests sr, DesktopData desk, Settings s, AcceleratorKeys ak, Synonyms syn, BibTex bib) {
    searchframe = this;
    // init variables from parameters
    dataObj=d;
    desktopObj=desk;
    bibtexObj = bib;
    searchrequest=sr;
    synonymsObj = syn;
    accKeys = ak;
    settingsObj=s;
    mainframe=zkn;
    // check whether memory usage is logged. if so, tell logger that new entry windows was opened
    if (settingsObj.isMemoryUsageLogged) {
        // log info
        Constants.zknlogger.log(Level.INFO,"Memory usage logged. Search Results Window opened.");
    }
    // create brushed look for window, so toolbar and window-bar become a unit
    if (settingsObj.isMacAqua()) {
        MacUtils.makeWindowLeopardStyle(getRootPane());
        // WindowUtils.createAndInstallRepaintWindowFocusListener(this);
        WindowUtils.installJComponentRepainterOnWindowFocusChanged(this.getRootPane());
    }
    // init all components
    Tools.initLocaleForDefaultActions(org.jdesktop.application.Application.getInstance(de.danielluedecke.zettelkasten.ZettelkastenApp.class).getContext().getActionMap(SearchResultsFrame.class, this));
    initComponents();
    initListeners();
    // remove border, gui-builder doesn't do this
    initBorders(settingsObj);
    // set application icon
    setIconImage(Constants.zknicon.getImage());
    // if we have mac os x with aqua, make the window look like typical cocoa-applications
    if (settingsObj.isMacAqua()) {
        setupMacOSXLeopardStyle();
    }
    if (settingsObj.isSeaGlass()) {
        setupSeaGlassStyle();
    }
    // init toggle-items
    viewMenuHighlight.setSelected(settingsObj.getHighlightSearchResults());
    tb_highlight.setSelected(settingsObj.getHighlightSearchResults());
    viewMenuShowEntry.setSelected(settingsObj.getShowSearchEntry());
    jButtonResetList.setEnabled(false);
    // init table
    initTable();
    // init combobox. The automatic display-update should be managed
    // through the combobox's action listener
    initComboBox();
    // init the menu-accelerator table
    initAcceleratorTable();
    initActionMaps();
    // This method initialises the toolbar buttons. depending on the user-setting, we either
    // display small, medium or large icons as toolbar-icons.
    initToolbarIcons();
    // init default sont-sizes
    initDefaultFontSize();
    // and update the title
    updateTitle();
}
 
開發者ID:sjPlot,項目名稱:Zettelkasten,代碼行數:71,代碼來源:SearchResultsFrame.java


注:本文中的com.explodingpixels.widgets.WindowUtils.installJComponentRepainterOnWindowFocusChanged方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。