Package org.gephi.attribute.api

Examples of org.gephi.attribute.api.Index


            for (Transformer transformer : Lookup.getDefault().lookupAll(Transformer.class)) {
                if (transformer instanceof RankingTransformer || transformer instanceof PartitionTransformer) {
                    if (transformer.isNode()) {
                        for (Column col : attributeModel.getNodeTable()) {
                            if (!col.isProperty()) {
                                Index index = localScale ? graphModel.getNodeIndex(graphModel.getVisibleView()) : graphModel.getNodeIndex();
                                if (transformer instanceof RankingTransformer && isRanking(col) && !attributeNodeFunctions.contains(col)) {
                                    nodeFunctions.add(new FunctionImpl(this, col, transformer, uis.get(transformer.getClass()), new RankingImpl(col, index, defaultInterpolator)));
                                } else if (transformer instanceof PartitionTransformer && isPartition(col) && !attributeNodeFunctions.contains(col)) {
                                    nodeFunctions.add(new FunctionImpl(this, col, transformer, uis.get(transformer.getClass()), new PartitionImpl(col, index)));
                                }
                                foundNodeColumns.add(col);
                            }
                        }
                    }
                    if (transformer.isEdge()) {
                        for (Column col : attributeModel.getEdgeTable()) {
                            if (!col.isProperty() && col.isNumber()) {
                                Index index = localScale ? graphModel.getEdgeIndex(graphModel.getVisibleView()) : graphModel.getEdgeIndex();
                                if (transformer instanceof RankingTransformer && isRanking(col) && !attributeEdgeFunctions.contains(col)) {
                                    edgeFunctions.add(new FunctionImpl(this, col, transformer, uis.get(transformer.getClass()), new RankingImpl(col, index, defaultInterpolator)));
                                } else if (transformer instanceof PartitionTransformer && isPartition(col) && !attributeEdgeFunctions.contains(col)) {
                                    edgeFunctions.add(new FunctionImpl(this, col, transformer, uis.get(transformer.getClass()), new PartitionImpl(col, index)));
                                }
View Full Code Here


            }
        }
    }

    private boolean isPartition(Column column) {
        Index index;
        if (AttributeUtils.isNodeColumn(column)) {
            index = localScale ? graphModel.getNodeIndex(graphModel.getVisibleView()) : graphModel.getNodeIndex();
        } else {
            index = localScale ? graphModel.getEdgeIndex(graphModel.getVisibleView()) : graphModel.getEdgeIndex();
        }
        int valueCount = index.countValues(column);
        int elementCount = index.countElements(column);
        double ratio = valueCount / (double) elementCount;
        if (column.isNumber()) {
            Class columnTypeClass = column.getTypeClass();
            if (columnTypeClass.equals(Integer.class)) {
                if (ratio < 0.6) {
View Full Code Here

        return false;
    }

    private boolean isRanking(Column column) {
        if (column.isNumber()) {
            Index index;
            if (AttributeUtils.isNodeColumn(column)) {
                index = localScale ? graphModel.getNodeIndex(graphModel.getVisibleView()) : graphModel.getNodeIndex();
            } else {
                index = localScale ? graphModel.getEdgeIndex(graphModel.getVisibleView()) : graphModel.getEdgeIndex();
            }
            if (index.countValues(column) > 0 && !isPartition(column)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of org.gephi.attribute.api.Index

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.