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


Java DockableFrame类代码示例

本文整理汇总了Java中com.jidesoft.docking.DockableFrame的典型用法代码示例。如果您正苦于以下问题:Java DockableFrame类的具体用法?Java DockableFrame怎么用?Java DockableFrame使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: registerNormalView

import com.jidesoft.docking.DockableFrame; //导入依赖的package包/类
private void registerNormalView(PageComponent pageComponent, JideViewDescriptor viewDescriptor) {
	if (logger.isInfoEnabled()) {
		logger.info("Registering view " + pageComponent.getId());
	}
	DockingManager manager = window.getDockingManager();
	String frameName = pageComponent.getId();
	if (manager.getAllFrameNames().contains(frameName)) {
		if (logger.isDebugEnabled()) {
			logger.debug("Showing existing docked frame " + frameName);
		}
		DockContext currentContext = manager.getContextOf(frameName);
		if (currentContext.isHidden()) {
			if (viewDescriptor.isFloatOnShow()) {
				manager.floatFrame(frameName, viewDescriptor.getFloatBounds(), true);
			} 
			else {
				manager.showFrame(frameName);
			}
		} 
		else {
			manager.activateFrame(frameName);
		}
	} 
	else {
		if (logger.isDebugEnabled()) {
			logger.debug("Adding new dockable frame " + frameName);
		}
		DockableFrame frame = createDockableFrame(pageComponent, viewDescriptor);
		manager.addFrame(frame);
		if(viewDescriptor.getShowTitleBar() != null){
			frame.setShowTitleBar(viewDescriptor.getShowTitleBar().booleanValue());
		}
	}
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:35,代码来源:JideApplicationPage.java

示例2: getDockableFrame

import com.jidesoft.docking.DockableFrame; //导入依赖的package包/类
DockableFrame getDockableFrame() {
    return dockableFrame;
}
 
开发者ID:Captain-Chaos,项目名称:WorldPainter,代码行数:4,代码来源:Palette.java

示例3: build

import com.jidesoft.docking.DockableFrame; //导入依赖的package包/类
DockableFrame build() {
    DockableFrame dockableFrame = new DockableFrame(id);

    JPanel panel = new JPanel(new GridBagLayout());
    if (margin > 0) {
        panel.setBorder(new EmptyBorder(margin, margin, margin, margin));
    }
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridwidth = GridBagConstraints.REMAINDER;
    constraints.weightx = 1.0;
    if (expand) {
        constraints.fill = GridBagConstraints.BOTH;
        constraints.weighty = 1.0;
        panel.add(component, constraints);
    } else {
        constraints.fill = GridBagConstraints.HORIZONTAL;
        panel.add(component, constraints);
        constraints.weighty = 1.0;
        panel.add(new JPanel(), constraints);
    }
    dockableFrame.add(panel, BorderLayout.CENTER);

    // Use title everywhere
    dockableFrame.setTitle(title);
    dockableFrame.setSideTitle(title);
    dockableFrame.setTabTitle(title);
    dockableFrame.setToolTipText(title);

    // Try to find an icon to use for the tab
    if ((icon == null) && (component instanceof Container)) {
        icon = findIcon((Container) component);
        if (icon != null) {
            if (((icon.getIconHeight() > 16 * UI_SCALE) || (icon.getIconWidth() > 16 * UI_SCALE))
                    && (icon instanceof ImageIcon)
                    && (((ImageIcon) icon).getImage() instanceof BufferedImage)) {
                float s;
                if (icon.getIconWidth() > icon.getIconHeight()) {
                    // Wide icon
                    s = 16f * UI_SCALE / icon.getIconWidth();
                } else {
                    // Tall (or square) icon
                    s = 16f * UI_SCALE / icon.getIconHeight();
                }
                BufferedImageOp op = new AffineTransformOp(AffineTransform.getScaleInstance(s, s), AffineTransformOp.TYPE_BICUBIC);
                BufferedImage iconImage = op.filter((BufferedImage) ((ImageIcon) icon).getImage(), null);
                icon = new ImageIcon(iconImage);
            }
        }
    }
    dockableFrame.setFrameIcon(icon);

    // Use preferred size of component as much as possible
    final java.awt.Dimension preferredSize = component.getPreferredSize();
    dockableFrame.setAutohideWidth(preferredSize.width);
    dockableFrame.setDockedWidth(preferredSize.width);
    dockableFrame.setDockedHeight(preferredSize.height);
    dockableFrame.setUndockedBounds(new Rectangle(-1, -1, preferredSize.width, preferredSize.height));

    // Make hidable, but don't display hide button, so incidental panels can
    // be hidden on the fly
    dockableFrame.setHidable(true);
    dockableFrame.setAvailableButtons(BUTTON_FLOATING | BUTTON_AUTOHIDE | BUTTON_HIDE_AUTOHIDE);
    dockableFrame.setShowContextMenu(false); // Disable the context menu because it contains the Close option with no way to hide it

    // Initial location of panel
    dockableFrame.setInitMode(DockContext.STATE_FRAMEDOCKED);
    dockableFrame.setInitSide(side);
    dockableFrame.setInitIndex(index);

    // Other flags
    dockableFrame.setAutohideWhenActive(true);
    dockableFrame.setMaximizable(false);

    //Help key
    dockableFrame.putClientProperty(HELP_KEY_KEY, "Panel/" + id);
    return dockableFrame;
}
 
开发者ID:Captain-Chaos,项目名称:WorldPainter,代码行数:78,代码来源:App.java


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