Next: Writing classes
Up: ClassesComponents, and
Previous: ClassesComponents, and
Classes that can be used without definition are called base classes. DJ offers the following base classes:
Arc Button Circle Label Line Oval Rectangle
RoundRectangle Polygon Square Star TextArea
TextField Triangle
All these classes have the following attributes:
- x: left-upper x-coordinate of the component in the main panel.
- y: left-upper y-coordinate of the component in the main panel.
- width: width of the component.
- height: height of the component.
- color: color of the component. For Button, Label, TextArea and TextField, this attribute specify the color of the text in the component.
- visible: the component is visible if this attribute is true; and invisible otherwise.
Besides the common attributes, each class also has some specific attributes. For example, the Line class has four integer attributes x1, y1, x2, and y2 that specify the starting and ending points of line components. For the classes Arc, Circle, Rectangle, Square, RoundRectangle, etc., there is a Boolean attribute called fill that specifies whether or not the graphical components are filled. For components with a text, there are attributes for specifying the font used for the text
. See Appendix I for the structures of the base classes.
Neng-Fa ZHOU
Sat Apr 18 16:14:29 JST 1998