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


Java Display类代码示例

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


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

示例1: startup

import org.apache.pivot.wtk.Display; //导入依赖的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

示例2: startup

import org.apache.pivot.wtk.Display; //导入依赖的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

示例3: startup

import org.apache.pivot.wtk.Display; //导入依赖的package包/类
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
    BXMLSerializer bxmlSerializer = new BXMLSerializer();
 window = (DissectorWindow) bxmlSerializer.readObject(getClass().getResource("application.xml"));
 window.open(display);

 //ExtendedRandomAccessFile in = open(getClass(), "JavaClassDissector.class" );
 //JavaClassDissector dissector = new JavaClassDissector().read(in);

 //String filename = "/home/bramp/personal/dissector/dissector-core/src/test/resources/net/bramp/dissector/png/z00n2c08.png";
 //String filename = "/home/bramp/personal/dissector/dissector-core/target/classes/net/bramp/dissector/java/JavaClassDissector.class";
 //String filename = "/home/bramp/src/transcoder/samples/lane_bryant/6th_and_Lane_480_RK2 RF22 F24 A32 H240.mp4";
 //String filename = "/home/bramp/personal/dissector/dissector-core/src/test/resources/net/bramp/dissector/torrent/KNOPPIX 7.2.0 DVD.torrent";
 String filename = "/home/bramp/personal/dissector/dissector-core/src/test/resources/net/bramp/dissector/zip/test.zip";
 ExtendedRandomAccessFile file = new ExtendedRandomAccessFile(filename, "r");

 //window.loadDissector(file, new PngDissector());
 //window.loadDissector(file, new JavaClassDissector());
 //window.loadDissector(file, new IsoDissector());
 //window.loadDissector(file, new TorrentDissector());
 window.loadDissector(file, new ZipDissector());

}
 
开发者ID:bramp,项目名称:dissector,代码行数:24,代码来源:DissectorApplication.java

示例4: main

