Meme Media and a Meme Pool - PowerPoint PPT Presentation

1 / 46
About This Presentation
Title:

Meme Media and a Meme Pool

Description:

For the same slotName, for example, the first line of the get' method examines ... pad is used to transport this pad among different IntelligentPad systems sharing ... – PowerPoint PPT presentation

Number of Views:37
Avg rating:3.0/5.0
Slides: 47
Provided by: yuzuru
Category:
Tags: keys | media | meme | pool

less

Transcript and Presenter's Notes

Title: Meme Media and a Meme Pool


1
??????????(5)
  • ?? ?

2
Meme Media Architecture
3
Meme Media Architecture
  • (1) Wrapper architecture.
  • (2) Frame architecture.
  • (3) MVC architecture.
  • (4) Update-dependency architecture.
  • (5) Compound-document architecture

4
Frame architecture
  • IntelligentPad exploits a frame architecture for
    each pad.
  • Each pad provides a set of slots that work as
    connection jacks.
  • The content object in each pad can be accessed
    only through its slots.
  • The IntelligentPad architecture provides two
    types of standard access messages for each
    slot?set and gimme.
  • Each set message takes a single parameter
    value, while each gimme message takes no
    parameters.
  • Corresponding to these two kinds of slot
    accesses, each slot s is defined by two methods,
    i.e., the set method Procs, set to be invoked
    by a set message, and the gimme method Procs,
    gimme to be invoked by a gimme message.
  • The default method for a set message sets the
    parameter value to a special register dedicated
    to this slot, while the default method of a
    gimme message returns the current value of the
    same dedicated register.
  • The logical function of each pad is specified by
    its slots and by the two methods defined for each
    of these slots.

5
MVC architecture View Integration
6
Controller View
  • When the controller detects either a mouse event
    or a keyboard event, it asks its view for the
    message selector of the corresponding action, and
    then asks its view to perform the method for this
    message.
  • The view must define the methods for the
    following messages to answer the message selector
    name
  • blueButtonViewAction
  • (the action to take when the blue button is down)
  • redButtonDownAction
  • (the action to take when the red button is down)
  • redButtonUpAction
  • (the action to take when the red button is up)
  • redButtonWentDownAction
  • (the action to take when the red button goes
    down)
  • keyboardViewAction
  • (the action to take when a key is pressed)
  • red button left button
  • yellow button center button
  • blue button right button

7
  • When the controller detects either a mouse event
    or a keyboard event, it asks its view for the
    message selector of the corresponding action.
  • redButtonDownAction
  • ?selected
  • This makes the view to perform selected aPoint
    when the red button is down.
  • selected aPoint
  • If the selected flag is not already set,
  • self isSelected
  • ifFalse set the selected flag,
  • internals at isSelected put
    true.
  • and request to redraw itself.
  • self invalidate

8
  • To ask the view to perform the corresponding
    action, the controller sends the following
    message to the view.
  • perform action with aPoint

9
set, get, update
  • The view can send its model no other messages
    than
  • set data to slotName and
  • get slotName,
  • where slotName may be any of the public model
    slots or private model slots.
  • The model can send its view no other messages
    than
  • update aSymbol,
  • where the current implementation uses only nil
    for aSymbol.

10
  • set data to slotName
  • (self slotList includes slotName)
  • ifFalse ?nil.
  • (self respondsTo (set, slotName, )
    asSymbol)
  • ifTrue self perform (set, slotName,
    ) asSymbol with data
  • ifFalse self setDefault data to
    slotName
  • The first line of the set method examines if
    the slotName is included in the slot list of the
    model. Let this slotName be a string index for
    example. The third line examines if the model has
    a method for the message selector setindex. If
    it has, the fourth line makes the model perform
    its method for the message selector setindex
    with data as its parameter. Otherwise, the
    index slot is considered as a data slot.

11
  • setDefault data to slotName
  • slots at slotName ifAbsent ?self.
  • (slots at slotName)data ifTrue ?nil.
  • slots at slotName put data.
  • self changed
  • When the index slot is considered as a data
    slot, the entry with the same name index is
    selected from the data slot list, and its value
    is set to the specified data. Whenever the data
    slot value is updated, the changed message is
    sent to the model.

