1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.onemind.awtbridge.peer;
22
23 import org.onemind.awtbridge.BridgeContext;
24 import org.onemind.awtbridge.input.BridgeInputContext;
25 import org.onemind.awtbridge.render.BridgeRenderContext;
26 import org.onemind.awtbridge.util.ComponentEventListeners;
27 /***
28 * A default PeerBridge abstract implementation that handle the registration and id generation.
29 * @author TiongHiang Lee (thlee@onemindsoft.org)
30 * @version $Id: AbstractBridgePeer.java,v 1.4 2005/04/26 17:38:55 thlee Exp $ $Name: awtbridge-1_0_0 $
31 */
32 public abstract class AbstractBridgePeer extends BridgePeer
33 {
34
35 /*** whether the peer is up-to-date (for implementing caching) */
36 private boolean _upToDate = false;
37
38 /*** whether the dimension has changed since last render */
39 private boolean _isDimensionChanged = true;
40
41 /***
42 * {@inheritDoc}
43 */
44 public AbstractBridgePeer(Object componentObject, BridgeContext context)
45 {
46 super(componentObject, context);
47 }
48
49 /***
50 * whether this peer is up-to-date (the component does not any changes since the peer is last painted.) *
51 * @return true if component has no display changes since the peer is last painted.
52 */
53 public final boolean isUpToDate()
54 {
55 return _upToDate;
56 }
57
58 /***
59 * Set the peer up-to-date status to b
60 * @param b new up-to-date status
61 */
62 public final void setUpToDate(boolean b)
63 {
64 _upToDate = b;
65 }
66
67 /***
68 * Whether the dimension has changed since last render
69 * @return true if changed
70 */
71 public final boolean isDimensionChanged()
72 {
73 return _isDimensionChanged;
74 }
75
76 /***
77 * Set whether the dimension has changed since last render
78 * @param b whether the dimension changed
79 */
80 public final void setDimensionChanged(boolean b)
81 {
82 _isDimensionChanged = b;
83 }
84
85 /***
86 * {@inheritDoc}
87 */
88 protected void selfProcessInput(BridgeInputContext context,
89 Object inputObject)
90 {
91 throw new UnsupportedOperationException("selfProcessInput is not supported");
92 }
93
94 /***
95 * {@inheritDoc}
96 */
97 protected void selfRender(BridgeRenderContext context, Object renderObject)
98 {
99 throw new UnsupportedOperationException("selfProcessInput is not supported");
100 }
101
102 }