Squeak Class Documentation category index | class index  
 
HandMorph
  category: Morphic-Kernel
  superclass: Morph
  subclasses: HandMorphForReplay RemoteHandMorph RemoteControlledHandMorph

The cursor may be thought of as the HandMorph. The hand's submorphs hold anything being carried by dragging.

There is some minimal support for multiple hands in the same world.

instance methods
  accessing
  cursorPoint
lastEvent
mouseOverHandler
position
targetOffset
userInitials
userPicture
userPicture:

  balloon help
  balloonHelp
balloonHelp:
deleteBalloonTarget:
removePendingBalloonFor:
spawnBalloonFor:
triggerBalloonFor:after:

  classification
  isHandMorph

  cursor
  cursorBounds
showTemporaryCursor:
showTemporaryCursor:hotSpotOffset:

  double click support
  resetClickState
waitForClicksOrDrag:event:
waitForClicksOrDrag:event:selectors:threshold:

  drawing
  colorForInsets
drawOn:
fullDrawOn:
hasChanged
hasUserInformation
needsToBeDrawn
nonCachingFullDrawOn:
restoreSavedPatchOn:
savePatchFrom:
shadowForm
shadowOffset
trailMorph
updateCacheCanvas:

  event handling
  checkForMoreKeyboard
flushEvents
handleEvent:
noticeMouseOver:event:
pauseEventRecorderIn:
processEvents

  focus handling
  keyboardFocus
keyboardFocus:
mouseFocus
mouseFocus:
newKeyboardFocus:
newMouseFocus:
newMouseFocus:event:
releaseAllFoci
releaseKeyboardFocus
releaseKeyboardFocus:
releaseMouseFocus
releaseMouseFocus:

  genie
  allowsGestureStart:target:
disableGenie
disableGenieFocus:
enableGenie
ensureGenieGestureProcessor
genieGestureProcessor
gestureStart:target:
giveGenieChanceToEscape
handleEventWithGenieEscaped:
isGenieEnabled
isGenieRecognizing
prepareMouseFocusChangeFrom:to:
resetGenie
switchGenieEnabled
switchGenieFocus:
temporaryCursor

  geometry
  changed
fullBounds
invalidRect:from:
position:
userInitials:andPicture:

  grabbing/dropping
  attachMorph:
dropMorph:event:
dropMorphs
dropMorphs:
grabMorph:
grabMorph:from:
targetOffset:

  halo handling
  halo
halo:
obtainHalo:
releaseHalo:
removeHaloFromClick:on:
removePendingHaloFor:
spawnMagicHaloFor:
triggerHaloFor:after:

  initialization
  adaptedToWorld:
initForEvents
initialize
interrupted
resourceJustLoaded

  listeners
  addEventListener:
addKeyboardListener:
addListener:to:
addMouseListener:
eventListeners
eventListeners:
keyboardListeners
keyboardListeners:
mouseListeners
mouseListeners:
removeEventListener:
removeKeyboardListener:
removeListener:from:
removeMouseListener:

  object fileIn
 

  paste buffer
  copyToPasteBuffer:
objectToPaste
pasteBuffer
pasteBuffer:
pasteMorph

  private
  objectForDataStream:
releaseCachedState
veryDeepCopyWith:

  private events
  generateDropFilesEvent:
generateKeyboardEvent:
generateMouseEvent:
mouseTrailFrom:
moveToEvent:
sendEvent:focus:
sendEvent:focus:clear:
sendFocusEvent:to:clear:
sendKeyboardEvent:
sendListenEvent:to:
sendMouseEvent:

class methods
  accessing
  doubleClickTime
doubleClickTime:

  initialization
  initialize

  instance creation
  includeInNewMorphMenu

  utilities
  attach:
newEventRules:
showEvents:

instance methods
  accessing top  
 

cursorPoint

Implemented for allowing embedded worlds in an event cycle to query a hand's position and get it in its coordinates. The same can be achieved by #point:from: but this is simply much more convenient since it will look as if the hand is in the lower world.


 

lastEvent


 

mouseOverHandler


 

position


 

targetOffset

Return the offset of the last mouseDown location relative to the origin of the recipient morph. During menu interactions, this is the absolute location of the mouse down event that invoked the menu.


 

userInitials


 

userPicture


 

userPicture:


  balloon help top  
 

balloonHelp

Return the balloon morph associated with this hand


 

balloonHelp:

Return the balloon morph associated with this hand


 

deleteBalloonTarget:

Delete the balloon help targeting the given morph


 

removePendingBalloonFor:

Get rid of pending balloon help.


 

spawnBalloonFor:


 

triggerBalloonFor:after:

Trigger balloon help after the given time out for some morph


  classification top  
 

isHandMorph


  cursor top  
 

cursorBounds


 

showTemporaryCursor:

Set the temporary cursor to the given Form. If the argument is nil, revert to the normal cursor.


 

showTemporaryCursor:hotSpotOffset:

Set the temporary cursor to the given Form.
If the argument is nil, revert to the normal hardware cursor.


  double click support top  
 

