Elegant Dockable framework : Dockable « Swing Components « Java

Java
1. 2D Graphics GUI
2. 3D
3. Advanced Graphics
4. Ant
5. Apache Common
6. Chart
7. Collections Data Structure
8. Database SQL JDBC
9. Design Pattern
10. Development Class
11. Email
12. Event
13. File Input Output
14. Game
15. Hibernate
16. J2EE
17. J2ME
18. JDK 6
19. JSP
20. JSTL
21. Language Basics
22. Network Protocol
23. PDF RTF
24. Regular Expressions
25. Security
26. Servlets
27. Spring
28. Swing Components
29. Swing JFC
30. SWT JFace Eclipse
31. Threads
32. Tiny Application
33. Velocity
34. Web Services SOA
35. XML
Microsoft Office Word 2007 Tutorial
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Java » Swing Components » DockableScreenshots 
Elegant Dockable framework
Elegant Dockable framework


package net.eleritec.docking.demos.elegant;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.UIManager;
import javax.swing.plaf.basic.BasicSplitPaneDivider;
import javax.swing.plaf.basic.BasicSplitPaneUI;

import net.eleritec.docking.Dockable;
import net.eleritec.docking.DockingPort;
import net.eleritec.docking.defaults.DefaultDockingPort;
import net.eleritec.docking.defaults.StandardBorderManager;


public class ElegantDemo extends JFrame {
  private JSplitPane horizontalSplit;
  private JSplitPane vertSplitRight;
  private JSplitPane vertSplitLeft;
  
  private ElegantPanel j2eeHierarchyView;
  private ElegantPanel j2eeNavView;
  private ElegantPanel consoleView;
  private ElegantPanel serversView;
  private ElegantPanel tasksView;
  private ElegantPanel searchView;
  private ElegantPanel synchronizeView;
  private ElegantPanel outlineView;
  private ElegantPanel editorView;
  
  private ElegantDockingPort topLeft;
  private ElegantDockingPort bottomLeft;
  private ElegantDockingPort topRight;
  private ElegantDockingPort bottomRight;
  
  public ElegantDemo() {
    super("Elegant Docking Demo");
    init();
  }

  private void init() {
    createViews();
    horizontalSplit = createSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    vertSplitLeft = createSplitPane(JSplitPane.VERTICAL_SPLIT);
    vertSplitRight = createSplitPane(JSplitPane.VERTICAL_SPLIT);
    
    horizontalSplit.setLeftComponent(vertSplitLeft);
    horizontalSplit.setRightComponent(vertSplitRight);
    initDockingPorts();
    
    setContentPane(horizontalSplit);
  }
  
  private void createViews() {
    j2eeHierarchyView = new ElegantPanel("J2EE Hierarchy");
    j2eeNavView = new ElegantPanel("J2EE Navigator");
    consoleView = new ElegantPanel("Console");
    serversView = new ElegantPanel("Servers");
    tasksView = new ElegantPanel("Tasks");
    searchView = new ElegantPanel("Search");
    synchronizeView = new ElegantPanel("Synchronize");
    outlineView = new ElegantPanel("Outline");
    editorView = new ElegantPanel("Editor");
  }
  

  private void initDockingPorts() {
    topLeft = new ElegantDockingPort();
    bottomLeft = new ElegantDockingPort();
    topRight = new ElegantDockingPort();
    bottomRight = new ElegantDockingPort();
    
    topLeft.add(j2eeHierarchyView);
    topLeft.add(j2eeNavView);
    bottomLeft.add(outlineView);
    topRight.add(editorView);
    bottomRight.add(tasksView);
    bottomRight.add(serversView);
    bottomRight.add(consoleView);
    bottomRight.add(searchView);
    bottomRight.add(synchronizeView);    

    vertSplitLeft.setLeftComponent(topLeft);
    vertSplitLeft.setRightComponent(bottomLeft);
    vertSplitRight.setLeftComponent(topRight);
    vertSplitRight.setRightComponent(bottomRight);
  }


  private void postInit() {
    horizontalSplit.setDividerLocation(0.3d);
    vertSplitLeft.setDividerLocation(0.75d);
    vertSplitRight.setDividerLocation(0.75d);
  }

  private static JSplitPane createSplitPane(int orientation) {
    JSplitPane split = new JSplitPane(orientation);
    // remove the border from the split pane
    split.setBorder(null);
         
    // set the divider size for a more reasonable, less bulky look 
    split.setDividerSize(3);

    // check the UI.  If we can't work with the UI any further, then
    // exit here.
    if (!(split.getUI() instanceof BasicSplitPaneUI))
       return split;

    //  grab the divider from the UI and remove the border from it
    BasicSplitPaneDivider divider =
             ((BasicSplitPaneUIsplit.getUI()).getDivider();
    if (divider != null)
       divider.setBorder(null);

    return split;
  }
  
  public static void main(String[] args) {
    ElegantDemo demo = new ElegantDemo();
    demo.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    demo.setSize(800600);
    demo.setVisible(true);
    
    // now that we're visible and validated, move the split pane
    // dividers to their proper locations.
    demo.postInit();
  }
}

           
       
dockingSrc-0.3.zip( 57 k)
Related examples in the same category
1. Swing dockable windowSwing dockable window
2. Simple demo for dockable windowsSimple demo for dockable windows
3. Compound dockable windowCompound dockable window
4. Cursor indication for dockable componentCursor indication for dockable component
5. SplitPane and dockable componentSplitPane and dockable component
6. Add border for dockable componentAdd border for dockable component
7. TabbedPane and dockable component 2TabbedPane and dockable component 2
8. Swing dock framework
w_ww._j_a__v___a__2s__.___c___om__ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.