Source code: org/embl/ebi/escience/scufl/talisman/ScuflModelBean.java
1 /**
2 * This file is a component of the Taverna project,
3 * and is licensed under the GNU LGPL.
4 * Copyright Tom Oinn, EMBL-EBI
5 */
6 package org.embl.ebi.escience.scufl.talisman;
7
8 import org.embl.ebi.escience.scufl.ScuflModel;
9 import org.embl.ebi.escience.scufl.view.DotView;
10 import org.embl.ebi.escience.scufl.view.XScuflView;
11
12 // IO Imports
13 import java.io.Serializable;
14
15 import java.lang.String;
16
17
18
19 /**
20 * This bean allows you to load a ScuflModel with attached
21 * XScuflView and DotView representations into a Talisman
22 * bean field. It exposes the XML and Dot representations
23 * by the getXScufl and getDot methods, which can therefore
24 * be accessed by Talisman's bean accessor proxy fields,
25 * see the documentation for the Talisman resolver for more
26 * details of how to do this.
27 * @author Tom Oinn
28 */
29 public class ScuflModelBean implements Serializable {
30
31 private ScuflModel model = null;
32 private DotView dotView = null;
33 private XScuflView xscuflView = null;
34
35 /**
36 * Must have a default constructor to comply with the
37 * Talisman bean requirements. In this case, it creates
38 * an empty ScuflModel, and attaches a DotView and XScuflView
39 * to it.
40 */
41 public ScuflModelBean() {
42 this.model = new ScuflModel();
43 this.dotView = new DotView(model);
44 this.dotView.setPortDisplay(DotView.BOUND);
45 this.xscuflView = new XScuflView(model);
46 }
47
48 /**
49 * Get the underlying model for this bean
50 */
51 public ScuflModel getModel() {
52 return this.model;
53 }
54
55 /**
56 * Get the XML text
57 */
58 public String getXScufl() {
59 return this.xscuflView.getXMLText();
60 }
61
62 /**
63 * Get the Dot description
64 */
65 public String getDot() {
66 return this.dotView.getDot();
67 }
68
69 }