本文整理汇总了Java中org.cytoscape.model.CyIdentifiable类的典型用法代码示例。如果您正苦于以下问题:Java CyIdentifiable类的具体用法?Java CyIdentifiable怎么用?Java CyIdentifiable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CyIdentifiable类属于org.cytoscape.model包,在下文中一共展示了CyIdentifiable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: mapDataSeriesRowsToTableColumn
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
@Override
public void mapDataSeriesRowsToTableColumn(CyNetwork network, Class<? extends CyIdentifiable> targetClass, String columnName,
DataSeries<?, ?> ds) {
Map<Class<? extends CyIdentifiable>, Map<String, DataSeries<?, ?>>> networkMappings = mappings.get(network);
if (networkMappings == null)
{
networkMappings = new HashMap<>();
mappings.put(network, networkMappings);
}
Map<String, DataSeries<?, ?>> localMap = networkMappings.get(targetClass);
if(localMap == null)
{
localMap = new HashMap<>();
networkMappings.put(targetClass, localMap);
}
if(localMap.containsKey(columnName))
{
logger.warn("Remapping column '" + columnName +"' for network " + Utils.getNetworkName(network) + " class " + targetClass.getSimpleName());
}
localMap.put(columnName, ds);
fireEvent(new DataSeriesMappingEvent(this, EventType.MAPPING_ADDED, Collections.singletonList(new MappingDescriptor<DataSeries<?,?>>(network, targetClass, columnName, ds))));
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:27,代码来源:DataSeriesMappingManagerImpl.java
示例2: getMappedDataSeries
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
@Override
public <T extends DataSeries<?, ?>> T getMappedDataSeries(CyNetwork network, Class<? extends CyIdentifiable> targetClass,
String columnName, Class<T> seriesClass) {
DataSeries<?, ?> series = getMappedDataSeries(network, targetClass, columnName);
if(series == null)
{
return null;
}
else if(seriesClass.isAssignableFrom(series.getClass()))
{
@SuppressWarnings("unchecked")
T castSeries = (T)series;
return (T)castSeries;
}
else
{
throw new DataSeriesException("Mapped data series " + series.getName() + " does not have expected class (" + seriesClass.getName() + ")");
}
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:20,代码来源:DataSeriesMappingManagerImpl.java
示例3: getAllMappings
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public <T extends DataSeries<?, ?>> Map<String, T> getAllMappings(CyNetwork network, Class<? extends CyIdentifiable> targetClass,
Class<T> dataSeriesClass) {
Map<Class<? extends CyIdentifiable>, Map<String, DataSeries<?, ?>>> networkMap = mappings.get(network);
if(networkMap == null)
{
return Collections.EMPTY_MAP;
}
Map<String, DataSeries<?, ?>> localMap = networkMap.get(targetClass);
if(localMap == null)
{
return Collections.EMPTY_MAP;
}
return (Map<String, T>)Maps.filterEntries(localMap, e -> dataSeriesClass.isAssignableFrom(e.getValue().getClass()));
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:17,代码来源:DataSeriesMappingManagerImpl.java
示例4: updateEdgeWeightColumnList
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
private void updateEdgeWeightColumnList() {
weightColumnModel.removeAllElements();
if (session == null) {
return;
}
CyNetworkView view = session.getNetworkView();
CyNetwork model = view.getModel();
CyTable table = model.getDefaultEdgeTable();
table.getColumns()
.stream()
.filter(c -> !CyIdentifiable.SUID.equals(c.getName()) && Number.class.isAssignableFrom(c.getType()))
.map(c -> c.getName())
.sorted(String.CASE_INSENSITIVE_ORDER)
.forEach(name -> weightColumnModel.addElement(name));
weightColumn.setSelectedItem(session.getWeightColumn());
if (weightColumn.getSelectedIndex() == -1 && weightColumnModel.getSize() > 0) {
weightColumn.setSelectedIndex(0);
}
}
开发者ID:baryshnikova-lab,项目名称:safe-java,代码行数:24,代码来源:ImportPanelController.java
示例5: loadFromSession
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
public LongObjectMap<SafeSession> loadFromSession(CySession cySession) throws IOException {
CyTable dataTable = cySession.getTables()
.stream()
.map(metadata -> metadata.getTable())
.filter(table -> DATA_TABLE_TITLE.equals(table.getTitle()))
.findFirst()
.orElse(null);
LongObjectMap<SafeSession> sessions = new LongObjectHashMap<>();
if (dataTable == null) {
return sessions;
}
for (CyRow row : dataTable.getAllRows()) {
String json = row.get(SAFE_DATA_COLUMN, String.class);
SafeSession session = parseSession(json);
Long oldSuid = row.get(CyIdentifiable.SUID, Long.class);
CyNetworkView view = cySession.getObject(oldSuid, CyNetworkView.class);
session.setNetworkView(view);
sessions.put(view.getSUID(), session);
}
return sessions;
}
开发者ID:baryshnikova-lab,项目名称:safe-java,代码行数:26,代码来源:SafeSessionSerializer.java
示例6: set
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
public static void set(CyNetwork network, CyIdentifiable entry, String tableName, String name, Object value, Class<?> type) {
CyRow row = network.getRow(entry, tableName);
CyTable table = row.getTable();
CyColumn column = table.getColumn(name);
if (value != null) {
if (column == null) {
if (value instanceof List) {
table.createListColumn(name, type, false);
}
else if (value instanceof Collection) {
throw new IllegalArgumentException("Arrt. values collection is not a List: "
+ value.getClass().getSimpleName());
}
else {
table.createColumn(name, type, false);
}
}
row.set(name, value);
}
}
开发者ID:cytoscape,项目名称:biopax,代码行数:21,代码来源:AttributeUtil.java
示例7: serialize
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
@Override
public void serialize(final CyNetworkView networkView, JsonGenerator jgen, SerializerProvider provider)
throws IOException, JsonProcessingException {
final CyNetwork network = networkView.getModel();
Collection<CyRow> root = network.getDefaultNodeTable().getMatchingRows(CyNetwork.SELECTED, true);
if (root.size() != 1) {
throw new IllegalStateException("You need to select one node as the root for this tree.");
}
CyRow rootNodeRow = root.iterator().next();
final CyNode rootNode = network.getNode(rootNodeRow.get(CyIdentifiable.SUID, Long.class));
if (rootNode == null) {
throw new IllegalStateException("Could not find the root for this tree.");
}
jgen.useDefaultPrettyPrinter();
expanded = new HashSet<CyNode>();
getChildren(network, rootNode, jgen);
}
开发者ID:keiono,项目名称:cytoscape-d3,代码行数:23,代码来源:D3CyNetworkViewTreeSerializer.java
示例8: set
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
public static void set(CyNetwork network, CyIdentifiable entry, String tableName, String name, Object value, Class<?> type) {
CyRow row = network.getRow(entry, tableName);
CyTable table = row.getTable();
CyColumn column = table.getColumn(name);
if (value != null) {
if (column == null) {
if (value instanceof List) {
table.createListColumn(name, type, false);
}
else if (value instanceof Collection) {
throw new IllegalArgumentException("Attribute value is a Collection and not List: "
+ value.getClass().getSimpleName());
}
else {
table.createColumn(name, type, false);
}
}
row.set(name, value);
}
}
开发者ID:PathwayCommons,项目名称:CyPath2,代码行数:21,代码来源:Attributes.java
示例9: updateMapRowNamesWithColumn
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
private void updateMapRowNamesWithColumn(Class<? extends CyIdentifiable> targetClass)
{
showColumnsForClass(String.class, mapRowNamesWithColumn, targetClass);
if(mapRowNamesWithColumn.getPossibleValues().contains("name") && mapRowNamesWithColumn.getSelectedValue() == null)
{
mapRowNamesWithColumn.setSelectedValue("name");
}
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:9,代码来源:MapColumnTask.java
示例10: showColumnsForClass
import org.cytoscape.model.CyIdentifiable; //导入依赖的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
示例11: ChartSource
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
public ChartSource(CyNetwork network, Class<? extends CyIdentifiable> targetClass, CyRow row) {
super();
this.network = network;
this.targetClass = targetClass;
this.row = row;
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:7,代码来源:DataSeriesVisualPanel.java
示例12: unmapTableColumnInternal
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
protected void unmapTableColumnInternal(CyNetwork network, Class<? extends CyIdentifiable> targetClass, String columnName, boolean fireEvent) {
Map<Class<? extends CyIdentifiable>, Map<String, DataSeries<?, ?>>> networkMappings = mappings.get(network);
if (networkMappings == null)
{
logger.warn("No mappings for network " + Utils.getNetworkName(network) + " exists. Cannot remove mapping for '" + columnName + "'");
return;
}
Map<String, DataSeries<?, ?>> localMap = networkMappings.get(targetClass);
if(localMap == null)
{
logger.warn("No mappings for " + targetClass.getSimpleName() + " exists. Cannot remove mapping for '" + columnName + "'");
return;
}
if(!localMap.containsKey(columnName))
{
logger.warn("Mappings for column '" + columnName + "' for network " + Utils.getNetworkName(network) + " and class " + targetClass.getSimpleName() + " does not exist, cannot remove.");
return;
}
DataSeries<?,?> ds = localMap.get(columnName); //store for event
localMap.remove(columnName);
if(fireEvent)
{
fireEvent(new DataSeriesMappingEvent(this, EventType.MAPPING_REMOVED, Collections.singletonList(new MappingDescriptor<DataSeries<?,?>>(network, targetClass, columnName, ds))));
}
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:28,代码来源:DataSeriesMappingManagerImpl.java
示例13: isMappingsEmpty
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
@Override
public boolean isMappingsEmpty() {
for(Map<Class<? extends CyIdentifiable>, Map<String, DataSeries<?, ?>>> networkMapping : mappings.values())
{
for(Map<String, DataSeries<?,?>> classMapping: networkMapping.values())
{
if(!classMapping.isEmpty())
{
return false;
}
}
}
return true;
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:15,代码来源:DataSeriesMappingManagerImpl.java
示例14: getTargetsWithMappedDataSeries
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
@Override
public Collection<Class<? extends CyIdentifiable>> getTargetsWithMappedDataSeries(CyNetwork network) {
Map<Class<? extends CyIdentifiable>, Map<String, DataSeries<?, ?>>> networkMapping = mappings.get(network);
if(networkMapping == null)
{
return Collections.EMPTY_LIST;
}
return networkMapping.keySet();
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:10,代码来源:DataSeriesMappingManagerImpl.java
示例15: MappingDescriptor
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
public MappingDescriptor(CyNetwork network, Class<? extends CyIdentifiable> targetClass, String columnName,
T dataSeries) {
super();
this.network = network;
this.targetClass = targetClass;
this.columnName = columnName;
this.dataSeries = dataSeries;
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:9,代码来源:MappingDescriptor.java
示例16: updateExistingColumnForMapping
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
private void updateExistingColumnForMapping(Class<? extends CyIdentifiable> targetClass)
{
showColumnsForClass(DataSeriesMappingManager.MAPPING_COLUMN_CLASS, existingColumnForMapping, targetClass);
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:5,代码来源:MapColumnTask.java
示例17: TargetClassInfo
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
public TargetClassInfo(String displayName, Class<? extends CyIdentifiable> targetClass) {
super();
this.displayName = displayName;
this.targetClass = targetClass;
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:6,代码来源:MapColumnTask.java
示例18: getTargetClass
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
public Class<? extends CyIdentifiable> getTargetClass() {
return targetClass;
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:4,代码来源:MapColumnTask.java
示例19: unmapTableColumn
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
@Override
public void unmapTableColumn(CyNetwork network, Class<? extends CyIdentifiable> targetClass, String columnName) {
unmapTableColumnInternal(network, targetClass, columnName, true);
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:5,代码来源:DataSeriesMappingManagerImpl.java
示例20: getMappingTable
import org.cytoscape.model.CyIdentifiable; //导入依赖的package包/类
@Override
public CyTable getMappingTable(CyNetwork network, Class<? extends CyIdentifiable> targetClass) {
return network.getTable(targetClass, CyNetwork.LOCAL_ATTRS);
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:5,代码来源:DataSeriesMappingManagerImpl.java
注:本文中的org.cytoscape.model.CyIdentifiable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论