File: BusinessObjectWrapper.java

package info (click to toggle)
libjgraph-java 5.12.4.2%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 7,884 kB
  • ctags: 7,321
  • sloc: java: 20,619; xml: 135; sh: 51; makefile: 10
file content (44 lines) | stat: -rw-r--r-- 879 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.jgraph.example.mycellmodeleditor;

import javax.swing.tree.DefaultMutableTreeNode;

/**
 * A very basic wrapper storing a reference to a custom user object with a
 * label.
 * 
 * @author rvalyi
 */
public class BusinessObjectWrapper {
	private String label = "";

	/**
	 * The wrapper where you put your real buisness object.
	 * (An other solution is that you business object
	 * implements a toString method and you deal with it
	 * in the editor)
	 */
	private DefaultMutableTreeNode value;

	public String getLabel() {
		return label;
	}

	public void setLabel(String stringValue) {
		this.label = stringValue;
	}

	public DefaultMutableTreeNode getValue() {
		return value;
	}

	public void setValue(DefaultMutableTreeNode value) {
		this.value = value;
	}

	/**
	 * Used by JGraph to render the cell label
	 */
	public String toString() {
		return label;
	}
}