• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java JXMultiSplitPane类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createMultiSplitPaneDemo

import org.jdesktop.swingx.JXMultiSplitPane; //导入依赖的package包/类
private void createMultiSplitPaneDemo() {
  setLayout( new BorderLayout());

  JXMultiSplitPane msp = new JXMultiSplitPane();

  String layoutDef = "(COLUMN (ROW weight=0.8 (COLUMN weight=0.25 " +
      "(LEAF name=left.top weight=0.5) (LEAF name=left.middle weight=0.5))" +
      "(LEAF name=editor weight=0.75)) (LEAF name=bottom weight=0.2))";

  MultiSplitLayout.Node modelRoot = MultiSplitLayout.parseModel( layoutDef );
  msp.getMultiSplitLayout().setModel( modelRoot );

  msp.add( new JButton( "Left Top" ), "left.top" );
  msp.add( new JButton( "Left Middle" ), "left.middle" );
  msp.add( new JButton( "Editor" ), "editor" );
  msp.add( new JButton( "Bottom" ), "bottom" );

  // ADDING A BORDER TO THE MULTISPLITPANE CAUSES ALL SORTS OF ISSUES
  msp.setBorder( BorderFactory.createEmptyBorder( 4, 4, 4, 4 ) );

  add( msp, BorderLayout.CENTER );
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:23,代码来源:MultiSplitPaneDemo.java


示例2: createSplitPane

import org.jdesktop.swingx.JXMultiSplitPane; //导入依赖的package包/类
private JComponent createSplitPane() {
        final JComponent demoContainer = new JXPanel();
        demoContainer.setLayout(new BorderLayout()); //BoxLayout(demoContainer, BoxLayout.LINE_AXIS));
        demoContainer.setBorder(BorderFactory.createLineBorder(Color.RED));
        
//      <snip> MultiSplit layout declaration
        String layout = 
            "(ROW " +
                 "(LEAF name=selector weight=0.3)" +
                 "(COLUMN weight=0.7 " +
                     "(LEAF name= demo weight=0.7)" +
                     "(LEAF name=source weight=0.3)" +
                 ")" +
            ")"; 
        MultiSplitLayout multiSplitLayout = new MultiSplitLayout(MultiSplitLayout.parseModel(layout));
//        </snip>
        JXMultiSplitPane splitPane = new JXMultiSplitPane();
        splitPane.setLayout(multiSplitLayout);
        splitPane.add("selector", createButtonStack(demoContainer));
        splitPane.add("demo", demoContainer);
        return splitPane;
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:23,代码来源:LoadedPanelExperiments.java


示例3: createTextAction

import org.jdesktop.swingx.JXMultiSplitPane; //导入依赖的package包/类
/**
 * @param demoContainer
 * @return
 */
private Action createTextAction(final JComponent demoContainer) {
    Action action = new AbstractAction("add editor - setText") {
        
        @Override
        public void actionPerformed(ActionEvent e) {
            demoContainer.removeAll();
            demoContainer.add(new JScrollPane(createEditorSetText()));
            JXMultiSplitPane pane = SwingXUtilities.getAncestor(JXMultiSplitPane.class, demoContainer);
            if (pane != null) {
                pane.revalidate();
            } else {
                demoContainer.revalidate();
            }
            
        }
    };
    return action;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:23,代码来源:LoadedPanelExperiments.java


示例4: createEditorSetPage

import org.jdesktop.swingx.JXMultiSplitPane; //导入依赖的package包/类
/**
 * @return
 */
protected JComponent createEditorSetPage() {
    final JEditorPane editor = createEditor();
    URL descriptionURL = getHTMLDescription();
    try {
        editor.setPage(descriptionURL);
    } catch (IOException e) {
        System.err.println("couldn't load description from URL:" + descriptionURL);
    }
    PropertyChangeListener l = new PropertyChangeListener() {
        
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            JXMultiSplitPane pane = SwingXUtilities.getAncestor(JXMultiSplitPane.class, editor);
            if (pane != null) {
                MultiSplitLayout layout = pane.getMultiSplitLayout();
                layout.layoutByWeight(pane.getParent());
            } 

        }
    };
    editor.addPropertyChangeListener("page", l);
    return editor;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:27,代码来源:LoadedPanelExperiments.java


示例5: createMultiColums

import org.jdesktop.swingx.JXMultiSplitPane; //导入依赖的package包/类
/**
 * This method creates a pane split into resizeable columns, containing its
 * arguments. The original column widths are weighted according to the
 * getWeight functions of each element handler.
 * @param elemHandlers
 * @return a freshly created split pane containing the elements
 */
private JXMultiSplitPane createMultiColums(ElementHandler... elemHandlers) {
	/*
	 * allocate one column for each real column and each divider
	 * -> elemHandlers.length columns
	 * -> elemHandlers.length - 1 dividers
	 */
	MultiSplitLayout.Node[] columns = new MultiSplitLayout.Node[elemHandlers.length*2 - 1];
	/*
	 * The sum of the weights in a MultiSplitLayout has to be <= 1.0,
	 * divide each arbitrary weight by the sum of all weights to get there.
	 */
	double totalWeight = 0;
	for(ElementHandler elemHandler : elemHandlers)
		totalWeight += elemHandler.getWeight();
    for(int i=0; i<elemHandlers.length; ++i) {
    	MultiSplitLayout.Leaf leaf = new MultiSplitLayout.Leaf(Integer.toString(i));
    	columns[2*i] = leaf;
    	leaf.setWeight(elemHandlers[i].getWeight() / totalWeight);
    }
    for(int i=0; i<columns.length; ++i)
    	if(columns[i] == null)
    		columns[i] = new MultiSplitLayout.Divider();
    MultiSplitLayout.Node layoutRoot = new MultiSplitLayout.RowSplit(columns);
    MultiSplitLayout layout = new MultiSplitLayout(layoutRoot);
    layout.setLayoutByWeight(true);
    JXMultiSplitPane pane = new JXMultiSplitPane(layout);
    for(int i=0; i<elemHandlers.length; ++i)
    	pane.add(Integer.toString(i), elemHandlers[i].toComponent());
    return pane;
}
 
开发者ID:AMOSTeam3,项目名称:amos-ss15-proj3,代码行数:38,代码来源:GuiViewElementHandler.java


示例6: positionRequirementPanelElements

import org.jdesktop.swingx.JXMultiSplitPane; //导入依赖的package包/类
private void positionRequirementPanelElements() {
	Requirement_HandlerRequirementTab = new Requirement_ElementHandler();
    Requirement_Detail_Handler = new Requirement_Detail_ElementHandler();
    JXMultiSplitPane pane = createMultiColums(Requirement_HandlerRequirementTab, Requirement_Detail_Handler);
   
    requirementModificationPanel.add(pane, BorderLayout.CENTER);
}
 
开发者ID:AMOSTeam3,项目名称:amos-ss15-proj3,代码行数:8,代码来源:GuiViewElementHandler.java


示例7: MainWindow

import org.jdesktop.swingx.JXMultiSplitPane; //导入依赖的package包/类
/**
 * Creates new form MainFrame
 */
public MainWindow() {
    initComponents();
    menuItemCopy.addActionListener(new DefaultEditorKit.CopyAction());
    menuItemCut.addActionListener(new DefaultEditorKit.CutAction());
    menuItemPaste.addActionListener(new DefaultEditorKit.PasteAction());
    setActionCommands();
    filterManager = new FilterManager();
    actionHandler = new ActionHandler(this, tmData, filterManager);
    actionHandler.setModelMediator(this);
    tmView = new TmView(actionHandler);
    alignToolBar = new AlignToolBar(actionHandler);
    editToolBar = new EditToolBar(actionHandler);
    editLeftSegment.setModelMediator(this);
    editRightSegment.setModelMediator(this);
    labelStatusBar = new JXLabel(" ");
    panelStatusBar = new JXStatusBar();
    msp = new JXMultiSplitPane();
    tableRows = new JXLabel(" ");
    makeUi();
    getContentPane().add(toolBar, BorderLayout.NORTH);
    getContentPane().add(msp);
    getContentPane().add(panelStatusBar, BorderLayout.SOUTH);
    setTitle(AppConstants.getDisplayNameAndVersion());

    if (Platform.isMacOsx()) {
        setMacProxy();
    }
    setCloseHandler();
    setMainFrameSize();
}
 
开发者ID:miurahr,项目名称:tmpotter,代码行数:34,代码来源:MainWindow.java


示例8: createContents

import org.jdesktop.swingx.JXMultiSplitPane; //导入依赖的package包/类
private Component createContents() {
  JPanel panel = new JPanel();
  panel.setLayout(new BorderLayout());

  JXMultiSplitPane msp = new JXMultiSplitPane();

  // @formatter:off
  TestProperty.propertyStore.setIfNull("ui.layout", "(COLUMN (ROW (LEAF name=componentTree weight=1.0) "
      + "(LEAF name=editor )) " + "(ROW (LEAF name=properties weight=0.8) " + "(LEAF name=preview weight=0.05)))");

  String layoutDef = TestProperty.propertyStore.get("ui.layout");

  // @formatter:on

  MultiSplitLayout.Node modelRoot = MultiSplitLayout.parseModel(layoutDef);

  msp.getMultiSplitLayout().setModel(modelRoot);

  componentTreePane = new ComponentTreePane(this);
  editorPane = new EditorPane(this);
  propertyPane = new PropertyPane(this);
  previewPane = new PreviewPane(this);

  msp.add(componentTreePane, "componentTree");
  msp.add(editorPane, "editor");
  msp.add(propertyPane, "properties");
  msp.add(previewPane, "preview");

  // adding a border to the multiplane causes all sorts of issues
  msp.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));

  panel.add(msp, BorderLayout.CENTER);
  pack();
  return panel;
}
 
开发者ID:gigony,项目名称:GUITester-core,代码行数:36,代码来源:GUITesterFrame.java


示例9: positionRequirementManagementPanelElements

import org.jdesktop.swingx.JXMultiSplitPane; //导入依赖的package包/类
private void positionRequirementManagementPanelElements() {
	JXMultiSplitPane pane = createMultiColums(Requirement_Handler_ManagementTab, Commit_Handler_ManagementTab, Linkage_Handler);
   
    LinkageManagmentPanel.add(pane, BorderLayout.CENTER);
}
 
开发者ID:AMOSTeam3,项目名称:amos-ss15-proj3,代码行数:6,代码来源:GuiViewElementHandler.java


示例10: createMainPanel

import org.jdesktop.swingx.JXMultiSplitPane; //导入依赖的package包/类
protected JComponent createMainPanel() {
//        <snip> MultiSplit layout declaration
        String layout = 
            "(ROW " +
                 "(LEAF name=selector weight=0.25)" +
                 "(COLUMN weight=0.75 " +
                     "(LEAF name= demo weight=0.7)" +
                     "(LEAF name=source weight=0.3)" +
                 ")" +
            ")"; 
        multiSplitLayout = new MultiSplitLayout(MultiSplitLayout.parseModel(layout));
//        </snip>
        JXMultiSplitPane splitPane = new JXMultiSplitPane();
        splitPane.setLayout(multiSplitLayout);

        // Create demo selector panel on left
        JComponent demoSelectorPanel = demoSelector.getSelectorComponent();
        demoSelectorPanel.setBorder(PANEL_BORDER);
        splitPane.add(demoSelectorPanel, "selector");
        
        // Create panel to contain currently running demo
        JComponent demoContainer = new JXPanel();
        demoContainer.setLayout(new BorderLayout());
        demoContainer.setBorder(PANEL_BORDER);
        splitPane.add(demoContainer, "demo");

        // Create source code pane
        codeViewer = new CodeViewer();
//        Font font = codeViewer.getFont();
//        codeViewer.setFont(font.deriveFont(Font.BOLD, 20.f));
        JComponent codeContainer = new JPanel(new BorderLayout());
        codeContainer.add(codeViewer);
        codeContainer.setBorder(PANEL_BORDER);
        splitPane.add(codeContainer, "source");
        
        // Create shareable popup menu for demo actions
        popup = new JPopupMenu();
        popup.add(new EditPropertiesAction());
        popup.add(new ViewCodeSnippetAction());

        return splitPane;
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:43,代码来源:SwingXSet.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java QuerySort类代码示例发布时间:2022-05-22
下一篇:
Java VelocityUtils类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap