AMAPstudio

User Tools


Groups of charts

[fc-2.2.2016 See the new Diagram lists feature: Diagram lists ]

It is possible to create a new extension to open several charts at the same time. The extension should be part of the capsis.extension.extractorgroup package and should extend capsis.extensiontype.ExtractorGroup.

The new extension lists the graphs which wil be opened at the same when it is triggered. The charts will then be managed independently as if opened separately as usual.

An exemple of ExtractorGroup opening 6 graphs:

package organon.extension.extractorgroup;
 
import java.util.ArrayList;
import java.util.List;
 
import jeeb.lib.util.Translator;
import capsis.extensiontype.ExtractorGroup;
 
/**
 * A group of data extractors for Organon.
 */
public class MetricPlots extends ExtractorGroup {
	// reviewed fc-12.9.2014, fixed several bugs
 
	static {
		Translator.addBundle("organon.OrgLabels");
	}
 
	public static final String NAME = Translator.swap("MetricPlots");
	public static final String VERSION = "1.0";
	public static final String AUTHOR = "F. de Coligny";
	public static final String DESCRIPTION = "MetricPlots.description";
 
	static List<String> extractorClassNames;
	static {
		extractorClassNames = new ArrayList<String>();
		extractorClassNames
				.add("organon.extension.dataextractor.OrgTreesPerHectare");
		extractorClassNames
				.add("organon.extension.dataextractor.OrgBasalAreaPerHectare");
		extractorClassNames
				.add("organon.extension.dataextractor.QuadraticMeanDiameterCm");
		extractorClassNames
				.add("organon.extension.dataextractor.OrgCubicMetersVolumePerHectare");
		extractorClassNames
				.add("organon.extension.dataextractor.OrgBoardFootVolumePerHectare");
		extractorClassNames
				.add("organon.extension.dataextractor.OrgStandDensityIndex");
		// 6 only fit better in the main window
		// extractorClassNames.add("organon.extension.dataextractor.OrgRelativeDensity");
 
	}
 
	/**
	 * Constructor.
	 */
	public MetricPlots() {
		super();
	}
 
	/**
	 * Returns the list of extractors this group contains.
	 */
	protected List<String> getExtractorClassNames() {
		return extractorClassNames;
	}
 
	/**
	 * Extension dynamic compatibility mechanism. This matchWith method checks
	 * if the extension can deal (i.e. is compatible) with the referent.
	 */
	static public boolean matchWith(Object referent) {
		return ExtractorGroup.matchWith(extractorClassNames, referent); // needed
	}
 
}

The labels are all translated in a single pair of translation files:

  • organon.OrgLabels_en.properties
  • organon.OrgLabels_fr.properties

Once your new class recompiled correctly and your translations added in the two translation files, ask Capsis to search the new extension, then launch Capsis, the extension should appear in the lateral bar on the left of the mainframe.

// from the install directory...
cd (...)/capsis4/

// recompile, 
ant compile

// ask capsis to search the new extensions, 
capsis -se

// and start capsis
capsis
documentation/extractorgroups.txt ยท Last modified: 2016/02/02 10:50 by coligny