resetClickState

Reset the double-click detection state to normal (i.e., not waiting for a double-click).


 

waitForClicksOrDrag:event:

Wait until the difference between click, double-click, or drag gesture is known, then inform the given morph what transpired. This message is sent when the given morph first receives a mouse-down event. If the mouse button goes up, then down again within DoubleClickTime, then 'doubleClick: evt' is sent to the morph. If the mouse button goes up but not down again within DoubleClickTime, then the message 'click: evt' is sent to the morph. Finally, if the button does not go up within DoubleClickTime, then 'drag: evt' is sent to the morph. In all cases, the event supplied is the original mouseDown event that initiated the gesture. mouseMove: and mouseUp: events are not sent to the morph until it becomes the mouse focus, which is typically done by the client in its click:, doubleClick:, or drag: methods.


 

waitForClicksOrDrag:event:selectors:threshold:

Wait until the difference between click, double-click, or drag gesture is known, then inform the given morph what transpired. This message is sent when the given morph first receives a mouse-down event. If the mouse button goes up, then down again within DoubleClickTime, then 'doubleClick: evt' is sent to the morph. If the mouse button goes up but not down again within DoubleClickTime, then the message 'click: evt' is sent to the morph. Finally, if the button does not go up within DoubleClickTime, then 'drag: evt' is sent to the morph. In all cases, the event supplied is the original mouseDown event that initiated the gesture. mouseMove: and mouseUp: events are not sent to the morph until it becomes the mouse focus, which is typically done by the client in its click:, doubleClick:, or drag: methods.


  drawing top  
 

colorForInsets

Morphs being dragged by the hand use the world's color


 

drawOn:

Draw the hand itself (i.e., the cursor).


 

fullDrawOn:

A HandMorph has unusual drawing requirements:
1. the hand itself (i.e., the cursor) appears in front of its submorphs
2. morphs being held by the hand cast a shadow on the world/morphs below
The illusion is that the hand plucks up morphs and carries them above the world.


 

hasChanged

Return true if this hand has changed, either because it has moved or because some morph it is holding has changed.


 

hasUserInformation


 

needsToBeDrawn

Return true if this hand must be drawn explicitely instead of being drawn via the hardware cursor. This is the case if it (a) it is a remote hand, (b) it is showing a temporary cursor, or (c) it is not empty. If using the software cursor, ensure that the hardware cursor is hidden.


 

nonCachingFullDrawOn:

A HandMorph has unusual drawing requirements:
1. the hand itself (i.e., the cursor) appears in front of its submorphs
2. morphs being held by the hand cast a shadow on the world/morphs below
The illusion is that the hand plucks up morphs and carries them above the world.


 

restoreSavedPatchOn:

Clear the changed flag and restore the part of the given canvas under this hand from the previously saved patch. If necessary, handle the transition to using the hardware cursor.


 

savePatchFrom:

Save the part of the given canvas under this hand as a Form and return its bounding rectangle.


 

shadowForm

Return a 1-bit shadow of my submorphs. Assumes submorphs is not empty


 

shadowOffset

Return the current shadow offset


 

trailMorph

You can't draw trails when picked up by the hand.


 

updateCacheCanvas:

Update the cached image of the morphs being held by this hand.


  event handling top  
 

checkForMoreKeyboard

Quick check for more keyboard activity -- Allows, eg, many characters
to be accumulated into a single replacement during type-in.


 

flushEvents

Flush any events that may be pending


 

handleEvent:

Handle the given event


 

noticeMouseOver:event:


 

pauseEventRecorderIn:

Suspend any recorder prior to a project change, and return it.
It will be resumed after starting the new project.


 

processEvents

Process user input events from the local input devices.


  focus handling top  
 

keyboardFocus


 

keyboardFocus:


 

mouseFocus


 

mouseFocus:


 

newKeyboardFocus:

Make the given morph the new keyboard focus, canceling the previous keyboard focus if any. If the argument is nil, the current keyboard focus is cancelled.


 

newMouseFocus:

Make the given morph the new mouse focus, canceling the previous mouse focus if any. If the argument is nil, the current mouse focus is cancelled.


 

newMouseFocus:event:


 

releaseAllFoci


 

releaseKeyboardFocus

Release the current keyboard focus unconditionally


 

releaseKeyboardFocus:

If the given morph had the keyboard focus before, release it


 

releaseMouseFocus

Release the current mouse focus unconditionally.


 

releaseMouseFocus:

If the given morph had the mouse focus before, release it


  genie top  
 

allowsGestureStart:target:


 

disableGenie


 

disableGenieFocus:


 

enableGenie


 

ensureGenieGestureProcessor


 

genieGestureProcessor


 

gestureStart:target:


 

giveGenieChanceToEscape


 

handleEventWithGenieEscaped:


 

isGenieEnabled


 

isGenieRecognizing


 

prepareMouseFocusChangeFrom:to:


 

resetGenie


 

switchGenieEnabled


 

switchGenieFocus:


 

temporaryCursor


  geometry top  
 

