Visibility Color Latest Additions - Version 5.5 [1.0.3]

New Drawing Widgets

The following new objects have been added to the list of available items:

VisibilityDecimalTextObject

VisibilityDashedLineObject

Visibility3dBoxObject

VisibilityEllipseObject

VisibilityShadowBoxObject

Widget Constructor Methods

VisibilityDecimalTextObject

Strictly speaking, this object has no new constructor methods because it is a sub class of VisibilityTextObject. It provides for alignment on the decimal point. Because it is sub classed from the standard text object it still responds to the standard justification tokens: ##l, ##r and ##c. It also implements ##d which causes the test to align on the decimal point. Because not all countries use a full stop as a decimal point, the character it uses is defined as Locale new lcMonetary monDecimalPoint. This provides a non-location specific function.

VisibilityDashedLineObject

This object is sub classed from VisibilityLineObject. It provides the facility to define more aspects of a line than was previously allowed. You can now define the following extra attributes:

The following is an excerpt from the IBM Smalltalk Programmer's Reference Manual

GCLineStyle specifies how a line should be drawn. Dash pattern is specified using a dash list (see "dashes" below) LineSolid (foreground color)

LineOnOffDash (foreground color)

LineDoubleDash (fore- and background color)


sp006015

GCCapStyle specifies how a line should be ended CapNotLast
CapButt
CapRound
CapProjecting

sp006020

CGJoinStyle specifies how two lines should be joined JoinMiter


JoinRound


JoinBevel


sp006025

There is also a dashes attribute which is defined in the IBM Smalltalk Programmer's Reference Manual as follows

dashes specifies the lengths of segments in the dash list Array of integers specifying the length of each dash in number of pixels
sp006055

The array takes a form as in the following examples (not exaustive): #(4 4), #(2 4 8), #(12 8 4 8) or #(12 4 4 4 4).

The new methods are:

#newDashedLineFor:width where:where whereEnd:whereEnd color: color dashStyle: dashStyle narrative: aNarrative

# newDashedLineFor:width where:where whereEnd:whereEnd color: color narrative: aNarrative
    This method does the same as the previous method except that it defaults the dash style to #(4 4).

Visibility3dBoxObject

This is a sub class of VisibilityBoxObject. It adds the ability to show a box as a 3d object. There is an additional parameter (wOffset) which defines the depth of the 3d element. There is a new constructor method to do this:

#newFor:width where:where whereEnd:whereEnd filled:filled color:color wOffset: wOffset narrative: aString

wOffset is defined in the same manner as all other measurements in Visibility either as a pixel number directly or a system calculated pixel number scaled from the standard 600dpi number provided using the built in adjustX: method.

#VisibilityShadowBoxObject

This is a sub class of VisibilityBoxObject. It adds the ability to show a box with a shadow behind. There is an additional parameter (sWidth) which defines the width of the shadow. There is a new constructor method to do this:

#newFor:width where:where whereEnd:whereEnd filled:filled color:color sWidth:sWidth narrative: aString

wOffset is defined in the same manner as all other measurements in Visibility either as a pixel number directly or a system calculated pixel number scaled from the standard 600dpi number provided using the built in adjustX: method.

 

VisibilityEllipseObject

This is a new class derived from the basic print object. It has two constructors:

#sliceFor:width rMajor: r1 rMinor: r2 where:where angle1: d1 angle2: d2 filled:filled color: color narrative: aString

This method produces a full ellipse if angle1 is set to 0 and angle2 is set to 360. Otherwise, angle1 rotates the ellipse around its centre point and angle2 defines the amount of the ellipse to be drawn. rMajor and rMinor define the two radii. 

#newFor:width rMajor: r1 rMinor: r2 where:where filled:filled color: color narrative: aString

This method forces a full ellipse. To achieve this, angle1 is defaulted to 0 and angle2 is defaulted to 360.

Changes to existing objects

