• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AttributeColumn类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: getGeoFields

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
public AttributeColumn[] getGeoFields() {
    return realCoordinatesRadioButton.isSelected() ? 
        new AttributeColumn[]{(AttributeColumn) longitudeComboBox.getSelectedItem(),
        (AttributeColumn) latitudeComboBox.getSelectedItem()} :
        new AttributeColumn[]{null, null};
}
 
开发者ID:romanseidl,项目名称:SHPExporter,代码行数:7,代码来源:SHPExporterDialog.java


示例17: execute

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
public boolean execute() {
    try {
        PreviewModel previewModel;
        final PreviewController previewController = Lookup.getDefault().lookup(PreviewController.class);

        //there seems to be a bug in gephi or in gephi & eclipse that needs a refresh of the preview - else the model is empty
        previewController.refreshPreview();

        previewModel = previewController.getModel();
        AttributeModel model = Lookup.getDefault().lookup(AttributeController.class).getModel();
        AttributeColumn[] nodeColums = model.getNodeTable().getColumns();

        //try to find the GeoFields
        AttributeColumn[] geoFields;
        GeoAttributeFinder gaf = new GeoAttributeFinder();
        geoFields = gaf.findGeoFields(nodeColums);

        SHPExporterDialog exporterDialog;
        exporterDialog = new SHPExporterDialog(nodeColums, geoFields);
        exporterDialog.setTitle("SHP Export Options");
        if (exporterDialog.showDialog()) {
            geoFields = exporterDialog.getGeoFields();
            File exportFile = exporterDialog.getFile();

            //Construct Export Filenames
            String baseName = exportFile.getName();
            baseName = baseName.substring(0, baseName.lastIndexOf("."));
            File pointFile = new File(exportFile.getParentFile(), baseName + ".node.shp");
            File edgeFile = new File(exportFile.getParentFile(), baseName + ".edge.shp");

            //convert data to pointFeatureSource
            SimpleFeatureType pointFeatureType = getFeatureTypeForAttributes(Point.class, nodeColums);
            SimpleFeatureCollection pointFeatureSource;
            pointFeatureSource = getPointFeatureSource(previewModel, pointFeatureType, geoFields);

            //convert data to edgeFeatureSource
            AttributeColumn[] edgeColums = model.getEdgeTable().getColumns();
            SimpleFeatureType edgeFeatureType = getFeatureTypeForAttributes(LineString.class, edgeColums);
            SimpleFeatureCollection edgeFeatureSource;
            edgeFeatureSource = getFeatureSource(false, previewModel, edgeFeatureType, geoFields);


            //Create Shapefile
            //Netbean securit-manager ist running wild - dunno what to do but cathc the exception
            writeSHP(pointFile.toURL(), pointFeatureType, pointFeatureSource);

            writeSHP(edgeFile.toURL(), edgeFeatureType, edgeFeatureSource);
            return true;
        }
    } catch (IOException ex) {
        Logger.getLogger(SHPExporter.class.getName()).log(Level.SEVERE, null, ex);
    }
    return true;
}
 
开发者ID:romanseidl,项目名称:SHPExporter,代码行数:55,代码来源:SHPExporter.java


示例18: getPointFeatureSource

import org.gephi.data.attributes.api.AttributeColumn; //导入依赖的package包/类
private SimpleFeatureCollection getPointFeatureSource(PreviewModel previewModel, SimpleFeatureType featureType, AttributeColumn[] geoFields) {
    boolean isPoints = true;
    SimpleFeatureCollection collection = getFeatureSource(isPoints, previewModel, featureType, geoFields);
    return collection;
}
 
开发者ID:romanseidl,项目名称:SHPExporter,代码行数:6,代码来源:SHPExporter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MalformedURIException类代码示例发布时间:2022-05-23
下一篇:
Java Chunk类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap