Sybernet / Supplied Packages Reference
Release 3.00
May 25, 2003
backwards forwards

HTTP.AWT

The AWT package provides subprograms for creating graphics. With it you can draw points, lines, circles, arcs, squares, pies, and quadrilaterals. There are also three subprograms that draw a pie chart, bar chart, and line graph simply by passing a select statement.

Although loosely patterned after the Java awt package, Java is not required to use this package. Graphic "images" created by this package are rendered in real-time. Depending on your broswer, you may actually see the image being drawn.

All images are created relative to the origin (0,0). By default this is the upper-left and upper-right area of your browser's window. You may change the origin with two global variables in this package: X_ORIGIN and Y_ORIGIN. It's always a good idea to reset them to zero when you are done.

Constants

AWT defines the following constants:

ALICEBLUE               constant    varchar(6)     := 'F0F8FF';
ANTIQUEWHITE            constant    varchar(6)     := 'FAEBD7';
AQUA                    constant    varchar(6)     := '00FFFF';
AQUAMARINE              constant    varchar(6)     := '7FFFD4';
AZURE                   constant    varchar(6)     := 'F0FFFF';
BEIGE                   constant    varchar(6)     := 'F5F5DC';
BISQUE                  constant    varchar(6)     := 'FFE4C4';
BLACK                   constant    varchar(6)     := '000000';
BLANCHEDALMOND          constant    varchar(6)     := 'FFEBCD';
BLUE                    constant    varchar(6)     := '0000FF';
BLUEVIOLET              constant    varchar(6)     := '8A2BE2';
BROWN                   constant    varchar(6)     := 'A52A2A';
BURLYWOOD               constant    varchar(6)     := 'DEB887';
CADETBLUE               constant    varchar(6)     := '5F9EA0';
CHARTREUSE              constant    varchar(6)     := '7FFF00';
CHOCOLATE               constant    varchar(6)     := 'D2691E';
CORAL                   constant    varchar(6)     := 'FF7F50';
CORNFLOWERBLUE          constant    varchar(6)     := '6495ED';
CORNSILK                constant    varchar(6)     := 'FFF8DC';
CRIMSON                 constant    varchar(6)     := 'DC143C';
CYAN                    constant    varchar(6)     := '00FFFF';
DARKBLUE                constant    varchar(6)     := '00008B';
DARKCYAN                constant    varchar(6)     := '008B8B';
DARKGOLDENROD           constant    varchar(6)     := 'B8860B';
DARKGRAY                constant    varchar(6)     := 'A9A9A9';
DARKGREEN               constant    varchar(6)     := '006400';
DARKKHAKI               constant    varchar(6)     := 'BDB76B';
DARKMAGENTA             constant    varchar(6)     := '8B008B';
DARKOLIVEGREEN          constant    varchar(6)     := '556B2F';
DARKORANGE              constant    varchar(6)     := 'FF8C00';
DARKORCHID              constant    varchar(6)     := '9932CC';
DARKRED                 constant    varchar(6)     := '8B0000';
DARKSALMON              constant    varchar(6)     := 'E9967A';
DARKSEAGREEN            constant    varchar(6)     := '8FBC8F';
DARKSLATEBLUE           constant    varchar(6)     := '483D8B';
DARKSLATEGRAY           constant    varchar(6)     := '2F4F4F';
DARKTURQUOISE           constant    varchar(6)     := '00CED1';
DARKVIOLET              constant    varchar(6)     := '9400D3';
DEEPPINK                constant    varchar(6)     := 'FF1493';
DEEPSKYBLUE             constant    varchar(6)     := '00BFFF';
DIMGRAY                 constant    varchar(6)     := '696969';
DODGERBLUE              constant    varchar(6)     := '1E90FF';
FIREBRICK               constant    varchar(6)     := 'B22222';
FLORALWHITE             constant    varchar(6)     := 'FFFAF0';
FORESTGREEN             constant    varchar(6)     := '228B22';
FUCHSIA                 constant    varchar(6)     := 'FF00FF';
GAINSBORO               constant    varchar(6)     := 'DCDCDC';
GHOSTWHITE              constant    varchar(6)     := 'F8F8FF';
GOLD                    constant    varchar(6)     := 'FFD700';
GOLDENROD               constant    varchar(6)     := 'DAA520';
GRAY                    constant    varchar(6)     := '808080';
GREEN                   constant    varchar(6)     := '008000';
GREENYELLOW             constant    varchar(6)     := 'ADFF2F';
HONEYDEW                constant    varchar(6)     := 'F0FFF0';
HOTPINK                 constant    varchar(6)     := 'FF69B4';
INDIANRED               constant    varchar(6)     := 'CD5C5C';
INDIGO                  constant    varchar(6)     := '4B0082';
IVORY                   constant    varchar(6)     := 'FFFFF0';
KHAKI                   constant    varchar(6)     := 'F0E68C';
LAVENDER                constant    varchar(6)     := 'E6E6FA';
LAVENDERBLUSH           constant    varchar(6)     := 'FFF0F5';
LAWNGREEN               constant    varchar(6)     := '7CFC00';
LEMONCHIFFON            constant    varchar(6)     := 'FFFACD';
LIGHTBLUE               constant    varchar(6)     := 'ADD8E6';
LIGHTCORAL              constant    varchar(6)     := 'F08080';
LIGHTCYAN               constant    varchar(6)     := 'E0FFFF';
LIGHTGOLDENRODYELLOW    constant    varchar(6)     := 'FAFAD2';
LIGHTGREEN              constant    varchar(6)     := '90EE90';
LIGHTGREY               constant    varchar(6)     := 'D3D3D3';
LIGHTPINK               constant    varchar(6)     := 'FFB6C1';
LIGHTSALMON             constant    varchar(6)     := 'FFA07A';
LIGHTSEAGREEN           constant    varchar(6)     := '20B2AA';
LIGHTSKYBLUE            constant    varchar(6)     := '87CEFA';
LIGHTSLATEGRAY          constant    varchar(6)     := '778899';
LIGHTSTEELBLUE          constant    varchar(6)     := 'B0C4DE';
LIGHTYELLOW             constant    varchar(6)     := 'FFFFE0';
LIME                    constant    varchar(6)     := '00FF00';
LIMEGREEN               constant    varchar(6)     := '32CD32';
LINEN                   constant    varchar(6)     := 'FAF0E6';
MAGENTA                 constant    varchar(6)     := 'FF00FF';
MAROON                  constant    varchar(6)     := '800000';
MEDIUMAQUAMARINE        constant    varchar(6)     := '66CDAA';
MEDIUMBLUE              constant    varchar(6)     := '0000CD';
MEDIUMORCHID            constant    varchar(6)     := 'BA55D3';
MEDIUMPURPLE            constant    varchar(6)     := '9370DB';
MEDIUMSEAGREEN          constant    varchar(6)     := '3CB371';
MEDIUMSLATEBLUE         constant    varchar(6)     := '7B68EE';
MEDIUMSPRINGGREEN       constant    varchar(6)     := '00FA9A';
MEDIUMTURQUOISE         constant    varchar(6)     := '48D1CC';
MEDIUMVIOLETRED         constant    varchar(6)     := 'C71585';
MIDNIGHTBLUE            constant    varchar(6)     := '191970';
MINTCREAM               constant    varchar(6)     := 'F5FFFA';
MISTYROSE               constant    varchar(6)     := 'FFE4E1';
MOCCASIN                constant    varchar(6)     := 'FFE4B5';
NAVAJOWHITE             constant    varchar(6)     := 'FFDEAD';
NAVY                    constant    varchar(6)     := '000080';
OLDLACE                 constant    varchar(6)     := 'FDF5E6';
OLIVE                   constant    varchar(6)     := '808000';
OLIVEDRAB               constant    varchar(6)     := '6B8E23';
ORANGE                  constant    varchar(6)     := 'FFA500';
ORANGERED               constant    varchar(6)     := 'FF4500';
ORCHID                  constant    varchar(6)     := 'DA70D6';
PALEGOLDENROD           constant    varchar(6)     := 'EEE8AA';
PALEGREEN               constant    varchar(6)     := '98FB98';
PALETURQUOISE           constant    varchar(6)     := 'AFEEEE';
PALEVIOLETRED           constant    varchar(6)     := 'DB7093';
PAPAYAWHIP              constant    varchar(6)     := 'FFEFD5';
PEACHPUFF               constant    varchar(6)     := 'FFDAB9';
PERU                    constant    varchar(6)     := 'CD853F';
PINK                    constant    varchar(6)     := 'FFC0CB';
PLUM                    constant    varchar(6)     := 'DDA0DD';
POWDERBLUE              constant    varchar(6)     := 'B0E0E6';
PURPLE                  constant    varchar(6)     := '800080';
RED                     constant    varchar(6)     := 'FF0000';
ROSYBROWN               constant    varchar(6)     := 'BC8F8F';
ROYALBLUE               constant    varchar(6)     := '4169E1';
SADDLEBROWN             constant    varchar(6)     := '8B4513';
SALMON                  constant    varchar(6)     := 'FA8072';
SANDYBROWN              constant    varchar(6)     := 'F4A460';
SEAGREEN                constant    varchar(6)     := '2E8B57';
SEASHELL                constant    varchar(6)     := 'FFF5EE';
SIENNA                  constant    varchar(6)     := 'A0522D';
SILVER                  constant    varchar(6)     := 'C0C0C0';
SKYBLUE                 constant    varchar(6)     := '87CEEB';
SLATEBLUE               constant    varchar(6)     := '6A5ACD';
SLATEGRAY               constant    varchar(6)     := '708090';
SNOW                    constant    varchar(6)     := 'FFFAFA';
SPRINGGREEN             constant    varchar(6)     := '00FF7F';
STEELBLUE               constant    varchar(6)     := '4682B4';
TAN                     constant    varchar(6)     := 'D2B48C';
TEAL                    constant    varchar(6)     := '008080';
THISTLE                 constant    varchar(6)     := 'D8BFD8';
TOMATO                  constant    varchar(6)     := 'FF6347';
TURQUOISE               constant    varchar(6)     := '40E0D0';
VIOLET                  constant    varchar(6)     := 'EE82EE';
WHEAT                   constant    varchar(6)     := 'F5DEB3';
WHITE                   constant    varchar(6)     := 'FFFFFF';
WHITESMOKE              constant    varchar(6)     := 'F5F5F5';
YELLOW                  constant    varchar(6)     := 'FFFF00';
YELLOWGREEN             constant    varchar(6)     := '9ACD32';

