01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent.client.gui;
19:
20: import javax.swing.Action;
21:
22: import de.finix.contelligent.client.base.ContelligentComponent;
23:
24: /**
25: * Interface for contelligent component renderers. You can impelement this
26: * interface in order to provide a special renderer for a component. The
27: * constructor of the renderer is called with two parameters: The component that
28: * is being edited and the view that contains your renderer.
29: */
30: public interface ComponentRenderer {
31:
32: /**
33: * Used to set renderer component.
34: */
35: public void setComponent(ContelligentComponent component);
36:
37: /**
38: * Returns the renderer component.
39: */
40: public ContelligentComponent getComponent();
41:
42: /**
43: * Used to set renderer view.
44: */
45: public void setView(View view);
46:
47: /**
48: * Returns the renderer view.
49: */
50: public View getView();
51:
52: /**
53: * Used to set renderer gui.
54: */
55: public void setGUI(GUI gui);
56:
57: /**
58: * Returns the gui that contains this renderer.
59: */
60: public GUI getGUI();
61:
62: /**
63: * Is this renderer scalable or does it have a fixed size
64: *
65: * @return true if this renderer is scalable, false if size is fixed
66: */
67: public boolean isScalable();
68:
69: /**
70: * Should be used to keep gui editor or renderer synchronous with underlying
71: * component (Only needed if editor and renderer instance differ.)
72: */
73: public void update();
74:
75: /**
76: * Should be used to implement initial renderer behaviour.
77: */
78: public void init();
79:
80: /**
81: * Return an array of actions that your renderer provides. If you want your
82: * renderer to switch the views menu, you have to implement a focus listener
83: * that sends the actions to the containing view.
84: */
85: public Action[] getActions();
86: }
|