本文整理汇总了Java中com.googlecode.lanterna.gui.component.EmptySpace类的典型用法代码示例。如果您正苦于以下问题:Java EmptySpace类的具体用法?Java EmptySpace怎么用?Java EmptySpace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EmptySpace类属于com.googlecode.lanterna.gui.component包,在下文中一共展示了EmptySpace类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FolderChooser
import com.googlecode.lanterna.gui.component.EmptySpace; //导入依赖的package包/类
public FolderChooser(GUIScreen screen) {
super("Choose folder to scan");
FileFilter fileFilter = new FileFilter() {
@Override
public boolean accept(File pathname) {
return pathname.isDirectory();
}
};
FileTreeItem root = new FileTreeItem(new File("/"), null, fileFilter);
Tree tree = new Tree(root);
tree.setOnItemSelectedListener(new Tree.OnItemSelectedListener() {
@Override
public void itemSelected(TreeItem item) {
File file = ((FileTreeItem) item).getFile();
logger.debug("Folder selected: " + file.getAbsolutePath());
selected = file;
}
});
addComponent(tree, BorderLayout.CENTER);
addComponent(new EmptySpace());
Panel buttonsPanel = new Panel(Panel.Orientation.HORISONTAL);
buttonsPanel.addComponent(new Button("Cancel", new Action() {
@Override
public void doAction() {
close();
}
}));
buttonsPanel.addComponent(new EmptySpace());
buttonsPanel.addComponent(new Button("Scan", new Action() {
@Override
public void doAction() {
close();
}
}));
addComponent(buttonsPanel, BorderLayout.BOTTOM, BorderLayout.CENTER);
TerminalSize size = screen.getScreen().getTerminalSize();
setWindowSizeOverride(new TerminalSize(size.getColumns() - 8, size.getRows() - 5));
screen.showWindow(this, GUIScreen.Position.OVERLAPPING);
}
示例2: AboutDialog
import com.googlecode.lanterna.gui.component.EmptySpace; //导入依赖的package包/类
public AboutDialog(GUIScreen screen) {
super("About");
logger.debug("About dialog");
Panel panel = new Panel();
panel.setLayoutManager(new VerticalLayout());
panel.addComponent(new Label("Condi " + Condi.VERSION, Terminal.Color.BLUE, true), VerticalLayout.MAXIMIZES_HORIZONTALLY);
panel.addComponent(new EmptySpace(1, 1));
panel.addComponent(new Label("CONsole DIsk usage analyzer"));
panel.addComponent(new EmptySpace(1, 1));
panel.addComponent(new Label("http://github.com/swapii/condi"));
panel.addComponent(new EmptySpace(1, 1));
panel.addComponent(new Button("OK", new Action() {
@Override
public void doAction() {
close();
}
}), VerticalLayout.MAXIMIZES_HORIZONTALLY);
addComponent(panel);
screen.showWindow(this, GUIScreen.Position.CENTER);
}