Squeak Class Documentation category index | class index  
 
HaloMorph
  category: Morphic-Widgets
  superclass: Morph
  subclasses:

This morph provides a halo of handles for its target morph. Dragging, duplicating, rotating, and resizing to be done by mousing down on the appropriate handle. There are also handles for help and for a menu of infrequently used operations.

instance methods
  accessing
  haloBox:
innerTarget
isMagicHalo
isMagicHalo:
magicAlpha
magicAlpha:
setTarget:
target
target:

  as yet unclassified
  morphicLayerNumber

  copying
  veryDeepFixupWith:
veryDeepInner:

  drawing
  drawOn:
drawSubmorphsOn:

  events
  blueButtonDown:
containsPoint:event:
dragTarget:
handleListenEvent:
handlerForBlueButtonDown:
mouseMove:
popUpFor:event:
popUpMagicallyFor:hand:
rejectsEvent:
staysUpWhenMouseIsDownIn:
transferHalo:
wantsKeyboardFocusFor:

  geometry
  bounds:
changed
containsPoint:
position:

  handles
  addChooseGraphicHandle:
addCollapseHandle:
addDebugHandle:
addDismissHandle:
addDragHandle:
addDupHandle:
addFewerHandlesHandle:
addFontEmphHandle:
addFontSizeHandle:
addFontStyleHandle:
addGrabHandle:
addGrowHandle:
addHelpHandle:
addMenuHandle:
addPaintBgdHandle:
addPoohHandle:
addRecolorHandle:
addRepaintHandle:
addRotateHandle:
addScaleHandle:
addScriptHandle:
addTileHandle:
addViewHandle:
addViewingHandle:
openViewerForTarget:with:
positionIn:horizontalPlacement:verticalPlacement:
tearOffTileForTarget:with:

  initialization
  acceptNameEdit
delete
initialize

  object fileIn
  convertToCurrentVersion:refStream:

  private
  addCircleHandles
addDirectionHandles
addFullHandles
addGraphicalHandle:at:on:send:to:
addGraphicalHandleFrom:at:
addHandle:on:send:to:
addHandleAt:color:icon:on:send:to:
addHandleAt:color:on:send:to:
addHandles
addHandlesForWorldHalos
addName
addNameBeneath:string:
addSimpleHandles
addSimpleHandlesForWorldHalos
addSimpleHandlesTo:box:
addSimpleSketchMorphHandlesInBox:
basicBox
basicBoxForSimpleHalos
directionArrowLength
dismiss
doDebug:with:
doDirection:with:
doDrag:with:
doDup:with:
doGrab:with:
doGrow:with:
doMenu:with:
doRecolor:with:
doRot:with:
doScale:with:
endInteraction
handleAllowanceForIconicHalos
handleSize
maybeCollapse:with:
maybeDismiss:with:
maybeDoDup:with:
mouseDownInCollapseHandle:with:
mouseDownInDimissHandle:with:
obtainHaloForEvent:andRemoveAllHandlesBut:
positionDirectionShaft:
prepareToTrackCenterOfRotation:with:
removeAllHandlesBut:
setCenterOfRotation:with:
setDirection:with:
setDismissColor:with:
showDirectionHandles:
showDirectionHandles:addHandles:
showingDirectionHandles
simpleFudgeOffset
startDrag:with:
startGrow:with:
startRot:with:
startScale:with:
strokeGrow:with:
trackCenterOfRotation:with:
trackDirectionArrow:with:

  stepping
  fadeIn
fadeInInitially
fadeOut
fadeOutFinally
handleEntered
handleLeft
localHaloBoundsFor:
step
stepTime

class methods
  as yet unclassified
  initialize

instance methods
  accessing top  
 

haloBox:


 

innerTarget


 

isMagicHalo


 

isMagicHalo:


 

magicAlpha


 

magicAlpha:


 

setTarget:

Private! Set the target without adding handles.


 

target


 

target:


  as yet unclassified top  
 

morphicLayerNumber

helpful for insuring some morphs always appear in front of or behind others.
smaller numbers are in front


  copying top  
 

