GF/ST Programmer Guide : GF/ST Programmer Guide : Class Hierarchy, Protocol and Events
Class Hierarchy, Protocol and Events
GF/ST Class Hierarchy
The tables below, broken into page-size chunks, show the base GF/ST classes in hierarchical order. Base image classes from which GF/ST classes inherit are shown in italics.
GF/ST modifies no base image methods on any platform. For a full listing of added classes and methods, refer to the .SUM files supplied on the distribution media. Common protocol for GFGraphicObject is summarized in the description for that class, in the next section.
For clarity of presentation, we have provided two page-size tables summarizing the GF/ST classes that have a common hierarchy on all platforms. Next, we provide one table for each Smalltalk platform supported by GF/ST, showing the specific hierarchy for GF/ST classes on each platform. For example, each Smalltalk implements a different Collection hierarchy. Our GFBoundedStack class is buried at the appropriate spot in the Collection hierarchy, which differs between Smalltalks.
GF/ST Class Hierarchy Common to All Platforms
(Other than PsiEventModel)
Object
......EvaluableAction
............GFConstraint
............GFMultiheadedConstraint
............GFPositionConstraint
......GFAbstractEndPlug
............GFEvaluableActionEndPlug
............GFGoEndPlug
......GFCategory
......GFCoordinateControl
......GFGraphicsDisplaySystem
............GFDoubleBufferingGraphicsDisplaySystem
......GFHandle
............GFConnectionHandle
............GFTrackHandle
..................GFParameterizedTrackHandle
..................GFSelectionTrackHandle
........................GFAbsoluteTrackHandle
......GFLogicalUnit
............GFHundredthMillimeter
............GFThousandthInch
............GFTwip
......GFMemento
......GFTool
............GFCreationTool
............GFDrawingActionTool
............GFGOActionTool
............GFScrollingTool
............GFSelectionTool
..................GFFastSelectionTool
..................GFFocusTool
GF/ST Classes Common
(PsiEventModel Hierarchy Only)
Object
......PsiEventModel
............GFDrawingInterface
............GFGraphicObject
..................GFAbstractPathGO
........................GFClosedPathGO
..............................GFEllipseGO
..............................GFRectangleGO
....................................GFRoundedRectangleGO
........................GFDirectedPathGO
..............................GFLineGO
....................................GFDependentLineGO
..............................GFPolylineGO
....................................GFBezierGO
....................................GFOrthogonalPathGO
..........................................GFDependentOrthogonalPathGO
....................................GFSplineGO
..................GFCachedGO
........................GFImageGO
..............................GFButtonGO
..............................GFGroupGO
..................GFCompositeGO
........................GFDrawing
..................GFHostWidgetGO
..................GFTextGO
............GFToolPalette
 
 
 
GF/ST Class Hierarcy Specific to VA Smalltalk
Object
......CgGC
............GFGC
..................GFTranslatingGC
........................GFScalingGC
..............................GFPrintingGC
......CgID
............CgDrawable
..................CgPixmap
........................GFPixmap
..............................GFOpaqueBitmap
..............................GFScratchPixmap
......CgRGBColor
............Color
..................RGBColor
......Collection
............SequenceableCollection
..................AdditiveSequenceableCollection
........................OrderedCollection
..............................GFBoundedStack
..................ArrayedCollection
........................Array
..............................ActionSequence
......ColorDialog
......CwWidget
............CwBasicWidget
..................CwComposite
........................CwDrawingArea
..............................GFDrawingPane
....................................GFOwnDCDrawingPane
......WbApplication
............GFApplicationWindowES
..................GFDrawingView
..................GFFloatingPalette
......GFCursorManager
......GFEmptyRectangle
......GFPrintDialog
 
