Next: 8  Package toc Up: RichDoc Framework XML Format Specification Previous: 6  Package math


7 Package drawing

Element geometry

Defines box in certain coordinate space, in terms of the anchor point, width, and height. The anchor point refers to the top-left corner of the rectangle, unless otherwise specified. For instance, for box element, the anchor point may be specified by the anchor style value.

h w y x [picture]
w
h
[x, y]
[end of picture]

Figure 3 Box Geometry (anchor point refers to top-left corner)

Parents: box tabBox customBox

Attributes: x y w h

Element transform

A drawingContainer that applies specified transformation to its contained drawingElements. The transformation is specified as a series of transformOperations.

Parents: drawingContainer

Attributes: userId id

Content: transformOperation+ (drawingElement | transform)+

Class transformOperation

Parents: transform

Element translate

Specifies translation transforming operation. All objects are transformed using transformation matrix

y x () (1)

Parents: transform

Attributes: x y

Element rotate

Specifies rotate transforming operation. All objects are transformed using transformation matrix

theta theta y theta x theta x theta theta y theta theta () (2)

Parents: transform

Attributes: x y theta

Element scale

Specifies scale transforming operation. All objects are transformed using transformation matrix

sy y sx sy sx x () (3)

Parents: transform

Attributes: x y sx sy

Element shear

Specifies shear transforming operation. All objects are transformed using transformation matrix

y sy sx x sy sx () (4)

Parents: transform

Attributes: x y sx sy

Class drawingContainer

Any element that may contain drawingElements.

Content: (drawingElement | transform)*

Class drawingElement

Drawing element is contentElement that may appear as a child of drawingContainer.

Parents: drawingContainer

Attributes: class id userId language

Content: style? indexEntryRef?

Element drawing

A block element that serves as a container for drawingElements.

Parents: blockContainer

Attributes: class id userId language

Content: style? indexEntryRef? animation? (drawingElement | transform)*

Element animation

Parents: drawing

Content: rule*

Element rule

Parents: animation

Simple Content: xsd:string

Element shape

Shape is closed or open stroke comprising segments defined using shapeSegment elements. The segments may be straight, quadratic, Bézier or arc.

bezierTo lineTo arcTo start [picture]
start
lineTo
bezierTo
arcTo
[end of picture]

Figure 4 Segmented Shape

Parents: drawingContainer

Attributes: closed filled class id userId language

Content: style? indexEntryRef? start shapeSegment+

Element start

Defines starting point of the shape. The type attribute controls behavior of the shape when user manipulates the starting point.

Parents: shape

Attributes: x y type(shapeSegment)

Class shapeSegment

Class of elements defining segments of a shape. Each segment has an attribute type that controls the behavior of the shape when user manipulates the point at the end of this segment.

Parents: shape

Attributes: type(shapeSegment)

Element lineTo

Straight shape segment, i.e. straight line from the current point to the point [x, y], see Figure 5.

x y [picture]
current point
[x, y]
[end of picture]

Figure 5 Straight Segment

Parents: shape

Attributes: x y type(shapeSegment)

Element quadTo

Quadratic shape segment, i.e. quadratic curve from the current point to the point [x, y], having [cx, cy] as a control point, see Figure 6.

cx y x cy [picture]
current point
[x, y]
[cx, cy]
[end of picture]

Figure 6 Quadratic Segment

Parents: shape

Attributes: x y cx cy type(shapeSegment)

Element bezierTo

Bézier shape segment, i.e. Bézier curve from the current point to the point [x, y], having [c1x, c1y] and [c2x, c2y] as a control points, see Figure 7.

c2y c2x c1x x y c1y [picture]
current point
[x, y]
[c1x, c1y]
[c2x, c2y]
[end of picture]

Figure 7 Bézier Segment

Parents: shape

Attributes: x y c1x c1y c2x c2y type(shapeSegment)

Element arcTo

Arc shape segment, i.e. arc segment from the current point to the point [x, y], having [mx, my] as a control point, see Figure 8.

mx my x y [picture]
current point
[x, y]
[mx, my]
[end of picture]

Figure 8 Arc Segment

Parents: shape

Attributes: x y my mx type(shapeSegment)

Element box

drawingElement representing a box with or without content. The general box shape is rectangular, but it may be changed by style to round or oval. Note that the geometry child is required, the omission of it is a deprecated construct, so in the schema it is listed as optional.

Parents: drawingContainer

Attributes: x y theta autoLayout width(box) class id userId language

Content: style? indexEntryRef? geometry? page?

Element link

Parents: drawingContainer

