Search in sources :

Example 1 with Toolbar

use of com.google.classyshark.gui.panel.toolbar.Toolbar 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);
}
Also used : DisplayArea(com.google.classyshark.gui.panel.displayarea.DisplayArea) IDisplayArea(com.google.classyshark.gui.panel.displayarea.IDisplayArea) JScrollPane(javax.swing.JScrollPane) JTabbedPane(javax.swing.JTabbedPane) Dimension(java.awt.Dimension) RingChartPanel(com.google.classyshark.gui.panel.chart.RingChartPanel) BorderLayout(java.awt.BorderLayout) ChangeEvent(javax.swing.event.ChangeEvent) MethodsCountPanel(com.google.classyshark.gui.panel.methodscount.MethodsCountPanel) ChangeListener(javax.swing.event.ChangeListener) JSplitPane(javax.swing.JSplitPane) FilesTree(com.google.classyshark.gui.panel.tree.FilesTree) Toolbar(com.google.classyshark.gui.panel.toolbar.Toolbar)

Aggregations

RingChartPanel (com.google.classyshark.gui.panel.chart.RingChartPanel)1 DisplayArea (com.google.classyshark.gui.panel.displayarea.DisplayArea)1 IDisplayArea (com.google.classyshark.gui.panel.displayarea.IDisplayArea)1 MethodsCountPanel (com.google.classyshark.gui.panel.methodscount.MethodsCountPanel)1 Toolbar (com.google.classyshark.gui.panel.toolbar.Toolbar)1 FilesTree (com.google.classyshark.gui.panel.tree.FilesTree)1 BorderLayout (java.awt.BorderLayout)1 Dimension (java.awt.Dimension)1 JScrollPane (javax.swing.JScrollPane)1 JSplitPane (javax.swing.JSplitPane)1 JTabbedPane (javax.swing.JTabbedPane)1 ChangeEvent (javax.swing.event.ChangeEvent)1 ChangeListener (javax.swing.event.ChangeListener)1