12
  • get slotName
  • ?(self respondsTo (get, slotName) asSymbol)
  • ifTrue self perform (get, slotName)
    asSymbol
  • ifFalse self getDefault slotName
  • getDefault slotName
  • ?slots at slotName ifAbsent nil
  • For the same slotName, for example, the first
    line of the get method examines if the model
    has a method for the message selector getindex.
    If it has, the second line makes the model
    perform its method for the message selector
    getindex. Otherwise, the index slot is
    considered as a data slot the entry with the
    same name index is selected from the data slot
    list, and its value is used as the return value.

13
  • The update method is defined in the view as
    follows.
  • messages to the view
  • update aSymbol
  • self viewUpdate
  • self refreshDisplay
  • self padUpdate
  • The first line performs the necessary updates of
    the view properties and the view internal
    variables in correspondence to the models
    update. The second line refreshes the display of
    the view if necessary. The third line performs
    the update of the pads that are functionally
    combined with this pad.

14
  • refreshDisplay
  • self invalidate
  • padUpdate
  • self updateToSlaves.
  • self updateToMaster

15
  • updateToMaster
  • (self setFlag and self master notNil)
  • ifTrue
  • self master set (Array with slotName
    with
  • (self get self primarySlotForSet)
    copy)
  • The method updateToMaster updates the parent
    pad by sending the connection slot of the parent
    the current value of the primary slot. This
    corresponds to the execution of a set message
    to the parent pad.
  • updateToSlaves
  • self slaves do pad (pad isKindOf
    PadView)

  • ifTrue (pad updatePad)

16
  • The state of a pad is the list of all the
    variables of this pad with each variable
    associated with its current value.
  • This is the state of a pad as a media object. It
    consists of the states of the three components of
    this pad, i.e., the model state, view state, and
    the controller state.
  • In addition to its state, every pad defines its
    logical state, which is a subset of all the
    variables in its model.
  • It is up to the programmer of a pad to decide
    which subset to define as its logical state.
  • For example, let us consider a pad that works as
    a bar meter. This pad may have two variables, one
    to hold the current value and the other to hold
    the current range. Its logical state may be
    defined to include either two of them or only the
    current value. In the latter case, the current
    range may be included either in the model state
    or in the view state. These alternatives define
    bar meter pads with different semantics.

17
Compound-Document Architecture
  • The IntelligentPad architecture adopts a
    compound-document architecture.
  • You may use paste operations in arbitrary ways,
    for example, to overlay multiple translucent pads
    of the same size, or to arrange multiple pads on
    the same base pad.

18
  • Users can easily replicate any pad, paste one pad
    on another, and peel a pad off a composite pad.
  • These operations can be equally applied both to
    any primitive pads and to any composite pads.
  • When a pad P2 is pasted on another pad P1, pad P2
    becomes a child of P1, and is termed its child
    pad or slave pad pad P1 becomes the parent of
    P2, and is called its parent pad or master pad.
  • No pad may have more than one parent pad.
  • Pads are decomposable persistent objects. You can
    easily decompose any composite pad by simply
    peeling off any primitive or composite component
    pad from its parent pad.

19
Standard Messages between Pads
  • gimme slotname
  • data
  • (self propertyList keys include slotname)
  • ifTrue ?self propertyGet slotname.
  • (self slotNames includes slotname)
  • ifTrue data(self get slotname) copy.
  • ?data
  • ifFalse self master notNil ifTrue ?self
    master gimme slotname.
  • ?nil
  • The second line of the gimme method examines
    if the slotname refers to properties of the view.
    If it does, then the value of this referred
    property is read out as the return value.
    Otherwise, the fourth line examines if this pad
    has the specified slot as its slot. If it has,
    the slot is accessed by a get message, and its
    return value is returned to the sender pad of
    this message. Otherwise, this gimme message is
    delegated to its parent pad, and its return value
    is returned to the sender pad of this message.

20
  • updatePad
  • data
  • self updateFlag
  • ifTrue data self sendGimme slotName.
  • data notNil ifTrue self set
    data to self

  • primarySlotForGimme
  • sendGimme slotname
  • self master isNil ifTrue ?nil.
  • ?self gimmeFlag
  • ifTrue self master gimme slotname
  • ifFalse nil
  • The method for the updatePad, when the
    updateFlag is set to enable this message,
    performs self sendGimme slotName, which, when
    gimmeFlag is also set to enable gimme messages,
    sends a gimme message to the specified slot of
    the parent pad. Its return value is then set to
    the primary slot for gimme of this pad.

