Example usage for com.intellij.openapi.ui ThreeComponentsSplitter setInnerComponent

List of usage examples for com.intellij.openapi.ui ThreeComponentsSplitter setInnerComponent

Introduction

In this page you can find the example usage for com.intellij.openapi.ui ThreeComponentsSplitter setInnerComponent.

Prototype

public void setInnerComponent(@Nullable JComponent component) 

Source Link

Document

Sets component which is located as the "inner" splitted area.

Usage

From source file:com.android.tools.idea.editors.gfxtrace.GfxTraceViewPanel.java

License:Apache License

public void setupViewHierarchy(@NotNull Project project) {
    JPanel rootPanel = getRootComponent();
    rootPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    final ThreeComponentsSplitter threePane = getThreePanes();
    threePane.setDividerWidth(5);/* w  w w.j a  v  a2s . c om*/

    // Set some preferences on the scrubber.
    getTopPanel().setBorder(BorderFactory.createLineBorder(JBColor.border()));
    getScrubberScrollPane().setViewportView(getScrubberList());

    // Get rid of the hidden component and remove references to its children, since it's just a placeholder for us to use the UI designer.
    getHiddenComponents().removeAll();
    rootPanel.remove(getHiddenComponents());
    setHiddenComponents(null);

    // Configure the buffer views.
    final JBRunnerTabs bufferTabs = new JBRunnerTabs(project, ActionManager.getInstance(),
            IdeFocusManager.findInstance(), this);
    bufferTabs.setPaintBorder(0, 0, 0, 0).setTabSidePaintBorder(1)
            .setPaintFocus(UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF())
            .setAlwaysPaintSelectedTab(UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF());
    JBPanel[] frameBuffers = new JBPanel[] { myColorBuffer, myWireframeBuffer, myDepthBuffer };
    for (int i = 0; i < frameBuffers.length; ++i) {
        bufferTabs.addTab(
                new TabInfo(frameBuffers[i]).setText(FrameBufferController.BufferType.values()[i].getName()));
    }
    bufferTabs.setBorder(new EmptyBorder(0, 2, 0, 0));
    setBufferTabs(bufferTabs);

    // Put the buffer views in a wrapper so a border can be drawn around it.
    Wrapper bufferWrapper = new Wrapper();
    bufferWrapper.setLayout(new BorderLayout());
    bufferWrapper.setBorder(BorderFactory.createLineBorder(JBColor.border()));
    bufferWrapper.setContent(bufferTabs);

    // Configure the Atom tree container.
    Wrapper atomTreeWrapper = new Wrapper();
    atomTreeWrapper.setBorder(BorderFactory.createLineBorder(JBColor.border()));
    atomTreeWrapper.setContent(myAtomScrollPane);

    // Now add the atom tree and buffer views to the middle pane in the main pane.
    final JBSplitter middleSplitter = new JBSplitter(false);
    middleSplitter.setMinimumSize(new Dimension(100, 10));
    middleSplitter.setFirstComponent(atomTreeWrapper);
    middleSplitter.setSecondComponent(bufferWrapper);
    threePane.setInnerComponent(middleSplitter);

    // Configure the miscellaneous tabs.
    JBRunnerTabs miscTabs = new JBRunnerTabs(project, ActionManager.getInstance(),
            IdeFocusManager.findInstance(), this);
    miscTabs.setPaintBorder(0, 0, 0, 0).setTabSidePaintBorder(1)
            .setPaintFocus(UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF())
            .setAlwaysPaintSelectedTab(UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF());
    miscTabs.addTab(new TabInfo(getMemoryPanel()).setText("Memory"));
    miscTabs.addTab(new TabInfo(getImagePanel()).setText("Image"));
    miscTabs.addTab(new TabInfo(getDocsPanel()).setText("Docs"));
    miscTabs.setBorder(new EmptyBorder(0, 2, 0, 0));

    getDocsScrollPane().setViewportView(getDocsPane());

    // More borders for miscellaneous tabs.
    Wrapper miscWrapper = new Wrapper();
    miscWrapper.setBorder(BorderFactory.createLineBorder(JBColor.border()));
    miscWrapper.setContent(miscTabs);

    // Borders for the state tree as well.
    Wrapper stateWrapper = new Wrapper();
    stateWrapper.setContent(getStateScrollPane());
    stateWrapper.setBorder(BorderFactory.createLineBorder(JBColor.border()));

    // Configure the bottom splitter.
    final JBSplitter bottomSplitter = new JBSplitter(false);
    bottomSplitter.setMinimumSize(new Dimension(100, 10));
    bottomSplitter.setFirstComponent(stateWrapper);
    bottomSplitter.setSecondComponent(miscWrapper);
    threePane.setLastComponent(bottomSplitter);

    // Make sure the bottom splitter honors minimum sizes.
    threePane.setHonorComponentsMinimumSize(true);

    threePane.addHierarchyBoundsListener(new HierarchyBoundsAdapter() {
        @Override
        public void ancestorResized(HierarchyEvent hierarchyEvent) {
            super.ancestorResized(hierarchyEvent);
            resize();
        }
    });
}