本文整理汇总了Java中fiji.util.gui.GenericDialogPlus.addStringField方法的典型用法代码示例。如果您正苦于以下问题:Java GenericDialogPlus.addStringField方法的具体用法?Java GenericDialogPlus.addStringField怎么用?Java GenericDialogPlus.addStringField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fiji.util.gui.GenericDialogPlus
的用法示例。
在下文中一共展示了GenericDialogPlus.addStringField方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addBrowseToCellVoyagerFolder
import fiji.util.gui.GenericDialogPlus; //导入方法依赖的package包/类
public static void addBrowseToCellVoyagerFolder( final GenericDialogPlus dialog, final String label, final String defaultPath, final int columns )
{
dialog.addStringField( label, defaultPath, columns );
final TextField text = ( TextField ) dialog.getStringFields().lastElement();
final GridBagLayout layout = ( GridBagLayout ) dialog.getLayout();
final GridBagConstraints constraints = layout.getConstraints( text );
final Button button = new Button( "Browse..." );
final ChooseCellVoyagerDirListener listener = new ChooseCellVoyagerDirListener( text );
button.addActionListener( listener );
button.addKeyListener( dialog );
final Panel panel = new Panel();
panel.setLayout( new FlowLayout( FlowLayout.LEFT, 0, 0 ) );
panel.add( text );
panel.add( button );
layout.setConstraints( panel, constraints );
dialog.add( panel );
}
示例2: addSaveAsFileField
import fiji.util.gui.GenericDialogPlus; //导入方法依赖的package包/类
public static void addSaveAsFileField( final GenericDialogPlus dialog, final String label, final String defaultPath, final int columns) {
dialog.addStringField( label, defaultPath, columns );
final TextField text = ( TextField ) dialog.getStringFields().lastElement();
final GridBagLayout layout = ( GridBagLayout ) dialog.getLayout();
final GridBagConstraints constraints = layout.getConstraints( text );
final Button button = new Button( "Browse..." );
final ChooseXmlFileListener listener = new ChooseXmlFileListener( text );
button.addActionListener( listener );
button.addKeyListener( dialog );
final Panel panel = new Panel();
panel.setLayout( new FlowLayout( FlowLayout.LEFT, 0, 0 ) );
panel.add( text );
panel.add( button );
layout.setConstraints( panel, constraints );
dialog.add( panel );
}
示例3: queryDirectoryAndRatio
import fiji.util.gui.GenericDialogPlus; //导入方法依赖的package包/类
protected DHMMetaData queryDirectoryAndRatio()
{
GenericDialogPlus gd = new GenericDialogPlus( "Specify Holographic Acquistion Directory" );
gd.addDirectoryField( "Holographic_Acquisition main directory", defaultDir, 50 );
gd.addMessage( "" );
gd.addMessage( "Camera pixel size (e.g. 3.45um) / Magnification (e.g. 20):" );
gd.addNumericField( "Pixel_distance_x", defaulCalX, 5 );
gd.addNumericField( "Pixel_distance_y", defaulCalY, 5 );
gd.addMessage( "Depth between planes (e.g. 0.5mm) / Magnification^2 (e.g. 20^2) * 1000 (mm to um):" );
gd.addNumericField( "Pixel_distance_z", defaulCalZ, 5 );
gd.addStringField( "Pixel_unit", defaulCalUnit );
gd.addMessage( "" );
gd.addCheckbox( "Open_all planes to ensure they have the same dimensions (takes time!)", defaultOpenAll );
gd.showDialog();
if ( gd.wasCanceled() )
return null;
return new DHMMetaData(
new File( defaultDir = gd.getNextString() ),
defaulCalX = gd.getNextNumber(),
defaulCalY = gd.getNextNumber(),
defaulCalZ = gd.getNextNumber(),
defaulCalUnit = gd.getNextString(),
defaultOpenAll = gd.getNextBoolean() );
}
示例4: getParameters
import fiji.util.gui.GenericDialogPlus; //导入方法依赖的package包/类
protected Parameters getParameters( final String sourcePathStr )
{
while ( true )
{
final GenericDialogPlus gd = new GenericDialogPlus( "CellVoyager Import" );
gd.addStringField( "Subsampling factors", lastSubsampling, 25 );
gd.addStringField( "Hdf5 chunk sizes", lastChunkSizes, 25 );
gd.addMessage( "" );
if ( null == sourcePathStr )
{
if ( null == sourceFolderStr )
{
final File folder = new File( System.getProperty( "user.dir" ) ).getParentFile().getParentFile();
sourceFolderStr = folder.getAbsolutePath();
}
}
else
{
sourceFolderStr = sourcePathStr;
}
addBrowseToCellVoyagerFolder( gd, "Measurement folder", sourceFolderStr, 25 );
if ( null == lastExportPath )
{
final File sourceFile = new File( sourceFolderStr );
final String parentFolder = sourceFile.getParent();
lastExportPath = new File( parentFolder, "export.xml" ).getAbsolutePath();
}
PluginHelper.addSaveAsFileField( gd, "Export to", lastExportPath, 25 );
gd.showDialog();
if ( gd.wasCanceled() )
return null;
lastSubsampling = gd.getNextString();
lastChunkSizes = gd.getNextString();
sourceFolderStr = gd.getNextString();
lastExportPath = gd.getNextString();
// parse mipmap resolutions and cell sizes
final int[][] resolutions = PluginHelper.parseResolutionsString( lastSubsampling );
final int[][] subdivisions = PluginHelper.parseResolutionsString( lastChunkSizes );
if ( resolutions.length == 0 )
{
IJ.showMessage( "Cannot parse subsampling factors: " + lastSubsampling );
continue;
}
if ( subdivisions.length == 0 )
{
IJ.showMessage( "Cannot parse hdf5 chunk sizes: " + lastChunkSizes );
continue;
}
else if ( resolutions.length != subdivisions.length )
{
IJ.showMessage( "Subsampling factors and hdf5 chunk sizes must have the same number of elements." );
continue;
}
final File sourceFolder = new File( sourceFolderStr );
String seqFilename = lastExportPath;
if ( !seqFilename.endsWith( ".xml" ) )
seqFilename += ".xml";
final File seqFile = new File( seqFilename );
final File parent = seqFile.getParentFile();
if ( parent == null || !parent.exists() || !parent.isDirectory() )
{
IJ.showMessage( "Invalid export filename " + seqFilename );
continue;
}
final String hdf5Filename = seqFilename.substring( 0, seqFilename.length() - 4 ) + ".h5";
final File hdf5File = new File( hdf5Filename );
return new Parameters( resolutions, subdivisions, sourceFolder, seqFile, hdf5File );
}
}
示例5: 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;
}
}
}