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


Java AttributeColumn类代码示例

本文整理汇总了Java中org.gephi.data.attributes.api.AttributeColumn的典型用法代码示例。如果您正苦于以下问题:Java AttributeColumn类的具体用法?Java AttributeColumn怎么用?Java AttributeColumn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AttributeColumn类属于org.gephi.data.attributes.api包,在下文中一共展示了AttributeColumn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAttributeField

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
AttributeColumn getAttributeField(String[] patterns, AttributeColumn[] columns) {
    for (AttributeColumn col : columns) {
        for (String str : patterns) {
            Pattern pattern = Pattern.compile(str, Pattern.CASE_INSENSITIVE);
            Matcher matcher = pattern.matcher(col.getTitle());
            if (matcher.find() && (col.getType() == AttributeType.FLOAT
                    // Make sure data is formatted correctly
                    || col.getType() == AttributeType.DOUBLE
                    || col.getType() == AttributeType.BIGDECIMAL
                    || col.getType() == AttributeType.DYNAMIC_BIGDECIMAL
                    || col.getType() == AttributeType.DYNAMIC_DOUBLE
                    || col.getType() == AttributeType.DYNAMIC_FLOAT)) {

                return col;
            }
        }
    }
    return null;
}
 
开发者ID:romanseidl,项目名称:SHPExporter,代码行数:20,代码来源:GeoAttributeFinder.java

示例2: getFeatureTypeForAttributes

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
private SimpleFeatureType getFeatureTypeForAttributes(Class geometryClass, AttributeColumn[] nodeColums) {
    SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
    builder.setName(geometryClass.getName());

    //Add a geometry
    builder.add(LOCATION_FIELD, geometryClass);

    for (AttributeColumn col : nodeColums) {
        String name = col.getTitle();
        AttributeType typ = col.getType();

        //ignore Lists? 
        if (!typ.isListType()) {
            builder.add(name, typ.getType());
        }
    }
    //add size and color attributes
    builder.add(SIZE_FIELD, Float.class);
    builder.add(COLOR_FIELD, String.class);

    //build the type
    SimpleFeatureType featureType = builder.buildFeatureType();
    return featureType;
}
 
开发者ID:romanseidl,项目名称:SHPExporter,代码行数:25,代码来源:SHPExporter.java

示例3: partition

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
public Partition<Node> partition(Graph<MultimodalItem, SameClassLink> itemsGraph) {

		UndirectedGraph graph = getGraph(itemsGraph);
		
		System.out.println("Nodes: " + graph.getNodeCount());
		System.out.println("Edges: " + graph.getEdgeCount());

		AttributeModel attributeModel = Lookup.getDefault().lookup(AttributeController.class).getModel();
		
		// Run modularity algorithm - community detection
		Modularity modularity = new Modularity();
		modularity.setUseWeight(true);
		modularity.setResolution(1.);
		modularity.setRandom(true);
		modularity.execute(graphModel, attributeModel);
		
		AttributeColumn modColumn = attributeModel.getNodeTable().getColumn(Modularity.MODULARITY_CLASS);

		@SuppressWarnings("unchecked")
		Partition<Node> p = partitionController.buildPartition(modColumn, graph);
		
		return p;
	}
 
开发者ID:socialsensor,项目名称:social-event-detection,代码行数:24,代码来源:LouvainClustering.java

示例4: checkIfColumnIsBoolean

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
/**
 * This method checks, if the given Column is boolean
 * @param chosenColumn name of the column
 * @return true if column is boolean, false otherwise
 */
private boolean checkIfColumnIsBoolean(String chosenColumn) {
    AttributeColumn[] columns = attrModel.getNodeTable().getColumns();
    for (AttributeColumn column : columns) {
        if (column.getTitle().equals(chosenColumn)) {
            return column.getType() == AttributeType.BOOLEAN;
        }
    }
    return false;
}
 
开发者ID:KSD-research-group,项目名称:plugin4gephi,代码行数:15,代码来源:Colorizer.java

