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


Java UIManager.getBoolean方法代码示例

本文整理汇总了Java中javax.swing.UIManager.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java UIManager.getBoolean方法的具体用法?Java UIManager.getBoolean怎么用?Java UIManager.getBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.UIManager的用法示例。


在下文中一共展示了UIManager.getBoolean方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: paintComponent

import javax.swing.UIManager; //导入方法依赖的package包/类
@Override
protected void paintComponent(Graphics g) {
    if( UIManager.getBoolean( "nb.startpage.defaultbackground" ) ) { //NOI18N
        super.paintComponent( g );
    } else {
        Graphics2D g2d = (Graphics2D) g;
        int width = getWidth();
        int height = getHeight();
        int gradientStop = height / 2;
        int bottomStart = gradientStop + gradientStop/2;

        g2d.setPaint(new GradientPaint(0, 0, COLOR_TOP_START, 0, gradientStop, COLOR_TOP_END));
        g2d.fillRect(0, 0, width, gradientStop);
        g2d.setPaint( COLOR_TOP_END );
        g2d.fillRect( 0, gradientStop, width, bottomStart );

        g2d.setPaint(new GradientPaint(0, bottomStart, COLOR_BOTTOM_START, 0, height, COLOR_BOTTOM_END));
        g2d.fillRect(0, bottomStart, width, height);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:StartPageContent.java

示例2: paintComponent

import javax.swing.UIManager; //导入方法依赖的package包/类
@Override
protected void paintComponent( Graphics g ) {
    Graphics2D g2d = ( Graphics2D ) g;
    int width = getWidth();
    int height = getHeight();

    g2d.setColor( Utils.getBorderColor() );
    g2d.drawRect( 0, 0, width, 12 );

    if( UIManager.getBoolean( "nb.startpage.defaultbackground" ) ) { //NOI18N
        g2d.setColor( UIManager.getColor("Tree.background") ); //NOI18N
    } else {
        g2d.setPaint( new GradientPaint( 0, 0, COL_GRADIENT_START, 0, 12, COL_GRADIENT_END ) );
    }
    g2d.fillRect( 1, 0, width-2, 12 );

    int imgWidth = IMG_BANNER.getWidth( this );
    int imgX = (width - imgWidth)/2;
    g2d.drawImage( IMG_BANNER, imgX, 13, imgWidth, height-13, this );
    if( imgX > 0 ) {
        g2d.setPaint( COL_BANNER_LEFT );
        g2d.fillRect( 0, 13, imgX, height-13 );
        g2d.setPaint( COL_BANNER_RIGHT );
        g2d.fillRect( width-imgX-1, 13, imgX+1, height-13 );
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ContentHeader.java

示例3: ToolbarConfiguration

import javax.swing.UIManager; //导入方法依赖的package包/类
/** Creates new empty toolbar configuration for specific name.
 * @param name new configuration name
 */
ToolbarConfiguration( String name, String displayName, List<ToolbarRow> rows ) {
    configName = name;
    // fix #44537 - just doing the simple thing of hacking the extension out of the display name.. node.getDisplayName is too unpredictable.
    if (displayName.endsWith(".xml")) {
        displayName = displayName.substring(0, displayName.length() - ".xml".length());
    }
    configDisplayName = displayName;
    // asociate name and configuration instance
    name2config.put(name, this);
    toolbarPanel = new JPanel( new GridLayout(0,1) ) {
        @Override
        public boolean isOpaque() {
            if( null != UIManager.get("NbMainWindow.showCustomBackground") ) //NOI18N
                return !UIManager.getBoolean("NbMainWindow.showCustomBackground"); //NOI18N
            return super.isOpaque();
        }
    };

    this.rows = new ArrayList<ToolbarRow>(rows);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:ToolbarConfiguration.java

示例4: setUI

import javax.swing.UIManager; //导入方法依赖的package包/类
public void setUI(TreeUI ui) {
    if (ui instanceof SynthTreeUI) {
        if (synthLikeUI == null) {
            super.setUI(ui);
            SynthTreeUI synthUI = (SynthTreeUI)ui;
            int left = synthUI.getLeftChildIndent();
            int right = synthUI.getRightChildIndent();

            synthLikeUI = new SynthLikeTreeUI();
            super.setUI(synthLikeUI);

            boolean nimbus = UIUtils.isNimbusLookAndFeel();
            synthLikeUI.setLeftChildIndent(left + (nimbus ? 4 : 6));
            synthLikeUI.setRightChildIndent(right);
        } else {
            super.setUI(synthLikeUI);
        }
    } else {
        super.setUI(ui);
        
        // #269500 - performance workaround for BasicTreeUI
        if (!DISABLE_TREEUI_FIX && ui instanceof BasicTreeUI)
            workaroundVerticalLines = UIManager.getBoolean("Tree.paintLines"); // NOI18N
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:ProfilerTreeTable.java

示例5: DesktopImpl

import javax.swing.UIManager; //导入方法依赖的package包/类
/** Creates a new instance of DesktopImpl */
public DesktopImpl () {
    // layered pane with absolute positioning, to enable overlapping
    layeredPane = new JLayeredPane();
    layeredPane.setLayout(new LayeredLayout());
    // desktop represents regular layer of layeredPane
    desktop = new JPanel() {
        @Override
        public boolean isOpaque() {
            if( UIManager.getBoolean( "NbMainWindow.showCustomBackground" ) ) //NOI18N
                return false;
            return super.isOpaque();
        }

        @Override
        public void updateUI() {
            Mutex.EVENT.readAccess( new Runnable() {
                @Override
                public void run() {
                    superUpdateUI();
                }
            });
        }

        private void superUpdateUI() {
            super.updateUI();
        }
    };
    desktop.setLayout(new GridBagLayout());
    Color bkColor = UIManager.getColor("NbSplitPane.background"); //NOI18N
    if( null != bkColor ) {
        desktop.setBackground(bkColor);
        desktop.setOpaque(true);
    }
    layeredPane.add(desktop);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:DesktopImpl.java

示例6: updateCorners

import javax.swing.UIManager; //导入方法依赖的package包/类
public void updateCorners() {
    if( UIManager.getBoolean( "NbMainWindow.showCustomBackground" ) ) //NOI18N
        return;
    
    SlidingView leftSlide = null;
    SlidingView topSlide = null;
    for( SlidingView view : slidingViews ) {
        if( Constants.LEFT.equals(view.getSide()) ) {
            leftSlide = view;
        }
        if( Constants.TOP.equals(view.getSide()) ) {
            topSlide = view;
        }
    }
    if( null == leftSlide || null == topSlide )
        return;

    desktop.setOpaque(true);
    if( !leftSlide.getTopComponents().isEmpty() || !topSlide.getTopComponents().isEmpty() ) {
        desktop.setBackground(new JPanel().getBackground());
    } else {
        Color bkColor = UIManager.getColor("NbSplitPane.background"); //NOI18N
        if( null != bkColor ) {
            desktop.setBackground(bkColor);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:DesktopImpl.java

示例7: MultiSplitPane

import javax.swing.UIManager; //导入方法依赖的package包/类
public MultiSplitPane() {
    setLayout( new MultiSplitLayout() );
    addMouseMotionListener( this );
    addMouseListener( this );

    Color bkColor = UIManager.getColor("NbSplitPane.background");
    if( null != bkColor ) {
        setBackground(bkColor);
        setOpaque(true);
    }
    if( UIManager.getBoolean( "NbMainWindow.showCustomBackground" ) ) //NOI18N
        setOpaque(false);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:MultiSplitPane.java

示例8: VisualPanel

import javax.swing.UIManager; //导入方法依赖的package包/类
public VisualPanel (SlideBarContainer modeContainer) {
    super(new BorderLayout());
    this.modeContainer = modeContainer;
    // To be able to activate on mouse click.
    enableEvents(java.awt.AWTEvent.MOUSE_EVENT_MASK);
    side = modeContainer.getSlidingView().getSide();
    if( isAqua ) {
        setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
        setOpaque(true);
    }
    if( UIManager.getBoolean( "NbMainWindow.showCustomBackground" ) ) //NOI18N
        setOpaque( false);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:SlideBarContainer.java

示例9: actionPerformed

import javax.swing.UIManager; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
	if (UIManager.getBoolean("FileChooser.readOnly")) {
		return;
	}
	JFileChooser fc = getFileChooser();
	File currentDirectory = fc.getCurrentDirectory();
	FileSystemView fsv = fc.getFileSystemView();
	File newFolder = null;

	String name = SwingTools.showInputDialog("file_chooser.new_folder", "");

	try {
		if (name != null && !"".equals(name)) {
			newFolder = fsv.createNewFolder(currentDirectory);
			if (newFolder.renameTo(fsv.createFileObject(fsv.getParentDirectory(newFolder), name))) {
				newFolder = fsv.createFileObject(fsv.getParentDirectory(newFolder), name);
			} else {
				SwingTools.showVerySimpleErrorMessage("file_chooser.new_folder.rename", name);
			}
		}
	} catch (IOException exc) {
		SwingTools.showVerySimpleErrorMessage("file_chooser.new_folder.create", name);
		return;
	} catch (Exception exp) {
		// do nothing
	}

	if (fc.isMultiSelectionEnabled()) {
		fc.setSelectedFiles(new File[] { newFolder });
	} else {
		fc.setSelectedFile(newFolder);
	}

	fc.rescanCurrentDirectory();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:37,代码来源:FileChooserUI.java

示例10: getNewFolderAction

import javax.swing.UIManager; //导入方法依赖的package包/类
@Override
public Action getNewFolderAction() {
	Action newFolderAction = new NewFolderAction();
	// Note: Don't return null for readOnly, it might
	// break older apps.
	if (UIManager.getBoolean("FileChooser.readOnly")) {
		newFolderAction.setEnabled(false);
	}
	return newFolderAction;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:11,代码来源:FileChooserUI.java

示例11: isDefaultButtons

import javax.swing.UIManager; //导入方法依赖的package包/类
public static boolean isDefaultButtons() {
    return UIManager.getBoolean( "nb.startpage.defaultbuttonborder" ); //NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:Utils.java

示例12: isSimpleTabs

import javax.swing.UIManager; //导入方法依赖的package包/类
public static boolean isSimpleTabs() {
    return UIManager.getBoolean( "nb.startpage.simpletabs" ); //NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:Utils.java

示例13: isDarkLaF

import javax.swing.UIManager; //导入方法依赖的package包/类
private static boolean isDarkLaF() {
    return UIManager.getBoolean("nb.dark.theme"); //NOI18N 
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:ImageUtilities.java

示例14: isOpaque

import javax.swing.UIManager; //导入方法依赖的package包/类
@Override
public boolean isOpaque() {
    if( null != UIManager.get("NbMainWindow.showCustomBackground") ) //NOI18N
        return !UIManager.getBoolean("NbMainWindow.showCustomBackground"); //NOI18N
    return super.isOpaque();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:MenuBar.java


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