Skip to content

cseduashraful/DeStruct-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeStruct-Java

Setup

  • Download the Visualizer Package
  • Keep the package folder in our project directory or on the classpath
  • Import the package in your code

How to use the visualization tool

  • Go to http://44.195.111.155/ [After December 15, 2023, this IP address will no longer be functional. Individuals seeking access to the Docker container for the web app, in order to host the site, are requested to get in touch with the owners.]
  • If you don't have an account, sign-up for one, and then log-in (username is your email).
  • Once you’ve logged in, click start a new program, and provide a name for the program and select the type of assignment (self-use).
  • Once you’ve clicked create a program, copy the API key shown at the top of the screen.
  • Now that you have your API key, go into your java file that you’ll be running tests in. You’ll call Visualizer.Initialize(“yourAPI”) with your API as an input string.
  • Go through the Example.java file to learn more about what methods you’ll call to generate your figures.
  • To see the visualization just go to the visualization web page and refresh the page. All your visualizations should show up in the tabs you’ve given to each visualization.

Fuctionalities Offered by DeStruct

Public Methods

All methods are static

public static void setDataStructureType(String type)

This method sets intended data-structure type for the visualizer. Default value is "graph" which is basically just inter-connected nodes. Currently only other data structure type that is available to visualize is "tree". Calling this method with invalid datat structure will reset it to default.

public static void resetDataStructuretype()

As the name suggests, this method resets the visualizer's target data structure to "graph"

public static void addClassNamesToVisualizeValue(String arr[], boolean discardBasicClass:optional)

By default the visualization block shows the values of class members having basic data types (int, double, float, String, boolean). To include values (return value of tostring method) in the visualtion block of any other class, we can pass class names as an array of String. If we do not want values of basic data types, we can set discardBasicClass to true.

public static void addToVisualizationTarget(String classname)

Adds class to recursively explore for visualizations

public static void addToVisualizationTarget(String[] classnames)

Adds to recursively explore for visualization

public static void clearVisualizationTargets()

Clears all the registered classes for recursive visualization

public static void Visualize(Object obj, String Step)

visualizes obj and all of the connected nodes that has datatypes registered for recursive visualization. Step is a string that marks a particular visualization call.

public static void Visualize(String Step)

Visualizes all registered objects and all of their connected nodes that has datatypes registered for recursive visualization.

public static void register(Object object)

Manually registers an object and it's connected nodes for recursive visualization.

public static void unregister(Object object)

Manually unregister an object from visualization queue. The object might still get visualizaed if one of its ancestor is registered visualization.

public void clearRegistration()

Clears the visualization array

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages