Intent

Tree based implementation in Language:Java.

Motivation

This project was created at the PTT-Hackathon 2011.

The tree-based view allows the user to get a large overview of the hierarchy of the system:Company. The tree allows easy navigation within this hierarchy. The tree also provides quick adjustment on changes of the Feature:Hierarchical company data.

Illustration

The main features Feature:Cut, Feature:Total and Feature:Hierarchical company are adopted from Contribution:javaInheritance. The main difference to Contribution:swing is, that the navigation is simplified with a tree view. This tree has to be initialized recursively with the company as root:

/*
 * This method initializes the tree-view.
 */
private Component createTree() {
	Company company = model.getCompany(); // get company data

	DefaultMutableTreeNode root = new DefaultMutableTreeNode(company); // create root element

	for (Department d : company.getDepts()) { // run through the departments and add them to the root
		root.add(addDepartmentNode(d)); // create department subtrees
	}

	tree = new JTree(root);

	return new JScrollPane(tree); // return the JTree within a scroll pane
}

The department subtrees are created in a similar way.

Architecture

The main architecture of this project is MVC. The class Interaction.java starts the application and creates the main parts of the MVC-structure: The MainView.java creates the tree and provides a container for the single views of the company, departments and employees. These views are initialized by the Controller.java while the data and the selected element of the tree is stored in the Model.java. The main features Feature:Cut and Feature:Total can be found in org.softlang.operations while the classes for the data structure are in org.softlang.company.

Usage

The implementation has been tested with Java version 5.

Metadata


There are no revisions for this page.

User contributions

    This user never has never made submissions.

    User edits

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.