veryDeepFixupWith:

If target and arguments fields were weakly copied, fix them here. If they were in the tree being copied, fix them up, otherwise point to the originals!!


 

veryDeepInner:

Copy all of my instance variables. Some need to be not copied at all, but shared. Warning!! Every instance variable defined in this class must be handled. We must also implement veryDeepFixupWith:. See DeepCopier class comment.


  drawing top  
 

drawOn:

Draw this morph only if it has no target.


 

drawSubmorphsOn:

Display submorphs back to front


  events top  
 

blueButtonDown:

Transfer the halo to the next likely recipient


 

containsPoint:event:

Blue buttons are handled by the halo


 

dragTarget:

Begin dragging the target


 

handleListenEvent:

We're listen for possible drop events here to add back those handles after a dup/grab operation


 

handlerForBlueButtonDown:

Blue button was clicked within the receiver


 

mouseMove:

Drag our target around


 

popUpFor:event:

This message is sent by morphs that explicitly request the halo on a button click. Note: anEvent is in aMorphs coordinate frame.


 

popUpMagicallyFor:hand:

Programatically pop up a halo for a given hand.


 

rejectsEvent:

Return true to reject the given event. Rejecting an event means neither the receiver nor any of it's submorphs will be given any chance to handle it.


 

staysUpWhenMouseIsDownIn:


 

transferHalo:

Transfer the halo to the next likely recipient


 

wantsKeyboardFocusFor:

to allow the name to be edited in the halo in the old tty way; when we morphic-text-ize the name editing, presumably this method should be removed


  geometry top  
 

bounds:


 

changed

Quicker to invalidate handles individually if target is large (especially the world)


 

containsPoint:

This method is overridden so that, once up, the handles will stay up as long as the mouse is within the box that encloses all the handles even if it is not over any handle or over its owner.


 

position:

Halos display imprefectly if their coordinates are non-integral
-- especially the direction handles.


  handles top  
 

addChooseGraphicHandle:

If the target is a sketch morph, and if the governing preference is set, add a halo handle allowing the user to select a new graphic


 

addCollapseHandle:

Add the collapse handle, with all of its event handlers set up, unless the target's owner is not the world or the hand.


 

addDebugHandle:


 

addDismissHandle:

Add the dismiss handle according to the spec, unless selectiveHalos is on and my target resists dismissal


 

addDragHandle:


 

addDupHandle:


 

addFewerHandlesHandle:


 

addFontEmphHandle:


 

addFontSizeHandle:


 

addFontStyleHandle:


 

addGrabHandle:

If appropriate, add the black halo handle for picking up the target


 

addGrowHandle:


 

addHelpHandle:


 

addMenuHandle:


 

addPaintBgdHandle:


 

addPoohHandle:


 

addRecolorHandle:

Add a recolor handle to the receiver, if appropriate


 

addRepaintHandle:


 

addRotateHandle:


 

addScaleHandle:


 

addScriptHandle:

If the halo's innerTarget claims it wants a Script handle, add one to the receiver, forming it as per haloSpec


 

addTileHandle:

Add the 'tear-off-tile' handle from the spec


 

addViewHandle:

Add the 'open viewer' handle from the halo spec


 

addViewingHandle:

If appropriate, add a special Viewing halo handle to the receiver


 

openViewerForTarget:with:

Open a viewer for my inner target


 

positionIn:horizontalPlacement:verticalPlacement:


 

tearOffTileForTarget:with:

Tear off a tile representing my inner target


  initialization top  
 

acceptNameEdit

If the name is currently under edit, accept the changes


 

delete

Delete the halo. Tell the target that it no longer has the halo; accept any pending edits to the name; and then either actually delete myself or start to fade out


 

initialize


  object fileIn top  
 

convertToCurrentVersion:refStream:

subclasses should implement if they wish to convert old instances to modern ones


  private top  
 

addCircleHandles


 

addDirectionHandles


 

addFullHandles

Later, obey a preference to choose between circle-iconic and solid-circles


 

addGraphicalHandle:at:on:send:to:

