1 /*
2 * Copyright (c) 2006 Stiftung Deutsches Elektronen-Synchroton,
3 * Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY.
4 *
5 * THIS SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "../AS IS" BASIS.
6 * WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
7 * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE AND
8 * NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
9 * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
10 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
11 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. SHOULD THE SOFTWARE PROVE DEFECTIVE
12 * IN ANY RESPECT, THE USER ASSUMES THE COST OF ANY NECESSARY SERVICING, REPAIR OR
13 * CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE.
14 * NO USE OF ANY SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
15 * DESY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
16 * OR MODIFICATIONS.
17 * THE FULL LICENSE SPECIFYING FOR THE SOFTWARE THE REDISTRIBUTION, MODIFICATION,
18 * USAGE AND OTHER RIGHTS AND OBLIGATIONS IS INCLUDED WITH THE DISTRIBUTION OF THIS
19 * PROJECT IN THE FILE LICENSE.HTML. IF THE LICENSE IS NOT INCLUDED YOU MAY FIND A COPY
20 * AT HTTP://WWW.DESY.DE/LEGAL/LICENSE.HTM
21 */
22
23 package de.desy.acop.displayers.tools;
24
25 import java.beans.PropertyVetoException;
26
27 import com.cosylab.gui.displayers.DataSource;
28 import com.cosylab.gui.displayers.MultipleDisplayer;
29 import com.cosylab.util.CommonException;
30
31 import de.desy.acop.transport.ConnectionParameters;
32 import de.desy.acop.transport.adapters.AdapterFactory;
33
34 /**
35 * <code>AcopMultipleDisplayer</code> should be implemented by those displayers that
36 * connects to multiple data sources. The class should accept multiple
37 * <code>AcopDisplayerParameters</code> and create <code>DataSource</code>s for
38 * those parameters and connect the DataSources with GUI. DataSources
39 * should be obtained via <code>AdapterFactory</code> and released in the manner
40 * prescribed by AdapterFactory.
41 *
42 * @author Jaka Bobnar, Cosylab
43 * @see AcopDisplayerParameters
44 * @see AdapterFactory
45 */
46 public interface MultipleAcopDisplayer<T extends AcopDisplayerParameters> extends MultipleDisplayer {
47
48 /** DisplayerParameters property name tag */
49 public static final String DISPLAYER_PARAMETERS_PROPERTY = "displayerParameters";
50
51 /**
52 * Returns all ConnectionParameters attached to this displayer.
53 *
54 * @return an array of all connection parameters
55 * @deprecated use {@link #getDisplayerParameters()}
56 */
57 public ConnectionParameters[] getConnectionParameters();
58
59 /**
60 * Adds ConnectionParameters to the displayer. Upon adding ConnectionParameters
61 * the displayer should create a DataSource and connect it to the remote channe
62 * as specified by the parameters.
63 *
64 * @param parameters
65 * @throws CommonException if setting failed due to connection problem
66 * @throws PropertyVetoException if setting the property failed because of improper
67 * parameters
68 * @deprecated use {@link #addDisplayerParameters(AcopDisplayerParameters)}
69 */
70 public void addConnectionParameters(ConnectionParameters parameters) throws CommonException, PropertyVetoException;
71
72 /**
73 * Sets ConnectionParameter to the displayer. All previous connections
74 * should be terminated and then the new added. If the new array includes
75 * parameters that are already connected with this displayer, those connections
76 * do not need to be terminated. At the end of procedure the displayer should
77 * have only connections specified by the array <code>parameters</code>.
78 *
79 * @param parameters remote connections points
80 * @throws CommonException if setting failed due to connection problem
81 * @throws PropertyVetoException if setting the property failed because of improper
82 * parameters
83 * @deprecated use {@link #setDisplayerParameters(AcopDisplayerParameters[])}
84 */
85 public void setConnectionParameters(ConnectionParameters[] parameters) throws CommonException, PropertyVetoException;
86
87 /**
88 * Adds <code>AcopDisplayerParameters</code> to this displayer. All previous
89 * connections are kept and this one is added to the list. Upon adding the
90 * displayer should connect to the remote point specified by this
91 * <code>parameters</code> and adapt the screen according to other supplied
92 * parameters.
93 *
94 * @param parameters remote connection point and screen parameters
95 * @throws CommonException if setting failed due to connection problem
96 * @throws PropertyVetoException if setting the property failed because of improper
97 * parameters
98 */
99 public void addDisplayerParameters(T parameters) throws CommonException, PropertyVetoException;
100
101 /**
102 * Returns an array of all <code>AcopDisplayerParameters</code> associated
103 * with this displayer.
104 *
105 * @return an array of all parameters
106 */
107 public T[] getDisplayerParameters();
108
109 /**
110 * Sets <code>AcopDisplayerParameters</code> to this displayer. All previous
111 * connections should be terminated and then the new added. If the new array
112 * includes parameters that are already connected with this displayer, those
113 * connections do not need to be terminated. At the end of procedure the
114 * displayer should have only connections specified by the array
115 * <code>parameters</code>. Displayer should not allow two have two identical
116 * parameters. Parameters are identical if the
117 * {@link AcopDisplayerParameters#equals(Object)} returns true.
118 *
119 * @param parameters remote connections points
120 * @throws CommonException if setting failed due to connection problem
121 * @throws PropertyVetoException if setting the property failed because of improper
122 * parameters
123 */
124 public void setDisplayerParameters(T[] parameters) throws CommonException, PropertyVetoException;
125
126 /**
127 * Removes a <code>ConnectionParameters</code> from this displayer. DataSource that
128 * belongs to this parameters should be released (via AdapterFactory) and all
129 * resource associated with this parameters in the displayer should be released.
130 *
131 * @param parameters connection to be removed
132 * @return DataSource associated with this parameters
133 * @deprecated use {@link #removeDisplayerParameters(AcopDisplayerParameters)}
134 */
135 public DataSource removeConnectionParameters(ConnectionParameters parameters);
136
137 /**
138 * Removes a <code>AcopDisplayerParameters</code> from this displayer. DataSource
139 * that belongs to this parameters should be released (via AdapterFactory) and all
140 * resource associated with this parameters in the displayer should be released.
141 *
142 * @param parameters parameters to be removed
143 * @return DataSource associated with this parameters
144 */
145 public DataSource removeDisplayerParameters(T parameters);
146 }
147
148
149 /* __oOo__ */