Search in sources :

Example 1 with JBinaryViewer

use of org.freeinternals.commonlib.ui.JBinaryViewer in project selenium_java by sergueik.

the class JSplitPaneClassFile method createAndShowGUI.

private void createAndShowGUI(JFrame top) {
    // Construct class file viewer
    final JTreeClassFile jTreeClassFile = new JTreeClassFile(this.classFile);
    jTreeClassFile.addTreeSelectionListener(new TreeSelectionListener() {

        @Override
        public void valueChanged(final javax.swing.event.TreeSelectionEvent evt) {
            jTreeClassFileSelectionChanged(evt);
        }
    });
    final JPanelForTree panel = new JPanelForTree(jTreeClassFile, top);
    final JTabbedPane tabbedPane = new JTabbedPane();
    // Construct binary viewer
    this.binaryViewer = new JBinaryViewer();
    this.binaryViewer.setData(this.classFile.getClassByteArray());
    this.binaryViewerView = new JScrollPane(this.binaryViewer);
    this.binaryViewerView.getVerticalScrollBar().setValue(0);
    tabbedPane.add("Class File", this.binaryViewerView);
    // Construct opcode viewer
    this.opcode = new JTextPane();
    this.opcode.setAlignmentX(Component.LEFT_ALIGNMENT);
    // this.opcode.setFont(new Font(Font.DIALOG_INPUT, Font.PLAIN, 14));
    this.opcode.setEditable(false);
    this.opcode.setBorder(null);
    this.opcode.setContentType("text/html");
    tabbedPane.add("Opcode", new JScrollPane(this.opcode));
    // Class report
    this.report = new JTextPane();
    this.report.setAlignmentX(Component.LEFT_ALIGNMENT);
    this.report.setEditable(false);
    this.report.setBorder(null);
    this.report.setContentType("text/html");
    tabbedPane.add("Report", new JScrollPane(this.report));
    this.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
    this.setDividerSize(5);
    this.setDividerLocation(280);
    this.setLeftComponent(panel);
    this.setRightComponent(tabbedPane);
    this.binaryViewerView.getVerticalScrollBar().setValue(0);
}
Also used : JScrollPane(javax.swing.JScrollPane) JTextPane(javax.swing.JTextPane) JTabbedPane(javax.swing.JTabbedPane) JPanelForTree(org.freeinternals.commonlib.ui.JPanelForTree) TreeSelectionListener(javax.swing.event.TreeSelectionListener) JBinaryViewer(org.freeinternals.commonlib.ui.JBinaryViewer) TreeSelectionEvent(javax.swing.event.TreeSelectionEvent)

Aggregations

JScrollPane (javax.swing.JScrollPane)1 JTabbedPane (javax.swing.JTabbedPane)1 JTextPane (javax.swing.JTextPane)1 TreeSelectionEvent (javax.swing.event.TreeSelectionEvent)1 TreeSelectionListener (javax.swing.event.TreeSelectionListener)1 JBinaryViewer (org.freeinternals.commonlib.ui.JBinaryViewer)1 JPanelForTree (org.freeinternals.commonlib.ui.JPanelForTree)1