Package org.jdesktop.swingx

Examples of org.jdesktop.swingx.MultiSplitLayout$Node


    boolean status(final List<String> toks) {
        if (standaloneNodes.size() > 0) {
            out.println("Standalone Nodes:");
            for (String nodeName : standaloneNodes.keySet()) {
                Node node = standaloneNodes.get(nodeName);
                for (String curi : node.getInstalledContributions()) {
                    for (String dc : node.getDeployedComposites(curi)) {
                        out.println("   " + nodeName + " " + dc);
                    }
                }
            }
            out.println();
        }
        if (nodes.size() > 0) {
            for (Node node : nodes.values()) {
                out.println("Domain: " + node.getDomainName());
                List<String> ics;
                if (toks.size() > 1) {
                    ics = new ArrayList<String>();
                    ics.add(toks.get(1));
                } else {
                    ics = node.getInstalledContributions();
                }

                for (String curi : ics) {
                    Contribution c = node.getInstalledContribution(curi);
                    List<String> dcs = node.getDeployedComposites(curi);
                    if (toks.size() > 2) {
                        dcs = new ArrayList<String>();
                        dcs.add(toks.get(2));
                    } else {
                        dcs = node.getDeployedComposites(curi);
                    }
                    for (String compositeUri : dcs) {
                        for (Artifact a : c.getArtifacts()) {
                            if (compositeUri.equals(a.getURI())) {
                                out.println("   " + curi
View Full Code Here


                 "(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);
View Full Code Here

           
            @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);
View Full Code Here

                 "(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
View Full Code Here

    multiSplitPane = new JXMultiSplitPane();
    multiSplitPane.setDividerSize( 5 );
    multiSplitPane.getMultiSplitLayout().setModel( modelRoot );
   
    MultiSplitLayout multiSplitLayout = multiSplitPane.getMultiSplitLayout();
    multiSplitLayout.setLayoutMode( MultiSplitLayout.USER_MIN_SIZE_LAYOUT  );
    multiSplitLayout.layoutByWeight( multiSplitPane );

    cardPanel = new XCardPanel( multiSplitPane );

    dockingPanel.add( leftSidebar, BorderLayout.WEST );
    dockingPanel.add( rightSidebar, BorderLayout.EAST );
View Full Code Here

    String layout = (String)params.get( "config" );
    if (( layout == null ) || ( layout.length() == 0 ))
      layout = defaultLayoutDef;
   
    MultiSplitLayout.Node modelRoot = MultiSplitLayout.parseModel( layout );
    MultiSplitLayout multiSplitLayout = multiSplitPane.getMultiSplitLayout();
    multiSplitLayout.setModel( modelRoot );
    multiSplitLayout.layoutByWeight( multiSplitPane );
  }
View Full Code Here

  /**
   * Attempt to restore the docking layout
   */  
  public void loadLayout( InputStream is )
  {
    MultiSplitLayout multiSplitLayout = multiSplitPane.getMultiSplitLayout();
    try {
      XMLDecoder d = new XMLDecoder(new BufferedInputStream( is ));
      MultiSplitLayout.Node model = (MultiSplitLayout.Node)( d.readObject());
      multiSplitLayout.setModel( model );
      multiSplitLayout.setFloatingDividers( false );
      d.close();

      // trick is used to restore the size of the example window
      multiSplitPane.setPreferredSize( model.getBounds().getSize());
     
      dockHiddenChildren();
    }
    catch (Exception exc) {
      MultiSplitLayout.Node model = MultiSplitLayout.parseModel( defaultLayoutDef );
      multiSplitLayout.setModel( model );
    }
  }
View Full Code Here

   * @param content the content that is wrapped by the XDockable
   * @return the XDockable instance or null if the component was not found
   */
  public XDockable findDockable( Object content )
  {
    MultiSplitLayout multiSplitLayout = multiSplitPane.getMultiSplitLayout();
    int numChildren = multiSplitPane.getComponentCount();
    for ( int i = 0; i < numChildren; i++ ) {
      Component comp = multiSplitPane.getComponent( i );
      if ( comp instanceof XDockableFrame ) {
        XDockable dockable = ((XDockableFrame)comp).findDockable( content );
View Full Code Here

  /**
   * Dock any children that have been restored.
   */
  private void dockHiddenChildren()
  {
    MultiSplitLayout multiSplitLayout = multiSplitPane.getMultiSplitLayout();
    int numChildren = multiSplitPane.getComponentCount();
    for ( int i = 0; i < numChildren; i++ ) {
      Component comp = multiSplitPane.getComponent( i );
      if ( comp instanceof XDockingPanel ) {
        MultiSplitLayout.Node node = multiSplitLayout.getNodeForComponent( comp );
        if ( !node.isVisible())
          ((XDockingPanel)comp).dock();
      }
    }
  }
View Full Code Here

   * set to true.
   * @param comp the component that has just been hidden
   */
  private void hideDividers( Component comp )
  {
    MultiSplitLayout layout = (MultiSplitLayout)splitPane.getLayout();
    MultiSplitLayout.Node node = layout.getNodeForComponent( comp );
    if ( node != null ) {
      MultiSplitLayout.Split p = node.getParent();
      p.hide( node );
      if ( !p.isVisible())
        p.getParent().hide( p );
     
      p.checkDividers( p );
      // If the split has become invisible then the parent may also have a divider
      // that needs to be hidden.
      while ( !p.isVisible()) {
        p = p.getParent();
        if ( p != null )
          p.checkDividers( p );
        else
          break;       
      }
    }
    layout.setFloatingDividers( false );
  }
View Full Code Here

TOP

Related Classes of org.jdesktop.swingx.MultiSplitLayout$Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.