当前位置: 首页>>代码示例>>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;未经允许,请勿转载。