use of com.google.classyshark.gui.panel.displayarea.DisplayArea in project android-classyshark by google.
the class ClassySharkPanel method buildUI.
private void buildUI() {
BorderLayout borderLayout = new BorderLayout();
setLayout(borderLayout);
ringChartPanel = new RingChartPanel(this);
toolbar = new Toolbar(this);
add(toolbar, BorderLayout.NORTH);
toolbar.addKeyListenerToTypingArea(this);
displayArea = new DisplayArea(this);
final JScrollPane rightScrollPane = new JScrollPane(displayArea.onAddComponentToPane());
theme.applyTo(rightScrollPane);
filesTree = new FilesTree(this);
JTabbedPane jTabbedPane = new JTabbedPane();
JScrollPane leftScrollPane = new JScrollPane(filesTree.getJTree());
theme.applyTo(leftScrollPane);
jTabbedPane.addTab("Classes", leftScrollPane);
methodsCountPanel = new MethodsCountPanel(this);
jTabbedPane.addTab("Methods count", methodsCountPanel);
theme.applyTo(jTabbedPane);
jTabbedPane.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
int dividerLocation1 = jSplitPane.getDividerLocation();
JTabbedPane jTabbedPane1 = (JTabbedPane) e.getSource();
if (jTabbedPane1.getSelectedIndex() == 0) {
jSplitPane.setRightComponent(rightScrollPane);
} else {
jSplitPane.setRightComponent(ringChartPanel);
}
jSplitPane.setDividerLocation(dividerLocation1);
}
});
jSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
jSplitPane.setDividerSize(3);
jSplitPane.setPreferredSize(new Dimension(1000, 700));
jSplitPane.add(jTabbedPane, JSplitPane.LEFT);
jSplitPane.add(rightScrollPane, JSplitPane.RIGHT);
jSplitPane.getLeftComponent().setVisible(true);
jSplitPane.setDividerLocation(300);
theme.applyTo(jSplitPane);
add(jSplitPane, BorderLayout.CENTER);
}
Aggregations