changed

Report that the area occupied by this morph should be redrawn.


 

fullBounds

Extend my bounds by the shadow offset when carrying morphs.


 

invalidRect:from:

Note that a change has occurred and record the given damage rectangle relative to the origin this hand's cache.


 

position:

Overridden to align submorph origins to the grid if gridding is on.


 

userInitials:andPicture:


  grabbing/dropping top  
 

attachMorph:

Position the center of the given morph under this hand, then grab it.
This method is used to grab far away or newly created morphs.


 

dropMorph:event:

Drop the given morph which was carried by the hand


 

dropMorphs

Drop the morphs at the hands position


 

dropMorphs:

Drop the morphs at the hands position


 

grabMorph:

Grab the given morph (i.e., add it to this hand and remove it from its current owner) without changing its position. This is used to pick up a morph under the hand's current position, versus attachMorph: which is used to pick up a morph that may not be near this hand.


 

grabMorph:from:

Grab the given morph (i.e., add it to this hand and remove it from its current owner) without changing its position. This is used to pick up a morph under the hand's current position, versus attachMorph: which is used to pick up a morph that may not be near this hand.


 

targetOffset:

Set the offset at which we clicked down in the target morph


  halo handling top  
 

halo

Return the halo associated with this hand, if any


 

halo:

Set halo associated with this hand


 

obtainHalo:

Used for transfering halos between hands


 

releaseHalo:

Used for transfering halos between hands


 

removeHaloFromClick:on:


 

removePendingHaloFor:

Get rid of pending balloon help or halo actions.


 

spawnMagicHaloFor:


 

triggerHaloFor:after:

Trigger automatic halo after the given time out for some morph


  initialization top  
 

adaptedToWorld:

If I refer to a world or a hand, return the corresponding items in the new world.


 

initForEvents


 

initialize


 

interrupted

Something went wrong - we're about to bring up a debugger.
Release some stuff that could be problematic.


 

resourceJustLoaded

In case resource relates to me


  listeners top  
 

addEventListener:

Make anObject a listener for all events. All events will be reported to the object.


 

addKeyboardListener:

Make anObject a listener for keyboard events. All keyboard events will be reported to the object.


 

addListener:to:

Add anObject to the given listener group. Return the new group.


 

addMouseListener:

Make anObject a listener for mouse events. All mouse events will be reported to the object.


 

eventListeners


 

eventListeners:


 

keyboardListeners


 

keyboardListeners:


 

mouseListeners


 

mouseListeners:


 

removeEventListener:

Remove anObject from the current event listeners.


 

removeKeyboardListener:

Remove anObject from the current keyboard listeners.


 

removeListener:from:

Remove anObject from the given listener group. Return the new group.


 

removeMouseListener:

Remove anObject from the current mouse listeners.


  object fileIn top  

  paste buffer top  
 

copyToPasteBuffer:

Save this morph in the paste buffer. This is mostly useful for copying morphs between projects.


 

objectToPaste

It may need to be sent #startRunning by the client


 

pasteBuffer

Return the paste buffer associated with this hand


 

pasteBuffer:

Set the contents of the paste buffer.


 

pasteMorph


  private top  
 

objectForDataStream:

I am about to be written on an object file. Write a path to me in the other system instead.


 

releaseCachedState

Release any state that can be recomputed on demand, such as the pixel values for a color gradient or the editor state for a TextMorph. This method may be called to save space when a morph becomes inaccessible. Implementations of this method should do 'super releaseCachedState'.


 

veryDeepCopyWith:

Return self. Do not copy hands this way.


  private events top  
 

generateDropFilesEvent:

Generate the appropriate mouse event for the given raw event buffer


 

generateKeyboardEvent:

Generate the appropriate mouse event for the given raw event buffer


 

generateMouseEvent:

Generate the appropriate mouse event for the given raw event buffer


 

mouseTrailFrom:

Current event, a mouse event buffer, is about to be processed. If there are other similar mouse events queued up, then drop them from the queue, and report the positions inbetween.


 

moveToEvent:

Issue a mouse move event to make the receiver appear at the given position


 

sendEvent:focus:

Send the event to the morph currently holding the focus, or if none to the owner of the hand.


 

sendEvent:focus:clear:

Send the event to the morph currently holding the focus, or if none to the owner of the hand.


 

sendFocusEvent:to:clear:

Send the event to the morph currently holding the focus


 

sendKeyboardEvent:

Send the event to the morph currently holding the focus, or if none to the owner of the hand.


 

sendListenEvent:to:

Send the event to the given group of listeners


 

sendMouseEvent:

Send the event to the morph currently holding the focus, or if none to the owner of the hand.


class methods
  accessing top  
 

doubleClickTime


 

doubleClickTime:


  initialization top  
 

initialize

HandMorph initialize


  instance creation top  
 

includeInNewMorphMenu

Not to be instantiated from the menu


  utilities top  
 

attach:

Attach aMorph the current world's primary hand.


 

newEventRules:


 

showEvents:

HandMorph showEvents: true