All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mxgraph.analysis.mxGraphProperties Maven / Gradle / Ivy

Go to download

JGraphX Swing Component - Java Graph Visualization Library This is a binary & source redistribution of the original, unmodified JGraphX library originating from: "https://github.com/jgraph/jgraphx/archive/v3.4.1.3.zip". The purpose of this redistribution is to make the library available to other Maven projects.

There is a newer version: 3.4.1.3
Show newest version
package com.mxgraph.analysis;

import java.util.Map;

import com.mxgraph.util.mxUtils;

/**
 * Constants for graph structure properties
 */
public class mxGraphProperties
{
	public enum GraphType
	{
		FULLY_CONNECTED,
		RANDOM_CONNECTED,
		TREE,
		FLOW,
		NULL,
		COMPLETE,
		NREGULAR,
		GRID,
		BIPARTITE,
		COMPLETE_BIPARTITE,
		BASIC_TREE,
		SIMPLE_RANDOM,
		BFS_DIR,
		BFS_UNDIR,
		DFS_DIR,
		DFS_UNDIR,
		DIJKSTRA,
		MAKE_TREE_DIRECTED, 
		SIMPLE_RANDOM_TREE, 
		KNIGHT_TOUR, 
		KNIGHT, 
		GET_ADJ_MATRIX, 
		FROM_ADJ_MATRIX, 
		PETERSEN, 
		WHEEL, 
		STAR, 
		PATH, 
		FRIENDSHIP_WINDMILL, 
		FULL_WINDMILL, 
		INDEGREE, 
		OUTDEGREE, 
		IS_CUT_VERTEX, 
		IS_CUT_EDGE, 
		RESET_STYLE, 
		KING, 
		BELLMAN_FORD
	}

	/**
	 * Whether or not to navigate the graph raw graph structure or 
	 * the visible structure. The value associated with this key
	 * should evaluate as a string to 1 or 
	 * 0
	 */
	public static String TRAVERSE_VISIBLE = "traverseVisible";
	
	public static boolean DEFAULT_TRAVERSE_VISIBLE = false;

	/**
	 * Whether or not to take into account the direction on edges. 
	 * The value associated with this key should evaluate as a 
	 * string to 1 or 0
	 */
	public static String DIRECTED = "directed";
	
	public static boolean DEFAULT_DIRECTED = false;

	/**
	 * @param properties
	 * @param defaultValue
	 * @return
	 */
	public static boolean isTraverseVisible(Map properties, boolean defaultValue)
	{
		if (properties != null)
		{
			return mxUtils.isTrue(properties, TRAVERSE_VISIBLE, defaultValue);
		}

		return false;
	}

	/**
	 * 
	 * @param properties
	 * @param isTraverseVisible
	 */
	public static void setTraverseVisible(Map properties,
			boolean isTraverseVisible)
	{
		if (properties != null)
		{
			properties.put(TRAVERSE_VISIBLE, isTraverseVisible);
		}
	}

	/**
	 * 
	 * @param properties
	 * @return
	 */
	public static boolean isDirected(Map properties, boolean defaultValue)
	{
		if (properties != null)
		{
			return mxUtils.isTrue(properties, DIRECTED, defaultValue);
		}

		return false;
	}

	/**
	 * 
	 * @param properties
	 * @param isTraverseVisible
	 */
	public static void setDirected(Map properties,
			boolean isDirected)
	{
		if (properties != null)
		{
			properties.put(DIRECTED, isDirected);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy