org.apache.pivot.wtk.Display Java Examples

The following examples show how to use org.apache.pivot.wtk.Display. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GeoTriples.java    From GeoTriples with Apache License 2.0 6 votes vote down vote up
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    String language = properties.get(LANGUAGE_KEY);
    System.out.println(language);
    Locale locale = (language == null) ? Locale.getDefault() : new Locale(language);
    System.out.println(locale);
    @SuppressWarnings("unused")
    URL url=classLoader.getResource("GeoTriplesWindow.json");
    
    Resources resources = new Resources("GeoTriplesWindow",locale);
    BXMLSerializer bxmlSerializer = new BXMLSerializer();
    System.out.println(classLoader.getResource("GeoTriplesWindow.bxml"));
    System.out.println(classLoader.getResource("/GeoTriplesWindow.bxml"));
    System.out.println(GeoTriples.class.getResource("GeoTriplesWindow.bxml"));
    System.out.println(GeoTriples.class.getResource("/GeoTriplesWindow.bxml"));
    window = (GeoTriplesWindow)bxmlSerializer.readObject(classLoader.getResource("GeoTriplesWindow.bxml"),resources);
    window.open(display);
}
 
Example #2
Source File: Master.java    From setupmaker with Apache License 2.0 6 votes vote down vote up
@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");
}
 
Example #3
Source File: MosaicPaneRefImpl.java    From Mosaic with Apache License 2.0 5 votes vote down vote up
@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);
  }
 
Example #4
Source File: GeoTriplesWindow.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
@Override
public void open(Display display, Window owner) {
	super.open(display, owner);
	

	/*
	 * ApplicationContext.scheduleRecurringCallback(new Runnable() {
	 * 
	 * @Override public void run() { refreshTable(); } }, REFRESH_INTERVAL);
	 */
	}
 
Example #5
Source File: NGDialog.java    From setupmaker with Apache License 2.0 4 votes vote down vote up
@Override public void open(Display display, Window owner, DialogCloseListener dialogCloseListenerArgument)
{
    inGroupName.setText("");
    validated=false;
    super.open(display, owner, dialogCloseListenerArgument);
}