X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fdemos%2FDemoTreeViewWindow.java;h=479895127edd6d3ab5e20dbd03e2cfa96720966b;hb=e6bb1700749980e69b5e913acbfd276f129c24dc;hp=6101d27dc637bd1d6a0137781d64df470b10d479;hpb=329fd62e4acdaa8e9f4cccd518d47c0b07e79f51;p=fanfix.git diff --git a/src/jexer/demos/DemoTreeViewWindow.java b/src/jexer/demos/DemoTreeViewWindow.java deleted file mode 100644 index 6101d27..0000000 --- a/src/jexer/demos/DemoTreeViewWindow.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Jexer - Java Text User Interface - * - * License: LGPLv3 or later - * - * This module is licensed under the GNU Lesser General Public License - * Version 3. Please see the file "COPYING" in this directory for more - * information about the GNU Lesser General Public License Version 3. - * - * Copyright (C) 2015 Kevin Lamonte - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, see - * http://www.gnu.org/licenses/, or write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - * - * @author Kevin Lamonte [kevin.lamonte@gmail.com] - * @version 1 - */ -package jexer.demos; - -import java.io.IOException; - -import jexer.*; -import jexer.event.*; - -/** - * This window demonstates the TTreeView widget. - */ -public class DemoTreeViewWindow extends TWindow { - - /** - * Hang onto my TTreeView so I can resize it with the window. - */ - private TTreeView treeView; - - /** - * Public constructor. - * - * @param parent the main application - * @throws IOException if a java.io operation throws - */ - public DemoTreeViewWindow(final TApplication parent) throws IOException { - super(parent, "Tree View", 0, 0, 44, 16, TWindow.RESIZABLE); - - // Load the treeview with "stuff" - treeView = addTreeView(1, 1, 40, 12); - new TDirectoryTreeItem(treeView, ".", true); - } - - /** - * Handle window/screen resize events. - * - * @param resize resize event - */ - @Override - public void onResize(final TResizeEvent resize) { - if (resize.getType() == TResizeEvent.Type.WIDGET) { - // Resize the text field - treeView.setWidth(resize.getWidth() - 4); - treeView.setHeight(resize.getHeight() - 4); - treeView.reflow(); - return; - } - - // Pass to children instead - for (TWidget widget: getChildren()) { - widget.onResize(resize); - } - } - -}