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


Java GraphController类代码示例

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


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

示例1: NetworkStatistics

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
public NetworkStatistics() {
	controller = Lookup.getDefault().lookup(StatisticsController.class);
	graph = Lookup.getDefault().lookup(GraphController.class).getModel()
			.getGraph();
	allStats = new ArrayList<Statistics>();

	cc = (ConnectedComponents) controller.getBuilder(
			ConnectedComponents.class).getStatistics();
	allStats.add(cc);

	degree = (Degree) controller.getBuilder(Degree.class).getStatistics();
	allStats.add(degree);

	density = (GraphDensity) controller.getBuilder(GraphDensity.class)
			.getStatistics();
	allStats.add(density);

	distance = (GraphDistance) controller.getBuilder(GraphDistance.class)
			.getStatistics();
	allStats.add(distance);
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:22,代码来源:NetworkStatistics.java

示例2: bResetColorsActionPerformed

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
/**
 * Click on button "Reset Colors"
 * @param evt ActionEvent
 */
private void bResetColorsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bResetColorsActionPerformed
    GraphModel model = Lookup.getDefault().lookup(GraphController.class).getModel();
    
    // color all nodes black
    Node[] nodes = model.getUndirectedGraph().getNodes().toArray();
    for(Node n : nodes) {
        n.getNodeData().setColor(0, 0, 0);
    }
    
    // color all edges black
    Edge[] edges = model.getUndirectedGraph().getEdges().toArray();
    for(Edge e : edges) {
        e.getEdgeData().setColor(0, 0, 0);
    }
}
 
开发者ID:KSD-research-group,项目名称:plugin4gephi,代码行数:20,代码来源:ArchitecturalGraphMLTopComponent.java

示例3: layoutGraph

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
public void layoutGraph() {

		GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
		ForceAtlas2 layout = new ForceAtlas2(null);
		//		YifanHuLayout layout = new YifanHuLayout(null, new StepDisplacement(1f));
		layout.setGraphModel(graphModel);
		layout.initAlgo();
		layout.resetPropertiesValues();
		//		layout.setOptimalDistance(200f);
		layout.setEdgeWeightInfluence(0.1);
		layout.setScalingRatio(50.0);
		layout.setLinLogMode(false);
		int maxSteps = 100;

		for (int i = 0; i < maxSteps && layout.canAlgo(); i++) {
			layout.goAlgo();
		}
		layout.endAlgo();

	}
 
开发者ID:nullbox,项目名称:Data-and-Information-Visualization-Project,代码行数:21,代码来源:GraphJPanel.java

示例4: Vertex

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
/**
 * General constructor for a vertex
 * 
 * @param id
 */
