View Javadoc

1   /*
2    * Copyright (c) 2003-2008 by Cosylab d. d.
3    *
4    * This file is part of CosyBeans.
5    *
6    * CosyBeans is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU General Public License as published by
8    * the Free Software Foundation, either version 3 of the License, or
9    * (at your option) any later version.
10   *
11   * CosyBeans is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU General Public License for more details.
15   *
16   * You should have received a copy of the GNU General Public License
17   * along with CosyBeans.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  
20  package com.cosylab.gui.displayers;
21  
22  import java.util.Map;
23  
24  
25  /**
26   * <code>MinimalDataConsumer</code> is minimal implementation of
27   * <code>DataConsumer</code> as convenience for cunsumer implementators.
28   *
29   * @author <a href="mailto:igor.kriznar@cosylab.com">Igor Kriznar</a>
30   * @version $Id: MinimalDataConsumer.java,v 1.4 2008-04-22 12:31:02 jbobnar Exp $
31   *
32   * @since Feb 14, 2004.
33   */
34  public class MinimalDataConsumer implements DataConsumer
35  {
36  	/** Zero length array. */
37  	public static final String[] EMPTY_STRING_ARRAY = new String[]{  };
38  
39  	/** Zero length array. */
40  	public static final Class[] EMPTY_CLASS_ARRAY = new Class[]{  };
41  	protected DataState dataState;
42  	protected String name = "MinimalConsumerImpl";
43  
44  	/**
45  	 * Creates new instance.
46  	 */
47  	public MinimalDataConsumer()
48  	{
49  		super();
50  	}
51  
52  	/* (non-Javadoc)
53  	 * @see com.cosylab.gui.displayers.DataConsumer#getDefaultDataConsumer()
54  	 */
55  	public DataConsumer getDefaultDataConsumer()
56  	{
57  		return this;
58  	}
59  
60  	/* (non-Javadoc)
61  	 * @see com.cosylab.gui.displayers.DataConsumer#updateDataState(com.cosylab.gui.displayers.DataState)
62  	 */
63  	public void updateDataState(DataState state)
64  	{
65  		dataState = state;
66  	}
67  
68  	/* (non-Javadoc)
69  	 * @see com.cosylab.gui.displayers.DataConsumer#setCharacteristics(java.util.Map)
70  	 */
71  	public void setCharacteristics(Map characteristics)
72  	{
73  	}
74  
75  	/* (non-Javadoc)
76  	 * @see com.cosylab.gui.displayers.DataConsumer#getName()
77  	 */
78  	public String getName()
79  	{
80  		return name;
81  	}
82  
83  	/* (non-Javadoc)
84  	 * @see com.cosylab.gui.displayers.DataConsumer#getSupportedCharacteristics()
85  	 */
86  	public String[] getSupportedCharacteristics()
87  	{
88  		return EMPTY_STRING_ARRAY;
89  	}
90  
91  	/* (non-Javadoc)
92  	 * @see com.cosylab.gui.displayers.DataConsumer#getSupportedConsumerTypes()
93  	 */
94  	@SuppressWarnings("unchecked")
95  	public Class[] getSupportedConsumerTypes()
96  	{
97  		return EMPTY_CLASS_ARRAY;
98  	}
99  
100 	/* (non-Javadoc)
101 	 * @see com.cosylab.gui.displayers.DataConsumer#getDataConsumer(java.lang.Class)
102 	 */
103 	public <D extends DataConsumer> D getDataConsumer(Class<D> type) {
104 		// TODO Auto-generated method stub
105 		return null;
106 	}
107 
108 }
109 
110 /* __oOo__ */