The following changes have been made to existing objects:

VisibilityTextObject

This has a new facility to enable rotation of text. There is a new constructor:

#newFor:aLine where:where justification:aJustification font:font color:color narrative: aString angle: anAngle

where anAngle can be one of the following

Narrative

All objects now have a narrative attribute. This is the ideal place to note the purpose of an individual object when constructing complex pages. This narrative is used when the new debugging mode is set to on. To retain backwards compatibility all previously supplied constructors default the narrative to an empty string.

VisibilityLineAttributes

Line Attributes: There is a new object VisibilityLineAttributes (described in full later) that provides a holder for all the attributes associated with drawing a line. This is to simplify the constructors when building the new dashed lines and lines (dashed or otherwise) with arrowheads. VisibilityLineObject has a new constructor #newForAttributes: which takes an instance of VisibilityLineAttributes and uses the information within that to construct the line.

VisibilityLineAttributes has the following attributes defined:

These all have definitions that existed in previous versions or have been defined earlier in this document.

The following are its constructors:

#newFor: lineWidth capStyle: capStyle joinStyle: joinStyle dashStyle: dashStyle location: aLocation color: aColor arrowHead: showArrow narrative: aNarrative
#newWithBothArrowFor: lineWidth capStyle: capStyle joinStyle: joinStyle dashStyle: dashStyle location: aLocation color: aColor narrative: aNarrative
#newWithEndArrowFor: lineWidth capStyle: capStyle joinStyle: joinStyle dashStyle: dashStyle location: aLocation color: aColor narrative: aNarrative
#newWithStartArrowFor: lineWidth capStyle: capStyle joinStyle: joinStyle dashStyle: dashStyle location: aLocation color: aColor narrative: aNarrative

These constructors enable you to define a line in all its glory. Note that there is an arrowHead attribute in the first, generic constructor, whilst the following three define the arrow head directly. It is possible to have an arrow head on either or both ends of the line and for the line to be dashed with arrow heads.

Previewing Objects

One major change to the functionality is the ability to see a preview before printing. There are two ways to acheive this:

  1. To use the provided method within VisibilityPrint. Normally one prints a page by calling printDoc:. If you use previewDoc: then a window will open instead of a print operation being carried out.
  2. Use the provided VisPrintPreviewWidget which has a series of callbacks and methods which enable you to add the widget to your own windows
  3. Use the provided VisPrintPreviewTestWindow in VisPrintPreviewTestApp application. This has a fully constructed window that provides for scaling of the view, paging between pages and then printing either all or one of those pages.

Because of time constraints, please refer to the items mentioned above for guidance on the use of these until we release the final documentation which will describe these activities in full.

Landscape/Portrait Switch with a print job

Normally, Windows programs are only able to print a document using either portrait or landscape but not both. (MS Word does manage it but we assume that the Microsoft programmers know more that others about such things). However, because of the abilities that come from being able to rotate text, Visibility can now rotate a whole page before printing. This means that, although the print job is set to portrait, some pages can be printed in landscape. To achieve this, we have sub classed OrderedCollection with our own VisibilityHoldingCollection. 

When creating the collection that will hold you print objects, use a VisibilityHoldingCollection instead of an OrderedCollection. Using the provided constructor #newForOrientation: anOrientation, you can tell it whether the collection should be printed in ##portrait or ##landscape. Your final document will contain n collections within its overall OrderedCollection. If these collections are of the type VisibilityHoldingCollection, then the orientation held there will be used.

For backwards code compatibility, if the collection is a standard OrderedCollection then the preset orientation will be used.

This change ensures that all pages of a report can now be printed within a single print job, adding convenience and removel of the annoyance of finding that others have interspersed their print runs with yours.

Further Release of the Manual

It is intended that a completely new manual for Visibility bringing all of the changes together into one document and expanding on the preview capabilities will be produced shortly. This will be supplied to all purchasers as soon as it is ready.


Further Information