Functional Specification of : Class Maneuver by SNEEZ (Stan, Nick, Eric, Estefania, Zach) (previously known as Team I) PURPOSE (steph) The purpose of Class Maneuver is to provide users with a tool to model and display classes and their relationships using UML (Unified Model Language) specifications. It is Class Maneuver's goal to allow users to create class diagrams in the most convenient and SPEEDIEST fashion. << -More info on topics of XMI -that we intend only to implement Class diagrams -importance of UI >> DESCRIPTION (eric) GUI COMPONENTS (eric) This software will incorporate an intuitive Graphical User Interface(GUI) to enable the user to more easily create and edit the UML diagrams. The GUI will consist of a menu, a floating toolbar, which will contain buttons for the most functions of the software, as well as a virtual scroller which allows the user to easily scroll through the current diagram. COMPONENT FUNCTIONALITY TOOLBAR (Stan) Toolbar is a free-floating window which contains a collection of buttons. State buttons These buttons determine the state of Class Maneuver. Pointing device operations in the Design Window lead to different actions depending on the state selected by the state buttons. These buttons are "sticky," i.e. when depressed, they stay depressed until another state button is clicked. Button Description Arrow selector [ state button ] - when in this state, the user can select, move, or edit existing class diagram elements in the Design Window. See the Class Diagram elements section for details. New Class [ non-state button ] - creates a new class. See Diagram Elements section for details. New Association Class [ state button ] - allows the user to create a new class attached to an association relationship. New Generalization Relation [ state button ] - allows the user to create a new generalization relation. New Aggregation Relation [ state ] - allows the user to create a new aggregation relation. New Package [ non-state ] New Interface [ non-state ] Edit buttons Cut Removes the selected elements and places them into the clipboard. Copy Creates elements that are exact copies of the selected elements but have names like "Copy of" followed by the name each one of the original elements. Relations between original elements are preserved among the new elements. Paste Places the elements from the clipboard onto the Design Window, preserving the links which the original elements had among themselves as well as with other elements in the diagram. The user is given an outline of things to be pasted and chooses the place in the Design Window where the elements will be placed. Align Horizontal Aligns the [multiply] selected object(s) horizontally with the object which was selected first. Align Vertical Aligns the [multiply] selected object(s) vertically with the object which was selected first. Navigation buttons Follow link to end When a relationship (link) is selected in the Design Window and the the system is in the "Select Arrow" mode, clicking this button once will scroll the window to show the element to which the link is attached. Clicking on it again will scroll the window to the element at the other end of the link. Clicking on it further will toggle between the ends of the link. If there is an association class attached to the link it will be switched to as well. Go to parent/container/sibling/children/contained Toggles the Design Window scope to show the classes which are related to the currently selected class. (Can be clicked repeatedly to switch between many classes having the same relation to the current selection). Class Surgery Button Make Interface Finds common methods among multiple selected classes, creates a new interface with these methods, marks classes as implementing these interfaces. Make Abstract Class Finds common methods and attributes among multiply selected classes, creates a new class with these attributes, makes the originally selected classes children of the new class. Make Package Makes a new package, puts all of the multiply selected classes into the package. VIRTUAL SCROLLER (Eric) The Virtual Scroller will enable the user to scroll easily around the Design Window without the hassle of using the horizontal and vertical scroll bars. The Virtual Scroller will be located at the bottom left of the GUI. The Virtual Scroller will consist of a transparent rectangle designated the Virtual Boundary. By dragging the Virtual Boundary, the user will be able to scroll around the Design Window quickly and efficiently. The background of the Virtual Scroller will contain an iconized versions of the classes in the actual UML diagram that was created in the Design Window. CLASS BROWSER (Nick) The Class Browser will act as a navigational tool whereby classes and their relationships can be quickly displayed and navigated. - The user chooses which schema is used to organize the classes by selecting the appropriate tab on the hierarchical list. - By selecting (left-clicking) on a class, the Design Window "jumps" to the specified class. - Double-clicking on the class has the same effect as double-clicking on a class in the Design Window, bringing up an editing dialog. - Right-clicking on a class will bring up a context menu which will allow the user to manipulate the class, including adding a class based on the current viewing schema. For example: add new child, add new dependency,etc. - Class drag-and-drop will also be supported, allowing the user to reposition the selected class(es) in the current viewing schema (except flat view). Classes can be displayed through a tabbed hierarchical list organized by one the following: - Flat View The classes are simply listed in alphabetical order. Expanding a class shows its methods and attributes - Inheritance Classes are grouped according to their inheritance relationships Expanding a class shows its children in the inheritance hierarchy. - Containment Classes are grouped according to their containment relationships Expanding a class shows the classes it contains. - Association Classes which have associations will be shown if this schema is selected. Expanding a class shows the classes that are associated to it, including the association class if applicable. DESIGN WINDOW (Eric) The Design Window is where the user will be able to edit and view the UML class diagram that has been created. While the Deisgn Window will encorporate the usual scroll bars to view the diagram, the Virtual Scroller will be used mostly to scroll around the diagram. The Design Window will display any of the class representations containing the class names, attributes, and methods as well as the links between the classes. Certain elements may be hidden using options from the Menu Bar and pop-up submenus. The user may also be able to select multiple classes while holding down the SHIFT key and pressing the left mouse button. Menu (Eric) The Menu Bar is located at the top of the GUI with the following options: File - under the File menu, the user can create a NEW diagram, OPEN an existing diagram, SAVE the current diagram, save the current diagram under another name using SAVE AS, or EXIT the program. Edit - under the Edit menu, the user may use the usual options to edit the current diagram using CUT, COPY, and PASTE. Under the SELECT submenu, the user can SELECT ALL the classes and their elements, or select a class plus their ASSOCIATED CLASSES, CHILD CLASSES, AGGREGATED CLASSES, or ALL RELATED CLASSES. View - under the View menu, the user can choose which components of the GUI to display as well as what elements of the diagram in the Design Window to show or hide. The View menu will include checkbox options to Hide/Show the Toolbar, the Class Browser, and the Virtual Scroller. There will be options to Hide/Show global Class Attributes, Class Methods, Link Names, Link Arity, Link Role Names. Also options will be included to hide/show All Relations, Associations, Generalizations, Aggregations, Packages and Interfaces. Help - under the Help menu, the user may bring up a pop-up window displaying some information about the program itself. DIAGRAM ELEMENTS (Stan) ================ Classes * To create: Click on the toolbar's New Class button. A Class Editor window appears which allows the user to enter the data for the new class. Once the data is entered, the outline of the new class is shown on screen and the user can pick the new classes location. Left-clicking finalizes the classes' location, and the class is drawn on the screen properly. * To manipulate: To move the class around, drag its diagram in the design window. To specify local visibility, right-click on the class diagram. The user is given a pop-up menu which allows the user to specify which parts of the class are shown on the screen (are attributes shown? are methods shown?). Copy clicked on classes means creating a copy of this class with the name "Copy of ." * To delete: Press the Delete key, or click on the Cut button. * To edit class: Double-click on the class to see the Class Editor. Association Classes * To create: Click on the new association class button (the program enters the "new association class" mode). Drag a rubberband line between an existing class and an association relationship. A Class Editor window allows the user to edit data for the class. * To manipulate: Copying an association produces a new class with the same attributes and methods as in the original class having a name of "Copy of ". The copy is not attached to the association relationship. * Mimics regular classes in other respects. Relations share the following properties: * To create: Click on the create relation button on the toolbar (the program enters the "create new relation" state). Drag an "rubberband" line from one class to another. For generalization and aggregation relations, the arrow is placed by the class onto which the rubberband line was dragged. The relation element of the diagram is then drawn properly. The Relation Editor specific to the type of the relationship appears on the screen. Upon completion, the relation is drawn properly on the screen with link names, arity etc. displayed. To create associations which associate a class with itself, click on the create relation button on the toolbar and then instead of dragging a "rubberband" line double-click on the class. * To manipulate: In the "Select Arrow" mode, the user can select the entire relationship by clicking on it. Once the relationship has been selected, its ends can be dragged onto other classes. To specify local visibility, the user can right-click on the relation. A pop-up menu allows to specify whether the link name, arity, roles of objects (if applicable) should be shown with the link. * To delete: Press the Delete key, or click on the Cut button. If the current relation is and there is an association class attached to it, then it is erased. * To edit: Double click on the link to bring up the Relationship Editor. Interfaces * To create: Click on the create interface button on the toolbar. A Class Editor allows to specify methods for the interface and its name. The interface's outline is then placed on the screen, and user can move it around to specify its final location. Left-click finalizes the placement of the interface. * To manipulate: Behaves like a class. * To delete: Behaves like a class. * To edit: Double click to bring up Class Editor. Packages * To create: Click on the create package button on the toolbar. Enter the package's name in the dialog box. Place the package's outline wherever you desire. * To manipulate: Drag classes into the package box or out of the package box. * To delete: A package is deleted together with classes inside it, after confirmation. * To edit: Double click to edit the package's name. FEATURES LAYOUT MANAGEMENT (steph) Layout Management commands exist to assist user in keeping class diagrams visually appealing. ALIGNMENT Users can select multiple classes at once, and align them either horizontally or vertically so that users can arrange their classes orderly. - - HORIZONTAL To align multiple classes horizontally, select two or more classes and then click the right mouse button in the Design Window. Can be performed using toolbar. - VERTICAL To align multiple classes vertically, select two or more classes and then click the right mouse button in the Design Window. Can be performed using toolbar. VIEW (Steph) View Options allow user to choose to display Class Diagram at different levels of abstraction. - GLOBAL shows everything that a user has created so far and it applies visibility options to all elements of the diagram. - LOCAL Being able to select visibility options for each element of the diagram separately. - OTHER - ASSOCIATIONS: shows or hide all associations in Design Window - INHERITANCE: shows or hide all inheritance in Design Window - METHODS: shows or hide all methods in Design Window - ATTRIBUTES: shows or hide all attributes in Design Window - CONTAINMENTS: shows or hide all containments in Design Window - packages, interfaces: shows or hides all packages interfaces in Design Window - DIFFERENT SELECTIONS: association, inheritnace, methods, attributes, containments, packages interfaces CODE GENERATION (Nick) - A minimal amount of code generation from the class diagrams will be supported. - The user may select anywhere from one to all of the classes in the project for automatic code generation. - Separate class files for Java will be initially supported. Support for other languages (C++, Perl) will be implemented after the prototype if time exists. - Multiple saves will be supported, allowing the user to implement the methods in the class and perform code generation if the model is changed, preserving the contents of the methods. MODEL SAVE AND LOAD IN SUBSET OF XMI (Steph) The created class models can be saved and loaded in the subset of XMI. ABSTRACT CLASS OPERATIONS (class surgery) (Nick) CLASS TRANSFORMATIONS (Class Surgery) Abstracted class transformations are to be provided for the user. Operations that the user may perform are: - Make Interface User may select one or many classes and create an interface, creation and having those classes implement the interface. implementaion - The methods that are contained in the interface may be specified in a dialog box and/or automatically generated by detecting method commonality among selected classes. - Make Abstract Class User may select one or many classes and the class editor will class automatically create an abstract class and have the selected creation classes inherit from it. Abstracted methods will be common methods that exist among the selected classes. The user will have the option to select any, all, or none of those methods and, in addition, add additional methods to the class. - General User may create a class from another selected class based on its class methods and attributes creation - A dialog box appears and asks the user which methods and attributes to copy - Package User may create a package containing existing classes. "Class Surgery" can be selected by the appropriate button on the toolbar or from within the Class Editor (General). Navigation Tool (Stan) Navigation tools allow the user to quickly locate classes which are related to the current selection in some way. See Toolbar|Navigation.