(by Michael Froehlich, 1994-12-01)

This file contains some examples for commands which can be send to daVinci
by using the application in this directory. First you have to connect the 
application to daVinci (see README-file in this directory or the user manual). 
Then you can copy one of the commands into the upper text subwindow of the 
application and send it to daVinci's application interface by pressing the
send button.

Before you start, please replace all occurances of '....' in this text by
the absolute path of the directory where you've installed daVinci (i.e where
you can find the directory /example_graphs)!

	DON'T USE THE COMMENTS (starting with '---') AS PART OF THE COMMAND!
	
Press 'Send Message' and the command will be transmitted to daVinci. 

	SEND ONLY ONE COMMAND AT A TIME! 

Commands are described in the user manual in detail.

--- Send a new graph in term representation format to daVinci. 		---
new_term([l("Object A",n("anything",[a("OBJECT","Object A")],[e("anything",[],l("Object C",n("anything",[a("OBJECT","Object C")],[e("anything",[],l("Object E",n("anything",[a("OBJECT","Object E")],[e("anything",[],r("Object D"))])))]))),e("anything",[],l("Object B",n("anything",[a("OBJECT","Object B")],[e("anything",[],l("Object D",n("anything",[a("OBJECT","Object D")],[])))])))])),l("Object F",n("anything",[a("OBJECT","Object F")],[e("anything",[],r("Object B"))]))])

--- Create an application specific menu in daVinci. Don't do that 	---
--- twice with the same menu identifiers! 			       	---
create_menu(submenu_entry("applmenu","Application",[menu_entry("applmenu A","Command A"),menu_entry("applmenu B","Command B"),blank,submenu_entry("applmenu_sub","Submenu",[menu_entry("applmenu C","Command C"),menu_entry("applmenu D","Command D"),])]))

--- Activate some menu entries in this menu tree (but create it first  	---
--- with the command above!). 						---
activate_menu_entries(["applmenu","applmenu A","applmenu_sub","applmenu C","applmenu D"])

--- Start a user dialog (a text input). 				---
question_string("A question",["Please enter","some text:"],"Delete this!")

--- Start a user dialog (a choice). 					---
question_boolean("Another question",["How do you do?"],":->",":-{",true)

--- Start a user dialog (a confirmation). 				---
confirmer("Please confirm",["You have to press","the button"],"Yes, this one")

--- Report a message in the left footer. 				---
show_message("Here is a message for you!")

--- Report a status in the right footer. 				---
show_status("Here is a status")

--- Load a graph in term representation from a file. Please use a 	---
--- valid graph filename! 					  	---	
load_graph("..../example_graphs/graph_example.daVinci")

--- Load a graph in term representation from a file. Please use a 	---
--- valid graph filename! The graph is automatically placed afterwards.	---
load_graph_placed("..../example_graphs/graph_example.daVinci")

--- Load a status of daVinci from a file. Please use a valid status 	---
--- filename! 			       					---	
load_status("..../example_graphs/xerox_star.status")

--- Save the current graph in a file (in term representation format). 	---
save_graph("..../example_graphs/xerox_star_new.daVinci")

--- Save the status of daVinci in a file. 				---
save_status("..../example_graphs/xerox_star_new.status")

--- Save the current graph in a file (in PostScript format). 		---
save_postscript("..../example_graphs/xerox_star_new.ps")

--- Set the scale of the visualization to 15%. 				---
set_scale(15)

--- Start the layout algorithm (edge crossing minimization) for the 	---
--- whole graph. 					       		---
place_all_nodes

--- Start the layout algorithm (edge crossing minimization) only for  	---
--- the visible subgraph (i.e. all nodes visible in the window). 	---
place_visible_nodes

--- Shrink the width of the graph if this is possible. 			---
compact_graph

--- Select one or more nodes in the displayed graph. Do this after   	---
--- loading status file 'xerox_star.status' (see load_status above). 	---
--- IMPORTANT: The identifiers used in the examples are the labels of 	---
--- the node in the term representation, not the text of the nodes!	---
select_nodes_labels(["Sketchpad","Alto"])

--- Hide (i.e. collapse) the subgraphs of all currently selected  	---
--- nodes. The subgraph is shown again if it was hidden before. 	---
hide_or_show_subgraph

--- Hide the subgraphs for the nodes in the list. Do this after   	---
--- loading status file 'xerox_star.status' (see load_status above).	---
hide_subgraphs(["Memex"])

--- Show the subgraphs for the nodes in the list. Do this after   	---
--- loading status file 'xerox_star.status' (see load_status above). 	---
show_subgraphs(["Memex"])

--- Show all hidden subgraphs. ---
restore_subgraphs

--- Start the encapsulation operation for all selected nodes, i.e. all	---
--- the incomming and outgoing edges are hidden (or shown if they were 	---
--- hidden before).	            					---	
hide_or_show_edges

--- Show all hidden edges. 						---
restore_edges

--- Set the accuracy of the phase one of the crossing minimization 	---
--- algorithm to the specified value (must be between 1 and 20).  	---
--- Values greater than 5 are not very useful.                    	---
set_accuracy_phase_1(3)

--- Set the accuracy of the phase two of the crossing minimization 	---
--- algorithm to the specified value (must be between 1 and 40).   	---
set_accuracy_phase_2(8)

--- Set the font size to the specified value (must be one of the 	---
--- following  values: 6,8,10,12,14,18,24,34).   			---
set_font_size(34)

--- Set the gap width (minimal distance between two nodes) to the  	---
--- specified value (between 4 and 300).				---
set_gap_width(20)

--- Set the gap height (minimal distance between two layers) to the  	---
--- specified value (between 4 and 300).				---
set_gap_height(40)

--- Set the gap for multiple edges to the specified value (must be 	---
--- between 2 and 20). Send command					---
load_graph("..../example_graphs/multiple_edges.daVinci")
--- first to see the effect of this command.			   	---
set_multiple_edge_gap(20)

--- Set the radius for self refering edges to the specified value 	---
--- (must be between 8 and 30). Send 				  	---
load_graph("..../example_graphs/self_refering_edges.daVinci")
--- first to see the effect of this command.			  	---
set_self_refering_edge_radius(30)

--- Set the title of the visualization window. 				---
set_window_title("My Title")

--- Set the size of the visualization window. 				---
set_window_size(400,300)

--- Set the position of the visualization window. 			---
set_window_position(100,100)

--- Open daVinci, i.e. deiconify it, if it was iconified before. 	---
open_window

--- Close daVinci, i.e. iconify it. 					---
close_window

--- Lock daVinci, i. e. disable user input. 				---
deactivation

--- Unlock daVinci, i. e. enable user input again. 			---
activation

--- Quit daVinci. ---
quit

--- !!!Here are the commands for the new features of daVinci V1.4.1!!!	---

--- First, you have to send the following command to load a graph.	---
load_status("..../example_graphs/xerox_star.status")
--- Change the color of one node without redrawing the whole graph.	---
--- Only one of the 16 supported color values of daVinci can be used. 	---
--- They can be viewed with the tool daVincicolors (in the tools/ 	---
--- directory).								---
change_node_color("Memex","red")

--- Center a node in the visualization window. Be sure that graph	---
--- xerox_star.status is loaded (see example above).			---
focus_node("Interleaf")

--- Do the same with animation (i.e. use a smooth scrolling). The 	---
--- number (30) is the scrolling speed in pixel per step.		---
focus_node_animated(30,"Pygmalion")

