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. Class
8. Collections Data Structure
9. Data Type
10. Database SQL JDBC
11. Design Pattern
12. Development Class
13. EJB3
14. Email
15. Event
16. File Input Output
17. Game
18. Generics
19. GWT
20. Hibernate
21. I18N
22. J2EE
23. J2ME
24. JDK 6
25. JNDI LDAP
26. JPA
27. JSP
28. JSTL
29. Language Basics
30. Network Protocol
31. PDF RTF
32. Reflection
33. Regular Expressions
34. Scripting
35. Security
36. Servlets
37. Spring
38. Swing Components
39. Swing JFC
40. SWT JFace Eclipse
41. Threads
42. Tiny Application
43. Velocity
44. Web Services SOA
45. XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 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
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.