public InatPlugin() {
		this.configurationFile = CytoscapeInit.getConfigFile("ANIMO-configuration.xml");

		try {
			InatBackend.initialise(this.configurationFile);
			System.setProperty("java.security.policy", CytoscapeInit.getConfigFile("ANIMO-security.policy").getAbsolutePath());

			CytoPanel p = Cytoscape.getDesktop().getCytoPanel(SwingConstants.WEST);
			p.add(TAB_NAME, this.setupPanel(this));
			TAB_INDEX = p.getCytoPanelComponentCount() - 1; //We assume that the component was added at the end
			
			INATPropertyChangeListener pcl = new INATPropertyChangeListener(legendColors, legendShapes);
			final PropertyChangeSupport pcs = Cytoscape.getPropertyChangeSupport();
			pcs.addPropertyChangeListener(Cytoscape.NETWORK_CREATED, pcl); //Add all visual mappings
			pcs.addPropertyChangeListener(Cytoscape.NETWORK_LOADED, pcl); //Make arrows "smooth"
			pcs.addPropertyChangeListener(CytoscapeDesktop.NETWORK_VIEW_CREATED, pcl); //Add right-click menus
			pcs.addPropertyChangeListener(Cytoscape.NETWORK_MODIFIED, pcl); //Add/remove nodes
			pcs.addPropertyChangeListener(Cytoscape.SESSION_LOADED, pcl); //We listen for the session events in order to make sure that nothing "strange" happens when the current session file is closed
			
			//Cytoscape.getPropertyChangeSupport().addPropertyChangeListener(pcl);
			
			colorsListener = pcl.getColorsListener();
			shapesListener = pcl.getShapesListener();
			
			final VisualMappingManager vizMap = Cytoscape.getVisualMappingManager();
			ChangeListener vizMapChangeListener = new ChangeListener() {
				@Override
				public void stateChanged(ChangeEvent e) {
					if (Cytoscape.getCurrentNetworkView() != null) {
						Calculator ca = vizMap.getVisualStyle().getNodeAppearanceCalculator().getCalculator(VisualPropertyType.NODE_FILL_COLOR);
						if (ca != null) {
							for (ObjectMapping m : ca.getMappings()) {
								try {
									m.removeChangeListener(colorsListener);
								} catch (Exception ex) {
								}
								m.addChangeListener(colorsListener);
							}
						}
						ca = vizMap.getVisualStyle().getNodeAppearanceCalculator().getCalculator(VisualPropertyType.NODE_SHAPE);
						if (ca != null) {
							for (ObjectMapping m : ca.getMappings()) {
								try {
									m.removeChangeListener(shapesListener);
								} catch (Exception ex) {
								}
								m.addChangeListener(shapesListener);
							}
						}
						legendColors.updateFromSettings();
						legendShapes.updateFromSettings();
					}
				}
			};
			vizMap.addChangeListener(vizMapChangeListener);
			
			
		} catch (InatException e) {
			// show error panel
			CytoPanel p = Cytoscape.getDesktop().getCytoPanel(SwingConstants.WEST);
			JPanel errorPanel = new JPanel(new BorderLayout());
			JTextArea message = new JTextArea(e.getMessage());
			message.setEditable(false);
			JScrollPane viewport = new JScrollPane(message);
			errorPanel.add(viewport, BorderLayout.CENTER);
			p.add(TAB_NAME, errorPanel);
		}
	}