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


Java GenericDialogPlus.getNextChoiceIndex方法代码示例

本文整理汇总了Java中fiji.util.gui.GenericDialogPlus.getNextChoiceIndex方法的典型用法代码示例。如果您正苦于以下问题:Java GenericDialogPlus.getNextChoiceIndex方法的具体用法?Java GenericDialogPlus.getNextChoiceIndex怎么用?Java GenericDialogPlus.getNextChoiceIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fiji.util.gui.GenericDialogPlus的用法示例。


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

示例1: getParameters

import fiji.util.gui.GenericDialogPlus; //导入方法依赖的package包/类
public static Parameters getParameters()
{
	final GenericDialogPlus gd = new GenericDialogPlus( "Resave dataset as TIFF" );

	if ( defaultPath == null )
		defaultPath = LoadParseQueryXML.defaultXMLfilename;

	PluginHelper.addSaveAsFileField( gd, "Select new XML", defaultPath, 80 );
	
	gd.addChoice( "ImgLib2_data_container", StackList.imglib2Container, StackList.imglib2Container[ defaultContainer ] );
	gd.addCheckbox( "Lossless compression of TIFF files (ZIP)", defaultCompress );
	gd.addMessage( "Use ArrayImg if -ALL- input views are smaller than ~2048x2048x500 px (2^31 px), or if the\n" +
				   "program throws an OutOfMemory exception while processing.  CellImg is slower, but more\n" +
			       "memory efficient and supports much larger file sizes only limited by the RAM of the machine.", 
			       new Font( Font.SANS_SERIF, Font.ITALIC, 11 ) );

	gd.showDialog();
	
	if ( gd.wasCanceled() )
		return null;

	final Parameters params = new Parameters();
	
	params.xmlFile = gd.getNextString();
	
	if ( !params.xmlFile.endsWith( ".xml" ) )
		params.xmlFile += ".xml";

	params.compress = defaultCompress = gd.getNextBoolean();

	defaultPath = LoadParseQueryXML.defaultXMLfilename = params.xmlFile;

	if ( ( defaultContainer = gd.getNextChoiceIndex() ) == 0 )
		params.imgFactory = new ArrayImgFactory< FloatType >();
	else
		params.imgFactory = new CellImgFactory< FloatType >();

	return params;
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:40,代码来源:Resave_TIFF.java

示例2: defineDataset

import fiji.util.gui.GenericDialogPlus; //导入方法依赖的package包/类
public Pair< SpimData2, String > defineDataset( final boolean save )
{
	final ArrayList< MultiViewDatasetDefinition > datasetDefinitions = new ArrayList< MultiViewDatasetDefinition >();
	
	for ( final MultiViewDatasetDefinition mvd : staticDatasetDefinitions )
		datasetDefinitions.add( mvd.newInstance() );
	
	// verify that there are definitions
	final int numDatasetDefinitions = datasetDefinitions.size();
	
	if ( numDatasetDefinitions == 0 )
	{
		IJ.log( "No Multi-View Dataset Definitions available." );
		return null;
	}
	
	// get their names
	final String[] titles = new String[ numDatasetDefinitions ];
	
	for ( int i = 0; i < datasetDefinitions.size(); ++i )
		titles[ i ] = datasetDefinitions.get( i ).getTitle();
	
	// query the dataset definition to use
	final GenericDialogPlus gd1 = new GenericDialogPlus( "Select type of multi-view dataset" );

	if ( defaultDatasetDef >= numDatasetDefinitions )
		defaultDatasetDef = 0;
	
	gd1.addChoice( "Type_of_dataset: ", titles, titles[ defaultDatasetDef ] );
	//Choice choice = (Choice)gd1.getChoices().lastElement();
	gd1.addStringField( "XML_filename", defaultXMLName, 30 );
	/*
	final MyMultiLineLabel label = MyMultiLineLabel.addMessage( gd1,
			formatEntry( datasetDefinitions.get( defaultDatasetDef ).getExtendedDescription(), numCharacters, numLinesDocumentation ),
			new Font( Font.MONOSPACED, Font.PLAIN, 11 ),
			Color.BLACK );
					
	addListeners( gd1, choice, label, datasetDefinitions );*/
	
	GUIHelper.addWebsite( gd1 );
	
	gd1.showDialog();
	if ( gd1.wasCanceled() )
		return null;
	
	defaultDatasetDef = gd1.getNextChoiceIndex();
	final String xmlFileName = defaultXMLName = gd1.getNextString();
	
	// run the definition
	final MultiViewDatasetDefinition def = datasetDefinitions.get( defaultDatasetDef );
	
	IOFunctions.println( defaultDatasetDef );
	
	final SpimData2 spimData = def.createDataset();
	
	if ( spimData == null )
	{
		IOFunctions.println( "Defining multi-view dataset failed." );
		return null;
	}
	else
	{
		final String xml = SpimData2.saveXML( spimData, xmlFileName, "" );

		if ( xml != null )
		{
			GenericLoadParseQueryXML.defaultXMLfilename = xml;
			return new ValuePair< SpimData2, String >( spimData, xml );
		}
		else
		{
			return null;
		}
	}
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:76,代码来源:Define_Multi_View_Dataset.java


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