21
  • In a default way of defining a pad, we use self
    sendGimme slotName in the view to send a
    gimme message to its parent pad, and self
    setDefault data to self primarySlotForSet in
    the model to send a set message to its parent
    pad. The method for setDefault is define as
    follows.
  • setDefault data to slotname
  • slots at slotname ifAbsent ?self.
  • (slots at slotname) data ifTrue ?nil.
  • slots at slotname put data.
  • self changed
  • The execution of self setDefault data to self
    primarySlotForSet makes the model to send an
    update message to the view, which then makes
    the view to perform self viewUpdate, self
    refreshDisplay, and self padUpdate in this
    order. The last of them executes self
    updateToSlaves and self updateToMaster. The
    latter will send the specified connection slot of
    its parent pad the set message with the
    current value of the primary slot for set
    messages.

22
  • The following is the previously given definition
    of the method updateToMaster. The first two
    lines check if the set message is enabled. The
    following two lines update the value of the
    connection slot.
  • updateToMaster
  • (self setFlag and self master notNil)
  • ifTrue
  • self master set (Array with slotName
    with
  • (self get self
    primarySlotForSet) copy)
  • Of course, you may directly use self master set
    data to slotName to send a set message to the
    parent pad. In this case, you have to define all
    the necessary updates.

23
Standard messages for geometrical operations
  • changeRelativeOrigin aPoint
  • to change the relative location on its parent pad
  • relativeOrigin
  • to obtain its relative location on its parent pad
  • changeExtent aPoint
  • to resize the pad
  • extent
  • to obtain its size
  • changeBorderWidth anInteger
  • to change its border width
  • borderWidth
  • to obtain its border width

24
  • moveTo aPoint offset anOffset
  • to move the pad to the specified location
  • copyTo aPoint offset anOffset
  • to make its copy at the specified location
  • setBackgroundColorName aSymbol
  • to set its background color to the specified one
  • backgroundColor
  • to obtain its background color
  • setForegroundColorName aSymbol
  • to set its foreground color to the specified one
  • foregroundColor
  • to obtain its foreground color

25
User-event dispatching mechanism
  • for class Controller
  • startUp
  • self controlInitialize.
  • self controlLoop.
  • self controlTerminate
  • where
  • for class PadController
  • controlInitialize
  • (view isKindOf PadView) ifTrue view enter
  • controlTerminate
  • (view isKindOf PadView) ifTrue view
    leave

26
  • controlLoop
  • previousState state
  • state self sensor redButtonPressed.
  • state ifTrue self redButtonDown self
    sensor cursorPoint.
  • previousState state copy.
  • self poll
  • state self sensor redButtonPressed.
  • state
  • ifTrue previousState
  • ifTrue self
    redButtonDown self sensor cursorPoint
  • ifFalse self
    redButtonWentDown self sensor cursorPoint
  • ifFalse previousState
  • ifTrue self
    redButtonWentUp self sensor cursorPoint
  • ifFalse self
    redButtonUp self sensor cursorPoint.
  • self isControlActive
  • whileTrue self controlActivity.
  • (state or previousState) ifTrue self
    redbuttonUp view bounds center

27
  • When the mouse cursor enters a pad, its
    controller performs the controlLoop method to
    detect various mouse and keyboard events.
  • The loop from the fourth line to the fifteenth
    line of the controlLoop method tries to detect
    the four different events caused by the red
    button of the mouse.
  • When it detects any of these events, it asks the
    view if this pad defines the corresponding
    action, and makes it perform this action (, which
    will be explained later).
  • This loop also repetitively performs the
    following method.

28
  • for class PadController
  • controlActivity
  • self sensor yellowButtonPressed self
    viewHasCursor
  • ifTrue ?self yellowButtonActivity.
  • self sensor blueButtonPressed (self
    viewHasCursor view isFixed not)
  • ifTrue ?self blueButtonActivity.
  • self sensor keyboardPressed
  • (view keyboardViewAction notNil self
    viewHasCursor)
  • ifTrue ?self keyboardActivity.
  • super controlActivity.
  • ?nil

