* Main entry point.
*/
public static void main(String [] args) throws Exception {
- // For this application, we must use ptypipe so that the tile shells
- // can be aware of their size.
-
JexerImageViewer app = new JexerImageViewer();
(new Thread(app)).start();
}
setActive(true);
// Add directory treeView
- treeView = addTreeViewWidget(0, 0, getWidth() / 2, getHeight() - 1,
+ treeView = addTreeViewWidget(0, 0, getWidth() / 2, getHeight(),
new TAction() {
public void DO() {
TTreeItem item = treeView.getSelected();
},
filters);
- // This appears to be a bug. If I pass keystrokes to the tree view,
- // it will center correctly.
- treeView.onKeypress(new TKeypressEvent(kbDown));
- treeView.onKeypress(new TKeypressEvent(kbUp));
-
if (directoryList.getList().size() > 0) {
activate(directoryList);
setThumbnail(directoryList.getPath());
imageWidget = new TImage(this, getWidth() - width,
getHeight() - height, width, height, image, 0, 0, null);
- // Resize the image down until it can fit within the pane.
- while ((imageWidget.getRows() > height)
- || (imageWidget.getColumns() > width)
- ) {
- imageWidget.onKeypress(new TKeypressEvent(kbAltDown));
- }
+ // Resize the image to fit within the pane.
+ imageWidget.setScaleType(TImage.Scale.SCALE);
imageWidget.setActive(false);
activate(directoryList);