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


Java Window.isActive方法代碼示例

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


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

示例1: findChildWindow

import java.awt.Window; //導入方法依賴的package包/類
/**
 * Finds the first direct child window of the given window that matches the
 * specified attributes.
 * 
 * @param baseWindow the parent window.
 * @param isVisible the child window must be visible or not.
 * @param isActive the child window must be active or not.
 * @return a child window matching the attributes, or null if none found.
 */
public static Window findChildWindow(Window baseWindow, boolean isVisible, boolean isActive)
{
	Window ownedWindows[] = baseWindow.getOwnedWindows();
	for( int i = 0; i < ownedWindows.length; ++i )
	{
		Window w = ownedWindows[i];

		// If this is an active Frame or Dialog then start again from it:
		if( (w instanceof Frame) || ((w instanceof Dialog) && ((Dialog) w).isModal()) )
		{
			boolean check1 = !(isVisible ^ w.isVisible());
			boolean check2 = !(isActive ^ w.isActive());

			if( check1 && check2 )
			{
				return ownedWindows[i];
			}
		}
	}

	return null;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:32,代碼來源:ComponentHelper.java

示例2: updateActive

import java.awt.Window; //導入方法依賴的package包/類
@Override
protected void updateActive(boolean active) {
    // #48588 - when in SDI, slidein needs to front the editor frame.
    if(active) {
        Window window = SwingUtilities.getWindowAncestor(panel);
        if(window != null && !window.isActive() && WindowManagerImpl.getInstance().getEditorAreaState() == Constants.EDITOR_AREA_SEPARATED) {
            window.toFront();
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:SlideBarContainer.java

示例3: isActive

import java.awt.Window; //導入方法依賴的package包/類
@Override
public boolean isActive() {
    Window window = SwingUtilities.getWindowAncestor(panel);
    // #54791 - just a doublecheck, IMHO should not happen anymore
    // after the winsys reenetrancy fix.
    return window == null ? false : window.isActive();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:SlideBarContainer.java

示例4: paintBorder

import java.awt.Window; //導入方法依賴的package包/類
public void paintBorder(Component c, Graphics g, int x, int y,
    int w, int h) {

    Color background;
    Color highlight;
    Color shadow;

    Window window = SwingUtilities.getWindowAncestor(c);
    if (window != null && window.isActive()) {
        background = MetalLookAndFeel.getPrimaryControlDarkShadow();
        highlight = MetalLookAndFeel.getPrimaryControlShadow();
        shadow = MetalLookAndFeel.getPrimaryControlInfo();
    } else {
        background = MetalLookAndFeel.getControlDarkShadow();
        highlight = MetalLookAndFeel.getControlShadow();
        shadow = MetalLookAndFeel.getControlInfo();
    }

    g.setColor(background);
    // Draw outermost lines
    g.drawLine( x+1, y+0, x+w-2, y+0);
    g.drawLine( x+0, y+1, x+0, y +h-2);
    g.drawLine( x+w-1, y+1, x+w-1, y+h-2);
    g.drawLine( x+1, y+h-1, x+w-2, y+h-1);

    // Draw the bulk of the border
    for (int i = 1; i < 5; i++) {
        g.drawRect(x+i,y+i,w-(i*2)-1, h-(i*2)-1);
    }

    if ((window instanceof Frame) && ((Frame) window).isResizable()) {
        g.setColor(highlight);
        // Draw the Long highlight lines
        g.drawLine( corner+1, 3, w-corner, 3);
        g.drawLine( 3, corner+1, 3, h-corner);
        g.drawLine( w-2, corner+1, w-2, h-corner);
        g.drawLine( corner+1, h-2, w-corner, h-2);

        g.setColor(shadow);
        // Draw the Long shadow lines
        g.drawLine( corner, 2, w-corner-1, 2);
        g.drawLine( 2, corner, 2, h-corner-1);
        g.drawLine( w-3, corner, w-3, h-corner-1);
        g.drawLine( corner, h-3, w-corner-1, h-3);
    }

}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:48,代碼來源:MetalBorders.java


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