示例5: exists

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
/**
 * This method checks, if the given string exists in all columns
 * @param s string to be checked
 * @param columns columns where to check
 * @return true if existing as column, false if not
 */
private static boolean exists(String s, AttributeColumn[] columns) {
    for (AttributeColumn column : columns) {
        if (s.equals(column.getTitle())) {
            return true;
        }
    }
    return false;
}
 
开发者ID:KSD-research-group,项目名称:plugin4gephi,代码行数:15,代码来源:GraphmlLayout.java

示例6: findGeoFields

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
public AttributeColumn[] findGeoFields(AttributeColumn[] columns) {
    String[] latAttributes = {"latitude", "^lat$", "^y$", "(.*)lat(.*)"};
    String[] lonAttributes = {"longitude", "lon", "lng", "^x$", "(.*)lon(.*)", "(.*)lng(.*)"};

    // find attributes by iterating over property names
    longitudeColumn = getAttributeField(lonAttributes, columns);
    latitudeColumn = getAttributeField(latAttributes, columns);
    AttributeColumn[] result = {getLongitudeColumn(), getLatitudeColumn()};
    return result;
}
 
开发者ID:romanseidl,项目名称:SHPExporter,代码行数:11,代码来源:GeoAttributeFinder.java

示例7: getCoordinateForNode

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
private Coordinate getCoordinateForNode(Node node, AttributeColumn[] geoFields) {
    double latitude, longitude;

    //is there a location set? else use pseudo-coordinates...
    if (geoFields[0] != null) {
        final AttributeRow row = (AttributeRow) (node).getNodeData().getAttributes();
        latitude = getDoubleForCoordinateFieldObject(row.getValue(geoFields[0]));
        longitude = getDoubleForCoordinateFieldObject(row.getValue(geoFields[1]));
    } else {
        latitude = node.getNodeData().x();
        longitude = node.getNodeData().y();
    }
    Coordinate coordinate = new Coordinate(latitude, longitude);
    return coordinate;
}
 
开发者ID:romanseidl,项目名称:SHPExporter,代码行数:16,代码来源:SHPExporter.java

示例8: getFloatValue

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
public float getFloatValue(Node node, AttributeColumn column) {
return ((Number) node.getNodeData().getAttributes().getValue(column.getIndex())).floatValue();
}
 
开发者ID:WouterSpekkink,项目名称:EventGraphLayout_0.8.2,代码行数:4,代码来源:TimeForce.java

示例9: getProperties

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
@Override
public LayoutProperty[] getProperties() {
    List<LayoutProperty> properties = new ArrayList<LayoutProperty>();
    final String TIMEFORCE =  "Time Force Layout";
    
    try {
        properties.add(LayoutProperty.createProperty(
                this, Double.class,
                "Scale of Order",
                TIMEFORCE,
                "Determines the separation of the nodes on the x-axis",
                "getOrderScale", "setOrderScale"));
        properties.add(LayoutProperty.createProperty(
                this, AttributeColumn.class,
                "Order",
                TIMEFORCE,
                "Selects the attribute that indicates the order of events",
                "getOrder", "setOrder", NodeColumnNumbersEditor.class));
        properties.add(LayoutProperty.createProperty(
                this, Boolean.class,
                "Set Vertical Force",
                TIMEFORCE,
                "Used to push unconnected groups of nodes away from each other",
                "isVertical", "setVertical"));
        properties.add(LayoutProperty.createProperty(
                this, Double.class,
                "Vertical Scale",
                TIMEFORCE,
                "Sets the strength of the vertical force",
                "getScalingRatio", "setScalingRatio"));
        properties.add(LayoutProperty.createProperty(
                this, Boolean.class,
                "Strong Gravity Mode",
                TIMEFORCE,
                "Sets the strong gravity mode",
                "isStrongGravityMode", "setStrongGravityMode"));
        properties.add(LayoutProperty.createProperty(
                this, Double.class,
                "Gravity",
                TIMEFORCE,
                "Pulls nodes to origin of the y-axis. Prevents islands from drifting away.",
                "getGravity", "setGravity"));
        properties.add(LayoutProperty.createProperty(
                this, Double.class,
                "Jitter Tolerance",
                TIMEFORCE,
                "How much swiging you allow.",
                "getJitterTolerance", "setJitterTolerance"));
        properties.add(LayoutProperty.createProperty(
                this, Integer.class,
                "Threads",
                TIMEFORCE,
                "Possibility to use more threads if your cores can handle it.",
                "getThreadsCount", "setThreadsCount"));
        properties.add(LayoutProperty.createProperty(
                this, Boolean.class,
                "Center",
                TIMEFORCE,
                "Centers the graph",
                "isCenter", "setCenter"));

    } catch (Exception e) {
        e.printStackTrace();
    }

    return properties.toArray(new LayoutProperty[0]);
}
 