Attributes: type(link) x1 y1 x2 y2 from to class id userId language

Content: style? indexEntryRef? ((rectangularPoint | bezier))?

Element bezier

Specification of parameters of a Bézier link.

Parents: link

Attributes: length angle baseAngle

Element rectangularPoint

Specifies a hint for rectangular or corner link. For corner link, there are two options how to draw it. The one is chosen for which the real link corner is closer to the hint point, see Figure 9a. In the case of rectangular link, consisting of three segments, the rectangularPoint determines either x or y coordinate of the middle segment of the link. There are also two options, from which the one is chosen for which the first node point is closer to the rectangularPoint, see Figure 9b and c. In the figure, orange point denotes the rectangularPoint, while the two green points denote the two alternatives, from which the closer is taken.

[picture]






[end of picture]

Figure 9 How rectangularPoint influences link shape

Parents: link

Attributes: x y

Element bitmap(drawing)

Parents: drawingContainer

Attributes: x y aspect class id userId language height(bitmap) width(bitmap) data scale

Content: style? indexEntryRef? sourceInfo?

Element sourceInfo

Identifies the source from which this bitmap has been imported. It might be used e.g. for updating the bitmap when source changes, or for re-rasterizing the bitmap in another resolution.

Parents: bitmap

Attributes: type(sourceInfo) name(sourceInfo) id data width(sourceInfo) height(sourceInfo)

Element tabBox

Parents: drawingContainer

Attributes: class id userId language

Content: style? indexEntryRef? geometry table

Element linDim

Linear dimension drawingElement. The elements from and to define endpoints of the dimension arrow. The elements extension1 and extension2 define the length of the extension line. The extension line is always perpendicular to the dimension arrow. If the extension value is positive, the extension extends in the direction at right angle clockwise from the fromto vector. If the value is negative, it extends in counter-clockwise direction. Alternatively, the extension point may be defined using snap child element, in which case it is associated with some point hosted by another object. In this case, the from or to points may be modified to maintain the perpendicular property of the extension line, but they may be moved only along the main dimension line. The text of the dimension is defined using the page element. The position of the page is defined using the alignment element.

alignment(linDim) alignment(linDim) alignment(linDim) extension1 extension2 to alignment(linDim) from [picture]
text
from
to
extension2
extension1
alignment(linDim)
[end of picture]

Figure 10 Linear Dimension

Parents: drawingContainer

Attributes: class id userId language

Content: style? indexEntryRef? from to extension1 extension2 alignment(linDim) page

Element from

Starting point of linDim drawingElement.

Parents: linDim

Attributes: x y

Element to

Ending point of linDim drawingElement.

Parents: linDim

Attributes: x y

Element alignment(linDim)

Specifies the position of the linDim's annotation.

Parents: linDim

Attributes: type(linDimAlignment)

Content: position

Element position

Parents: alignment(linDim)

Attributes: x y

Element extension1

Defines the direction and length of the first extension point of linDim, if the value(style) is present. Alternatively, the extension point may be defined using nested snap point.

to value(dimExtension) value(dimExtension) value(dimExtension) from value(dimExtension) value(dimExtension) value(dimExtension) from value(dimExtension) value(dimExtension) to [picture]

value(dimExtension)

value(dimExtension)
from
to
to
from
[end of picture]

Figure 11 Beginning of Linear Dimension

Parents: linDim

Attributes: value(dimExtension)

Content: snap?

Element extension2

Defines the direction and length of the second extension point of linDim, if the value(style) is present. Alternatively, the extension point may be defined using nested snap point.

value(dimExtension) from from value(dimExtension) to value(dimExtension) value(dimExtension) to value(dimExtension) value(dimExtension) value(dimExtension) value(dimExtension) [picture]


value(dimExtension)
from
to
to
from
value(dimExtension)
[end of picture]

Figure 12 Beginning of Linear Dimension

Parents: linDim

Attributes: value(dimExtension)

Content: snap?

Element snap

Defines that extension point of linDim is associated with certain point of other object. The object is identified by its identifier using the id attribute, and its point is identified by the type(snap) attribute.

Parents: extension1 extension2

Attributes: id type(snap)

Element customBox

Custom box is a special box whose content is drawn by user-supplied code. The code is supplied in the form of a bytecode of a class that is expected to be of type org.ksmsa.richDoc.drawing.view.CustomBoxCodeBase and override the method draw(double width, double height). The element should provide the bytecode in the compiled child element, and may optionally provide the fragment of the source code in the child element source.

Parents: drawingContainer

Attributes: class id userId language

Content: style? indexEntryRef? geometry source? compiled

Element compiled

