org.apache.pivot.collections.Map Java Examples

The following examples show how to use org.apache.pivot.collections.Map. 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: AddSourceTable.java    From GeoTriples with Apache License 2.0 6 votes vote down vote up
@Override
public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
	
	selectSource.setAction(new Action() {
		
		@Override
		public void perform(Component source) {
			@SuppressWarnings({ "unchecked", "unused" })
			Sequence<TableName> mm=(Sequence<TableName>) listView.getSelectedItems();
			if( listView.getSelectedItems().getLength()==0)
			{
				return;
			}
			AddSourceTable.this.selectedItems=new ArrayList<TableName>();
			for(int i=0;i<mm.getLength();++i)
			{
				TableName selecteditem=mm.get(i);
				AddSourceTable.this.selectedItems.add(selecteditem);
			}
			
			close(true);
		}
	});
}
 
Example #2
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 #3
Source File: OpenConnection.java    From GeoTriples with Apache License 2.0 6 votes vote down vote up
@Override
public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
	
       // Get a reference to the button group
       // Add a button press listener
	selectChoice.getButtonPressListeners().add(new ButtonPressListener() {
           @Override
           public void buttonPressed(Button button) {
              if(connectiontype.getSelection()==shapeFileChoice)
              {
           	   contype=ConnectionType.SHAPEFILE;
           	   openShapeFile();
              }
              else if(connectiontype.getSelection()==sqlChoice)
              {
           	   contype=ConnectionType.SQL;
           	   openSQLconnection();
              }
              else if (connectiontype.getSelection() == rmlChoice) {
           	   contype=ConnectionType.RML;
           	   openRMLMapping();
              }
           }
       });
   }
 
Example #4
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 #5
Source File: SortDialog.java    From setupmaker with Apache License 2.0 6 votes vote down vote up
@Override
public void initialize(Map<String, Object> arg0, URL arg1, Resources arg2)
{
    tableView.setTableData(packs);
    
    //Action binding
    btTop.setAction(APositioning);
    btUp.setAction(APositioning);
    btDown.setAction(APositioning);
    btBottom.setAction(APositioning);
    
    rbName.setAction(ASortBy);
    rbSize.setAction(ASortBy);
    rbFileType.setAction(ASortBy);
    rbInstallType.setAction(ASortBy);
    rbGroup.setAction(ASortBy);
    rbRequired.setAction(ASortBy);
    rbCustom.setAction(ASortBy);
   
}
 
Example #6
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 #7
Source File: RGDialog.java    From setupmaker with Apache License 2.0 4 votes vote down vote up
@Override public void initialize(Map<String, Object> arg0, URL arg1, Resources arg2)
{
}
 
Example #8
Source File: NGDialog.java    From setupmaker with Apache License 2.0 4 votes vote down vote up
@Override public void initialize(Map<String, Object> arg0, URL arg1, Resources arg2)
{
    //Actions binding
    btGroupAdd.setAction(AGroupAdd);
    btGroupAdd.setButtonDataKey("ENTER");
}