本文整理汇总了Java中org.cytoscape.work.util.ListSingleSelection类的典型用法代码示例。如果您正苦于以下问题:Java ListSingleSelection类的具体用法?Java ListSingleSelection怎么用?Java ListSingleSelection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListSingleSelection类属于org.cytoscape.work.util包,在下文中一共展示了ListSingleSelection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: MapColumnTask
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
public MapColumnTask(CyServiceRegistrar registrar) {
this.applicationManager = registrar.getService(CyApplicationManager.class);
this.mappingManager = registrar.getService(DataSeriesMappingManager.class);
DataSeriesManager dataSeriesManager = registrar.getService(DataSeriesManager.class);
CyNetworkManager networkManager = registrar.getService(CyNetworkManager.class);
targetClass = new ListSingleSelection<>(new TargetClassInfo("Nodes", CyNode.class), new TargetClassInfo("Edges", CyEdge.class));
dataSeries = new ListSingleSelection<>(dataSeriesManager.getAllDataSeries());
existingColumnForMapping = new ListSingleSelection<>();
mapRowNamesWithColumn = new ListSingleSelection<>();
targetNetwork = new ListSingleSelection<>(networkManager.getNetworkSet().stream().toArray(CyNetwork[]::new));
if(applicationManager.getCurrentNetwork() != null)
{
targetNetwork.setSelectedValue(applicationManager.getCurrentNetwork());
}
updateExistingColumnForMapping(CyNode.class);
updateMapRowNamesWithColumn(CyNode.class);
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:23,代码来源:MapColumnTask.java
示例2: AbstractImportTask
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
public AbstractImportTask(CyServiceRegistrar registrar) {
super();
this.registrar = registrar;
this.dataSeriesManager = registrar.getService(DataSeriesManager.class);
DataSeriesImportManager importManager = registrar.getService(DataSeriesImportManager.class);
this.provider = new ListSingleSelection<>(importManager.getAllImportProviders().stream()
.map(x -> new ProviderDisplay(x))
.collect(Collectors.toList()));
Optional<ProviderDisplay> timeSeriesDisplay = provider.getPossibleValues().stream()
.filter(x ->
x.getProvider().getImportedClass() != null && TimeSeries.class.isAssignableFrom(x.getProvider().getImportedClass()))
.findAny();
if(timeSeriesDisplay.isPresent())
{
provider.setSelectedValue(timeSeriesDisplay.get());
}
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:23,代码来源:AbstractImportTask.java
示例3: setSoftFile
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
public void setSoftFile(SoftFile file)
{
softFile = file;
if(file.getTables().size() > 1)
{
List<StringAndIndex> choice = new ArrayList<>();
for(int i = 0; i < file.getTables().size(); i++)
{
SoftTable softTable = file.getTables().get(i);
choice.add(new StringAndIndex(i, softTable.getType().toString() + ": " + softTable.getCaption()));
}
tableSelection = new ListSingleSelection<>(choice);
}
else
{
tableSelection = null; //makes the GUI skip the prompt
}
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:19,代码来源:ChooseSoftTableTask.java
示例4: getTargetColumns
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
private ListSingleSelection<String> getTargetColumns()
{
final CyTable table = network.getTable(CyNode.class, CyNetwork.DEFAULT_ATTRS);
final List<String> colNames = new ArrayList<String>();
for (final CyColumn col : table.getColumns()) {
// Exclude list, numerical, boolean type columns
if (String.class.isAssignableFrom(col.getType())) {
colNames.add(col.getName());
}
}
ListSingleSelection<String> toReturn =
new ListSingleSelection<String>(colNames);
if(colNames.contains("UNIPROT"))
toReturn.setSelectedValue("UNIPROT");
else if(colNames.contains("GENE SYMBOL"))
toReturn.setSelectedValue("GENE SYMBOL");
else if(colNames.contains("URI"))
toReturn.setSelectedValue("URI");
else if(colNames.contains(CyRootNetwork.SHARED_NAME))
toReturn.setSelectedValue(CyRootNetwork.SHARED_NAME); //less desired
return toReturn;
}
开发者ID:PathwayCommons,项目名称:CyPath2,代码行数:27,代码来源:ExpandNetworkTask.java
示例5: getExistingColumnForMapping
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
@Tunable(description="Existing column", groups={"Column"}, dependsOn="createNewColumn=false", listenForChange ={"targetClass","targetNetwork"})
public ListSingleSelection<String> getExistingColumnForMapping()
{
if(!updatingExistingColumnForMapping)
{
updatingExistingColumnForMapping = true;
try {
updateExistingColumnForMapping(targetClass.getSelectedValue().getTargetClass());
} finally {
updatingExistingColumnForMapping = false;
}
}
return existingColumnForMapping;
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:15,代码来源:MapColumnTask.java
示例6: getMapRowNamesWithColumn
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
@Tunable(description="Column to match row names", groups={"Mapping"}, dependsOn="mapByRowNames=true", listenForChange ="targetClass")
public ListSingleSelection<String> getMapRowNamesWithColumn()
{
if(!updatingMapRowNamesWithColumn)
{
updatingMapRowNamesWithColumn = true;
try
{
updateMapRowNamesWithColumn(targetClass.getSelectedValue().getTargetClass());
} finally {
updatingMapRowNamesWithColumn = false;
}
}
return mapRowNamesWithColumn;
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:16,代码来源:MapColumnTask.java
示例7: showColumnsForClass
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
private void showColumnsForClass(Class<?> columnType, ListSingleSelection<String> selection, Class<? extends CyIdentifiable> targetClass)
{
CyNetwork network = targetNetwork.getSelectedValue();
List<CyColumn> candidateColumns = new ArrayList<>(mappingManager.getMappingTable(network, targetClass).getColumns());
List<String> filteredCandidateColumnsNames = candidateColumns.stream()
.filter(col -> col.getType() == columnType && !col.isPrimaryKey())
.map(col -> col.getName())
.collect(Collectors.toList());
filteredCandidateColumnsNames.sort(new AlphanumComparator<>());
selection.setPossibleValues(filteredCandidateColumnsNames);
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:15,代码来源:MapColumnTask.java
示例8: SmoothDataSeriesTask
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
public SmoothDataSeriesTask(CyServiceRegistrar registrar) {
this.dataSeriesManager = registrar.getService(DataSeriesManager.class);
this.smoothingService = registrar.getService(SmoothingService.class);
this.registrar = registrar;
timeSeries = new ListSingleSelection<>(dataSeriesManager.getDataSeriesByType(TimeSeries.class));
outputParameters = new SmoothingOutputParameters();
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:8,代码来源:SmoothDataSeriesTask.java
示例9: BaseExportReportsTask
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
public BaseExportReportsTask(SafeSession session) {
CyNetworkView view = session.getNetworkView();
CyNetwork network = view.getModel();
nodeTable = network.getDefaultNodeTable();
List<String> names = SafeUtil.getStringColumnNames(nodeTable)
.collect(Collectors.toList());
nodeNameColumn = new ListSingleSelection<>(names);
nodeNameColumn.setSelectedValue(CyNetwork.NAME);
this.session = session;
}
开发者ID:baryshnikova-lab,项目名称:safe-java,代码行数:14,代码来源:BaseExportReportsTask.java
示例10: listSingleSelectionFromEnum
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
public static ListSingleSelection<String> listSingleSelectionFromEnum(Enum<?>[] values) {
List<String> names = new ArrayList<>(values.length);
for(Enum<?> value : values) {
names.add(value.name());
}
return new ListSingleSelection<>(names);
}
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:8,代码来源:TaskTools.java
示例11: ExpandNetworkTask
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
public ExpandNetworkTask(CyNetworkView cyNetworkView, View<CyNode> cyNodeView)
{
network = cyNetworkView.getModel();
columnSelection = getTargetColumns();
querySelection = new ListSingleSelection<String>("NEIGHBORHOOD","PATHSBETWEEN");
querySelection.setSelectedValue("NEIGHBORHOOD");
}
开发者ID:PathwayCommons,项目名称:CyPath2,代码行数:8,代码来源:ExpandNetworkTask.java
示例12: SmoothInteractiveShowUITask
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
public SmoothInteractiveShowUITask(CyServiceRegistrar registrar) {
this.registrar = registrar;
timeSeries = new ListSingleSelection<>(registrar.getService(DataSeriesManager.class).getDataSeriesByType(TimeSeries.class));
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:5,代码来源:SmoothInteractiveShowUITask.java
示例13: ExponentiateDataSeriesTask
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
public ExponentiateDataSeriesTask(DataSeriesManager dataSeriesManager) {
dataSeries = new ListSingleSelection<>(
dataSeriesManager.getDataSeriesByType(DoubleDataSeries.class));
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:5,代码来源:ExponentiateDataSeriesTask.java
示例14: setExistingColumnForMapping
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
public void setExistingColumnForMapping(ListSingleSelection<String> columnsForMapping)
{
this.existingColumnForMapping = columnsForMapping;
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:5,代码来源:MapColumnTask.java
示例15: setMapRowNamesWithColumn
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
public void setMapRowNamesWithColumn(ListSingleSelection<String> mapRowNamesWithColumn)
{
this.mapRowNamesWithColumn = mapRowNamesWithColumn;
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:5,代码来源:MapColumnTask.java
示例16: ExportDataSeriesTask
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
public ExportDataSeriesTask(DataSeriesManager dataSeriesManager, DataSeriesStorageManager dataSeriesStorageManager) {
dataSeries = new ListSingleSelection<>(dataSeriesManager.getAllDataSeries());
this.dataSeriesStorageManager = dataSeriesStorageManager;
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:5,代码来源:ExportDataSeriesTask.java
示例17: RemoveDataSeriesTask
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
public RemoveDataSeriesTask(DataSeriesManager dataSeriesManager) {
this.dataSeriesManager = dataSeriesManager;
dataSeries = new ListSingleSelection<>(dataSeriesManager.getAllDataSeries());
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:5,代码来源:RemoveDataSeriesTask.java
示例18: RemoveColumnMappingTask
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
public RemoveColumnMappingTask(DataSeriesMappingManager mappingManager) {
super();
this.mappingManager = mappingManager;
targetMapping = new ListSingleSelection<>(mappingManager.getAllMappingDescriptors());
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:6,代码来源:RemoveColumnMappingTask.java
示例19: BioPaxReaderTask
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
/**
* Constructor
*
* @param stream input biopax stream
* @param inputName a file or pathway name (can be later updated using actual data)
* @param cyServices api services
* @param visualStyleUtil biopax/sif visual style utilities
*/
public BioPaxReaderTask(InputStream stream, String inputName,
CyServices cyServices, VisualStyleUtil visualStyleUtil)
{
this.networks = new HashSet<CyNetwork>();
this.stream = stream;
this.inputName = inputName;
this.cyServices = cyServices;
this.visualStyleUtil = visualStyleUtil;
// initialize the root networks Collection
nameToRootNetworkMap = new HashMap<String, CyRootNetwork>();
for (CyNetwork net : cyServices.networkManager.getNetworkSet()) {
final CyRootNetwork rootNet = cyServices.rootNetworkManager.getRootNetwork(net);
if (!nameToRootNetworkMap.containsValue(rootNet))
nameToRootNetworkMap.put(rootNet.getRow(rootNet).get(CyRootNetwork.NAME, String.class), rootNet);
}
List<String> rootNames = new ArrayList<String>();
rootNames.add(CREATE_NEW_COLLECTION);
rootNames.addAll(nameToRootNetworkMap.keySet());
rootNetworkSelection = new ListSingleSelection<String>(rootNames);
rootNetworkSelection.setSelectedValue(CREATE_NEW_COLLECTION);
// initialize the list of data processing modes
readerMode = new ListSingleSelection<>(ReaderMode.values());
readerMode.setSelectedValue(ReaderMode.DEFAULT);
// init the SIF rules/patterns list
sifSelection = new ListMultipleSelection<SIFType>(SIFEnum.values());
sifSelection.setSelectedValues(sifSelection.getPossibleValues());
//TODO init SBGN options
sbgnSelection = new ListSingleSelection<String>();
// initialize renderer list
final List<NetworkViewRenderer> renderers = new ArrayList<>();
final Set<NetworkViewRenderer> rendererSet = cyServices.applicationManager.getNetworkViewRendererSet();
// If there is only one registered renderer, we don't want to add it to the List Selection,
// so the combo-box does not appear to the user, since there is nothing to select anyway.
if (rendererSet.size() > 1) {
renderers.addAll(rendererSet);
Collections.sort(renderers, new Comparator<NetworkViewRenderer>() {
@Override
public int compare(NetworkViewRenderer r1, NetworkViewRenderer r2) {
return r1.toString().compareToIgnoreCase(r2.toString());
}
});
}
rendererList = new ListSingleSelection<>(renderers);
}
开发者ID:cytoscape,项目名称:biopax,代码行数:58,代码来源:BioPaxReaderTask.java
示例20: BioPaxReaderTask
import org.cytoscape.work.util.ListSingleSelection; //导入依赖的package包/类
/**
* Constructor
* @param stream input biopax stream
* @param inputName a file or pathway name (can be later updated using actual data)
*/
public BioPaxReaderTask(InputStream stream, String inputName)
{
this.networks = new HashSet<CyNetwork>();
this.stream = stream;
this.inputName = inputName;
// initialize the root networks Collection
nameToRootNetworkMap = new HashMap<String, CyRootNetwork>();
for (CyNetwork net : App.cyServices.networkManager.getNetworkSet()) {
final CyRootNetwork rootNet = App.cyServices.rootNetworkManager.getRootNetwork(net);
if (!nameToRootNetworkMap.containsValue(rootNet))
nameToRootNetworkMap.put(rootNet.getRow(rootNet).get(CyRootNetwork.NAME, String.class), rootNet);
}
List<String> rootNames = new ArrayList<String>();
rootNames.add(CREATE_NEW_COLLECTION);
rootNames.addAll(nameToRootNetworkMap.keySet());
rootNetworkSelection = new ListSingleSelection<String>(rootNames);
rootNetworkSelection.setSelectedValue(CREATE_NEW_COLLECTION);
// initialize the list of data processing modes
readerMode = new ListSingleSelection<>(ReaderMode.values());
readerMode.setSelectedValue(ReaderMode.DEFAULT);
// init the SIF rules/patterns list
sifSelection = new ListMultipleSelection<SIFType>(SIFEnum.values());
List<SIFType> values = sifSelection.getPossibleValues();
//remove sif rules/types/patterns that we don't want to apply by default
for(SIFType item : sifSelection.getPossibleValues()) {
if(item == SIFEnum.NEIGHBOR_OF // excl. this ubiquitous but confusing type (not useful)
|| item == SIFEnum.INTERACTS_WITH //excl. PPIs (mostly PSI-MI data)
// || item == SIFEnum.REACTS_WITH
)
{
values.remove(item);
}
}
sifSelection.setSelectedValues(values);
// initialize renderer list
final List<NetworkViewRenderer> renderers = new ArrayList<>();
final Set<NetworkViewRenderer> rendererSet = App.cyServices.applicationManager.getNetworkViewRendererSet();
// If there is only one registered renderer, we don't want to add it to the List Selection,
// so the combo-box does not appear to the user, since there is nothing to select anyway.
if (rendererSet.size() > 1) {
renderers.addAll(rendererSet);
Collections.sort(renderers, new Comparator<NetworkViewRenderer>() {
@Override
public int compare(NetworkViewRenderer r1, NetworkViewRenderer r2) {
return r1.toString().compareToIgnoreCase(r2.toString());
}
});
}
rendererList = new ListSingleSelection<>(renderers);
}
开发者ID:PathwayCommons,项目名称:CyPath2,代码行数:60,代码来源:BioPaxReaderTask.java
注:本文中的org.cytoscape.work.util.ListSingleSelection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论