public Vertex(int id) {
	this.internalNode = Lookup.getDefault().lookup(GraphController.class)
			.getModel().factory().newNode();

	setId(id);
	setSize(DEFAULT_SIZE);
	setFillColor(DEFAULT_FILL_COLOR);
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:14,代码来源:Vertex.java

示例5: BrowsableNetwork

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
/**
 * Creates a Network accessor object without modifying the underlying graph
 * structure.
 * 
 * @param clearGraph
 */
public BrowsableNetwork(boolean clearGraph) {
	this.graphModel = Lookup.getDefault().lookup(GraphController.class)
			.getModel();

	setGraph();

	if (clearGraph)
		this.graph.clear();
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:16,代码来源:BrowsableNetwork.java

示例6: Edge

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
public Edge(Vertex source, Vertex target) {
	this.internalEdge = Lookup.getDefault().lookup(GraphController.class)
			.getModel().factory()
			.newEdge(source.internalNode, target.internalNode);

	setColor(DEFAULT_COLOR);
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:8,代码来源:Edge.java

示例7: bootstrapGephi

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
private GraphModel bootstrapGephi() {
	// boostrap gephi
	Lookup lookup = Lookup.getDefault();
	ProjectController pc = lookup.lookup(ProjectController.class);
	pc.newProject();
	@SuppressWarnings("unused")
	Workspace workspace = pc.getCurrentWorkspace();
	GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
	return graphModel;
}
 
开发者ID:ServiceCutter,项目名称:ServiceCutter,代码行数:11,代码来源:GephiSolver.java

示例8: initializing

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
public static void initializing() {
	if (!initialized) {
		pc = Lookup.getDefault().lookup(ProjectController.class);
		pc.newProject();
		workspace = pc.getCurrentWorkspace();
		graph_model = Lookup.getDefault().lookup(GraphController.class).getModel(workspace);
		the_graph = graph_model.getUndirectedGraph();
	}
	the_graph.clear();
	// System.gc();
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:12,代码来源:AbstractGraphLayoutStatement.java

示例9: Controller

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
/**
 * Constructor
 */
public Controller() {
    // initialize
    storage.initialize();
    imagePanel = new ImagePanel(this);
    listPanel = new ListPanel(this);
    mainFrame = new MainFrame(this, new MainPanel(imagePanel, listPanel));
    
    // checks for beginning
    if(Lookup.getDefault().lookup(GraphController.class).getModel() == null) {
        // found null pointer
        MessageHandler.showErrorMessage("No project created. Please create a new project in Gephi first.");
        mainFrame.dispose();
        System.exit(0);
    }
    
    // load image
    ImageLoader.loadImage(mainFrame, imagePanel, messages);
    
    // ask if load points from gephi
    if(JOptionPane.showConfirmDialog(mainFrame, "Do you want to load your existing data from Gephi into the GraphCreator?", "Existing data", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
        storage.loadDataFromGephi();
        updateNodes(storage.getNodes());
        updateEdges(storage.getEdges());
    }
    else {
        // clear current model
        Lookup.getDefault().lookup(GraphController.class).getModel().clear();
    }
}
 
开发者ID:KSD-research-group,项目名称:plugin4gephi,代码行数:33,代码来源:Controller.java

示例10: filterGraph

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
private void filterGraph() {
	FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
	GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();

	SelectionFilter degreeFilter = new SelectionFilter(controller.getSelectedNodes());
	Query query = filterController.createQuery(degreeFilter);

	GraphView view = filterController.filter(query);
	graphModel.setVisibleView(view);

}
 
开发者ID:nullbox,项目名称:Data-and-Information-Visualization-Project,代码行数:12,代码来源:GraphJPanel.java

示例11: LouvainClustering

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
public LouvainClustering() {
	this.pc = Lookup.getDefault().lookup(ProjectController.class);
	pc.newProject();
	this.workspace = pc.getCurrentWorkspace();
	 
	this.graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
	this.factory = graphModel.factory();
	
	this.partitionController = Lookup.getDefault().lookup(PartitionController.class);
}
 
开发者ID:socialsensor,项目名称:social-event-detection,代码行数:11,代码来源:LouvainClustering.java

示例12: init

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
public void init() {
	this.graphModel = Lookup.getDefault().lookup(GraphController.class)
			.getModel();
	setGraph();
	this.graph.clear();
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:7,代码来源:BrowsableNetwork.java

示例13: convert

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
/**
    * 
    * @param srcpath
    * @throws IOException
    */
   public void convert(String srcpath) throws IOException {
File graphmlFile = new File(srcpath);

// Init a project - and therefore a workspace
ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
pc.newProject();
Workspace workspace = pc.getCurrentWorkspace();

// get import controller
ImportController importController = Lookup.getDefault().lookup(ImportController.class);

// Import file
Container container = importController.importFile(graphmlFile);


// Append imported data to GraphAPI
importController.process(container, new DefaultProcessor(), workspace);

graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();

   }
 
开发者ID:learning-layers,项目名称:Expert-Identification-Service,代码行数:27,代码来源:GraphMl2GEXFConverter.java

示例14: initialize

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
/**
 * This method initalizes the connection
 * @return true if successful, false otherwise
 */
public boolean initialize() {
    // get model
    model = Lookup.getDefault().lookup(GraphController.class).getModel();
    return (model != null);
}
 
开发者ID:KSD-research-group,项目名称:plugin4gephi,代码行数:10,代码来源:DataLoaderGephi.java

示例15: load

import org.gephi.graph.api.GraphController; //导入依赖的package包/类
public void load(QueryWindowData newDataset) {
	if (newDataset == null)
		return;

	currentQueryWindow = newDataset;

	if (skip) {
		skip = false;
		return;
	}
	if (this.selectedNodes == null || this.currentQueryWindow == null) {
		logger.info("Not all data yet, not displaying graph");
		return;
	}

	GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();

	if (graphModel != null) {
		if (!keep)
			graphModel.getGraph().clear();
		else
			graphModel.getGraph().clearEdges();

		ProjectController projectController = Lookup.getDefault().lookup(ProjectController.class);
		projectController.cleanWorkspace(workspace);

		// Gephi doesn't terminate these Threads. Since many of these threads lead to OutOfMemory Errors,
		// kill all left-over threads manually.
		terminateThreads("DHNS View Destructor");

	}

	// import to container
	Container container = Lookup.getDefault().lookup(ContainerFactory.class).newContainer();
	GephiImporter gImporter = new GephiImporter(currentQueryWindow, ipMap, this.selectedNodes);
	ContainerLoader loader = container.getLoader();
	gImporter.execute(loader);

	// process data from container into internal graph structure
	ImportController importController = Lookup.getDefault().lookup(ImportController.class);
	importController.process(container, new CustomProcessor(), workspace);

	// update view
	setChanged();
	notifyObservers();
}
 
开发者ID:nullbox,项目名称:Data-and-Information-Visualization-Project,代码行数:47,代码来源:GephiController.java


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