The compiled part of the enclosing customBox, in the form of BASE64-encoded bytecode.

Parents: customBox

Simple Content: xsd:string

Element source

Contains the fragment of the source code that is used to compile the bytecode of the enclosing customBox. The fragment is the body of the method draw(double width, double height) of the class extending org.ksmsa.richDoc.drawing.view.CustomBoxCodeBase.

Parents: customBox

Simple Content: xsd:string

Class bitmap

Attributes: height(bitmap) width(bitmap) data scale class id userId language

Content: style? indexEntryRef? sourceInfo?

Attribute x

Attribute y

Attribute w

Attribute h

Attribute theta

Attribute sx

Attribute sy

Attribute filled

Attribute closed

Attribute type(shapeSegment)

Controls the behavior of shape when user drags one of its manipulation points.

corner
only the selected manipulation point is affected; this may be used to create discontinuous (corner) points of adjacent bezier curves, see Figure 13 a.
straight
ensures first-order continuity when control point is dragged; that is the adjacent control vectors must have the same direction, but may differ in length, see Figure 13 b.
smooth
ensures second-order continuity when control point is dragged; that is the adjacent control vectors must be equal in both direction and length, see Figure 13 c.
auto
sets the control points automatically when the node point is dragged, see Figure 13 d.
[picture]
(a)
(b)
(c)
(d)
[end of picture]

Figure 13 (a) corner, (b) straight, (c) smooth, (d) auto

Attribute cx

Attribute cy

Attribute c1x

Attribute c1y

Attribute c2x

Attribute c2y

Attribute mx

Attribute my

Attribute autoLayout

Turns this box to auto-layout mode. In this mode, all boxes that are reachable from this box via links, are positioned out automatically.

Attribute from

Specifies the object associated with the starting point of the enclosing link.

Attribute to

Attribute x1

Attribute x2

Attribute y1

Attribute y2

Attribute type(link)

Attribute length

Distance of the link's control point from its node point, relative to the length of the link, see Figure 14. If the link length is zero (i.e. the link is a loop), the length is relative to the value of 1.

[picture]
length

[end of picture]

Figure 14 Bézier Link

Attribute baseAngle

Specifies the angle of rotation of Bézier link around its collapsed point, see Figure 15.

[picture]
baseAngle
[end of picture]

Figure 15 Bézier Link

Attribute angle

Specifies the angle of the control point relative from the link vector for Bézier link, see Figure 16. The angle is relative to the angle of link's base, from-to vector. If the link base vector has zero length, i.e. the link is a loop, the angle is relative to the baseAngle attribute.

[picture]
angle
angle
[end of picture]

Figure 16 Bézier Link

Attribute aspect

Specifies the aspect ratio of a bitmap, if not equal to 100%. The height of a bitmap is equal to width(bitmap) * aspect. If the value is 1, it may be omitted.

Attribute type(linDimAlignment)

Attribute value(dimExtension)

Specifies length and direction of linDim's extension lines, extension1 and extension2.

Attribute type(snap)

Defines which point within particular drawingElement should be associated with enclosing extension point of linDim. The following values are legal, depending on the type of the associated drawingElement referenced by snap's id attribute:

shape
1-start, n-center, n-end, where n is one-based index of shape's segment. That is, 1-start is the starting point of the shape, 1-center is the middle of the first segment, 1-end is the end of the first segment and the beginning of the second segment, and so on.
box
topLeft, top, topRight, left, center, right, bottomLeft, bottom, bottomRight

Attribute type(sourceInfo)

Type of the source used to initialize the enclosing bitmap. The valid values are:

jar
The bitmap has been imported from java archive file. The file is identified by the name(sourceInfo) attribute, which specifies fully-qualified path of the bitmap file within the java archive, for example, org/ksmsa/richDoc/view/bold.png.
eps
The bitmap was created by rasterizing Encapsulated Postscript image. The source is identified by binary data, either using the id attribute in case of multi-file serialization mode, or data attribute in single-file serialization mode. These attributes reference binary stream containing deflated content of the eps file. The width(sourceInfo) or height attributes may be used if other than native size of the EPS file has been requested.

Attribute name(sourceInfo)

Attribute width(sourceInfo)

For the bitmap imported from EPS, specifies the desired width of the image in pts (as specified by the LaTeX \epsfxsize macro)

Attribute height(sourceInfo)

For the bitmap imported from EPS, specifies the desired height of the image in pts (as specified by the LaTeX \epsfysize macro)

Attribute scale

Attribute data


Next: 8  Package toc Up: RichDoc Framework XML Format Specification Previous: 6  Package math