29
  • This method further examines if any of the
    remaining mouse-button events and keyboard events
    has occurred.
  • These would include such events as pressing the
    yellow button, the blue button, and the keyboard.
  • When this method detects any of these events, it
    makes the pad perform the corresponding action (,
    which will be explained later).
  • Then the method performs the following method in
    the while loop of the controlLoop.

30
  • For class Controller
  • controlActivity
  • self controlToNextLevel
  • controlToNextLevel
  • aSubView
  • aSubView?view subViewWantingControl.
  • aSubView isNil ifFalse aSubView controller
    startUp
  • The execution of super controlActivity
    transfers the event management from the current
    pad to its child pad that includes the mouse
    cursor. Even during the execution of the
    controlLoop, the mouse may change its location.
    This transfer is necessary to dispatch each mouse
    event to the outermost pad at its cursor location.

31
  • The controlLoop execution exits from its loop
    when self isControlActive becomes false. This
    message performs the following method.
  • for class PadController
  • isControlActive
  • ?self viewHasCursor and
  • (self sensor blueButtonPressed and view
    isFixed) not and
  • view isVisible
  • The condition self isControlActive becomes
    false if the mouse exits from the pad, or the
    blue button is pressed, or the pad becomes
    invisible. In this case, the controlLoop
    execution exits from its loop, and if the red
    button is still down, assumes that the red button
    is released and performs the corresponding
    action.

32
  • When the controlLoop method detects any mouse
    event, it performs the corresponding action among
    the followings
  • self redButtonDown self sensor cursorPoint,
  • self redButtonWentDown self sensor
    cursorPoint,
  • self redButtonWentUp self sensor
    cursorPoint,
  • self redButtonUp self sensor cursorPoint

33
  • Each pad uses the red button to define its
    specific operations. For example, the
    redButtonDown method is defined as follows.
  • redButtonDown aPoint
  • action
  • (action view redButtonDownAction) isNil
  • ifTrue ?self
  • ifFalseview perform action with aPoint
  • This performs the red button action defined for
    this pad if any. The other methods are also
    similarly defined.

34
  • The yellowButtonActivity and the
    blueButtonActivity methods are defined
    similarly to the above-mentioned red button
    activities.
  • blueButtonActivity
  • action
  • (action view blueButtonViewAction) isNil
  • ifTrue self sensor shiftdown
  • if True ?self
    shiftBlueButtonActivity.
  • self moveWithDrag
  • ifFalseview perform action with self
    sensor cursorPoint
  • yellowButtonActivity
  • action
  • (action view yellowButtonViewAction) isNil
  • ifTrue self resizeWithDrag
  • ifFalse view perform action with self
    sensor cursorPoint
  • The blue button is used to drag a pad, while the
    yellow button is used to resize a pad.

35
  • When the blue button is clicked with the pressing
    of the shift key, the pad pops up an operation
    menu including the following entries move,
    resize, copy, connection, shared copy,
    property, primary slot, free, and delete.
    A selection of any one of them will invoke its
    operation method.
  • shiftBlueButtonActivity
  • index
  • index (PopUpMenu labels
    move\resize\copy\connection\shared
  • copy\property\primary
    slot\free\delete withCRs) startUp.
  • index gt 0 ifTrue
  • self perform
    ((moveWithDrag resizeWithDrag
  • copyPad
    changeConnection sharedCopyPad
  • openPropertySheet
    openprimarySlotSheet free
  • delete) at index)

36
  • The keyboardActivity is defined as follows.
  • keyboardActivity
  • key
  • self sensor keyboardPressed
  • whileTrue key self sensor keyboard.
  • (key isKindOf Character)
  • ifFalse ?self.
  • self keyIn key
  • keyIn keyChar
  • action
  • (action view keyboardViewAction) isNil
  • ifTrue ?self
  • ifFalse view perform action with
    keyChar
  • When a key input occurs, this method asks the
    view of the pad if it will respond to a keyboard
    event, and, if it will, tells the view to perform
    the corresponding action with the input key.

