Sunteți pe pagina 1din 17

Artisynth: Navigation Panel & Selection Manager Software Design Overview

Version 1.0 April 27th, 2006

Revisions
Version 1.0 Primary Author(s) Chad Decker Description of Version Initial version of the design overview document. Date Completed April. 27, 200

Table of Contents
1.1 System Overview................................................................................................................................. 4 1.2 Supporting Materials............................................................................................................................4 2.1 Operational Context............................................................................................................................. 6 2.2 Main rame........................................................................................................................................... 6 !.1 Overview............................................................................................................................................ 10 !.2 "#e $avigation %anel in &ept# ..........................................................................................................10 !.2.1 '"ree .......................................................................................................................................... 11 !.2.2 $av%anelMuta(le"ree$o&e....................................................................................................... 11 !.2.2 Component)nfo...........................................................................................................................11 !.2.! "ree$o&eSele*tion+istener........................................................................................................ 12 !.2.!.1 Sele*te&%at#sManager.............................................................................................................12 !.! "#e Sele*tion Manager in &ept#........................................................................................................ 1! !.!.1 Sele*tionManager.......................................................................................................................1! !.!.1.1 Sele*tion ,an&ler.................................................................................................................... 14 !.!.1.2 Sele*tion -in&ow ./n&er Development0............................................................................... 14 !.!.2 %o1ea(le%opup........................................................................................................................... 12 !.!.! %opup3e4uest+istener................................................................................................................16 4.1 Con*lusion......................................................................................................................................... 15

1 Introduction
1.1 System Overview
Arti!"nth is a modular component#$ased s"stem for performing d"namical %D simulations of the human vocal tract and face. It is intended to provide a test$ed for anatomical modeling and acoustic research in areas such as speech s"nthesis, linguistics, medicine, and dentistr". &he framework provided $" the s"stem ena$les

researchers to construct, refine, and e'change models of rigid $odies (such as $one) and soft tissues (such as a tongue), and integrate these into a comprehensive model of the vocal tract and surrounding structures. Arti!"nth provides $ase support for a variet" of parametric and d"namic models, including rigid $odies, mass#spring and finite element models, and spline#$ased curves and shapes. Artis"nth provides an A*I for model creation, along with a driver application for viewing and controlling the d"namical simulation of models. &his specification document discusses revisions which were made to the +ser Interaction framework to allow for model traversal, selection, and editing through two main su$s"stems, the -avigation *anel, and !election .anager.

1.2 Supporting Materials


*resentation on Artis"nth /http,00www.artis"nth.org0e'terndoc0A1!*#2002#2.pdf3.

Artis"nth /http,00www.artis"nth.org3.

4ikipedia, Design *atterns /http,00en.wikipedia.org0wiki0Design5*atterns3.

!un .icros"stems, Class 6&ree /http,007ava.sun.com072se01.8.20docs0api07ava'0swing06&ree.html3.

2 High Level Design Summary


Main Console

Sele*tionManager 8Singleton9 Sele*tion ,an&ler

%ro(e:&itor

Main rame

Sele*tion -in&ow Split%ane

Menu6ar,an&ler

7+Viewer%anel %opup3e4uest +istener

$avigation%anel 8Singleton9

"ree$o&e Sele*tion+istener %o1ea(le%opup Sele*te&%at#s Manager

'"ree

$av%anelMuta(le "ree$o&e

Mo&ify%o1e Dialog

Mo&ify3en&er %o1eDialog

Component)nfo

-i&getCreator

3en&er%rops %anel

Figure 1.0 UML Diagram of the SelectionManager and NavigationPanel operational context.

2.1 Operational onte!t


9igure 1.0 a$ove shows the current placement of the -avigation*anel and !election .anager *ackages within the Artis"nth framework. .ainframe, which is the main viewer for Artis"nth consists of three main components, the .enu:ar;andler, <=1iewer*anel, and -avigation*anel. &he ladder two panels are the principle sources of +ser Interaction with the %D models, and have a great deal of interaction with the !election.anager package. &he *ro$e>ditor, and Console modules hook into the functionalit". !election.anager, and .ain9rame o$7ects respectivel", to offer e'tended s"stem

2.2 Main"rame

Figure 2.0 mage of MainFrame

9igure 2.0 shows the three principle components in .ain9rame, on the left is the -avigation *anel which scans and presents the unit components of the %D model which is shown graphiall" to the right in the <=1iewer*anel. &he -avigation panel is capa$le of scanning models, which are shown in the hierarchal format shown a$ove. In addition, to $eing a$le to collapse and view the components, the -avigation *anel

like the <=1iewer*anel, has the a$ilit" to select the individual model components, <=1iewer panel. Depending on the viewing frustum, model components ma" $e

$ut also allows a user to select model components which ma" not $e visi$le in the outside the viewing $oundaries of the viewer, or components ma" overlap, hiding one another. In addition to -avigation *anel offering a user the a$ilit" to view and select model components such as plane constraints or particle constraints, which aren?t rendera$le, as shown $elow in figure 2.1. select items which cannot $e selected in the <=1iewer*anel, it also allows a user to

Figure 2.1 mage of MainFrame !ith "on#traint#

:oth -avigation*anel, and <=1iewer*anel have their own selection mechanism, which feeds into the !election .anager !u$s"stem as mentioned in section 2.%. -avigation*anel allows three methods of selection and deselection, individual component selection, multiple component selection (using the Ctrl @ mouse selection), and list selection (using the !hift @ mouse selection)A while the <=1iewer*anel offers users $oth individual and multiple component selection. &he <=1iewer*anel and -avigation*anel (via the &ree-ode!election=istener) provide notification of selected o$7ects to the !election.anager su$s"stem which is discussed in greater detail in selection %.2. &he !election.anager provides a

centraliBed point for selection handling, where different selection mechanisms can

send notifications of o$7ects $eing selected, and the change is reflected in the other selection mechanisms. 9igure 2.2 $elow shows the updating of the -avigation *anel taking place when o$7ects in the <=1iewer*anel are selected, 7ust as how <=1iewer*anel o$7ects are updated when selections are made in the -avigation*anel.

Figure 2.2 Updating of the MainFrame a# a re#ult of #election event#.

Cnce a component is selected, and the other selection mechanisms updated

appropriatel", the !election .anager $uilds a popup menu which displa"s the properties of the components which can $e selected as shown $elow in figure 2.%. &his popup menu can $e accessed with a right click selection on the .ain9rame. 1arious dialogs will $ecome visi$le for the selections in the popup menu, and when affirmed, the changes applied to the o$7ects in the model. If multiple components figure 2.8. are selected then the intersection of their common properties is displa"ed such as in

Figure 2.$ Popup menu compo#ed %& the Selection Manager.

Figure 2.' Popup menu compo#ed %& the Selection Manager inter#ecting common propertie#.

# Low Level Design Summary


&he section provides a low level overview of the -avigation *anel and !election .anager packages.

#.1 Overview
&he following selections discuss the inter workings of the -avigation*anel, and !election.anager packages. &he -avigation*anel consists of two main functionalities, first the generation and displa" of the model components, and &he !election manager consists of two main functionalities, first providing a centraliBed o$7ect for selection mechanisms such as -avigation*anel and <=1iwer*anel to provide, and receive information on the selection, and deselection of o$7ects and second the !election .anager manages the *okea$le*opup propert" editor window.

second the action handling which takes place then nodes in the tree are selected.

#.2 $he %avigation &anel in depth


$avigation%anel 8Singleton9

Sele*tionManager 8Singleton9

"ree$o&e Sele*tion+istener Sele*te&%at#s Manager

'"ree

Sele*tion ,an&ler

$av%anelMuta(le "ree$o&e

Sele*tion -in&ow Component)nfo


Figure $.0 (he Navigation Panel# interaction !ith the Selection Manager.

9igure %.0 a$ove shows the decomposition of the -avigation *anel into 2 principle components, this selection provides a description of responsi$ilities and implementation for each of these classes.

3.2.1 JTree
Description, &he 6&ree is s 6ava !wing Component which allows the displa" of hierarchical data. &he 6tree o$7ect doesn?t actuall" contain the data $ut simpl" $" Duer"ing its data model. Implementation, &he data in the 6&ree is organiBed in a nodal fashion with each element $eing a muta$le tree node. In the -avigation*anel, a wrapper class for these nodes are used to em$ed additional operational information in the nodes. provides a view of the data. =ike an" non#trivial !wing component, the tree gets data

3.2.2 NavPanelMuta le!reeNode


Description, &he -av*anel.uta$le&ree-ode is a wrapper o$7ect for 6ava?s Default.uta$le&ree-ode with added information which is used to determine state information for the e'pansion0collapse of collections of anon"mous model component collections. Implementation, !tate information such as if the node, as a categor", contains an is stored here. &his allows the Duer"ing of categories when selected to see if the *opup option to e'pand0collapse categories is displa"ed to a user.

anon"mous o$7ect (either a model component or a collection of model components)

3.2.2 Component"nfo
Description, &he ComponentInfo is an o$7ect which is em$edded in the -av*anel.uta$le&ree-ode, that when selected, is passed to the !election.anager. It serves as a wrapper class for two t"pes of o$7ects, Artis"nth .odelComponent o$7ects or -av*anel.uta$le&ree-ode o$7ects, as discussed a$ove in %.2.2. In the case of .odelComponent the ComponentInfo class offers a routine to e'tract a listing of .odelComponent?s ph"sical and rendera$le properties. Implementation, *ointed to $" the -av*anel.uta$le&ree-ode, the ComponentInfo?s to!tring function contains the name which is displa"ed in the 6&ree, as currentl" assigned $" the -avigation*anel. &he o$7ect inside, either a .odelComponent

o$7ects or -av*anel.uta$le&ree-ode o$7ects are used in two fashions, to manipulate the appearance of the tree, and for o$7ect passing when a selection is made which

are discussed in section %.2.%.

3.2.3 !reeNode#election$istener
Description, Implementation, &o manipulate the appearance of the tree, specificall" with the collapsing, and e'pansion of Anon"mous Collections of .odelComponents, the -av*anel.uta$le&ree-ode of the node which contains the anon"mous child nodes is used $" the -avigaion*anel to manipulate the structure of the 6&ree a$out this node. 4hen components are selected using the <=1iewer*anel, and a .odelComponent selected or deselected, the &ree-ode!election=istener, discussed in %.2.% searches and selects or deselects the path to thr found node appropriatel".

for the appropriate -av*anel.uta$le&ree-ode which contains the .odelComponent

3.2.3.1 SelectedPathsManager
Description, &he responsi$ilit" of the selected paths manager is to maintain the state of nodes which have $een added or removed via the -avigation*anel. 4hen a multiple selection takes place in the -avigation*anel, the selected paths manager is a$le to determine which tree nodes, have $een added, or removed from the selection space. Implementation, &he !election .anager maintains a cop" of the previous selection list which was provided $" the 6&ree. &he .anager then performs a two wa" difference on the previous list, and the new selection list passed to it as a parameter, to determine which -av*anel.uta$le&ree-odes have $een added or removed from the since the last selection.

#.# $he Selection Manager in depth


&he !election manager has two main responsi$ilities, to provide a centraliBed o$7ect for selection mechanisms to interact with one another, and to manage the *okea$le*opup propert" editor window.

7+Viewer%anel Sele*tionManager 8Singleton9 Sele*tion ,an&ler Sele*tion -in&ow "ree$o&e Sele*tion+istener Sele*te&%at#s Manager $avigation%anel 8Singleton9

Mo&ify3en&er %o1eDialog %o1ea(le%opup Mo&ify%o1e Dialog

3en&er%rops %anel

-i&getCreator

%opup3e4uest +istener

Figure $.1 Selection Manager)# interaction !ith Selection Mechani#m# #uch a# the *L+ie!Panel, and (reeNodeSelection Li#tener

3.3.% #electionMana&er
Description, As shown amove in 9igure %.1, the !election manager emplo"s a .ediator pattern, $" which the various selection mechanisms, can notif" the other selection mechanisms, and the *okea$le*opup window accordingl". a linked list structure of .odelComponents called m"!electedItems. .anager, of the changes, and the selection manager delegates this information to Implementation, &he components of the model which are selected are maintained in

3.3.1.1 Selection Handler


Description, &he !election;andler which implements the <=!election=istener interface provides an entr" point into the !election.anager, for the <=1iewer*anel. Its responsi$ilties include handling <=!election events, which involves sending a notification the the !election.anager, where the !election.anager selects or deselects the component in the <=1iewer*anel, and sends a reDuest to the -avigation*anel. Implementation, 4hen a selection event takes place in the <=1iewer*anel, a call is made to the items!elected method in the !election;andler. &he !election;andler, then sends a notification the the !election.anager notif"ing it that a selection, or deselection has taken place in the viewer panel.

-avigation*anel to appropriatel" select or deselect the corresponding path in the

3.3.1.2 Selection Window (Under Develop ent!


Description, Is a window, currentl" used for software development, which displa"s the o$7ects which are currentl" selected according to the !election .anager. Its application for future development, is particuarl" useful in largescale models with multiple components. It can serve as a method $" which a user can interact with a small su$set of the components present in the model as shown $elow in 9igure %.2. Implementation, 4hen a compoent selection or deselection takes place, through a selection mechanism the component is added or removed respectivel" from the linked list structure of .odelComponents called m"!electedItems. &he !election list.

4indow offers a graphical representation of the components which are in the linked

Figure $.2 Selection Manager)# Selection -indo! #ho!ing the "omponent# !hich are currentl& #elected through interaction# !ith %oth the Navigation Panel, and *L+i!erPanel.

3.3.2 Po'ea lePopup


Description, &he *okea$le*opup o$7ect is a popup window which displa"s the selecta$le options of the components which are currentl" selected. In the case of multiple components, the *okea$le*opup o$7ect will compute the intersection of the common options for the o$7ects selected, as shown in figure 2.8. &he *okea$le*opup o$7ect is also responsi$le for handling the selection made $" the user and creating the corresponding modification dialog as show in figure %.1. Implementation, &he *okea$le*opup o$7ect is created and maintained $" the !election.anager. 4hen the !election.anager is informed of a selection, or selected lists, and informs it to modif" the popup options accordingl". &he *okea$le*opup window decides which options are e'posed when the deselection, the !election.anager notifies the *okea$le*opup of the revised list of

loadComponents method is called. &he *okea$le*opup o$7ect is an e'tension of the 6popup.enu, and is activated $" the *opupEeDuest=istener when a right click occurs as desri$e $elow in section %.%.%.

3.3.3 Popup(e)uest$istener
Description, &he *opupEeDuest=istener is responsi$le for displa"ing the *okea$le*opup window when the user has right clicked with the mouse $utton. Implementation, &here are two entr" points to the *opupEeDuest=istener. &he first entr" point is the mouse*ressed() method which is attached to the 6&ree in the -avigaion*anel and is fired when a right mouse $utton click occurs in the 6&ree

panel. &he second is the show*opup method which is called manuall", as opposed to $eing a registered listener, $" the <=1iewer*anel when a right click occurs in the <=1iewer*anel.

' Design Summary


4.1 Conclusion
*revious to the addition of the two su$s"stems, the -avigation *anel and !election .anager, Artis"nth was a s"stem where propert" editing was limited to a programmer manuall" editing code to change values within a model. 4ith the e'tension of these new su$s"stems, a user, without programming e'perience, can interact with models d"namicall" $" changing component properties such as mass, velocit" and tension, and revisting the simulation instinateneousl". In addition, the -avigation*anel provides the user the a$ilit" to traverse through the model mechanism for model component selection and editing. components and, com$ined with the !election .anager, provides a uniform &hese two su$s"stems offer a framework in which the s"stem can $e e'panded to

offer features such as the creation, attachment and deletion of model components, which will ensure that Artis"nth will continue to $e an essential tool for anatomical modeling and acoustic research in areas such as speech s"nthesis, linguistics, medicine, and dentistr".

S-ar putea să vă placă și