开发者ID:WouterSpekkink,项目名称:EventGraphLayout_0.8.2,代码行数:68,代码来源:TimeForce.java

示例10: resetPropertiesValues

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
@Override
public void resetPropertiesValues() {
   AttributeModel attModel = Lookup.getDefault().lookup(AttributeController.class).getModel();
   for (AttributeColumn c : attModel.getNodeTable().getColumns()) {
       if(c.getId().equalsIgnoreCase("order")
               || c.getId().equalsIgnoreCase("ord")
               || c.getTitle().equalsIgnoreCase("order")
               || c.getTitle().equalsIgnoreCase("ord")) {
           order = c;
       } else {
           order = null;
       }
   }
    int nodesCount = 0;

    if (graphModel != null) {
        nodesCount = graphModel.getGraphVisible().getNodeCount();
    }

    setOrderScale(10.0);
    
    // Tuning
    setScalingRatio(1.0);
    
    setStrongGravityMode(false);
    setGravity(1.);
    
    setVertical(false);
    setCenter(false);

    // Performance
    if (nodesCount >= 50000) {
        setJitterTolerance(10d);
    } else if (nodesCount >= 5000) {
        setJitterTolerance(1d);
    } else {
        setJitterTolerance(0.3d);
    }

    setThreadsCount(2);
    

    
}
 
开发者ID:WouterSpekkink,项目名称:EventGraphLayout_0.8.2,代码行数:45,代码来源:TimeForce.java

示例11: getOrder

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
public AttributeColumn getOrder() {
    return order;
}
 
开发者ID:WouterSpekkink,项目名称:EventGraphLayout_0.8.2,代码行数:4,代码来源:TimeForce.java

示例12: setOrder

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
public void setOrder(AttributeColumn order) {
   this.order = order;
}
 
开发者ID:WouterSpekkink,项目名称:EventGraphLayout_0.8.2,代码行数:4,代码来源:TimeForce.java

示例13: getLongitudeColumn

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
/**
 * @return the longitudeColumn
 */
public AttributeColumn getLongitudeColumn() {
    return longitudeColumn;
}
 
开发者ID:romanseidl,项目名称:SHPExporter,代码行数:7,代码来源:GeoAttributeFinder.java

示例14: getLatitudeColumn

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
/**
 * @return the latitudeColumn
 */
public AttributeColumn getLatitudeColumn() {
    return latitudeColumn;
}
 
开发者ID:romanseidl,项目名称:SHPExporter,代码行数:7,代码来源:GeoAttributeFinder.java

示例15: SHPExporterDialog

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
public SHPExporterDialog(AttributeColumn[] nodeColums, AttributeColumn[] geoFields) {
    super(new JFrame(), "SHP Export Options", true);
    initComponents();
    this.nodeColums = nodeColums;
    this.geoFields = geoFields;
}
 
开发者ID:romanseidl,项目名称:SHPExporter,代码行数:7,代码来源:SHPExporterDialog.java


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