use of com.google.classyshark.gui.panel.FileTransferHandler in project android-classyshark by google.
the class MethodsCountPanel method setup.
private void setup() {
this.setLayout(new BorderLayout());
treeModel = new DefaultTreeModel(new DefaultMutableTreeNode(null));
jTree = new JTree(treeModel);
jTree.setRootVisible(false);
jTree.setCellRenderer(new CellRenderer());
theme.applyTo(jTree);
DefaultTreeCellRenderer cellRenderer = (DefaultTreeCellRenderer) jTree.getCellRenderer();
cellRenderer.setFont(new Font("Monospaced", Font.PLAIN, 20));
jTree.setCellRenderer(cellRenderer);
jTree.addTreeSelectionListener(new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent e) {
Object selection = jTree.getLastSelectedPathComponent();
DefaultMutableTreeNode defaultMutableTreeNode = (DefaultMutableTreeNode) selection;
ClassNode node = (ClassNode) defaultMutableTreeNode.getUserObject();
viewerController.onSelectedMethodCount(node);
}
});
JScrollPane jScrollPane = new JScrollPane(jTree);
this.setBorder(new EmptyBorder(0, 0, 0, 0));
this.add(jScrollPane, BorderLayout.CENTER);
theme.applyTo(jScrollPane);
jTree.setDragEnabled(true);
jTree.setTransferHandler(new FileTransferHandler(viewerController));
}
Aggregations