Globals

AWT defines the following global variables:

X_ORIGIN                            binary_integer := 0;
Y_ORIGIN                            binary_integer := 0;

Summary of Subprograms

Subprogram Description
drawPoint
 
Draws a point.
drawLine
 
Draws a line between two points.
drawRect
 
Draws a rectangle.
fillRect
 
Fills a rectangle.
draw3DRect
 
Draws a 3D rectangle.
fill3DRect
 
Fills a 3D rectangle.
drawCircle
 
Draws a circle.
fillCircle
 
Fills a circle.
drawText
 
Writes your text at a particular coordinate.
drawOval
 
Draws an Oval.
fillOval
 
Fills an Oval.
drawArc
 
Draws an arc.
drawOvalArc
 
Draws an oval arc.
drawAngle
 
Draws a line for a given angle.
drawPie
 
Draws a pie.
fillPie
 
Fills a pie.
drawOvalArc
 
Draws an oval arc.
drawQuad
 
Draws a quadrilateral.
fillQuad
 
Fills a quadrilateral.
drawLayer
 
Creates a layer or div element.
draw3DLayer
 
Creates a 3D layer or div element.
drawChart
 
Creates a line graph.
drawBarChart
 
Creates a bar chart.
drawPieChart
 
Creates a pie chart.

