List of usage examples for com.intellij.openapi.ui ThreeComponentsSplitter setDividerWidth
public void setDividerWidth(int width)
From source file:com.android.tools.adtui.workbench.WorkBench.java
License:Apache License
@NotNull private ThreeComponentsSplitter initSplitter(@NotNull ThreeComponentsSplitter splitter) { splitter.setDividerWidth(0); splitter.setDividerMouseZoneSize(Registry.intValue("ide.splitter.mouseZone")); splitter.setHonorComponentsMinimumSize(true); splitter.setFirstComponent(new SidePanel<>(Side.LEFT, myModel)); splitter.setLastComponent(new SidePanel<>(Side.RIGHT, myModel)); splitter.setShowDividerControls(true); return splitter; }
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); // 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();//from w ww.java 2 s . c om 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(); } }); }