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


Java Window类代码示例

本文整理汇总了Java中org.apache.pivot.wtk.Window的典型用法代码示例。如果您正苦于以下问题:Java Window类的具体用法?Java Window怎么用?Java Window使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Window类属于org.apache.pivot.wtk包,在下文中一共展示了Window类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: perform

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
public void perform(Component source) {
    log.info("reload GUI");
    try {
        Window newWindow = createWindow();
        display.remove(window);
        window = newWindow;
        initComponents();
        display.add(window);
    } catch (Exception ex) {
        log.error("error loading main.bxml", ex);
        if (window != null)
            Alert.alert(MessageType.ERROR, "error loading main.bxml\n" + ex, window);
        else
            System.exit(1);
    }
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:17,代码来源:Main.java

示例2: startup

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
    Window window = new Window();
    window.open(display);
    /*
    AlbumSearch albumSearch = new AlbumSearch(1L, "Hell\u00f6 W\u00f6rld", "The? Cool & Groovy \u00c4rtist", false, false);
    new ShareAction(window, albumSearch).perform(null);
    */
    Song song1 = new Song();
    song1.setSongID(1000L);
    song1.setSongName("S\u00f6ng 2 & S\u00f6ng 3");
    song1.setArtistName("Bl\u00fcr");
    Song song2 = new Song();
    song2.setSongID(1004L);
    song2.setSongName("Caravan? Of L\u00f6ve");
    song2.setArtistName("The Housem\u00e4rtins");
    List<Song> songs = new ArrayList<>(song1, song2);
    new ShareAction(window, songs).perform(null);
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:20,代码来源:ShareAction.java

示例3: startup

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
@Override public void startup(Display display, Map<String, String> properties) throws Exception// App start
{
    Out.print(LOG_LEVEL.DEBUG, "Data loaded to memory");
    
    Locale.setDefault(Locale.ENGLISH);// Set default UI language to English
    BXMLSerializer bxmlSerializer = new BXMLSerializer();
    window = (Window) bxmlSerializer.readObject(getClass().getResource("master.bxml"));
    window.open(display);

    // Helper launch if first time
    if (facade.appConfig.isHelp()) {
        helper.open(window);
        facade.appConfig.setHelp(false);
    }
    
    Out.print(LOG_LEVEL.DEBUG, "Window open");
}
 
开发者ID:DevComPack,项目名称:setupmaker,代码行数:18,代码来源:Master.java

示例4: handleClose

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
public void handleClose(@Nonnull Window widget) {
    if (getApplication().getPhase() == ApplicationPhase.SHUTDOWN) {
        return;
    }
    int visibleWindows = 0;
    for (Window window : getWindows()) {
        if (window.isShowing()) {
            visibleWindows++;
        }
    }

    if (visibleWindows <= 1 && isAutoShutdown()) {
        if (!getApplication().shutdown())
            show(widget);
    }
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:17,代码来源:DefaultPivotWindowManager.java

示例5: initShortcuts

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
private void initShortcuts() {
    // Global shortcut: Reload GUI with Ctrl-R
    window.getActionMappings().add(new Window.ActionMapping(
        new Keyboard.KeyStroke(Keyboard.KeyCode.R, Platform.getCommandModifier().getMask()),
        "reloadGUI"));
    // Global shortcut: Close currently active tab with Ctrl-W
    window.getActionMappings().add(new Window.ActionMapping(
        new Keyboard.KeyStroke(Keyboard.KeyCode.W, Platform.getCommandModifier().getMask()),
        "closeCurrentTab"));
    // Global shortcut: Close all tabs with Ctrl-Shift-W
    window.getActionMappings().add(new Window.ActionMapping(
        new Keyboard.KeyStroke(Keyboard.KeyCode.W, Platform.getCommandModifier().getMask() + Keyboard.Modifier.SHIFT.getMask()),
        "closeAllTabs"));
    // Desktop-wide hotkey: Pause/Resume with media key (if available and supported on current platform)
    provider = Provider.getCurrentProvider(false);
    if (provider != null) {
        HotKeyListener hotKeyListener = new HotKeyListener() {
            @Override
            public void onHotKey(HotKey hotKey) {
                log.debug("hotkey received: " + hotKey);
                Services.getPlayService().pauseOrResume();
            }
        };
        provider.register(MediaKey.MEDIA_PLAY_PAUSE, hotKeyListener);
        provider.register(KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent.META_DOWN_MASK + InputEvent.SHIFT_DOWN_MASK), hotKeyListener);
        log.info("Registered global hotkeys MEDIA_PLAY_PAUSE and Win-Shift-P");
    } else {
        log.warn("No support for global hotkeys on this platform (detected: " + ARCH + "; os-type " + getOSType());
    }
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:31,代码来源:Main.java

示例6: createWindow

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
private Window createWindow() throws IOException, SerializationException {
    BXMLSerializer serializer = new BXMLSerializer();
    serializer.getNamespace().put("main", this);
    Window window = (Window) serializer.readObject(getClass().getResource("main.bxml"), resources);
    serializer.bind(this, Main.class);
    window.setTitle("GrooveJames " + getVersionNumberAndDate());
    return window;
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:9,代码来源:Main.java

示例7: startup

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
public void startup(Display display, Map<String, String> properties) throws Exception {
    final TextArea errorText = new TextArea();
    errorText.setEditable(false);
    errorText.getStyles().put("wrapText", true);
    errorText.getStyles().put("backgroundColor", Color.YELLOW);
    errorText.setText(getLongText());
    ScrollPane scrollPane = new ScrollPane(FILL, AUTO);
    scrollPane.getStyles().put("backgroundColor", Color.BLUE);
    scrollPane.setView(errorText);
    Window window = new Window(scrollPane);
    window.setMaximized(true);
    window.open(display);
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:14,代码来源:TextAreaTest.java

示例8: valueAdded

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
@Override
public void valueAdded(Map<String, Object> map, String key) {
    Object value = Objects.requireNonNull(map.get(key));

    if (getComponents().add(key)) {
        getBeanFactory().registerSingleton(key, value);

        if (value instanceof Window) {
            Window window = (Window) value;
            window.getWindowStateListeners().add(new WindowStateListenerImpl());
        }
    }
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:14,代码来源:AbstractLumpiApplicationContext.java

示例9: previewWindowOpen

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
@Override
public Vote previewWindowOpen(Window window) {
    for (String key : getComponents()) {
        final Object value = Objects.requireNonNull(getBean(key));

        if (value instanceof Bindable) {
            org.apache.pivot.wtk.ApplicationContext.queueCallback(new BindingCallback(AbstractLumpiApplicationContext.this, (Bindable) value));
        }
    }
    return super.previewWindowOpen(window);
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:12,代码来源:AbstractLumpiApplicationContext.java

示例10: createWindow

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
@Bean
@Lazy
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Override
public Window createWindow() {
    return new Window();
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:8,代码来源:AbstractPivotBeanConfiguration.java

示例11: windowOpened

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
@Override
public void windowOpened(Window window) {
    if (!isResizable()) {
        disableResizing();
    } else {
        enableResizing();
    }
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:9,代码来源:HostFrame.java

示例12: handleShowByInjectedHandler

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
@Override
protected boolean handleShowByInjectedHandler(@Nonnull String name, @Nonnull Window window) {
    try {
        PivotWindowDisplayHandler handler = getApplication().getInjector()
            .getInstance(PivotWindowDisplayHandler.class, named(name));
        handler.show(name, window);
        return true;
    } catch (InstanceNotFoundException infe) {
        return super.handleShowByInjectedHandler(name, window);
    }
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:12,代码来源:ConfigurablePivotWindowDisplayHandler.java

示例13: handleHideByInjectedHandler

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
@Override
protected boolean handleHideByInjectedHandler(@Nonnull String name, @Nonnull Window window) {
    try {
        PivotWindowDisplayHandler handler = getApplication().getInjector()
            .getInstance(PivotWindowDisplayHandler.class, named(name));
        handler.hide(name, window);
        return true;
    } catch (InstanceNotFoundException infe) {
        return super.handleHideByInjectedHandler(name, window);
    }
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:12,代码来源:ConfigurablePivotWindowDisplayHandler.java

示例14: createApplicationContainer

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
@Nonnull
@Override
public Object createApplicationContainer(@Nonnull Map<String, Object> attributes) {
    Window window = new Window();
    setPropertiesNoException(window, attributes);
    return window;
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:8,代码来源:AbstractPivotGriffonApplication.java

示例15: before

import org.apache.pivot.wtk.Window; //导入依赖的package包/类
@Override
@SuppressWarnings("ConstantConditions")
protected void before(@Nonnull GriffonApplication application, @Nonnull Object target) throws Throwable {
    application.startup();
    application.ready();
    TestDesktopPivotApplication.getReadyLatch().await();

    window = (Window) application.getWindowManager().getStartingWindow();
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:10,代码来源:GriffonPivotFuncRule.java


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