com.sun.swingset3.utilities.AnimatingSplitPane Java Examples

The following examples show how to use com.sun.swingset3.utilities.AnimatingSplitPane. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SwingSet3.java    From littleluck with Apache License 2.0 4 votes vote down vote up
protected JComponent createMainPanel() {
    
    // Create main panel with demo selection on left and demo/source on right
    mainPanel = new JPanel();
    mainPanel.setLayout(new BorderLayout());
   
    // Create demo selector panel on left
    demoSelectorPanel = new DemoSelectorPanel(demoListTitle, demoList);
    demoSelectorPanel.setPreferredSize(new Dimension(DEMO_SELECTOR_WIDTH, MAIN_FRAME_HEIGHT));
    demoSelectorPanel.addPropertyChangeListener(new DemoSelectionListener());
    mainPanel.add(demoSelectorPanel, BorderLayout.WEST);
    
    // Create splitpane on right to hold demo and source code
    demoSplitPane = new AnimatingSplitPane(JSplitPane.VERTICAL_SPLIT);
    demoSplitPane.setBorder(EMPTY_BORDER);
    mainPanel.add(demoSplitPane, BorderLayout.CENTER);
    
    // Create panel to contain currently running demo
    demoContainer = new JPanel();
    demoContainer.setLayout(new BorderLayout());
    demoContainer.setBorder(PANEL_BORDER);
    demoContainer.setPreferredSize(new Dimension(DEMO_PANEL_WIDTH, DEMO_PANEL_HEIGHT));
    demoSplitPane.setTopComponent(demoContainer);

    currentDemoPanel = demoPlaceholder;
    demoContainer.add(demoPlaceholder, BorderLayout.CENTER);
            
    // Create collapsible source code pane

    codeViewer = new CodeViewer();
    codeContainer = new JPanel(new BorderLayout());
    codeContainer.add(codeViewer);
    codeContainer.setBorder(PANEL_BORDER);
    codeContainer.setMinimumSize(new Dimension(0,0));
    demoSplitPane.setBottomComponent(codeContainer);
    
    addPropertyChangeListener(new SwingSetPropertyListener());        
    
    // Create shareable popup menu for demo actions
    popup = new JPopupMenu();
    popup.add(new EditPropertiesAction());
    popup.add(new ViewCodeSnippetAction());

    return mainPanel;
}
 
Example #2
Source File: SwingSet3.java    From beautyeye with Apache License 2.0 4 votes vote down vote up
protected JComponent createMainPanel() {
    
    // Create main panel with demo selection on left and demo/source on right
    mainPanel = new JPanel();
    mainPanel.setLayout(new BorderLayout());
   
    // Create demo selector panel on left
    demoSelectorPanel = new DemoSelectorPanel(demoListTitle, demoList);
    demoSelectorPanel.setPreferredSize(new Dimension(DEMO_SELECTOR_WIDTH, MAIN_FRAME_HEIGHT));
    demoSelectorPanel.addPropertyChangeListener(new DemoSelectionListener());
    mainPanel.add(demoSelectorPanel, BorderLayout.WEST);
    
    // Create splitpane on right to hold demo and source code
    demoSplitPane = new AnimatingSplitPane(JSplitPane.VERTICAL_SPLIT);
    demoSplitPane.setBorder(EMPTY_BORDER);
    mainPanel.add(demoSplitPane, BorderLayout.CENTER);
    
    // Create panel to contain currently running demo
    demoContainer = new JPanel();
    demoContainer.setLayout(new BorderLayout());
    demoContainer.setBorder(PANEL_BORDER);
    demoContainer.setPreferredSize(new Dimension(DEMO_PANEL_WIDTH, DEMO_PANEL_HEIGHT));
    demoSplitPane.setTopComponent(demoContainer);

    currentDemoPanel = demoPlaceholder;
    demoContainer.add(demoPlaceholder, BorderLayout.CENTER);
            
    // Create collapsible source code pane

    codeViewer = new CodeViewer();
    codeContainer = new JPanel(new BorderLayout());
    codeContainer.add(codeViewer);
    codeContainer.setBorder(PANEL_BORDER);
    codeContainer.setMinimumSize(new Dimension(0,0));
    demoSplitPane.setBottomComponent(codeContainer);
    
    addPropertyChangeListener(new SwingSetPropertyListener());        
    
    // Create shareable popup menu for demo actions
    popup = new JPopupMenu();
    popup.add(new EditPropertiesAction());
    popup.add(new ViewCodeSnippetAction());

    return mainPanel;
}
 
Example #3
Source File: SwingSet3.java    From Darcula with Apache License 2.0 4 votes vote down vote up
protected JComponent createMainPanel() {
    
    // Create main panel with demo selection on left and demo/source on right
    mainPanel = new JPanel();
    mainPanel.setLayout(new BorderLayout());
   
    // Create demo selector panel on left
    demoSelectorPanel = new DemoSelectorPanel(demoListTitle, demoList);
    demoSelectorPanel.setPreferredSize(new Dimension(DEMO_SELECTOR_WIDTH, MAIN_FRAME_HEIGHT));
    demoSelectorPanel.addPropertyChangeListener(new DemoSelectionListener());
    mainPanel.add(demoSelectorPanel, BorderLayout.WEST);
    
    // Create splitpane on right to hold demo and source code
    demoSplitPane = new AnimatingSplitPane(JSplitPane.VERTICAL_SPLIT);
    demoSplitPane.setBorder(EMPTY_BORDER);
    mainPanel.add(demoSplitPane, BorderLayout.CENTER);
    
    // Create panel to contain currently running demo
    demoContainer = new JPanel();
    demoContainer.setLayout(new BorderLayout());
    demoContainer.setBorder(PANEL_BORDER);
    demoContainer.setPreferredSize(new Dimension(DEMO_PANEL_WIDTH, DEMO_PANEL_HEIGHT));
    demoSplitPane.setTopComponent(demoContainer);

    currentDemoPanel = demoPlaceholder;
    demoContainer.add(demoPlaceholder, BorderLayout.CENTER);
            
    // Create collapsible source code pane

    codeViewer = new CodeViewer();
    codeContainer = new JPanel(new BorderLayout());
    codeContainer.add(codeViewer);
    codeContainer.setBorder(PANEL_BORDER);
    codeContainer.setMinimumSize(new Dimension(0,0));
    demoSplitPane.setBottomComponent(codeContainer);
    
    addPropertyChangeListener(new SwingSetPropertyListener());        
    
    // Create shareable popup menu for demo actions
    popup = new JPopupMenu();
    popup.add(new EditPropertiesAction());
    popup.add(new ViewCodeSnippetAction());

    return mainPanel;
}