DRAW3DLAYER Procedure

draw3DLayer is exactly the same as drawLayer except that a 3D effect is created by shading each border.


Syntax

Procedure DRAW3DLAYER
(
    NAME                          VARCHAR2
,   TOP                           NUMBER
,   LEFT                          NUMBER
,   HEIGHT                        NUMBER
,   WIDTH                         NUMBER
,   BGCOLOR                       VARCHAR2
,   VISIBILITY                    VARCHAR2
,   ONMOUSEOVER                   VARCHAR2
,   ONMOUSEOUT                    VARCHAR2
,   ONMOUSEDOWN                   VARCHAR2
,   ONMOUSEMOVE                   VARCHAR2
,   FILLER                        VARCHAR2
)   ;

Parameters

Parameter Description
name
 
Name of layer.
top
 
Absolute Y coordinate.
left
 
Absolute X coordinate.
height
 
Height of object.
width
 
Width of object.
bgcolor
 
Background color of layer.
visibility
 
Determines is layer is visible (show) or invisbile (hide).
onmouseover
 
JavaScript onMouseOver event.
onmouseout
 
JavaScript onMouseOut event.
onmousedown
 
JavaScript onMouseDown event.
onmousemove
 
JavaScript onMouseMove event.
filler
 
Optional text.


Example

