GephiPluginsVis/LayoutPluginExample/src/org/gephi/plugins/example/layout/GravityWellLayout.java
//      defined by the given gravityNode. (Part of the gravityNode label)
defined by the given gravityNode. (Part of the gravityNode label)
defined by the given gravityNode . ( Part of the gravityNode label )
private float InterpretNodeCentrality(Graph sourceGraph, Node targetNode, Node gravityNode) {
        String centralityString = gravityNode.getNodeData().getLabel();
        centralityString = centralityString.substring(this.indicatorLabel.length());
        centralityString = centralityString.trim();
        try {
            switch (Integer.parseInt(centralityString)) {
                case (1):
                    return sourceGraph.getDegree(targetNode);
                case (2):
                    return targetNode.getNodeData().getRadius();
                case (3):
                    return targetNode.getNodeData().getLabel().length();
                case (4):
                    int charSum = 0;
                    String nodeLabel = targetNode.getNodeData().getLabel();
                    for (int i = 0; i < nodeLabel.length(); i++)
                        charSum += nodeLabel.charAt(i);
                    return charSum;
                default:
                    return 0;
            }
        } catch (NumberFormatException e) {
            return 0;
        }
    }
private float InterpretNodeCentrality ( Graph sourceGraph , Node targetNode , Node gravityNode ) { String centralityString = gravityNode . getNodeData ( ) . getLabel ( ) ; centralityString = centralityString . substring ( this . indicatorLabel . length ( ) ) ; centralityString = centralityString . trim ( ) ; try { switch ( Integer . parseInt ( centralityString ) ) { case ( 1 ) : return sourceGraph . getDegree ( targetNode ) ; case ( 2 ) : return targetNode . getNodeData ( ) . getRadius ( ) ; case ( 3 ) : return targetNode . getNodeData ( ) . getLabel ( ) . length ( ) ; case ( 4 ) : int charSum = 0 ; String nodeLabel = targetNode . getNodeData ( ) . getLabel ( ) ; for ( int i = 0 ; i < nodeLabel . length ( ) ; i ++ ) charSum += nodeLabel . charAt ( i ) ; return charSum ; default : return 0 ; } } catch ( NumberFormatException e ) { return 0 ; } }
defined by the given gravityNode.
defined by the given gravityNode .