import org.apache.pivot.wtk.Display; //导入依赖的package包/类
public static void main(String[] args) {
    String applicationClassName = args[0];
    final LumpiApplication<?, ?> application;

    try {
        application = (LumpiApplication<?, ?>) ClassLoader.getSystemClassLoader().loadClass(
                applicationClassName).newInstance();
        if (application != null) {
            final Display display =
                    application.getApplicationContext().getHostFrame().getDisplay();

            ApplicationContext.queueCallback(() -> {
                try {
                    application.startup(display, new HashMap<>());
                } catch (Exception exception) {
                    ApplicationContext.handleUncaughtException(exception);
                }
            });
        }
    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
        Logger.getLogger(ApplicationLauncher.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:24,代码来源:ApplicationLauncher.java

示例5: startup

import org.apache.pivot.wtk.Display; //导入依赖的package包/类
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
    // fix a bug in Pivot: replace the Tooltip skin class to set the background color of tooltips properly
    Theme.getTheme().set(Tooltip.class, FixedTerraTooltipSkin.class);

    this.resources = new Resources("groovejames.gui.resources");
    this.display = display;
    this.settings = Settings.load();
    this.downloadTracks.getListListeners().add(new DownloadTracksListListener());
    this.imageLoader = new ImageLoader();

    Services.getPlayService().setListener(new PlaylistListener());
    Services.getPlayService().getPlaylist().getListListeners().add(new PlaylistListListener());
    Services.applySettings(settings);

    initActions();
    window = createWindow();
    initShortcuts();
    initComponents();
    window.open(display);
    searchField.requestFocus();

    addClipboardListeners();
    Services.getWatchClipboardTask().checkNow();

    log.info("GUI initialized");
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:28,代码来源:Main.java

示例6: tooltipTriggered

import org.apache.pivot.wtk.Display; //导入依赖的package包/类
@Override
public void tooltipTriggered(Component component, int x, int y) {
    String tooltipText = component.getTooltipText();
    if (!isNullOrEmpty(tooltipText)) {
        Display display = component.getDisplay();
        Point location = component.mapPointToAncestor(display, x, y);
        int tooltipX = location.x + 16;
        int tooltipY = location.y;
        TextArea content = new TextArea();
        content.getStyles().put("wrapText", Boolean.TRUE);
        content.getStyles().put("margin", new Insets(0));
        content.setPreferredWidth(Math.min(display.getWidth() - tooltipX, getStringWidth(tooltipText, (Font) content.getStyles().get("font"))));
        content.setText(tooltipText);
        Tooltip tooltip = new Tooltip(content);
        int tooltipWidth = tooltip.getPreferredWidth();
        int tooltipHeight = tooltip.getPreferredHeight();
        // ensure tooltip is inside display's bounds
        if (tooltipX + tooltipWidth > display.getWidth()) {
            tooltipX -= tooltipX + tooltipWidth - display.getWidth();
        }
        if (tooltipY + tooltipHeight > display.getHeight()) {
            tooltipY -= tooltipHeight;
        }
        tooltip.setLocation(tooltipX, tooltipY);
        tooltip.open(component.getWindow());
    }
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:28,代码来源:TooltipTableMouseListener.java

示例7: startup

import org.apache.pivot.wtk.Display; //导入依赖的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: startup

import org.apache.pivot.wtk.Display; //导入依赖的package包/类
@Override
  public void startup(final Display display, Map<String, String> map) throws Exception {
MosaicPane mosaicPane = new MosaicPane();
mosaicPane.getComponentKeyListeners().add(getKeyListener());

ModelLoader loader = new ModelLoader(map.get("file"));
String[] model = loader.getModel(map.get("surface"));

System.out.println("model.length = " + model.length);

int i = 0;
for(String def : model) {
	String[] args = def.split("[\\s]*\\,[\\s]*");
	int offset = args.length > 4 ? args.length - 4 : 0;
	String id = args.length == 4 ? "" + (i++) : args[0];
	Label l = getLabel(i > 4 ? colors[random.nextInt(5)] : colors[i], id);
	mosaicPane.add(l, id, 
		Double.parseDouble(args[offset + 0]), 
		Double.parseDouble(args[offset + 1]),
		Double.parseDouble(args[offset + 2]),
		Double.parseDouble(args[offset + 3]));
	clientMap.put(id, l);
}

//Now that we've added the definitions and components to the Surface we can add it to the Engine.
mosaicPane.getEngine().addSurface(mosaicPane.getSurface());

window.setContent(mosaicPane);
      window.setTitle("Mosaic Layout Engine Demo (Pivot)");
      window.setMaximized(true);
      window.open(display);
      
      addMouseHandler(mosaicPane);
  }
 
开发者ID:fxpresso,项目名称:Mosaic,代码行数:35,代码来源:MosaicPaneRefImpl.java

示例9: collectModuleBindings

import org.apache.pivot.wtk.Display; //导入依赖的package包/类
@Override
protected void collectModuleBindings(@Nonnull Collection<Module> modules) {
    modules.add(new AbstractModule() {
        @Override
        protected void doConfigure() {
            bind(Display.class)
                .toInstance(display);
        }
    });
    super.collectModuleBindings(modules);
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:12,代码来源:PivotApplicationBootstrapper.java

示例10: createApplicationBootstrapper

import org.apache.pivot.wtk.Display; //导入依赖的package包/类
@Nonnull
@Override
@SuppressWarnings("ConstantConditions")
protected ApplicationBootstrapper createApplicationBootstrapper(@Nonnull Display display) {
    ApplicationBootstrapper bootstrapper = new TestPivotApplicationBootstrapper(this, display);
    if (bootstrapper instanceof TestCaseAware) {
        ((TestCaseAware) bootstrapper).setTestCase(testCase);
    }
    return bootstrapper;
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:11,代码来源:TestDesktopPivotApplication.java

示例11: startup

import org.apache.pivot.wtk.Display; //导入依赖的package包/类
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
	System.out.println("startup()");
	BXMLSerializer bxml = new BXMLSerializer();
	Window window = (Window) bxml.readObject(PlayerSimulatorApplication.class,
			"PlayerSimulatorWindow.bxml");
	window.open(display);
}
 
开发者ID:lumannnn,项目名称:AudioRacer,代码行数:9,代码来源:PlayerSimulatorApplication.java

示例12: startup

import org.apache.pivot.wtk.Display; //导入依赖的package包/类
@Override
public void startup(Display display, org.apache.pivot.collections.Map<String, String> properties) throws Exception {
	System.out.println("startup()");
	
	BXMLSerializer bxml = new BXMLSerializer();
	_window = (Window) bxml.readObject(WorldSimulatorWindow.class, "window.bxml");
	_window.open(display);
}
 
开发者ID:lumannnn,项目名称:AudioRacer,代码行数:9,代码来源:WorldSimulatorWindow.java

示例13: getDisplay

import org.apache.pivot.wtk.Display; //导入依赖的package包/类
public Display getDisplay() {
    return display;
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:4,代码来源:Main.java

示例14: open

import org.apache.pivot.wtk.Display; //导入依赖的package包/类
@Override public void open(Display display, Window owner, DialogCloseListener dialogCloseListenerArgument)
{
    inGroupName.setText("");
    validated=false;
    super.open(display, owner, dialogCloseListenerArgument);
}
 
开发者ID:DevComPack,项目名称:setupmaker,代码行数:7,代码来源:NGDialog.java

示例15: startup

import org.apache.pivot.wtk.Display; //导入依赖的package包/类
@Override
public final void startup(Display display, Map<String, String> properties) throws Exception {
    getApplicationContext().initializeGUI();
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:5,代码来源:AbstractLumpiApplication.java


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