本文整理汇总了Java中com.googlecode.lanterna.gui.Window类的典型用法代码示例。如果您正苦于以下问题:Java Window类的具体用法?Java Window怎么用?Java Window使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Window类属于com.googlecode.lanterna.gui包,在下文中一共展示了Window类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addGeneralShortcuts
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
private void addGeneralShortcuts() {
this.addWindowListener(new WindowAdapter() {
@Override
public void onUnhandledKeyboardInteraction(Window window, Key key) {
if (key.getKind() == Kind.Escape)
close();
}
});
}
开发者ID:frincon,项目名称:openeos,代码行数:12,代码来源:UnoWindow.java
示例2: run
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
@Override
public void run() {
LOG.debug("Running LanternaRunner");
guiScreen = TerminalFacade.createGUIScreen(terminal);
guiScreen.getScreen().startScreen();
Window mainWindow = createMainWindow();
guiScreen.showWindow(mainWindow);
guiScreen.getScreen().stopScreen();
terminal.clearScreen();
terminal.flush();
session.close(false);
LOG.debug("Finished LanternaRunner");
}
开发者ID:frincon,项目名称:openeos,代码行数:15,代码来源:LanternaRunner.java
示例3: createMainWindow
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
private Window createMainWindow() {
MenuWindow window = new MenuWindow(new IMenuDefinition() {
@Override
public String getName() {
return "Main Menu"; //TODO i18n
}
@Override
public String getDescription() {
return "Main Manu"; //TODO i18n
}
@Override
public MenuType getType() {
return MenuType.MENU;
}
@Override
public String getWindowId() {
return null;
}
@Override
public List<? extends IMenuDefinition> getSubMenuList() {
return rootMenuList;
}
@Override
public String getId() {
return this.getClass().getPackage().getName() + "." + getId();
}
}, windowManagerService, dictionaryService, uidaoService, windowActionService);
return window;
}
开发者ID:frincon,项目名称:openeos,代码行数:37,代码来源:LanternaRunner.java
示例4: handleShowByInjectedHandler
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
@Override
protected boolean handleShowByInjectedHandler(@Nonnull String name, @Nonnull Window window) {
try {
LanternaWindowDisplayHandler handler = getApplication().getInjector()
.getInstance(LanternaWindowDisplayHandler.class, named(name));
handler.show(name, window);
return true;
} catch (InstanceNotFoundException infe) {
return super.handleShowByInjectedHandler(name, window);
}
}
开发者ID:aalmiray,项目名称:griffon2,代码行数:12,代码来源:ConfigurableLanternaWindowDisplayHandler.java
示例5: handleHideByInjectedHandler
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
@Override
protected boolean handleHideByInjectedHandler(@Nonnull String name, @Nonnull Window window) {
try {
LanternaWindowDisplayHandler handler = getApplication().getInjector()
.getInstance(LanternaWindowDisplayHandler.class, named(name));
handler.hide(name, window);
return true;
} catch (InstanceNotFoundException infe) {
return super.handleHideByInjectedHandler(name, window);
}
}
开发者ID:aalmiray,项目名称:griffon2,代码行数:12,代码来源:ConfigurableLanternaWindowDisplayHandler.java
示例6: handleClose
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
public void handleClose(@Nonnull Window widget) {
if (getApplication().getPhase() == ApplicationPhase.SHUTDOWN) {
return;
}
int visibleWindows = getWindows().size();
if (visibleWindows <= 1 && isAutoShutdown()) {
if (!getApplication().shutdown())
show(widget);
}
}
开发者ID:aalmiray,项目名称:griffon2,代码行数:12,代码来源:DefaultLanternaWindowManager.java
示例7: createApplicationContainer
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
@Nonnull
@Override
public Object createApplicationContainer(@Nonnull Map<String, Object> attributes) {
String title = (String) attributes.remove("title");
if (title == null) {
title = getConfiguration().getAsString("application.title");
}
return new Window(title);
}
开发者ID:aalmiray,项目名称:griffon2,代码行数:10,代码来源:LanternaGriffonApplication.java
示例8: initUI
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
@Override
public void initUI() {
Window window = (Window) getApplication()
.createApplicationContainer(Collections.<String, Object>emptyMap());
getApplication().getWindowManager().attach("mainWindow", window); //<2>
Panel panel = new Panel(Panel.Orientation.VERTICAL);
panel.addComponent(new Label(getApplication().getMessageSource().getMessage("name.label")));
final TextBox input = new TextBox();
panel.addComponent(input);
LanternaAction sayHelloAction = (LanternaAction) getApplication().getActionManager()
.actionFor(controller, "sayHello")
.getToolkitAction();
final Runnable runnable = sayHelloAction.getRunnable();
sayHelloAction.setRunnable(new Runnable() { //<3>
@Override
public void run() {
model.setInput(input.getText());
runnable.run();
}
});
panel.addComponent(new MutableButton(sayHelloAction)); //<4>
final Label output = new Label();
panel.addComponent(output);
model.addPropertyChangeListener("output", new PropertyChangeListener() { //<3>
@Override
public void propertyChange(PropertyChangeEvent evt) {
output.setText(String.valueOf(evt.getNewValue()));
}
});
window.addComponent(panel);
}
开发者ID:aalmiray,项目名称:griffon2,代码行数:37,代码来源:SampleView.java
示例9: handleGlobalKeyPressed
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
public boolean handleGlobalKeyPressed(final Window sender, final Key key)
{
if (key.getCharacter() == 'q' || key.getKind() == Kind.Escape)
{
shutdown();
return true;
}
else if (key.getCharacter() == '?')
{
helpPopup.show();
return true;
}
return false;
}
开发者ID:d0x,项目名称:nchadoop,代码行数:16,代码来源:Controller.java
示例10: show
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
public void show(@Nonnull String name, @Nonnull Window window) {
requireNonBlank(name, ERROR_NAME_BLANK);
requireNonNull(window, ERROR_WINDOW_NULL);
screen.showWindow(window, GUIScreen.Position.CENTER);
}
开发者ID:aalmiray,项目名称:griffon2,代码行数:6,代码来源:DefaultLanternaWindowDisplayHandler.java
示例11: hide
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
public void hide(@Nonnull String name, @Nonnull Window window) {
requireNonBlank(name, ERROR_NAME_BLANK);
requireNonNull(window, ERROR_WINDOW_NULL);
window.close();
}
开发者ID:aalmiray,项目名称:griffon2,代码行数:6,代码来源:DefaultLanternaWindowDisplayHandler.java
示例12: doAttach
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
@Override
protected void doAttach(@Nonnull Window window) {
requireNonNull(window, ERROR_WINDOW_NULL);
window.addWindowListener(windowHelper);
}
开发者ID:aalmiray,项目名称:griffon2,代码行数:6,代码来源:DefaultLanternaWindowManager.java
示例13: doDetach
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
@Override
protected void doDetach(@Nonnull Window window) {
requireNonNull(window, ERROR_WINDOW_NULL);
}
开发者ID:aalmiray,项目名称:griffon2,代码行数:5,代码来源:DefaultLanternaWindowManager.java
示例14: isWindowVisible
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
@Override
protected boolean isWindowVisible(@Nonnull Window window) {
requireNonNull(window, ERROR_WINDOW_NULL);
return true;
}
开发者ID:aalmiray,项目名称:griffon2,代码行数:6,代码来源:DefaultLanternaWindowManager.java
示例15: onWindowClosed
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
@Override
public void onWindowClosed(@Nonnull Window window) {
super.onWindowClosed(window);
event(ApplicationEvent.WINDOW_HIDDEN, asList(window));
handleClose(window);
}
开发者ID:aalmiray,项目名称:griffon2,代码行数:7,代码来源:DefaultLanternaWindowManager.java
示例16: onWindowShown
import com.googlecode.lanterna.gui.Window; //导入依赖的package包/类
@Override
public void onWindowShown(Window window) {
super.onWindowShown(window);
event(ApplicationEvent.WINDOW_SHOWN, asList(window));
}
开发者ID:aalmiray,项目名称:griffon2,代码行数:6,代码来源:DefaultLanternaWindowManager.java
注:本文中的com.googlecode.lanterna.gui.Window类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论