Object
......GFWidgetCreator
............GFButtonCreator
............GFEntryFieldCreator
............GFListPaneCreator
............GFTextEditCreator
......Message
............DirectedMessage
..................GFMessage
........................GFLocator
......Rectangle
............GFDamagedRegion
............GFQuadTreeElement
......RectangleFromUserWindow
Description of GF/ST Classes
In this section, we provide an alphabetically sorted list of all base GF/ST classes, together with a brief description of each. The descriptions should all be contained in the class COMMENT method, but you may find this alphabetical sort easier to use. We adhere to the ParcPlace commenting conventions in GF/ST, showing the kind of object expected in an instance variable in angle brackets (i.e., <>). Also, when we indicate that an object is an <Action>, we mean that it is a block or an EvaluableAction of some kind - anything that responds to the protocol of EvaluableAction. Like a block in Smalltalk, an EvaluableAction responds to value or more specifically for EvaluableActions, evaluate. See the class description in this section for more discussion.
ActionSequence
Superclass: Array
Subclasses: None
Description: An ActionSequence is a collection of EvaluableActions. ActionSequences respond to evaluate and return the result of the last EvaluableAction.
Instance Variables: None
Color
Superclass: Object
Subclasses: Varies by platform
Platform Specifics: Color is a base image class. Superclass is Object. The subclass RGBColor is supplied by GF/ST.
Description: Color class is provided only for compatibility and centralized, convenient accessing methods for accessing and instantiating colors. For example, Color red returns an appropriate object for each platform.
Instance Variables: None
ColorDialog
Superclass: Object
Subclasses: None
Platform Specifics: VA Smalltalk only
Description: The ColorDialog is a VA Smalltalk-only GF/ST-supplied dialog for displaying the color palette and allowing you to select a color. It is used from the Color class method pickAColor, which is invoked from various default menus.
Instance Variables: None
EvaluableAction
Superclass: Object
Subclasses: GFConstraint GFMultiheadedConstraint GFPositionConstraint
Instance Variables: None
Description: EvaluableAction is an abstract class whose subclasses understand action-type protocol, such as evaluate, evaluateWithArgumentsEvaluableAction is a simple shell class used to group together GF constraint classes and support coercion methods. Blocks, while somewhat interchangeable in terms of their utility with EvaluableActions, are more “expensive” to use.
Instance Variables: None.
GFAbsoluteTrackHandle
Superclass: GFSelectionTrackHandle
Subclasses: None
Description: GFAbsoluteTrackHandle is a specialization that operates with absolute mouse positions, rather than deltas from the previous mouse position.
Instance Variables: None
GFAbstractEndPlug
Superclass: Object
Subclasses: GFEvaluableActionEndPlug GFGoEndPlug
Description: The GFAbstractEndPlug is the abstract superclass for the two kinds of end plugs used at the ends of path GO’s. End plugs allow you to specify via an EvaluableAction or a GO what kind of GO should be placed at the end of a line-type graphic object, such as a GFLineGO.
Instance Variables:
connectionOffset - <Point | GFLocator> The connectionOffset is the offset from the displayPoint to where the line should start drawing itself from.
displayOffset - <Point | GFLocator> The displayOffset is the offset from the displayPoint to the origin of the graphicObject that is being used in the lineEndGOPlug.
displayPoint - <Point | GFLocator> The displayPoint is the point where the line end is located. It will normally be the start or stop point of the line for which the plug is going to be used.
GFAbstractPathGO
Superclass: GFGraphicObject
Subclasses: GFClosedPathGO GFLineGO GFPolylineGO
Description: The GFAbstractPathGO is the abstract path that models graphic objects based on paths. No instances are expected to be created of this class. The responsibilities of the class are related to the path color, width and style. The display methods in this class merely set the pen information correctly, without actually displaying anything.
Instance Variables:
width - <Integer> The width of the path
color - <Color> The color of the path
lineStyle - <Integer> The line style of the path
GFApplicationWindowES
Superclass: WbApplication
Subclasses: GFDrawingView GFFloatingPalette
Platform Specifics: VA Smalltalk only
Description: GFApplicationWindowES and WbApplication are “glue” classes for VA Smalltalk only,. They provide helper methods for the basic GF/ST Drawing Editor user interfaces.
GFBezierGO
Superclass: GFPolylineGO
Subclasses: None
Description: The GFBezierGO class represents a Bezier curve with two control points. The points of the class represent the approximation of the Bezier curve.
Instance Variables:
start - <Point> The start position
stop - <Point> The stop position
controlPoint1 - <Point> The control point, which together with the start point specifies the tangent to the curve at the start point.
controlPoint2 - <Point> The control point, which together with the end point specifies the tangent to the curve at the end point.
GFBoundedStack
Superclass: OrderedCollection
Subclasses: None
Description: The GFBoundedStack represents a stack that has a limit to how far it can grow. When this bound is reached, and new elements are added, the least recently added elements are discarded.
Instance Variables:
bound - <Integer | UndefinedObject> The limit of the number of elements stored. The bounded stack is a subclass of OrderedCollection, but elements should only be added to the stack by the method push:, not add:.
GFButtonCreator
Superclass: GFWidgetCreator
Subclasses: None
Platform Specifics: VA Smalltalk only
Description: The wrapper class for the CwPushButton which is displayed using a GFHostWidgetGO.
Instance Variables: None
GFButtonGO
Superclass: GFImageGO
Subclasses: None
Description: The GFButtonGO class wraps an image (or creates an image based on a GO) with a border, as specified by the selector held in borderSelector. It also knows how to create handles that will give the GO a “button-like” behavior when the action for the button is defined (use whenClickedSend:to: to define the clicked action). The GFButtonGO also has an offset that can be used for positioning where the image is displayed within the button border.
Instance Variables:
borderSelector - <Symbol> The selector that is sent to the pen to draw the appropriate border on the button.
centerOffset - <Point> The amount to offset the displaying of the image within the bounds of the button.
GFCachedGO
Superclass: GFGraphicObject
Subclasses: GFImageGO PsiAbstractObjectGO
Description: GFCachedGO represents a graphic object that caches its display with a Bitmap. This allows complicated graphics to be created once, and quickly displayed.
Instance Variables:
cache - <Bitmap | GFGraphicObject> Used to represent the display
origin - <Point> The origin of the graphic object
GFCategory
Superclass: Object
Subclasses: None
Description: The GFCategory represents a category of tools used by a palette.
Instance Variables:
icon - <Bitmap | Icon | Pixmap | CgPixmap> The visual representation of the category
name - <String> The textual name of the category
tools - <Array of: GFTool> The tools of the category
defaultTool - <GFTool> The default tool of the category
GFClosedPathGO
Superclass: GFAbstractPathGO
Subclasses: GFEllipseGO GFRectangleGO
Description: The GFClosedPathGO is an abstract class that models the common behavior and state of figures that are closed paths. The primary responsibility of this class is to keep track of the fill color used in the graphic object, and set up the pen correctly based on this information.
Instance Variables:
fillColor - <Color> The color to fill the closed area with.
GFCompositeGO
Superclass: GFGraphicObject
Subclasses: GFDrawing
Description: GFCompositeGO represents a composition of graphic objects. These GO’s may then be manipulated as a group, while maintaining the ability to manipulate individual GO’s contained within the grouping. The display of the contained GO’s is clipped to the visible area of the composite.
Instance Variables:
displayBox - <Rectangle> The cached display area
graphicObjects - <SortedCollection of: GFGraphicObject> Graphic objects sorted in Z order
visibleArea - <Rectangle> The clipping region
showVisibleArea - <Boolean> Determines whether to display the bounds of the visible area
GFConnectionHandle
Superclass: GFHandle
Subclasses: None
Description: GFConnectionHandle represents a manipulator used to connect two graphic objects.
Instance Variables:
findTargetAction - <Action> The action to be evaluated that finds the target graphic object. The action accepts two arguments, the GFDrawingInterface and the target point currently under the mouse point.
targetPositionAction - <Action> The action to be evaluated that returns the target position of the connection. The action accepts two arguments, the graphic object to be connected, and the target point under the mouse point.
connectAction - <Action> The action to be evaluated that produces a connection graphic object. The action accepts two arguments, the start location and the stop location.
locationGenerationAction - <Action> The action to be evaluated that produces a locator for the stop location. The action accepts two arguments, the graphic object, and the target point under the mouse point.
connectedAction - <Action> The action to be evaluated after the connection has been made. The action accepts two arguments, the connection produced by the connectAction, and the location produced by the locationGenerationAction.
GFConstraint
Superclass: EvaluableAction
Subclasses: None
Description: GFConstraint is a generic constraint mechanism. It simply evaluates an action when told to.
Instance Variables:
action - <EvaluableAction> The action to evaluate when the constraint is fired. The action takes no arguments.
observedObjects - <Array of: Object> The objects that the constraint is dependent upon.
GFCoordinateControl
Superclass: Object
Subclasses: None
Description: The GFCoordinateControl represents a coordinate system, and the behavior associated with it. The GFCoordinateControl uses the native coordinate system of the host system, and has methods for converting to and from the native coordinate system and the user defined coordinate system. The system also controls the setup of pens to allow WYSIWYG displays, scaling, etc.
Instance Variables:
logicalUnit - <GFLogicalUnit> The logical units of the pixels
origin - <Point> The origin of the defined coordinate system referenced to the native coordinate system
axisDirection - <Point> The sign change required to convert from the native coordinate systems axis to the defined coordinate system
scale - <Point> The multiplicative scale imposed on the system
extent - <Point> The extent of the native coordinate system
grid - <Point> The grid modulus
useGrid - <Boolean> Determines whether to snap points to the grid modulus
GFCreationTool
Superclass: GFTool
Subclasses: None
Description: GFCreationTool is used to create GFGraphicObjects.
Instance Variables:
className - <Symbol> The symbol of the class to create
creationSelector - <Symbol> The selector to send to the class
GFCursorManager
Superclass: Object
Subclasses: None
Platform Specifics: VA Smalltalk only
Description: A shell class that provides the common behavior to set the cursor and restore it when a set of expressions or block is done executing.
Instance Variables:
cursorConstant - <SmallInteger> The cursor constant which will be restored when a block is done executing.
GFDamagedRegion
Superclass: Rectangle
Subclasses: None
Description: GFDamagedRegion is a specialized rectangle to prevent the needless, and expensive creation of rectangles during damage operations
Instance Variables:
valid - <Boolean> Flag to signal whether the receiver contains a valid region or not.
GFDependentLineGO
Superclass: GFLineGO
Subclasses: None
Description: The GFDependentLineGO is used to represent a line GO whose position is constrained. This class only moves and updates it’s position by these constraints. This class knows how to transform itself into other dependent connection objects, such as GFDependentOrthogonalPathGO.
Instance Variables:
startConstraint - <GFPositionConstraint> The constraint that determines the start position
stopConstraint - <GFPositionConstraint> The constraint that determines the stop position
GFDependentOrthogonalPathGO
Superclass: GFOrthogonalPathGO
Subclasses: None
Description: The GFDependentOrthogonalPathGO is used to represent an orthogonal path GO whose position is constrained. This class only moves and updates its position by these constraints. This class knows how to transform itself into other dependent connection objects, such as GFDependentLineGO.
Instance Variables:
startConstraint - <GFPositionConstraint> The constraint that determines the start position
stopConstraint - <GFPositionConstraint> The constraint that determines the stop position
GFDirectedPathGO
Superclass: GFAbstractPathGO
Subclasses: GFLineGO GFPolylineGO
Description: The GFDirectedPathGO class is the abstract superclass of all path-type GO’s which have directionality; i.e., a start point and a stop point. Subclasses actually implement start point and end points according to the kind of GO they are, since it is awkward to let, for example, GFPolylineGO’s only hold onto the points in between the start and stop point which they could inherit from this class.
Instance Variables:
startPlug - <nil | Subclass of: GFAbstractEndPlug> - The end plug at the start point
stopPlug - <nil | Subclass of: GFAbstractEndPlug> - The end plug at the end point
GFDoubleBufferingGraphicsDisplaySystem
Superclass: GFGraphicsDisplaySystem
Subclasses: None
Description: GFDoubleBufferingGraphicsDisplaySystem provides the smooth double buffering display. It also consumes more resources.
Instance Variables:
pen - <GFPen | GFScalingPen | GFScalingGC> The pen or GC of the displayPane, depending on the platform
scratch - <GFScratchBitmap> The bitmap used for double buffering display
GFDrawing
Superclass: GFCompositeGO
Subclasses: None
Description: GFDrawing represents the top level of the display hierarchy. As such, it is responsible for maintaining the display of the components. One major difference between GFDrawing and all other GFGraphicObjects is that the container of the GFDrawing is the GFDrawingInterface operating on the drawing.
Instance Variables:
firstGO - <GFGraphicObject> The bottom of the z-order
lastGO - <GFGraphicObject> The top of the z-order
coordSystem - <GFCoordinateControl> The coordinate system
displayGrid - <Boolean> Determines whether to display the grid
gridColor - <Color> The color of the displayed grid
GFDrawingActionTool
Superclass: GFTool
Subclasses: None
Description: GFDrawingActionTool is used to perform actions on the drawing as a whole
Instance Variables:
activateBlock - <Action> The action to perform when activated
deactivateBlock - <Action> The action to perform when deactivated
GFDrawingInterface
Superclass: PsiEventModel
Subclasses: None
Description: GFDrawingInterface is the “glue” class that ties together the GF/ST framework. It is the central point used to manipulate a drawing and the display thereof. It ties together the drawing, the display, the tools and the handles used. Its primary responsibilities are the correct manipulation of the drawing, the handling and tracking of selections in the drawing, the management of handles, and selection of tools.
Instance Variables:
palette - <GFPalette> The palette of tools available to the interface
selections - <Collection of: GFGraphicObject> The currently selected graphic objects in the drawing
handles - <Collection of: GFHandle> The currently active handles
drawing - <GFDrawing> The drawing being manipulated
display - <GFGraphicsDisplaySystem> The display system used to display the drawing
hideHandles - <Integer> A count to ensure correct display of handles
memento - <GFBoundedStack> Used to hold the undo information
GFDrawingPane
Superclass: CwDrawingArea
Subclasses: GFOwnDCDrawingPane
Description: GFDrawingPane is the surface upon which the drawing is displayed. Its sole purpose in life is to correctly scroll, and pass on relevant events to the display system, which is the behavior model for the GFDrawingPane.
Instance Variables:
displaySystem - <GFGraphicsDisplaySystem> This is the model of the drawing pane.
scrollPoint - <Point> The amount to scroll in the x and y direction
pagePoint - <Point> The amount to page in the x and y direction
GFDrawingView
Superclass: GFApplicationWindowES (and WbApplication)
Subclasses: none
Description: GFDrawingView is the basic “Drawing Editor“. It is included as part of the base GF/ST framework because it is so useful for helping to develop new applications and test new GO’s. From a development standpoint, this class gives you what its name implies: a view of a drawing.
Instance Variables (VA Smalltalk):
interface - <GFDrawingInterface> The instance of GFDrawingInterface for the drawing
paletteWindow - <GFFloatingPalette> The floating palette for this Drawing Editor
gfView - <GFDrawingPane>
titleString - <String> The label
instDict - <Dictionary with key: String and value: CwWidget> A dictionary to hold instances of the child widgets used in the status bar
GFEllipseGO
Superclass: GFClosedPathGO
Subclasses: None
Description: The GFEllipseGO represents a graphic object of an ellipse. The class keeps track of the rectangle that represents the ellipse.
Instance Variables:
ellipse - <Rectangle> The rectangle that represents the major and minor axis
GFEmptyRectangle
Superclass: Object
Subclasses: None
Description: The GFEmptyRectangle lets us merge with another rectangle and respond with that rectangle. The merge operation is common in GF/ST. Rather than initialize an instance variable to a Rectangle with origin at 0@0 and no extent, we initialize empty rectangles to GFEmptyRectangles.
Instance Variables: None
GFEntryFieldCreator
Superclass: GFWidgetCreator
Subclasses: None
Platform Specifics: VA Smalltalk only
Description: The wrapper class for the CwText which is being displayed using a GFHostWidgetGO.
Instance Variables: None
GFEvaluableActionEndPlug
Superclass: GFAbstractEndPlug
Subclasses: None
Description: The GFEvaluableActionEndPlug lets you supply an arbitrary EvaluableAction to build the line ending appropriate for a path GO. For example, the arrow heads at the ends of lines are built using a GFEvaluableActionEndPlug. Look in the method GFDirectedPathGO>>endArrowPlug to see how the GFEvaluableActionEndPlug is used for arrow-type line endings.
Instance Variables:
action - <EvaluableAction> The action draws the end plug.
shapeAction - <EvaluableAction> The shapeAction draws the mask for the end plug.
extent - <Point | GFLocator> The extent of the end plug.
GFFastSelectionTool
Superclass: GFSelectionTool
Subclasses: None
Description: GFFastSelectionTool is a specialization used to move graphic objects by displaying their outlines, rather than redrawing every movement.
GFFocusTool
Superclass: GFSelectionTool
Subclasses: None
Description: GFFocusTool is a specialization that disallows the selection of groups of graphic objects
GFGC
Superclass: CgGC
Subclasses: GFTranslatingGC
Platform Specifics: VA Smalltalk only
Description: The GFGC class is an abstract superclass to supports platform-independent protocols for GF/ST graphics contexts and caching of colors.
Instance Variables:
position - <Point>
pixelValueCache - <Dictionary with key: CgRGBColor value: CgRGBColor> A dictionary that maps instances of CgRGBColor to the closest matching CgRGBColor in the palette.
pixmap - <KindOf: CgDrawable> - The drawable for the GC.
fillColor <CgRGBColor> - The fill color used for filled GO’s
GFGOActionTool
Superclass: GFTool
Subclasses: None
Description: GFGOActionTool is used to perform arbitrary actions on selected graphic objects.
Instance Variables:
actionBlock - <Action> The action to evaluate on the selections
GFGoEndPlug
Superclass: GFAbstractEndPlug
Subclasses: None
Description: The GFGoEndPlug lets you supply an arbitrary graphic object as the line ending appropriate for a path GO. For examples and graphically displayed documentation, see the following class methods in GFDrawingInterface: rectangleLineEndExample, triangleLineEndExample, and circleLineEndExample.
Instance Variables:
go - <KindOf: GFGraphicObject> The GO which is used as the end plug
GFGraphicObject
Superclass: PsiEventModel
Subclasses: GFAbstractPathGO GFCachedGO GFCompositeGO GFHostWidgetGO GFTextGO
Description:
The GFGraphicObject represents the abstract behavior of all graphic objects. Since the class is an abstract class, no instances are ever created. GFGraphicObjects can display themselves using a pen, generate handles, etc. Every graphic object has a container. Graphic objects are kept in a linked list in the containing drawing (the root of the display hierarchy) in z-order. The head of the linked list is the bottom of the display, and the last GO in the list is at the top of the display.
All graphic objects are described in what is known as the native coordinate system. This coordinate system is set up depending on the platform. On all platforms and windowing systems this coordinate system is set up with 0@0 in the upper left corner of the surface with the x axis increasing to the right, and the y axis increasing downward. All points that graphic objects use must be integers, and cannot be negative values.
Rather than impose a heavyweight coordinate system on each graphic object, the framework relies on the drawing which contains the GO’s to supply a coordinate system. Therefore, GFGraphicObject supplies a protocol for converting between the native coordinate system and the actual coordinate system (user coordinate system). The default coordinate system is isomorphic to the native coordinate system. For more information on the coordinate system used, see the class GFCoordinateControl. When manipulating coordinate systems, you have to be very careful. It’s easy to get confused as to what coordinate system a point is defined in, as the point itself has no knowledge of this, nor should it. Points are always interpreted relative to a coordinate system, and you have to know which coordinate system you’re referencing when using a point. Be warned.
Instance Variables:
container - <KindOf: GFGraphicObject> The container of the graphic object.
prev - <KindOf: GFGraphicObject> The figure that is behind me in Z-Order.
next - <KindOf: GFGraphicObject> The figure that is in front of me in Z-Order.
Protocol Categories: (Partial List)
Display
displayWith:
displayWith:at:
displayWith:window:
displayShapeWith:
displayShapeWith:at:
redraw
willDamage
willDamage:
damaged
damaged:
Hit Testing
containedBy:
containsPoint:
intersects:
graphicObjectAt:
Coordinate Mapping
coordinateToNative:
nativeToCoordinate:
Utility
absolute:
align:with:
disableDefaultInteraction
disableHandles
disableMenu
disablePressHandle
enableDefaultInteraction
enableHandles
enableMenu
enablePressHandle
offCenter:
offCorner:
offOrigin:
relative:
Accessing
bottom
bottomCenter
bottomLeft
bottomRight
boundingBox
center
container
corner
displayBox
extent
grid
gridPoints
left
leftCenter
locator
metaObject
origin
right
rightCenter
top
topCenter
topLeft
topRight
Positioning
translateBy:
translateTo:
snapToGrid
Handles
generateHandles
generatePressHandle
GFGraphicsDisplaySystem
Superclass: Object
Subclasses: GFDoubleBufferingGraphicsDisplaySystem
Description: GFGraphicsDisplaySystem is the model of the display system for GF/ST. It coordinates the display of the interface, scrolling action, mouse tracking action, etc. In the great tradition of models, this is the model for the GFDrawingPane. All the action happens here.
Instance Variable
displayPane - <GFDrawingPane> The host object used to display
interface - <GFDrawingInterface> The interface connected
damagedRegion - <GFDamagedRegion> The region currently damaged
mousePoint - <Point> The current point
minFactor - <Point> Minimum factor used to prevent round off errors
visibleArea - <Rectangle> The visible scrolling area
hostActions - <OrderedCollection of: Action> Actions to evaluate for host widget display
GFGroupGO
Superclass: GFImageGO
Subclasses: None
Description: GFGroupGO represents the grouping of graphic objects in a drawing. The figures cannot be manipulated individually, and their representation may be cached by a bitmap.
Instance Variables:
graphicObjects - <IndexedCollection of: GFGraphicObject> The components
cacheFlag - <Boolean> Determines whether the display is cached or not
hostWidgets - <IndexedCollection of: GFHostWidgetGO> Special handling for host widgets
GFHandle
Superclass: Object
Subclasses: GFConnectionHandle GFTrackHandle
Description: GFHandle represents a manipulator on a GFGraphicObject that responds to mouse input. GFHandles know how to display themselves, give a description of their function, find out where they are located, generate mementos, and whether or not to snap the mouse point to the grid of the drawing or limit the mouse point to the drawing’s extent.
Instance Variables:
description - <String> A short description of the handle
releaseAction - <Action> The action to be performed when the handle is released
mementoType - <Symbol> The type of memento generated by changes
displayGO - <GFGraphicObject> The graphic object used to (optionally) display the handle
snapToGrid - <Boolean> Flag to snap the mouse point to the grid of the drawing
limit - <Boolean> Flag to limit the mouse point to the extent of the drawing
GFHostWidgetGO
Superclass: GFGraphicObject
Subclasses: None
Description: GFHostWidgetGO is the graphic object representation of host operating system widgets. The major difference between regular GO’s and host widget GO’s is that host widgets are always in the foreground. You can’t overlap them with graphic objects. This is a fundamental limitation that doesn’t appear to be solvable. However, any suggestions, solutions you might have, please forward them to Instantiations. Also, because we can’t really control the drawing of host GO’s as efficiently as regular GO’s, they flash noticeably when displayed. The support provided is pretty basic. This class is really a proof of concept, and a skeleton of what is needed to supply this kind of support under GF/ST. Note that GFHostWidgetGO’s host window system widgets.
Instance Variables:
area - <Rectangle> The rectangle that represents the visible area of the widget
hostWidget - <Window> The host component
GFHundredthMillimeter
Superclass: GFLogicalUnit
Subclasses: None
Description: GFHundredthMillimeter represents logical units measured in 100ths of a millimeter. This class is a stop gap until real units are implemented (That means a major overhaul of Number, Point, and Rectangle arithmetic).
Instance Variables: None
GFImageGO
Superclass: GFCachedGO
Subclasses: GFButtonGO GFGroupGO
Description: GFImageGO represents an image (Bitmap or Icon). The image is stretched to fit the desired area.
Instance Variables:
extent - <Point> The extent of the displayed region
GFLineGO
Superclass: GFDirectedPathGO
Subclasses: GFDependentLineGO
Description: The GFLineGO class represents the graphic object of a line.
Instance Variables:
start - <Point> The start position of the line
stop - <Point> The stop position of the line
GFListPaneCreator
Superclass: GFWidgetCreator
Subclasses: None
Platform Specifics: VA Smalltalk only
Description: The wrapper class for the CwList which is being displayed using a GFHostWidgetGO.
Instance Variables:
list - <OrderedCollection of: String> The initial list displayed in the CwList.
GFLocator
Superclass: Message
Subclasses: None
Description: The GFLocator class is a Message that evaluates to a point. Some specialized methods for copying and instance creation are provided. Other than that, it’s just a Message.
Instance Variables: None
GFLogicalUnit
Superclass: Object
Subclasses: GFHundredthMillimeter GFThousandthInch GFTwip
Description: GFLogicalUnit is a stop gap measure until real units are implemented.
Instance Variables:
resolution - <Number>
GFMemento
Superclass: Object
Subclasses: None
Description: GFMemento allows for the recording of state information while trying to preserve encapsulation. It should only be created via one of the #originator:state: variants. GFMemento will only allow access to the type and state information if the conditions for allowing access are met. Those conditions are: if a key symbol is provided, the originator and the object requesting the information must respond to the symbol in an = test. If the key is nil, then the requesting object must be == to the originator.
Instance Variables:
type - <Symbol | nil> Should be a selector that the restoring object will understand. If a type is specified, it is used as a selector sent to the restoring object with state as the parameter. An example of this would be if state was a Point, and the restoring object was a Rectangle, and type was #extent:. Given this setup, when the memento is restored, the restoring object (a Rectangle) is told to perform #extent: with the point as the argument.
state - <OrderedCollection of: Message> When type is not nil, the restoring object is told there to perform the type selector with state as the argument. When type is nil, state is an OrderedCollection of Messages which are evaluated in order.
GFMultiheadedConstraint
Superclass: EvaluableAction
Subclasses: None
Description: GFMultiheadedConstraint is used to implement a constraint with multiple sources.
Instance Variables:
sources - <Array of: Object> These are the sources of the constraint.
sink - <Object> This is the target of the constraint
action - <EvaluableAction> This is the action to be evaluated that implements the constraint. It takes two arguments, the first being the sources, the second being the sink.
selector - <Symbol> This is the selector of the message that the sink performs to enforce the constraint. The selector takes one argument, which is the result of evaluating the action.
GFOpaqueBitmap
Superclass: GFPixmap
Subclasses: None
Description: GFOpaqueBitmap is a bitmap that allows transparency (see-through areas). It is used in GFGroupGO’s.
Instance Variables: None
GFOrthogonalPathGO
Superclass: GFPolylineGO
Subclasses: GFDependentOrthogonalPathGO
Description: The GFOrthogonalPathGO class represents the shortest orthogonal path between two points. These paths must have a start direction and a stop direction. These directions are encoded with integers, codified in the class variables: Bottom, Left, Right, Top. Any reference to these directions should be made from the accessing methods for these directions on the class.
Instance Variables:
start - <Point> The start position of the path
stop - <Point> The stop position of the path
startDirection - <Integer> The direction from which the path originates
stopDirection - <Integer> The direction from which the path terminates
GFOwnDCDrawingPane
Superclass: GFDrawingPane
Subclasses: None
Description: The GFOwnDCDrawingPane is just a GFDrawingPane with its own device context, something which is necessary for double-buffering. It uses a GFDoubleBufferingGraphicsDisplaySystem as its model.
Instance Variables: None
GFPalettePane
Superclass: GroupPane
Subclasses: None
Description: GFPalettePane is the view of a palette of tools or categories. It can resize itself depending on the number of icons in the display
Instance Variables:
buttonPressed - <Integer> The index of the current button pressed.
selectedTool - <Integer> The index of the currently selected tool.
tools - <Array of: GFCategory or GFTool> The tools being displayed.
toolsRects -<Array of: Rectangle> The bounding boxes of the tools.
colors - unused.
toolsBitmap - <Bitmap> The cached display of the tools displayed.
GFParameterizedTrackHandle
Superclass: GFTrackHandle
Subclasses: None
Description: GFParameterizedTrackHandle is a specialization that allows an invariant parameter to be passed to the change action, which now accepts two arguments.
Instance Variables:
changeParameter - <Object> The object to be passed to the change action along with the result of the sense action
GFPixmap
Superclass: CgPixmap
Subclasses: None
Description: This class implements the modifications to the platform-specific superclass, primarily to handle issues associated with scaling.
Instance Variables:
pen - <GFScalingPen | GFScalingGC> The scaling pen or graphics context used to render the pixmap
GFPolylineGO
Superclass: GFDirectedPathGO
Subclasses: GFBezierGO GFOrthogonalPathGO GFSplineGO
Description: The GFPolylineGO represents graphic objects composed of multiple, connected line segments.
InstanceVariables:
points - <IndexedCollection> The points that define the line segments
origin - <Point> The origin of the display area defined by the line segments
extent - <Point> The extent of the display area defined by the line segments
closed - <Boolean> Whether the line segments form a closed path or not
fillColor - <Color> The fill color to use if closed
GFPositionConstraint
Superclass: EvaluableAction
Subclasses: None
Description: GFPositionConstraint is an action that, when evaluated, enforces a constraint of position.
Instance Variables:
receiver - <GFGraphicObject> This is the object whose position is constrained.
locator - <GFLocator> This is the locator of the constraint, which provides the constraint point.
settingMessage - <Symbol> This is the selector the receiver performs to implement the constraint. The argument of this message is the point provided by the locator.
GFPrintDialog
Superclass: Object
Subclasses: None
Platform Specifics: VA Smalltalk only
Description: The GFPrintDialog is a simple class used to coordinate potentially multi-page printing of drawings with the standard printer shell facilities of VA Smalltalk. It coordinates callbacks from the printer shell. The skeleton for the approach in this class was lifted from pages 314-316 in the IBM Smalltalk Programmer’s Reference V3.0.
Instance Variables:
done - <Boolean> Set to true when done
gc - <CgGC> The graphics context for the printer shell window
printTarget <GFDrawing> - The drawing to be printed
GFPrinterPen
Superclass: Pen
Subclasses: None
Description: A GFPrinterPen is a specialization of Pen used for GF/ST. The specializations allow for the correct printing of Bitmaps.
Instance Variables: None
GFPrintingGC
Superclass: GFScalingGC
Subclasses: None
Platform Specifics: VA Smalltalk only
Description: The GFPrintingGC is a specialization of the GFScalingGC used for printing. It ensures proper rounding of point values and bypasses the cache of pixelValueForColor.
GFQuadTreeElement
Superclass: Rectangle
Subclasses: None
Description: GFQuadTreeElement represents a node in a Quad Tree. A Quad Tree organizes its elements by area, and therefore can efficiently access information by point queries, or by area queries. The class is not as general as it could be, and is highly specialized for use by GFDrawing.
Instance Variables:
upperL - <GFQuadTreeElement> The upper left child
upperR - <GFQuadTreeElement> The upper right child
lowerL - <GFQuadTreeElement> The lower left child
lowerR - <GFQuadTreeElement> The lower right child
leafData - <Set> The collection of elements held by the tree
extent - <Point> The cached extent
GFRectangleGO
Superclass: GFClosedPathGO
Subclasses: GFRoundedRectangleGO
Description: The GFRectangleGO class represents the graphic object of a rectangle.
Instance Variables:
rectangle - <Rectangle> The rectangle
GFRoundedRectangleGO
Superclass: GFRectangleGO
Subclasses: None
Description: The GFRoundedRectangleGO class represents the graphic object of a rectangle that has rounded corners.
Instance Variables:
ellipse - <Point> The point describing the ellipse used to generate the rounded corners
GFScalingGC
Superclass: GFTranslatingGC
Subclasses: GFPrintingGC
Platform Specifics: VA Smalltalk only
Description: The GFScalingGC class adds scaling capabilities to the GFTranslatingGC by caching a scale factor and applying it in pixel and point transformations. It also caches font information.
Instance Variables:
scale - <Number> The scale factor applied to transformations
cachedFonts - <IdentityDictionary with key: (CgFont | CgFontStruct) and value: (CgFont | CgFontStruct)> An IdentityDictionary used to map the unscaled font to the closest matching scaled font or font struct
GFScratchPixmap
Superclass: GFPixmap
Subclasses: None
Platform Specifics: VA Smalltalk only
Description: The GFScratchPixmap is used for double-buffering in the GFGraphicsDisplaySystem. It uses a GFTranslatingGC as its pen, rather than a GFGC.
Instance Variables: None
GFSelectionTool
Superclass: GFTool
Subclasses: GFFastSelectionTool GFFocusTool
Description: GFSelectionTool is used to select, and manipulate graphic objects.
Instance Variables: None
GFSelectionTrackHandle
Superclass: GFTrackHandle
Subclasses: GFAbsoluteTrackHandle
Description: GFSelectionTrackHandle is a specialization that operates on the selections of a drawing as a whole, rather than on an individual basis.
Instance Variables: None
GFSplineGO
Superclass: GFPolylineGO
Subclasses: None
Description: The GFSplineGO represents the approximation of a spline function. The points of the class represent the line segments of this approximation.
Instance Variables:
controlPoints - <IndexedCollection of: Point> The control points of the spline
derivatives - <IndexedCollection of: Number> The derivatives at each knot
GFTextEditCreator
Superclass: GFWidgetCreator
Subclasses: None
Platform Specifics: VA Smalltalk only
Description: The wrapper class for the CwText which is displayed using a GFHostWidgetGO.
Instance Variables: None
GFTextGO
Superclass: GFGraphicObject
Subclasses: None
Description: GFTextGO represents a single line of text in a drawing.
Instance Variables:
box - <Rectangle> The box that exactly surrounds the text.
color - <Color> The color of the text.
font - <Font> The font used for text display.
text - <String> The text displayed by the GO.
GFThousandthInch
Superclass: GFLogicalUnit
Subclasses: None
Description: GFThousandthInch represents logical units measured in 1000ths of an inch. This class is a stop gap until real units are implemented (That means a major overhaul of Number, Point, and Rectangle arithmetic).
Instance Variables: None
GFTool
Superclass: Object
Subclasses: GFCreationTool GFDrawingActionTool GFGOActionTool GFSelectionTool
Description: GFTool represents the mode of interaction with the drawing. It receives all the user input, filters it, and determines who to send the input to (whether to the selections, or the handles), and can perform actions on its own. It is a relatively simple class, but without it, representation of the current mode of interaction would be extremely hard to model.
Instance Variables:
icon - <Icon> The icon that represents the tool.
cursor - <CursorManager> The cursor used by the tool.
interface - <GFDrawingInterface> The interface the tool is for.
name - <String> The textual description of the tool.
GFToolPalette
Superclass: PsiEventModel
Subclasses: None
Description: The GFToolPalette is a non-visual class that represents the notion of a palette of tools. The tools are held in categories. When a tool is activated, it becomes the ‘activeTool’, and when a category is activated, it becomes the ‘activeCategory’. The GFToolPalette can be displayed in a GFFloatingPaletteWindow; however, you can use a GFToolPalette in your application to help organize and track tool selections without using the other class.
Instance Variables:
activeTool - <GFTool> The currently active tool.
activeCategory - <GFCategory> The currently active tool category.
categories - <OrderedCollection of: GFCategory> Holds the available categories that can be selected.
GFTrackHandle
Superclass: GFHandle
Subclasses: GFParameterizedTrackHandle GFSelectionTrackHandle
Description: GFTrackHandle represents direct manipulation action that tracks mouse movement. When the mouse position is changed, the sense action is evaluated with the delta point of this change. The result of this action is then sent to the change action.
Instance Variables:
sense - <Action> An action evaluated with the delta point of the mouse movement. If there is no target for this action, the owner of the handle is used. If no sense action is defined, the result of the sense is the delta point.
change - <Action> An action evaluated with the result of the sense action. If the change has no target, the GO selected is used as the target of the action.
scrollFlag - <Boolean> Determines whether to scroll the display to track the mouse.
GFTranslatingGC
Superclass: GFGC
Subclasses: GFScalingGC
Platform Specifics: VA Smalltalk only
Description: The GFTranslatingGC tracks and accounts for the offset used for drawing operations, since the drawing size can exceed the displayable area shown on the screen.
Instance Variables:
offset - <Point> The display offset used for drawing operations
GFTwip
Superclass: GFLogicalUnit
Subclasses: None
Description: GFTwip represents logical units measured in 1440ths of an inch. This class is a stop gap until real units are implemented (That means a major overhaul of Number, Point, and Rectangle arithmetic).
Instance Variables: None
GFWidgetCreator
Superclass: Object
Subclasses: GFButtonCreator GFEntryFieldCreator GFListPaneCreator GFTextEditCreator
Platform Specifics: VA Smalltalk only
Description: The GFWidgetCreator class is an abstract class. It supports common protocol for the wrapper classes that are used to wrap specific host widgets displayed by the GFHostWidgetGO under VA Smalltalk.
Instance Variables:
widget - <KindOf: CwWidget> The widget
labelString - <String> The label for the widget, specific uses of which are subclass dependent
rectangle - <Rectangle> The rectangle specifying the widget x, y, width, and height
framingBlock - Not used at present.
fontList - <CwFontList> The font list for the widget
attributeAction - <Action> An action which can be evaluated with the widget as the argument to specify its attributes
PsiEventModel
Superclass: Object
Subclasses: GFDrawingInterface GFGraphicObject GFToolPalette
Description: PsiEventModel is the abstract superclass of all GFGraphicObjects and other classes in GF/ST. It tracks event handlers using its own event table instead of the class variable in Object. In this way, we can depend on garbage collection to clean up events when a GO is no longer referenced by anyone. Without this approach, you would be forced to send the #release message to all GO’s when you were done with them, and efficiency would be compromised.
Instance Variables:
eventTable - <IdentityDictionary with key: Symbol and value: ActionSequence> Holds the equivalent of the class variable Dependents in Object. When you triggerEvent: aSymbol, the ActionSequence for aSymbol is evaluated.
RectangleFromUserWindow
Superclass: Object
Subclasses: None
Platform Specifics: VA Smalltalk only
Description: The RectangleFromUserWindow implements the behavior necessary to prompt the user for an area of the screen from which to obtain a GFPixmap. This behavior is present in other Smalltalks in the standard fromUser method implemented in Image or other classes.
Instance Variables:
shell - <CwTopLevelShell> The shell
main - <CwMainWindow> The main window
trackingState - <Symbol> Either #tracking or #done
startPoint - <Point> The point where tracking initiates
cornerPoint - <Point> The point where tracking is done
gc - <CgGC> The graphics context
Summary of Events
Many GF/ST classes, including GFGraphicObject and GFDrawingInterface, are subclasses of PsiEventModel. These classes always inherit all events from their superclass via the eventsTriggered class method. The list below summarizes the events which are added at each level of the PsiEventModel hierarchy.
PsiEventModel
changed
changed:
GFDrawingInterface
getMenu
handleInvoked
mousePointChanged
noHandleInvoked
resizeVisibleArea
select
GFGraphicObject
attributeState
button1DoubleClick
damaged
deselect
generateHandles
getMenu
getMetaObject
needsPositionHandle
positionState
releasing
select
translate
GFAbstractPathGO
GFClosedPathGO
GFEllipseGO
resize
GFRectangleGO
resize
GFRoundedRectangleGO
GFDirectedPathGO
GFLineGO
moveEnd
moveStart
GFDependentLineGO
GFPolylineGO
resize
rotate
GFBezierGO
moveEnd
moveStart
GFOrthogonalPathGO
moveEnd
moveStart
GFDependentOrthogonalPathGO
GFSplineGO
GFCachedGO
resize
GFGroupGO
GFImageGO
GFButtonGO
GFCompositeGO
resetVisibleArea
resize
GFDrawing
damageRegion
redraw
GFHostWidgetGO
resize
GFTextGO
GFToolPalette
addedCategory
addedToolToCategory
removedCategory
removedToolFromCategory
selectCategory
selectTool
Events Explained
From the hierarchy given above, you can see what classes and their subclasses will trigger events. The table below summarizes the events by name, indicating the condition that causes the event to be triggered.
 
