43 |
# True to enable validating values in slots, default=true |
# True to enable validating values in slots, default=true |
44 |
attr_accessor :validation_enabled |
attr_accessor :validation_enabled |
45 |
|
|
46 |
# True if notify method propogates to parent.notify, default=true |
# True if notify method propagates to parent.notify, default=true |
47 |
attr_accessor :propogate_notifications |
attr_accessor :propagate_notifications |
48 |
|
|
49 |
# The root of this DataBus |
# The root of this DataBus |
50 |
attr_reader :root |
attr_reader :root |
59 |
@root = Slot.new("", nil, self) |
@root = Slot.new("", nil, self) |
60 |
@idCount = 0 |
@idCount = 0 |
61 |
@validation_enabled = true |
@validation_enabled = true |
62 |
@propogate_notifications = true |
@propagate_notifications = true |
63 |
end |
end |
64 |
|
|
65 |
## |
## |
91 |
STACK = "stack_slot" |
STACK = "stack_slot" |
92 |
PROC = "proc_slot" |
PROC = "proc_slot" |
93 |
|
|
94 |
# True if notify method propogates to parent.notify, default=true |
# True if notify method propagates to parent.notify, default=true |
95 |
attr_accessor :propogate_notifications |
attr_accessor :propagate_notifications |
96 |
|
|
97 |
attr_reader :path, :parent, :name, :attrs |
attr_reader :path, :parent, :name, :attrs |
98 |
|
|
110 |
@databus = databus |
@databus = databus |
111 |
@slots = Hash.new |
@slots = Hash.new |
112 |
@subscribers = Hash.new |
@subscribers = Hash.new |
113 |
@propogate_notifications = true |
@propagate_notifications = true |
114 |
notify(:notify_slot_add) |
notify(:notify_slot_add) |
115 |
end |
end |
116 |
|
|
393 |
|
|
394 |
## |
## |
395 |
# Sends out a notification to subscribers of this slot. If this slot |
# Sends out a notification to subscribers of this slot. If this slot |
396 |
# has a parent, the notification is propogated to the parent's notify method |
# has a parent, the notification is propagated to the parent's notify method |
397 |
# until the root slot is reached. |
# until the root slot is reached. |
398 |
# |
# |
399 |
# event:: [Symbol] The event (:notify_obj_action) |
# event:: [Symbol] The event (:notify_obj_action) |
410 |
end |
end |
411 |
end |
end |
412 |
end |
end |
413 |
@parent.notify(event, slot) if @propogate_notifications and @databus.propogate_notifications and @parent |
@parent.notify(event, slot) if @propagate_notifications and @databus.propagate_notifications and @parent |
414 |
end |
end |
415 |
|
|
416 |
## |
## |
523 |
|
|
524 |
## |
## |
525 |
# The Queue class represents a FIFO list for Slots that may need |
# The Queue class represents a FIFO list for Slots that may need |
526 |
# to manage such data (such as User Interface event propogation). |
# to manage such data (such as User Interface event propagation). |
527 |
# |
# |
528 |
class Queue |
class Queue |
529 |
|
|