37
Geometrical-operation notification
  • Every geometrical operation applied to a pad
    notifies its completion to the parent of this
    pad.
  • Unless otherwise specified, each pad receiving
    such a notification further propagates this to
    its parent pad.
  • Such geometrical operations on a pad include its
    moving, resizing, pasting, peeling, slot
    connection, the releasing of its slot connection,
    its copying, property change, selection, the
    releasing of its selection, its deletion,
    grouping, the releasing of its grouping, its
    saving, showing, and its hiding.
  • The notification of their completion can be used
    by another underlying pad such as a stage pad to
    trigger some of its performance.
  • These notifications of geometrical operations use
    the parent-child relationships among pads, which
    is different from the position event dispatching
    among pads.
  • These notifications include the following
    operation completion events moved, resized,
    copied, pasted, peeled, mclicked (mouse
    clicked), and keyIn (key input).

38
  • When one of these operations, say moving a pad
    from (100, 20) to (30, 50), is completed, this
    pad sends the following message to its parent
    pad.
  • sendEvent moved from P with (100_at_20
    30_at_50)
  • The recipient parent pad further forwards this
    message to its parent pad if it has one. It is up
    to each recipient pad to utilize this information
    or not.

39
Save and Exchange Format
  • The save-format representation of a pad is used
    to store this pad in a file. You need not store
    its pad classes. You only need to store the
    current state of each of its component pads, all
    the parent-child relationships among them, and
    all the slot-connections among them.
  • The save-format representation of a pad consists
    of this set of information, which is necessary
    and sufficient to reconstruct the original pad
    using the pad class library.
  • The exchange-format representation of a pad is
    used to transport this pad among different
    IntelligentPad systems sharing the same pad
    library. The implementation details of the shared
    library may differ in different systems.
  • The exchange-format representation of a pad
    consists of all the information necessary and
    sufficient to reconstruct the same pad at the
    destination site.
  • It logically provides the same information as the
    save-format representation of the same pad.

40
Copy and Shared Copy
41
(No Transcript)
42
Distributed Shared Copies
  • The IntelligentPad architecture allows us to
    electronically send a shared copy of an arbitrary
    pad to other users at different sites. Its
    receiver can share the model of this pad with its
    sender.
  • Shared copies of the same pad distributed across
    a computer network may concurrently request their
    model component to update its state.
  • In order to resolve any conflict among them,
    shared copies at different sites are assigned
    with different priority numbers.
  • Shared copies with larger priority numbers have
    higher priorities.
  • IntelligentPad divides the updating process of
    each pad into three phases, i.e.,
  • the update-request phase,
  • the model-update phase, and
  • the view-update phase.
  • Each request is sent to the model component,
    updates this component, and makes it update all
    of its view components.
  • With respect to their update, pads are classified
    into two types, i.e., combinatorial pads and
    sequential pads.

43
  • A combinatorial pad determines its next state
    independently from its current state,
  • while a sequential pad requires its current state
    information to determine its next state.
  • A combinatorial pad may accept a new update
    request with the higher priority, neglecting the
    preceding one under the processing, if the pad is
    still in either the update-request phase or the
    model-update phase. However, if it is already in
    the view-update phase, it cannot neglect the
    preceding update under the processing to accept a
    new one.
  • A sequential pad, on the other hand, can accept a
    new update request with the higher priority,
    neglecting the preceding one under the
    processing, only when the pad is still in the
    update-request phase.
  • IntelligentPad allows us to associate each shared
    copy with an arbitrary number as its priority
    level. An update request from a shared copy with
    i as its priority level is defined to have the
    same priority level i.

44
Global Variable Pads
  • Global variables are variables commonly accessed
    by more than one pad without using slot
    connections.
  • If the current time is defined as a global
    variable, pads can easily refer to the current
    time in their programs without explicitly
    connecting themselves to any slot that provides
    the current time.
  • Global variables are usually used by an
    application package of pads as shared variables
    accessible by any of these pads.
  • A package of physical simulation pads, for
    example, may use global variables to share
    physical constants.

45
  • If all global variables are accessible by any
    pad, they have a single level of access
    structure.
  • It is desirable to introduce a hierarchy to the
    access of global variables.
  • In the case of single-level global variables, we
    may consider that these global variables are
    defined in the desktop.
  • Similarly, we may consider a special pad that
    defines some global variables that can be
    accessed by any other pads over this pad.

46
Global variable pads
Write a Comment
User Comments (0)
About PowerShow.com