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

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

Introduction

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

Prototype

@Nullable
    public JComponent getInnerComponent() 

Source Link

Usage

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

License:Apache License

public void resize() {
    ThreeComponentsSplitter threePane = getThreePanes();

    assert (threePane.getLastComponent() instanceof JBSplitter);
    JBSplitter bottomSplitter = (JBSplitter) threePane.getLastComponent();

    assert (threePane.getInnerComponent() instanceof JBSplitter);
    JBSplitter middleSplitter = (JBSplitter) threePane.getInnerComponent();

    int scrubberHeight = getScrubberScrollPane().getMinimumSize().height;
    if (threePane.getFirstSize() < scrubberHeight) {
        int totalHeight = threePane.getHeight();
        int residualHeightAfter = Math.max(0, totalHeight - scrubberHeight);

        threePane.setFirstSize(scrubberHeight);
        int middleSize = middleSplitter.getPreferredSize().height;
        int bottomSize = bottomSplitter.getPreferredSize().height;
        if (bottomSize + middleSize > 0) {
            threePane.setLastSize(residualHeightAfter * bottomSize / (bottomSize + middleSize)); // Split the middle and bottom panes evenly.
        } else {/* w  w  w .  j  a  v  a  2 s .  co m*/
            threePane.setLastSize(residualHeightAfter / 2);
        }
    }
}

From source file:com.android.tools.idea.uibuilder.layeredimage.LayersManager.java

License:Apache License

@Override
protected LightToolWindow createContent(@NotNull DesignerEditorPanelFacade designer) {
    if (!(designer instanceof LayeredImageEditorPanel)) {
        return null;
    }//w  w  w.jav a 2  s .com

    LightToolWindow toolWindow = (LightToolWindow) designer.getClientProperty(getComponentName());
    if (toolWindow != null) {
        return toolWindow;
    }

    LayersPanel layersPanel = new LayersPanel();
    layersPanel.setImage(getImage(designer));

    PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(myProject);
    // When LightToolWindowManager#getEditorMode() is public (or a constructor which lets
    // me not specify it) is available and upstreamed, replace the following with just
    // anchor = getEditorMode() :
    String value = propertiesComponent.getValue(myEditorModeKey);
    ToolWindowAnchor anchor;
    if (value == null) {
        anchor = getAnchor();
    } else {
        anchor = value.equals("ToolWindow") ? null : ToolWindowAnchor.fromText(value);
    }

    ThreeComponentsSplitter contentSplitter = designer.getContentSplitter();
    if (contentSplitter.getInnerComponent() == null) {
        // If the inner component was removed we are bound to get a NPE during the LTW constructor.
        // This is a fix for http://b.android.com/219047
        return null;
    }
    return new LightToolWindow(layersPanel, "Image Layers", AllIcons.Toolwindows.ToolWindowPalette, layersPanel,
            layersPanel, contentSplitter, anchor, this, myProject, propertiesComponent,
            getVisibilityKeyName(designer), 200, null);
}