Add the supplied form as a graphical handle centered at the given point, and set it up to respond to the given event by sending the given selector to the given recipient. Return the handle.


 

addGraphicalHandleFrom:at:

Add the supplied form as a graphical handle centered at the given point. Return the handle.


 

addHandle:on:send:to:

Add a handle within the halo box as per the haloSpec, and set it up to respond to the given event by sending the given selector to the given recipient. Return the handle.


 

addHandleAt:color:icon:on:send:to:

Add a handle centered at the given point with the given color, and set it up to respond to the given event by sending the given selector to the given recipient. Return the handle.


 

addHandleAt:color:on:send:to:


 

addHandles


 

addHandlesForWorldHalos

Add handles for world halos, like the man said


 

addName

Add a name readout at the bottom of the halo.


 

addNameBeneath:string:

Add a name display centered beneath the bottom of the outer rectangle. Return the handle.


 

addSimpleHandles


 

addSimpleHandlesForWorldHalos

Nothing special at present here -- just use the regular handles. Cannot rotate or resize world


 

addSimpleHandlesTo:box:


 

addSimpleSketchMorphHandlesInBox:


 

basicBox


 

basicBoxForSimpleHalos


 

directionArrowLength


 

dismiss

Remove my target from the world.


 

doDebug:with:

Ask hand to invoke the a debugging menu for my inner target. If shift key is down, immediately put up an inspector on the inner target


 

doDirection:with:


 

doDrag:with:


 

doDup:with:

Ask hand to duplicate my target.


 

doGrab:with:

Ask hand to grab my target.


 

doGrow:with:

Called while the mouse is down in the grow handle


 

doMenu:with:

Ask hand to invoke the halo menu for my inner target.


 

doRecolor:with:

The mouse went down in the 'recolor' halo handle. Allow the user to change the color of the innerTarget


 

doRot:with:

Update the rotation of my target if it is rotatable. Keep the relevant command object up to date.


 

doScale:with:

Update the scale of my target if it is scalable.


 

endInteraction

Clean up after a user interaction with the a halo control


 

handleAllowanceForIconicHalos


 

handleSize


 

maybeCollapse:with:

Ask hand to collapse my target if mouse comes up in it.


 

maybeDismiss:with:

Ask hand to dismiss my target if mouse comes up in it.


 

maybeDoDup:with:


 

mouseDownInCollapseHandle:with:

The mouse went down in the collapse handle; collapse the morph


 

mouseDownInDimissHandle:with:


 

obtainHaloForEvent:andRemoveAllHandlesBut:

Make sure the event's hand correlates with the receiver, and remove all handles except the given one. If nil is provided as the handles argument, the result is that all handles are removed. Note that any pending edits to the name-string in the halo are accepted at this time.


 

positionDirectionShaft:

Position the shaft.


 

prepareToTrackCenterOfRotation:with:


 

removeAllHandlesBut:

Remove all handles except h.


 

setCenterOfRotation:with:


 

setDirection:with:

The user has let up after having dragged the direction arrow; now set the forward direction of the actual SketchMorph accordingly


 

setDismissColor:with:

Called on mouseStillDown in the dismiss handle; set the color appropriately.


 

showDirectionHandles:


 

showDirectionHandles:addHandles:


 

showingDirectionHandles


 

simpleFudgeOffset

account for the difference in basicBoxes between regular and simple handles


 

startDrag:with:

Drag my target without removing it from its owner.


 

startGrow:with:

Initialize resizing of my target. Launch a command representing it, to support Undo


 

startRot:with:

Initialize rotation of my target if it is rotatable. Launch a command object to represent the action


 

startScale:with:

Initialize scaling of my target.


 

strokeGrow:with:


 

trackCenterOfRotation:with:


 

trackDirectionArrow:with:


  stepping top  
 

fadeIn


 

fadeInInitially


 

fadeOut


 

fadeOutFinally


 

handleEntered


 

handleLeft


 

localHaloBoundsFor:

aMorph may be in the hand and perhaps not in our world


 

step

Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.


 

stepTime

Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.


class methods
  as yet unclassified top  
 

initialize

HaloMorph initialize