Event Description
addedCategory
A GFCategory was added to a GFToolPalette.
addedToolToCategory
A GFTool was added to a GFCategory in a GFToolPalette.
attributeState
An undo operation requested attribute information. Handlers of this event must return the attribute state information for the attribute GFMemento to be put on the undo stack.
 
Event Description
button1DoubleClick
A left mouse button double-click was performed with the mouse positioned on a GO.
changed
Retained for compatibility with the standard changed-update dependency mechanism in Object.
changed:
Retained for compatibility with the standard changed-update dependency mechanism in Object.
damaged
Triggered when a GO has damaged its area or changed its state in some way.
damageRegion
Triggered when a particular area of a drawing will be damaged.
deselect
Triggered when a GO has been deselected.
generateHandles
Triggered when a GO requires handles. Handlers of this event must return a collection of GFHandles for the GO.
getMenu
Triggered when a GO requires a menu (i.e., when the user pops up a menu via the right mouse button). Handlers of this event must return an instance of Menu.
getMetaObject
Triggered when you send #metaObject to a GO. Handlers of this event must return an object which is the metaObject for the GO (i.e., typically a domain model of some kind).
 
Event Description
handleInvoked
Triggered when you invoke a handle by clicking on it. Can be used to provide help in a status bar, as in the Drawing Editor.
mousePointChanged
Triggered by a GFDrawingInterface when you move the mouse position. Can be used to provide feedback on mouse position, as in the Drawing Editor.
moveEnd
Triggered by a GFLineGO when the ending position changes.
moveStart
Triggered by a GFLineGO when the starting position changes.
needsPositionHandle
Triggered by a GO when the user is going to move it. Handlers must return an instance of GFHandle. Default handling uses a GFSelectionTrackHandle to position the GO.
noHandleInvoked
Triggered when no handles are invoked for the GO; i.e., when no handle operations are ongoing. Can be used to know when to clear help information from a status pane.
positionState
An undo operation requested position information. Handlers of this event must return the position state information for the position GFMemento to be put on the undo stack.
redraw
Triggered when a drawing will be redrawn.
releasing
Triggered when a GO is released; i.e., at the beginning of the #release method.
 
Event Description
removedCategory
Triggered when a GFCategory was removed from a GFToolPalette.
removedToolFromCategory
Triggered when a GFTool was removed from a GFCategory.
resetVisibleArea
Triggered when a GFCompositeGO (or which a GFDrawing is one) has changed in a manner that causes the visible area to change (e.g., via scrolling or resizing).
resize
A GO was resized.
rotate
A GFPolylineGO was rotated.
select
A GO was selected.
selectCategory
Triggered when a GFCategory is selected in a GFToolPalette.
selectTool
Triggered when a GFTool is selected in a GFCategory of a GFToolPalette.
translate
A GO was moved.
 
 
Last modified date: 10/02/2020