TAPenImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Rick Beach, June 27, 1982 12:29 pm
Rick Beach, February 9, 1985 9:24:33 pm PST
DIRECTORY
NodeStyle USING [Ref],
TAPen,
TAPrivate,
TAStyle;
TAPenImpl: CEDAR PROGRAM
IMPORTS TAPrivate, TAStyle
EXPORTS TAPen = {
OPEN TAPen;
EstablishPen: PUBLIC PROCEDURE[nodeStyle: NodeStyle.Ref] = {
SELECT TAStyle.GetPenStyle[nodeStyle] FROM
Round => {
TAPrivate.PushReal[TAStyle.GetLineWeight[nodeStyle]];
TAPrivate.RoundPen[]};
Square => {
TAPrivate.PushReal[TAStyle.GetLineWeight[nodeStyle]];
TAPrivate.PushReal[TAStyle.GetLineWeight[nodeStyle]];
TAPrivate.PushReal[TAStyle.GetPenSlant[nodeStyle]];
TAPrivate.RectangularPen[]};
Rectangular => {
lineWeight: REAL ← TAStyle.GetLineWeight[nodeStyle];
penWidth: REAL ← TAStyle.GetPenWidth[nodeStyle];
penHeight: REAL ← TAStyle.GetPenHeight[nodeStyle];
a: REAL ← penWidth/MAX[penWidth, penHeight]*lineWeight;
b: REAL ← penHeight/MAX[penWidth, penHeight]*lineWeight;
TAPrivate.PushReal[a];
TAPrivate.PushReal[b];
TAPrivate.PushReal[TAStyle.GetPenSlant[nodeStyle]];
TAPrivate.RectangularPen[]};
Italic => {
TAPrivate.PushReal[TAStyle.GetLineWeight[nodeStyle]];
TAPrivate.PushReal[TAStyle.GetPenSlant[nodeStyle]];
TAPrivate.ItalicPen[]};
Elliptical => {
lineWeight: REAL ← TAStyle.GetLineWeight[nodeStyle];
penWidth: REAL ← TAStyle.GetPenWidth[nodeStyle];
penHeight: REAL ← TAStyle.GetPenHeight[nodeStyle];
a: REAL ← penWidth/MAX[penWidth, penHeight]*lineWeight;
b: REAL ← penHeight/MAX[penWidth, penHeight]*lineWeight;
TAPrivate.PushReal[a];
TAPrivate.PushReal[b];
TAPrivate.PushReal[TAStyle.GetPenSlant[nodeStyle]];
TAPrivate.EllipticalPen[]};
ENDCASE => ERROR;
};
}.