当前位置: 首页>>代码示例>>Java>>正文


Java EmptySpace类代码示例

本文整理汇总了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);
	}
 
开发者ID:swapii,项目名称:condi,代码行数:58,代码来源:FolderChooser.java

示例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);
	}
 
开发者ID:swapii,项目名称:condi,代码行数:31,代码来源:AboutDialog.java


注:本文中的com.googlecode.lanterna.gui.component.EmptySpace类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。