Squeak Class Documentation category index | class index  
 
CRDictionaryBrowser
  category: Genie-UI
  superclass: Model
  subclasses:

This class is used to browse a dictionary.
As all the other parts of the genie UI, the dictionary browser is built according to the MVC model.
Here a short description of all the classes participating in a single dictionary browser.
(Note: There are different views on a dictionary. Here, only the browser view is described)


CRDictionary (Model)
Instances of this class store and manage all the dictionary data.

CRDictionaryBrowserAppModel (Application Model)
This is the application model of a dictionary. Every dictionary browser uses an
application model to communicate with the dictionary. (As an example, the application
model has a cache holding distances between the features in the dictionary).
Every browser opened on a certain dictionary should use the same application model.
(However, it would also be possible to use more than one application model per dictionary)

CRDictionaryBrowser (View)
This class is part of the view in the MVC model. It manages all the properties of a
single browser view (layout properties, etc). The actual visual representation is
realized by using a (nested) PluggableCollectionMorph.
(Basically it's possible to open multiple visual representations on one single instance of this
class. But, all these instances share common layout properties. This is usually not
wanted and thus it is better to create a new instance of this class for every view).

PluggableCollectionMorph (View)
Objects of this class can represent the contents of a collection in a very flexible way.
The class is built in according to all the other pluggable morphs in Squeak. In the
case of the dictionary browser, objects of CRDictionaryBrowser are the models of
the PluggableCollectionMorphs.

instance methods
  accessing
  appModel
areCapturedPointsShown
areCapturedPointsShown:
areNextFeatureGraphicsShown
areNextFeatureGraphicsShown:
createMorphForFeature:
createRecognizer
dictionary
displayProperties
displayProperties:
hasOkayButton
hasOkayButton:
imageSize
imageSize:
invertedDict
nextFeatureCount
nextFeatureCount:
orientation
orientation:
relativeSize
relativeSize:
saveLayoutPropertiesAsDefault
setLayoutProperties:
setLayoutPropertiesToDefault
showDistanceToFeaturesInParents
showDistanceToFeaturesInParents:

  initialize-release
  asMorph
initializeAppModel:
initializeLayoutProperties
newMorph
newMorphWithFeature:

  menu
  menuChangeImageSizeRequestor:
menuSaveLayoutAsDefaultRequestor:
menuSetLayoutToDefaultRequestor:
menuSetNextFeatureCountRequestor:value:
menuSwitchCapturedPointsShownRequestor:
menuSwitchNextFeatureGraphicsShownRequestor:
menuSwitchOrientationRequestor:
menuSwitchRelativeSizeRequestor:
menuSwitchShowDistanceToFeaturesInParentsRequestor:

  private
  appModel:
clearResultCache
createAddFeatureMorphDefaultChar:
createBasicMorphForFeature:
createStringForItems:
dictSelector
isParentPane:
isSubPane:
orthoOrientation:
parentPaneOf:
prepareAddFeatureAt:parentPane:
removeSubPaneOf:
shownResultItemsFor:
subPaneAt:put:
subPaneDict
subPaneDict:
subPaneOf:

  updating
  removeDependent:
update:

  view hooks
  addCharActionRequestor:
addCharActionRequestor:newChar:
addFeature:to:requestor:
balloonText:requestor:
cancelAddFeatureTo:requestor:
changeCharRequestRequestor:
charKeyMorph:requestor:
deleteCharActionRequestor:
deleteFeatureActionRequestor:
featureKeyMorph:requestor:
featureMorph:requestor:
gotoCharActionRequestor:
menuActionRequestor:
objectToString:
okayActionRequestor:
prepareAddFeatureActionRequestor:
renameCharAction:event:sourceMorph:
renameCharAction:sourceMorph:requestor:
subPaneBalloonText:requestor:
subPaneMorph:requestor:

class methods
  accessing
  defaultLayoutInstance
defaultLayoutInstance:

  class initialization
  initialize

  default layout
  areCapturedPointsShown
areNextFeatureGraphicsShown
displayMode
hasOkayButton
imageSize
nextFeatureCount
orientation
relativeSize
showDistanceToFeaturesInParents

  instance creation
  appModel:
dictionary:
layoutInstance

instance methods
  accessing top  
 

appModel


 

areCapturedPointsShown


 

areCapturedPointsShown:


 

areNextFeatureGraphicsShown

Are graphical representations of the most similar features in the dictionary shown?


 

areNextFeatureGraphicsShown:


 

createMorphForFeature:

Create a morph representing the given featue


 

createRecognizer


 

dictionary


 

displayProperties

Return the display properties associated to this dictionary


 

displayProperties:

Set the display propertis forthis dictionary.
Set the display properties to #activeIntance to always use the currently active
properties


 

hasOkayButton


 

hasOkayButton:


 

imageSize

the image size of a features graphica representation


 

imageSize:


 

invertedDict

The inverted dictionary


 

nextFeatureCount

How many similar features shall be shown?


 

nextFeatureCount:

0, 1, 2


 

orientation

Orientation of the browser: #horizontal or #vertical


 

orientation:

Orientation of the browser: #topToBottom or #leftToRight


 

relativeSize

Shall the size of the features be relative to the absolute maximum size?


 

relativeSize:


 

saveLayoutPropertiesAsDefault


 

setLayoutProperties:


 

setLayoutPropertiesToDefault


 

showDistanceToFeaturesInParents

Shall distances to features in parents also be shown?


 

showDistanceToFeaturesInParents:


  initialize-release top  
 

asMorph


 

initializeAppModel:

This method sets the application model and initilizes the instance


 

initializeLayoutProperties

This method sets the layout properties of the dictionary according to the default
value specified on the class side.


 

newMorph

Create and initialize a new PluggableCollectionMorph which serves as my
graphical representation. There can be many graphical representations for one browser
objects. However, all the graphical representations share the same layout properties.
Create multiple instances of this clss to open multiple browsers with independent layout
properties.


 

newMorphWithFeature:

Initialize a morph containing aCRFeature as a new feature.


  menu top  
 

menuChangeImageSizeRequestor:


 

menuSaveLayoutAsDefaultRequestor:


 

menuSetLayoutToDefaultRequestor:


 

menuSetNextFeatureCountRequestor:value:


 

menuSwitchCapturedPointsShownRequestor:


 

menuSwitchNextFeatureGraphicsShownRequestor:


 

menuSwitchOrientationRequestor:


 

menuSwitchRelativeSizeRequestor:


 

menuSwitchShowDistanceToFeaturesInParentsRequestor:


  private top  
 

appModel:


 

clearResultCache


 

createAddFeatureMorphDefaultChar:

Create a morph to add a new feature for the given character


 

createBasicMorphForFeature:

Create a morph representing the given feature


 

createStringForItems:

Create a string representing the most similar features that are passed as the argument


 

dictSelector


 

isParentPane:

Is anObject a parent pane in one of my graphical representations


 

isSubPane:

Is an object a subpane in one of my graphical representations


 

orthoOrientation:

Return the orthogonal orientation


 

parentPaneOf:

Rturn the parent pane of anObject


 

prepareAddFeatureAt:parentPane:


 

removeSubPaneOf:

Remove the subpane of anObject, if anObject is a parent pane in one of my graphical
representations


 

shownResultItemsFor:

Calculate the features that are most similar to aCRFeature.


 

subPaneAt:put:

Register subObject as the subPane of anObject in one of my graphical representations


 

subPaneDict


 

subPaneDict:


 

subPaneOf:

If anObject is a parent pane in one of my graphical representations, return its sub-pane


  updating top  
 

removeDependent:

Remove the given object as one of the receiver's dependents.


 

update:

Decompose argument into parts and execute appropriate actions


  view hooks top  
 

addCharActionRequestor:

A view calls this method when a new character should be added


 

addCharActionRequestor:newChar:

A view calls this method when a new character should be added


 

addFeature:to:requestor:

A view calls this method when a new feature should be added


 

balloonText:requestor:


 

cancelAddFeatureTo:requestor:

A view calls this method when adding of a new chaacter should be canceled


 

changeCharRequestRequestor:

A view calls this method when the currently displayed character changes


 

charKeyMorph:requestor:

A view calls this method to obtain the morph that represents the index (key) of the
currently displayed character


 

deleteCharActionRequestor:

A view calls this method in order to delete a character


 

deleteFeatureActionRequestor:

A view calls this method in order to delete a feature


 

featureKeyMorph:requestor:

This method is called by one of my views to obtain the morph representing the
index (key) of the current feature.


 

featureMorph:requestor:

This method is called by a view to obtain the morph representing a feature


 

gotoCharActionRequestor:

Called when goto action of a view is executed


 

menuActionRequestor:

Called to pop up the menu in a view


 

objectToString:

General method that converts an object to a string. This is used by my views to
get printable representations of certain objects


 

okayActionRequestor:


 

prepareAddFeatureActionRequestor:

Called by one of my views to prepare the add feature action


 

renameCharAction:event:sourceMorph:

Called by a view to rename the current character


 

renameCharAction:sourceMorph:requestor:

Reorder the arguments for existing event handlers


 

subPaneBalloonText:requestor:


 

subPaneMorph:requestor:

Called by a feature to retrieve the subPane with all the features


class methods
  accessing top  
 

defaultLayoutInstance


 

defaultLayoutInstance:


  class initialization top  
 

initialize

DefaultLayoutInstance holds the current default layout for dictionary browsers.
Here a new default layout instance gets created


  default layout top  
 

areCapturedPointsShown


 

areNextFeatureGraphicsShown


 

displayMode


 

hasOkayButton


 

imageSize


 

nextFeatureCount

0, 1, 2


 

orientation


 

relativeSize


 

showDistanceToFeaturesInParents


  instance creation top  
 

appModel:


 

dictionary:


 

layoutInstance

Return an instance with the layout properties according to the class defaults