The following example illustrates how to call draw3dlayer:

http.awt.draw3DLayer
(
    name           => NULL
,   top            => 100
,   left           => 100
,   height         => 100
,   width          => 100
,   bgcolor        => http.awt.black
,   visibility     => NULL
,   onMouseOver    => 'window.status=''Hello'';return true;'
,   onMouseOut     => NULL
,   onMouseDown    => NULL
,   onMouseMove    => NULL
,   filler         => NULL
)   ;

DRAW3DRECT Procedure

draw3DRect is exactly the same as drawRect except that a 3D effect is created by shading each border


Syntax

Procedure DRAW3DRECT
(
    TOP                           NUMBER
,   LEFT                          NUMBER
,   HEIGHT                        NUMBER
,   WIDTH                         NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
top
 
Absolute Y coordinate.
left
 
Absolute X coordinate.
height
 
Height of object.
width
 
Width of object.
color
 
Object color.


Example

The following example illustrates how to call draw3drect:

http.awt.draw3DRect
(
    top            => 100
,   left           => 100
,   height         => 100
,   width          => 100
,   color          => http.awt.red
)   ;

DRAWANGLE Procedure

This procedure draws a line (not an angle) of length radius. The line is drawn from the X and Y coordinate with a length of radius with an angle offset of angle from the X coordinate.


Syntax

Procedure DRAWANGLE
(
    X                             NUMBER
,   Y                             NUMBER
,   RADIUS                        NUMBER
,   ANGLE                         NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
x
 
The X coordinate of the center of the circle.
y
 
The Y coordinate of the center of the circle.
radius
 
Radius of circle.
angle
 
Angle of line from the X coordindate.
color
 
Object color.


Example

The following example illustrates how to call drawangle:

for angle in 0..3 loop
    awt.drawAngle(0,0,100,angle*90   ,http.awt.green);
    awt.drawAngle(0,0,100,angle*90+45,http.awt.blue );
end loop;

DRAWARC Procedure

Draws an arc bounded by the specified rectangle from startAngle to endAngle. 0 degrees is at the 3-o'clock position. Positive arc angles indicate counter-clockwise rotations, negative arc angles are drawn clockwise.


Syntax

Procedure DRAWARC
(
    X                             NUMBER
,   Y                             NUMBER
,   RADIUS                        NUMBER
,   STARTANGLE                    NUMBER
,   ARCANGLE                      NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
x
 
The X coordinate of the center of the circle.
y
 
The Y coordinate of the center of the circle.
radius
 
Radius of circle.
startangle
 
Beginning angle in degrees.
arcangle
 
Length of angle in degrees.
color
 
Object color.


Example

The following example illustrates how to call drawarc:

http.awt.drawArc
(
    0
,   0
,   100
,   22
,   45
,   http.awt.blue
)   ;

DRAWBARCHART Procedure

This subprogram creates a bar chart from your select (value) statement. Your select statement should return two columns that correspond to the Y axis (its label) and the X axis (its value). It is up to you to specify the appropriate ORDER BY and GROUP BY clause.

If all labels can be centered at the bottom of the screen, they will be centered at the bottom of the screen. If this is not possible, your labels are displayed vertically if their length is less than four characters or you specified force_label to be true. In any case, a mouseOver on each bar will display its label and value.


Syntax

Procedure DRAWBARCHART
(
    VALUE                         VARCHAR2
,   WIDTH                         BINARY_INTEGER
,   HEIGHT                        BINARY_INTEGER
,   BGCOLOR                       VARCHAR2
,   CELLSPACING                   BINARY_INTEGER
,   CELLPADDING                   BINARY_INTEGER
,   TITLE                         VARCHAR2
,   FORCE_LABEL                   PL/SQL BOOLEAN
)   ;

Parameters

Parameter Description
value
 
The select statement used to create this graph.
width
 
Width of chart.
height
 
Height of chart.
bgcolor
 
Background color of chart.
cellspacing
 
Number of pixels between each bar.
cellpadding
 
Number of pixels between each bar and the X axis.
title
 
Optional title.
force_label
 
Forces the label to be drawn for each bar even if it would look stupid doing so.


Example

The following example illustrates how to call drawbarchart:

drawBarChart
(
    value           => 'SELECT * FROM HTTP.MEMORY WHERE STACKSIZE > 0'
,   width           => 460
,   height          => 260
,   bgcolor         => 'e7e7ce'
,   cellspacing     => 6
,   cellpadding     => 6
,   title           => '<h1 align=center>Sybernet Memory Usage</h1>'
)   ;

DRAWCHART Procedure

This subprogram creates a graph or line chart from your select (value) statement. Your select statement should return two columns that correspond to the Y axis (its label) and the X axis (its value).

If all labels can be centered at the bottom of the screen, they will be centered at the bottom of the screen. If this is not possible, your labels are displayed vertically if their length is less than four characters or you specified force_label to be true. This procedure will not display the same label twice in succession. If you are graphing activity for each day and your label is the current month, then only the 1st of the month is labeled.


Syntax

Procedure DRAWCHART
(
    VALUE                         VARCHAR2
,   WIDTH                         BINARY_INTEGER
,   HEIGHT                        BINARY_INTEGER
,   BGCOLOR                       VARCHAR2
,   CELLSPACING                   BINARY_INTEGER
,   CELLPADDING                   BINARY_INTEGER
,   TITLE                         VARCHAR2
,   FORCE_LABEL                   PL/SQL BOOLEAN
)   ;

Parameters

Parameter Description
value
 
The select statement used to create this graph.
width
 
Width of chart.
height
 
Height of chart.
bgcolor
 
Background color of chart.
cellspacing
 
Number of pixesl between each point.
cellpadding
 
Number of pixels between lowest point and Y axis.
title
 
Optional title.
force_label
 
Forces the label to be drawn for each line even if it would look stupid doing so.


Example

The following example illustrates how to call drawchart:

http.awt.drawChart
(
    value           => 'select to_char(trunc(TIMESTAMP),''Mon''), count(*) from HTTP_AUDITFILE where TIMESTAMP between ''Jan 1, 2003'' and ''Dec 31, 2003'' group  by trunc(TIMESTAMP)'
,   width           => 860
,   height          => 300
,   bgcolor         => 'e7e7ce'
,   cellspacing     => 0
,   cellpadding     => 0
,   title           => '<h1 align=center>Sybernet Application Usage 2003</h1>'
,   force_label     => false
)   ;

DRAWCIRCLE Procedure

Draws a circle whose center is at X and Y with a radius of radius using the specified color.


Syntax

Procedure DRAWCIRCLE
(
    X                             NUMBER
,   Y                             NUMBER
,   RADIUS                        NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
x
 
The X coordinate of the center of the circle.
y
 
The Y coordinate of the center of the circle.
radius
 
Radius of circle.
color
 
Object color.


Example

The following example illustrates how to call drawcircle:

http.awt.drawCircle
(
    0
,   0
,   100
,   http.awt.black
)   ;

DRAWLAYER Procedure

drawLayer creates a layer or div object (depending upon the browser that invoked it) and is thus compatible with Netscape 4.X browers and Netscape 7.X browsers. Most of the subprograms in this package actually call drawLayer.

onMouseOver, onMouseOut, onMouseDown, and onMouseMove are JavaScript events that may have to be supplied by JavaScript functions that you write; for example, onMouseOver may change the backGround color of a layer while onMouseOut restores the background color of that layer. It is beyond the scope of this manual to actually explain how you do that. HTTP.SP_HTML_CALENDAR is just one example that you might want to reference since it handles all of these events.


Syntax

Procedure DRAWLAYER
(
    NAME                          VARCHAR2
,   TOP                           NUMBER
,   LEFT                          NUMBER
,   HEIGHT                        NUMBER
,   WIDTH                         NUMBER
,   BGCOLOR                       VARCHAR2
,   VISIBILITY                    VARCHAR2
,   ONMOUSEOVER                   VARCHAR2
,   ONMOUSEOUT                    VARCHAR2
,   ONMOUSEDOWN                   VARCHAR2
,   ONMOUSEMOVE                   VARCHAR2
,   FILLER                        VARCHAR2
)   ;

Parameters

Parameter Description
name
 
The name of this layer.
top
 
Absolute Y coordinate.
left
 
Absolute X coordinate.
height
 
Height of object.
width
 
Width of object.
bgcolor
 
Background color of layer.
visibility
 
Determines is layer is visible (show) or invisbile (hide).
onmouseover
 
JavaScript onMouseOver event.
onmouseout
 
JavaScript onMouseOut event.
onmousedown
 
JavaScript onMouseDown event.
onmousemove
 
JavaScript onMouseMove event.
filler
 
Optional text.


Example

The following example illustrates how to call drawlayer:

http.awt.drawLayer
(
    name           => NULL
,   top            => 100
,   left           => 100
,   height         => 100
,   width          => 100
,   bgcolor        => http.awt.black
,   visibility     => NULL
,   onMouseOver    => 'window.status=''Hello'';return true;'
,   onMouseOut     => NULL
,   onMouseDown    => NULL
,   onMouseMove    => NULL
,   filler         => NULL
)   ;

DRAWLINE Procedure

Draws a line between the coordinates (TOP,LEFT) and (BOTTOM,RIGHT).


Syntax

Procedure DRAWLINE
(
    TOP                           NUMBER
,   LEFT                          NUMBER
,   BOTTOM                        NUMBER
,   RIGHT                         NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
top
 
Absolute Y coordinate.
left
 
Absolute X coordinate.
bottom
 
Absolute Y coordinate.
right
 
Absolute X coordinate.
color
 
Object color.


Example

The following example illustrates how to call drawline:

http.awt.drawLine
(
    0
,   0
,   150
,   150
)   ;

DRAWOVAL Procedure

Draws an oval whose center is at X and Y with a X radius of xradius and Y radius of yradius using the specified color.


Syntax

Procedure DRAWOVAL
(
    X                             NUMBER
,   Y                             NUMBER
,   XRADIUS                       NUMBER
,   YRADIUS                       NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
x
 
The X coordinate of the center of the circle.
y
 
The Y coordinate of the center of the circle.
xradius
 
Radius of circle along the X axis.
yradius
 
Radius of circle along the Y axis.
color
 
Object color.


Example

The following example illustrates how to call drawoval:

http.awt.drawOval
(
    0
,   0
,   50
,   100
,   http.awt.navy
)   ;

DRAWOVALARC Procedure

Draws an oval arc.


Syntax

Procedure DRAWOVALARC
(
    X                             NUMBER
,   Y                             NUMBER
,   XRADIUS                       NUMBER
,   YRADIUS                       NUMBER
,   STARTANGLE                    NUMBER
,   ARCANGLE                      NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
x
 
The X coordinate of the center of the circle.
y
 
The Y coordinate of the center of the circle.
xradius
 
Radius of circle along the X axis.
yradius
 
Radius of circle along the Y axis.
startangle
 
Beginning angle in degrees.
arcangle
 
Length of angle in degrees.
color
 
Object color.


Example

The following example illustrates how to call drawovalarc:

http.awt.drawOvalArc
(
    100
,   100
,   98
,   200
,   22
,   45
,   http.awt.red
)   ;

DRAWPIE Procedure

Draws a piece of pie.


Syntax

Procedure DRAWPIE
(
    X                             NUMBER
,   Y                             NUMBER
,   RADIUS                        NUMBER
,   STARTANGLE                    NUMBER
,   ARCANGLE                      NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
x
 
The X coordinate of the center of the circle.
y
 
The Y coordinate of the center of the circle.
radius
 
Radius of circle.
startangle
 
Beginning angle in degrees.
arcangle
 
Length of angle in degrees.
color
 
Object color.


Example

The following example illustrates how to call drawpie:

http.awt.drawPie
(
    50
,   150
,   150
,   190
,   30
,   http.awt.black
)   ;

DRAWPIECHART Procedure

This subprogram creates a pie chart from your select (value) statement. Your select statement should return two columns that correspond to the Y axis (its label) and the X axis (its value). It is up to you to specify the appropriate ORDER BY and GROUP BY clause.

Since it is difficult (or unpleasant) to display more than a few pieces of pie, you may specify a threshold for those values that should be grouped in the other category. Normally, pie charts display their values in descending order. Without the appropriate ORDER BY clause, your pie chart may group the wrong information under other.


Syntax

Procedure DRAWPIECHART
(
    VALUE                         VARCHAR2
,   RADIUS                        NUMBER
,   WIDTH                         BINARY_INTEGER
,   HEIGHT                        BINARY_INTEGER
,   BGCOLOR                       VARCHAR2
,   CELLSPACING                   BINARY_INTEGER
,   CELLPADDING                   BINARY_INTEGER
,   TITLE                         VARCHAR2
,   THRESHOLD                     NUMBER
)   ;

Parameters

Parameter Description
value
 
The select statement used to create this graph.
radius
 
Radius of circle.
width
 
Width of object.
height
 
Height of object.
bgcolor
 
Background color of chart.
cellspacing
 
unused.
cellpadding
 
unused.
title
 
Optional title.
threshold
 
Determines the percentage at which any value is displayed as other.


Example

The following example illustrates how to call drawpiechart:

http.awt.drawPieChart
(
    value          => 'select OWNER, count(OWNER) from ALL_OBJECTS where OWNER not in (''SYS'',''PUBLIC'') and OBJECT_TYPE = ''PACKAGE'' group by OWNER order by count(OWNER) desc'
,   radius         => 180
,   height         => 200
,   width          => 500
,   threshold      => 1.00
,   title          => 'Packages By Database Schema'
)   ;

DRAWPOINT Procedure

This procedure draws a single point or pixel with the specified color.


Syntax

Procedure DRAWPOINT
(
    TOP                           NUMBER
,   LEFT                          NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
top
 
Absolute Y coordinate.
left
 
Absolute X coordinate.
color
 
Object color.


Example

The following example illustrates how to call drawpoint:

http.awt.drawPoint
(
    0
,   0
,   http.awt.magenta
)   ;

DRAWQUAD Procedure

This procedure draws a quadrilateral. It is different from drawRect because each of the four corners may be anywhere on the screen. If you don't specify the corners correctly, you might end up with an hour-glass affect (which you might want) and if two of the corners share the same point, you'll end up with a triangle.


Syntax

Procedure DRAWQUAD
(
    TOP                           NUMBER
,   LEFT                          NUMBER
,   SOUTH                         NUMBER
,   WEST                          NUMBER
,   NORTH                         NUMBER
,   EAST                          NUMBER
,   BOTTOM                        NUMBER
,   RIGHT                         NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
top
 
Absolute Y coordinate.
left
 
Absolute X coordinate.
south
 
Absolute Y coordinate.
west
 
Absolute X coordinate.
north
 
Absolute Y coordinate.
east
 
Absolute X coordinate.
bottom
 
Absolute Y coordinate.
right
 
Absolute X coordinate.
color
 
Object color.


Example

The following example illustrates how to call drawquad:

http.awt.drawQuad
(
      0 ,   0
,   100 ,   0
,     0 ,   0
,   100 , 200
)   ;

DRAWRECT Procedure

Draws the outline of the specified rectangle using the specified color.


Syntax

Procedure DRAWRECT
(
    TOP                           NUMBER
,   LEFT                          NUMBER
,   HEIGHT                        NUMBER
,   WIDTH                         NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
top
 
Absolute Y coordinate.
left
 
Absolute X coordinate.
height
 
Height of object.
width
 
Width of object.
color
 
Object color.


Example

The following example illustrates how to call drawrect:

http.awt.drawRect
(
    0
,   0
,   20
,   40
,   http.awt.red
)   ;

DRAWTEXT Procedure

This procedure writes some text at the specified location.


Syntax

Procedure DRAWTEXT
(
    TOP                           NUMBER
,   LEFT                          NUMBER
,   HEIGHT                        NUMBER
,   WIDTH                         NUMBER
,   TEXT                          VARCHAR2
)   ;

Parameters

Parameter Description
top
 
Absolute Y coordinate.
left
 
Absolute X coordinate.
height
 
Height of object.
width
 
Width of object.
text
 
The text to be written.


Example

The following example illustrates how to call drawtext:

http.awt.drawText
(
    0
,   0
,   10
,   10
,   'Hello, World'
)   ;

FILL3DRECT Procedure

fill3DRect is exactly the same as fillRect except that a 3D effect is created by shading each border.


Syntax

Procedure FILL3DRECT
(
    TOP                           NUMBER
,   LEFT                          NUMBER
,   HEIGHT                        NUMBER
,   WIDTH                         NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
top
 
Absolute Y coordinate.
left
 
Absolute X coordinate.
height
 
Height of object.
width
 
Width of object.
color
 
Object color.


Example

The following example illustrates how to call fill3drect:

http.awt.fill3DRect
(
    0
,   0
,   20
,   40
,   http.awt.red
)   ;

FILLCIRCLE Procedure

Fills a circle whose center is at X and Y with a radius of radius using the specified color.


Syntax

Procedure FILLCIRCLE
(
    X                             NUMBER
,   Y                             NUMBER
,   RADIUS                        NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
x
 
The X coordinate of the center of the circle.
y
 
The Y coordinate of the center of the circle.
radius
 
Radius of circle.
color
 
Object color.


Example

The following example illustrates how to call fillcircle:

http.awt.fillCircle
(
    0
,   0
,   40
,   http.awt.yellow
)   ;

FILLOVAL Procedure

Fills an oval whose center is at X and Y with a X radius of xradius and Y radius of yradius using the specified color.


Syntax

Procedure FILLOVAL
(
    X                             NUMBER
,   Y                             NUMBER
,   XRADIUS                       NUMBER
,   YRADIUS                       NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
x
 
The X coordinate of the center of the circle.
y
 
The Y coordinate of the center of the circle.
xradius
 
Radius of circle along the X axis.
yradius
 
Radius of circle along the Y axis.
color
 
Object color.


Example

The following example illustrates how to call filloval:

http.awt.fillOval
(
    0
,   0
,   50
,   100
,   http.awt.navy
)   ;

FILLPIE Procedure

Fills a piece of pie.


Syntax

Procedure FILLPIE
(
    X                             NUMBER
,   Y                             NUMBER
,   RADIUS                        NUMBER
,   STARTANGLE                    NUMBER
,   ARCANGLE                      NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
x
 
The X coordinate of the center of the circle.
y
 
The Y coordinate of the center of the circle.
radius
 
Radius of circle.
startangle
 
Beginning angle in degrees.
arcangle
 
Length of angle in degrees.
color
 
Object color.


Example

The following example illustrates how to call fillpie:

http.awt.fillpie
(
    50
,   150
,   150
,   190
,   30
,   http.awt.black
)   ;

FILLQUAD Procedure

This procedure fills a quadrilateral. It is different from fillRect because each of the four corners may be anywhere on the screen. If you don't specify the corners correctly, you might end up with an hour-glass affect (which you might want) and if two of the corners share the same point, you'll end up with a triangle.


Syntax

Procedure FILLQUAD
(
    TOP                           NUMBER
,   LEFT                          NUMBER
,   SOUTH                         NUMBER
,   WEST                          NUMBER
,   NORTH                         NUMBER
,   EAST                          NUMBER
,   BOTTOM                        NUMBER
,   RIGHT                         NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
top
 
Absolute Y coordinate.
left
 
Absolute X coordinate.
south
 
Absolute Y coordinate.
west
 
Absolute X coordinate.
north
 
Absolute Y coordinate.
east
 
Absolute X coordinate.
bottom
 
Absolute Y coordinate.
right
 
Absolute X coordinate.
color
 
Object color.


Example

The following example illustrates how to call fillquad:

http.awt.fillQuad
(
      0 ,   0
,   100 ,   0
,     0 ,   0
,   100 , 200
)   ;

FILLRECT Procedure

Fills the specified rectangle with the specified color.


Syntax

Procedure FILLRECT
(
    TOP                           NUMBER
,   LEFT                          NUMBER
,   HEIGHT                        NUMBER
,   WIDTH                         NUMBER
,   COLOR                         VARCHAR2
)   ;

Parameters

Parameter Description
top
 
Absolute Y coordinate.
left
 
Absolute X coordinate.
height
 
Height of object.
width
 
Width of object.
color
 
Object color.


Example

The following example illustrates how to call fillrect:

http.awt.fillRect
(
    0
,   0
,   20
,   40
,   http.awt.red
)   ;



Sybernet is a trademark of SRI International.
Copyright © 1996-2009 SRI International. All Rights Reserved.
Denis D. Workman / http://Sybernet.sri.com/