use of org.freeinternals.commonlib.ui.JPanelForTree in project selenium_java by sergueik.
the class Main method open_JarFile.
private void open_JarFile(final File file) {
try {
this.zftree = new JTreeZipFile(new JarFile(file, false, JarFile.OPEN_READ));
this.zftree.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(final MouseEvent e) {
if (e.getClickCount() != 2) {
return;
}
if (zftree.getRowForLocation(e.getX(), e.getY()) == -1) {
return;
}
zftree_DoubleClick(zftree.getPathForLocation(e.getX(), e.getY()));
}
});
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
JOptionPane.showMessageDialog(this, ex.toString(), this.getTitle(), JOptionPane.ERROR_MESSAGE);
}
if (this.zftree != null) {
this.zftreeContainer = new JPanelForTree(this.zftree, this);
this.add(this.zftreeContainer, BorderLayout.CENTER);
this.resizeForContent();
}
}
use of org.freeinternals.commonlib.ui.JPanelForTree 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);
}
Aggregations