Source code: org/embl/ebi/escience/talisman/scuflsupport/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.talisman.scuflsupport;
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
16
17
18 /**
19 * This bean allows you to load a ScuflModel with attached
20 * XScuflView and DotView representations into a Talisman
21 * bean field. It exposes the XML and Dot representations
22 * by the getXScufl and getDot methods, which can therefore
23 * be accessed by Talisman's bean accessor proxy fields,
24 * see the documentation for the Talisman resolver for more
25 * details of how to do this.
26 * @author Tom Oinn
27 */
28 public class ScuflModelBean implements Serializable {
29
30 private ScuflModel model = null;
31 private DotView dotView = null;
32 private XScuflView xscuflView = null;
33
34 /**
35 * Must have a default constructor to comply with the
36 * Talisman bean requirements. In this case, it creates
37 * an empty ScuflModel, and attaches a DotView and XScuflView
38 * to it.
39 */
40 public ScuflModelBean() {
41 this.model = new ScuflModel();
42 this.dotView = new DotView(model);
43 this.dotView.setPortDisplay(DotView.BOUND);
44 this.xscuflView = new XScuflView(model);
45 }
46
47 /**
48 * Get the underlying model for this bean
49 */
50 public ScuflModel getModel() {
51 return this.model;
52 }
53
54 /**
55 * Get the XML text
56 */
57 public String getXScufl() {
58 return this.xscuflView.getXMLText();
59 }
60
61 /**
62 * Get the Dot description
63 */
64 public String getDot() {
65 return this.dotView.getDot();
66 }
67
68 }