123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735 |
- /****************************************************************
- ** Licensed Materials - Property of IBM
- **
- ** IBM Cognos Products: mdsrv
- **
- ** (C) Copyright IBM Corp. 2008, 2015
- **
- ** US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- *****************************************************************/
- //***********************************************************************************************
- // Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- // Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- //
- // Component: GDI
- //***********************************************************************************************
- //***********************************************************************************
- // GDI class
- //***********************************************************************************
- function gdi ( id_canvas, zoom )
- {
- ASSERT( id_canvas, "gdi: id_canvas is NOT valid !" );
- ASSERT( zoom, "gdi: zoom is NOT valid !" );
- // id must be the name/id of a container tag such as div.
- this.id = id_canvas;
- this.zoom = zoom || 100;
- this.zoomFactor = this.zoom / 100;
- this.htm = "";
- var temp = 0;
- if (document.documentElement.clientHeight == 0)
- temp = typeof document.body.insertAdjacentHTML != "undefined" && document.createElement;
- else
- temp = typeof document.documentElement.insertAdjacentHTML != "undefined" && document.createElement;
- this.ie = temp;
- this.canvas = document.getElementById (id_canvas);
- this.buf = new CStringBuffer();
- // setInterval ("Animation.animate ()", 50);
-
- this.setCanvas = function (id) { this.canvas = document.getElementById (id); }
- this.setZoom = function (zoom) { this.zoom = zoom; this.zoomFactor = this.zoom / 100; }
- this.getZoom = function () { return this.zoom; }
- this.init = function () { this.canvas.innerHTML = ""; }
- this.startContainer = function ( className, x, y, width, height, sId, sOverflow, sTooltip )
- {
- if ( typeof sOverflow == "undefined" )
- sOverflow = "hidden";
- this.buf.append( '<div class=' );
- this.buf.append( className );
- this.buf.append( ' style="position:absolute;overflow:' );
- this.buf.append( sOverflow );
- this.buf.append( ';left:' );
- this.buf.append( x * this.zoomFactor );
- this.buf.append( 'px;top:' );
- this.buf.append( y * this.zoomFactor );
- this.buf.append( 'px;width:' );
- this.buf.append( width * this.zoomFactor );
- this.buf.append( 'px;height:' );
- this.buf.append( height * this.zoomFactor );
- this.buf.append( 'px;"' );
- this.addId ( sId );
- this.addTooltip ( sTooltip );
- this.buf.append( '>' );
- }
- this.addText = function ( sText )
- {
- var escapedText = escapeHTML ( sText );
- this.buf.append( escapedText );
- }
- this.endContainer = function ()
- {
- this.buf.append( '<\/div>' );
- }
- this.divBackground = function ( className, x, y, width, height, sId )
- {
- this.buf.append( '<div class=' );
- this.buf.append( className );
- this.buf.append( ' style="position:absolute;' );
- this.buf.append( 'left:' );
- this.buf.append( x * this.zoomFactor );
- this.buf.append( 'px;top:' );
- this.buf.append( y * this.zoomFactor );
- this.buf.append( 'px;width:' );
- this.buf.append( width * this.zoomFactor );
- this.buf.append( 'px;height:' );
- this.buf.append( height * this.zoomFactor );
- this.buf.append( 'px;"' );
- this.addId ( sId );
- this.buf.append( '><\/div>' );
- }
-
- this.refresh = function ()
- {
- this.htm = this.buf.toString();
- if ( this.ie )
- {
- // moves the content into the container canvas (Internet Explorer)
- this.canvas.insertAdjacentHTML ( "BeforeEnd", this.htm );
- }
- else
- {
- var range = document.createRange ();
- range.setStartBefore ( this.canvas );
- range = range.createContextualFragment ( this.htm );
- this.canvas.appendChild ( range );
- }
- this.buf.cleanUp();
- }
-
- this.refreshObject = function ( id )
- {
- var elem = document.getElementById ( id );
- if ( elem )
- {
- elem.innerHTML = '';
- this.htm = this.buf.toString();
- if ( this.ie )
- {
- elem.insertAdjacentHTML ( "BeforeEnd", this.htm );
- }
- else
- {
- var range = document.createRange ();
- range.setStartBefore ( elem );
- range = range.createContextualFragment ( this.htm );
- elem.appendChild ( range );
- elem.innerHTML = this.htm;
- }
- //elem.style.display = "none";
- //elem.style.display = "block";
- }
- this.buf.cleanUp();
- }
- this.drawArrowLeft = function ( color, xArrowTip, yArrowTip, sPenStyle, nSize )
- {
- sPenStyle = 'solid';
- this.drawHorzLine ( color, 1, sPenStyle, xArrowTip, yArrowTip, nSize ); // Center line
- for ( var i = 1; i <= nSize/2; i++ )
- {
- this.drawHorzLine ( color, 1, sPenStyle, xArrowTip + i*2, yArrowTip - i, nSize - i*2 + 1 );
- this.drawHorzLine ( color, 1, sPenStyle, xArrowTip + i*2, yArrowTip + i, nSize - i*2 + 1 );
- }
- }
- this.drawArrowRight = function ( color, xArrowTip, yArrowTip, sPenStyle, nSize )
- {
- for ( var i = 1; i <= nSize/2; i++ )
- {
- this.drawHorzLine ( color, 1, sPenStyle, xArrowTip - nSize - 1, yArrowTip - i, nSize - i*2 + 1 );
- this.drawHorzLine ( color, 1, sPenStyle, xArrowTip - nSize - 1, yArrowTip + i, nSize - i*2 + 1 );
- }
- }
- this.drawArrowUp = function ( color, xArrowTip, yArrowTip, sPenStyle, nSize )
- {
- for ( var i = 1; i <= nSize/2; i++ )
- {
- this.drawVertLine ( color, 1, sPenStyle, xArrowTip - i, yArrowTip + i*2, nSize - i*2 + 1 );
- this.drawVertLine ( color, 1, sPenStyle, xArrowTip + i, yArrowTip + i*2, nSize - i*2 + 1 );
- }
- }
- this.drawArrowDown = function ( color, xArrowTip, yArrowTip, sPenStyle, nSize )
- {
- sPenStyle = 'solid';
- this.drawVertLine ( color, 1, sPenStyle, xArrowTip, yArrowTip - nSize - 1, nSize ); // Center line
- for ( var i = 1; i <= nSize/2; i++ )
- {
- this.drawVertLine ( color, 1, sPenStyle, xArrowTip - i, yArrowTip - nSize - 1, nSize - i*2 + 1 );
- this.drawVertLine ( color, 1, sPenStyle, xArrowTip + i, yArrowTip - nSize - 1, nSize - i*2 + 1 );
- }
- }
- this.fillRectangle = function ( color, x, y, width, height, opacity, extra )
- {
- this.div ( color, x, y, width, height, '', opacity, extra );
- }
- this.drawHorzLine = function ( color, penWidth, penStyle, x, y, width )
- {
- this.divLine ( color, x, y, width, penWidth, penStyle, penWidth, '', '', 'horzLine' );
- }
- this.drawHorzLineToPoint = function ( color, penWidth, penStyle, point1, point2 )
- {
- if ( point1.x == point2.x )
- return;
- // The first point should always be on the left
- if ( point1.x > point2.x )
- {
- var pointSwap = point1;
- point1 = point2;
- point2 = pointSwap;
- }
- var length = point2.x - point1.x;
- this.divLine ( color, point1.x, point1.y, length, penWidth, penStyle, penWidth, '', '', 'horzLine' );
- }
- this.drawVertLine = function ( color, penWidth, penStyle, x, y, height )
- {
- this.divLine ( color, x, y, penWidth, height, penStyle, penWidth, '', '', 'vertLine' );
- }
- this.drawVertLineToPoint = function ( color, penWidth, penStyle, point1, point2 )
- {
- if ( point1.y == point2.y )
- return;
- // The first point should always be on the top
- if ( point1.y > point2.y )
- {
- var pointSwap = point1;
- point1 = point2;
- point2 = pointSwap;
- }
- var height = point2.y - point1.y + penWidth;
-
- this.divLine ( color, point1.x, point1.y, penWidth, height, penStyle, penWidth, '', '', 'vertLine' );
- }
- this.drawVertAngledLineToPoint = function ( color, penWidth, penStyle, point1, point2, nElbowOffset )
- {
- if ( ! point1 || ! point2 )
- return;
- if ( point1.y == point2.y )
- return;
- // The first point should always be on the top
- var ptArrow = point2;
- if ( point1.y > point2.y )
- {
- var pointSwap = point1;
- point1 = point2;
- point2 = pointSwap;
- ptArrow = point1;
- }
- var nOffset = point2.y - point1.y;
- var xStep = point1.x - 20 - nElbowOffset;
- var ptStep = new CPoint ( xStep, point1.y + ( point2.y - point1.y ) / 2 );
- var ptStep1 = new CPoint ( xStep, point1.y );
- var ptStep2 = new CPoint ( xStep, point2.y );
- this.drawHorzLineToPoint ( color, penWidth, penStyle, point1, ptStep1 );
- this.drawVertLineToPoint ( color, penWidth, penStyle, ptStep1, ptStep2 );
- this.drawHorzLineToPoint ( color, penWidth, penStyle, ptStep2, point2 );
- this.drawArrowRight ( color, ptArrow.x, ptArrow.y, penStyle, DG.graphDefaults.nArrowSize );
- }
- this.drawLinePointToPoint = function ( color, penWidth, penStyle, pt1, pt2, nElbowOffset )
- {
- var point1 = pt1;
- var point2 = pt2;
- if ( point1 == point2 )
- return;
- // The first point should always be on the left
- if ( point1.x > point2.x )
- {
- var pointSwap = point1;
- point1 = point2;
- point2 = pointSwap;
- }
- // By now point1 is guaranteed to be on the left
- // point1.x += 1;
- if ( DG.graphDefaults.bUseShadows )
- point1.x += DG.graphDefaults.nShadowWidth - 1;
- if ( point1.y == point2.y )
- {
- this.drawHorzLineToPoint ( color, penWidth, penStyle, point1, point2 );
- return;
- }
- var xStep = point1.x + ( point2.x - point1.x ) / 2;
- xStep = Math.max ( point1.x + DG.graphDefaults.nArrowSize + 5, xStep - nElbowOffset );
- var ptStep1 = new CPoint ( xStep, point1.y );
- var ptStep2 = new CPoint ( xStep, point2.y );
- this.drawHorzLineToPoint ( color, penWidth, penStyle, point1, ptStep1 );
- this.drawVertLineToPoint ( color, penWidth, penStyle, ptStep1, ptStep2 );
- this.drawHorzLineToPoint ( color, penWidth, penStyle, ptStep2, point2 );
- }
- this.addId = function ( sId )
- {
- if ( typeof sId != "undefined" && sId.length > 0 )
- {
- this.buf.append( ' id=' );
- this.buf.append( sId );
- }
- }
- this.addTooltip = function ( sTooltip )
- {
- if ( typeof sTooltip != "undefined" && sTooltip.length > 0 )
- {
- this.buf.append( ' alt="' ); // For tooltip support in Internet Explorer
- this.buf.append( sTooltip );
- this.buf.append( '"' );
- this.buf.append( ' title="' ); // For tooltip support in other browsers
- this.buf.append( sTooltip );
- this.buf.append( '"' );
- }
- }
- this.addOpacity = function ( opacity )
- {
- if ( typeof opacity != "undefined" )
- {
- if ( this.ie )
- {
- this.buf.append( 'filter:alpha(opacity=' );
- this.buf.append( opacity * 100 );
- this.buf.append( ');' );
- }
- else
- {
- this.buf.append( 'opacity:' );
- this.buf.append( opacity );
- this.buf.append( ';' );
- }
- }
- // This is equal to one-liner:
- // this.buf.append( (this.ie ? 'filter:alpha(opacity=' + opacity*100 + ');' : 'opacity:' + opacity + ';') );
- }
- this.drawImageImpl = function ( image, className, x, y, width, height, sId, sTooltip )
- {
- this.buf.append( '<div class=' );
- this.buf.append( className );
- this.buf.append( ' style="left:' );
- this.buf.append( x * this.zoomFactor );
- this.buf.append( 'px;top:' );
- this.buf.append( y * this.zoomFactor );
- this.buf.append( 'px;width:' );
- this.buf.append( width * this.zoomFactor );
- this.buf.append( 'px;height:' );
- this.buf.append( height * this.zoomFactor );
- this.buf.append( 'px;' );
- this.buf.append( '">' );
- this.buf.append( '<img src="' );
- this.buf.append( image );
- this.buf.append( '" width=' );
- this.buf.append( width * this.zoomFactor );
- this.buf.append( ' height=' );
- this.buf.append( height * this.zoomFactor );
- this.addId ( sId );
- this.addTooltip ( sTooltip );
- this.buf.append( '><\/div>' );
- /*
- var elemHtml = '<div style="position:absolute;' +
- (typeof opacity != "undefined" && opacity != 1.0 ? (this.ie ? 'filter:alpha(opacity=' + opacity*100 + ');' : 'opacity:' + opacity + ';') : '') +
- 'left:' + x * this.zoomFactor + 'px;' +
- 'top:' + y * this.zoomFactor + 'px;' +
- 'width:' + width * this.zoomFactor + 'px;' +
- 'height:' + height * this.zoomFactor + 'px;' +
- (zIndex > -1 ? 'z-index:' + zIndex + ';' : '') +
- '">' +
- '<img src="' + image + '" width=' + width*this.zoomFactor + ' height=' + height*this.zoomFactor +
- (typeof sId != "undefined" ? ' id=' + sId : '') +
- '><\/div>';
- */
- }
- this.drawIcon = function ( image, x, y, width, height, id, sTooltip )
- {
- this.drawImageImpl ( image, 'classIconType', x, y, width, height, id, sTooltip );
- }
- this.drawActionIcon = function ( image, x, y, width, height, id, sTooltip )
- {
- this.drawImageImpl ( image, 'classIconAction', x, y, width, height, id, sTooltip );
- }
- this.drawBackgroundImage= function ( image, x, y, width, height, id )
- {
- this.drawImageImpl ( image, 'classBkImage', x, y, width, height, id );
- }
- /*
- * drawCaptionRect - intended to draw a caption rect with the bottom border only,
- * the image background, an icon at the left & the text aligned
- * alongside to the icon.
- * This one function will replace three others:
- * - gdi.drawBackgroundImage
- * - gdi.drawHorzLine
- * - gdi.drawString
- */
- this.drawCaptionRect = function ( idRect, className, text, x, y, width, height, penWidth, image )
- {
- var rectWidth = width - penWidth + 2;
- var rectHeight = height - penWidth + 2;
- if ( ! this.ie ) // for Firefox
- {
- rectWidth -= ( penWidth + 1 );
- rectHeight -= ( penWidth + 1 );
- }
- this.buf.append( '<div class=' );
- this.buf.append( className );
- this.buf.append( ' id=' );
- this.buf.append( idRect );
- this.buf.append( ' style="position:absolute;white-space:nowrap;overflow:hidden;' );
- this.buf.append( 'left:' );
- this.buf.append( x * this.zoomFactor );
- this.buf.append( 'px;top:' );
- this.buf.append( y * this.zoomFactor );
- this.buf.append( 'px;width:' );
- this.buf.append( width * this.zoomFactor );
- this.buf.append( 'px;height:' );
- this.buf.append( height * this.zoomFactor );
- this.buf.append( 'px;">' );
- this.buf.append( '<img src="' );
- this.buf.append( image );
- this.buf.append( '" width=' );
- this.buf.append( width * this.zoomFactor );
- this.buf.append( ' height=' );
- this.buf.append( height * this.zoomFactor );
- this.buf.append( ' class="img">' );
- this.buf.append( text );
- this.buf.append( '<\/div>' );
- /*
- this.htm += '<div class=' + className + ' id=' + idRect +
- ' style="position:absolute;white-space:nowrap;overflow:hidden;' +
- 'left:' + x * this.zoomFactor + 'px;' +
- 'top:' + y * this.zoomFactor + 'px;' +
- 'width:' + width * this.zoomFactor +'px;' +
- 'height:' + height* this.zoomFactor +'px;">' +
- '<img src="' + image + '" width=' + width*this.zoomFactor + ' height=' + height*this.zoomFactor + ' class="img">' +
- text +
- '<\/div>';
- */
- }
- this.drawRectangle = function ( color, x, y, width, height, sBorderStyle, penWidth, idRect )
- {
- var rectWidth = width - penWidth + 2;
- var rectHeight = height - penWidth + 2;
- if ( ! this.ie ) // for Firefox
- {
- rectWidth -= ( penWidth + 1 );
- rectHeight -= ( penWidth + 1 );
- }
- this.divLine ( color, x, y, rectWidth, rectHeight, sBorderStyle, penWidth, '', idRect );
- }
- this.drawString = function ( sText, color, x, y, width, height, font, size, style, sId, sTooltip )
- {
- var escapedText = escapeHTML( sText );
- var colorText = typeof color == "string" ? color : color.rgb;
- var opacity = color.opacity;
- var font_used = font != "" ? font : "verdana,geneva,helvetica,sans-serif";
- var fontStyle = getFontStyle (style);
- this.buf.append( '<div style="position:absolute;white-space:nowrap;overflow:hidden;' );
- this.buf.append( 'left:' );
- this.buf.append( x * this.zoomFactor );
- this.buf.append( 'px;top:' );
- this.buf.append( y * this.zoomFactor );
- this.buf.append( 'px;width:' );
- this.buf.append( width * this.zoomFactor );
- this.buf.append( 'px;height:' );
- this.buf.append( height * this.zoomFactor );
- this.buf.append( 'px;font-family:' );
- this.buf.append( font_used );
- this.buf.append( ';font-size:' );
- this.buf.append( size * this.zoomFactor );
- this.buf.append( 'px;z-index:1;' );
- this.buf.append( fontStyle );
- this.addOpacity( opacity );
- this.buf.append( 'color:' );
- this.buf.append( colorText );
- this.buf.append( ';"' );
- this.addId ( sId );
- this.addTooltip ( sTooltip );
- this.buf.append( '>' );
- this.buf.append( escapedText );
- this.buf.append( '<\/div>' );
- /*
- this.htm += '<div style="position:absolute;white-space:nowrap;overflow:hidden;'+
- 'left:' + x * this.zoomFactor + 'px;' +
- 'top:' + y * this.zoomFactor + 'px;' +
- 'width:' + width * this.zoomFactor +'px;' +
- 'height:' + height * this.zoomFactor +'px;' +
- 'font-family:' + font_used + ';'+
- 'font-size:' + size * this.zoomFactor + 'px;' +
- 'z-index:' + 1 + ';' +
- fontStyle +
- (typeof opacity != "undefined" ? (this.ie ? 'filter:alpha(opacity=' + opacity*100 + ');' : 'opacity:' + opacity + ';') : '') +
- 'color:' + colorText + ';"' +
- (typeof sId != "undefined" ? ' id=' + sId : '') +
- '>' +
- escapedText +
- '<\/div>';
- */
- }
- this.moveObject = function ( elem, x, y )
- {
- var domElem = elem;
- if ( typeof elem == "string" )
- domElem = document.getElementById( elem );
- domElem.style.left = x * this.zoomFactor + 'px';
- domElem.style.top = y * this.zoomFactor + 'px';
- }
- this.resizeObject = function ( elem, width, height )
- {
- var domElem = elem;
- if ( typeof elem == "string" )
- domElem = document.getElementById( elem );
- domElem.style.width = width * this.zoomFactor;
- domElem.style.height= height * this.zoomFactor;
- }
- // Private methods
- this.div = function ( color, x, y, width, height, sBorderStyle, opacity, extra )
- {
- var colorBk = typeof color == "string" ? color : color.rgb;
- x = x * this.zoomFactor;
- y = y * this.zoomFactor;
- width = width * this.zoomFactor;
- height = height * this.zoomFactor;
- if ( width < 1 ) width = 1;
- if ( height < 1 ) height = 1;
- this.buf.append( '<div style="position:absolute;' );
- this.buf.append( 'left:' );
- this.buf.append( x );
- this.buf.append( 'px;top:' );
- this.buf.append( y );
- this.buf.append( 'px;width:' );
- this.buf.append( width );
- this.buf.append( 'px;height:' );
- this.buf.append( height );
- this.buf.append( 'px;' );
- if ( sBorderStyle )
- {
- this.buf.append( 'border-style:' );
- this.buf.append( sBorderStyle );
- this.buf.append( ';' );
- }
- if ( this.ie )
- this.buf.append( 'clip:rect(0,' + width + 'px,' + height + 'px,0);' );
- this.addOpacity( opacity );
- this.buf.append( 'background-color:' );
- this.buf.append( colorBk );
- this.buf.append( ';"' );
- if ( extra )
- {
- this.buf.append( ' ' );
- this.buf.append( extra );
- }
- this.buf.append( '><\/div>' );
- /*
- var sBkColor = 'background-color:' + colorBk + ';';
- var sBorderString = sBorderStyle ? 'border-style:' + sBorderStyle + ';' : '';
- this.htm += '<div style="position:absolute;' +
- 'left:' + x + 'px;' +
- 'top:' + y + 'px;' +
- 'width:' + width + 'px;' +
- 'height:' + height + 'px;' +
- (sBorderString ? sBorderString : '') +
- (this.ie ? 'clip:rect(0,' + width + 'px,' + height + 'px,0);' : '') +
- (opacity ? (this.ie ? 'filter:alpha(opacity=' + opacity*100 + ');' : 'opacity:' + opacity + ';') : '') +
- sBkColor + '"' +
- (extra ? ' ' + extra : '') +
- '><\/div>';
- */
- }
- this.divLine = function ( color, x, y, width, height, sBorderStyle, nBorderWidth, opacity, sId, extra )
- {
- var colorBorder = typeof color == "string" ? color : color.rgb;
- x = x * this.zoomFactor;
- y = y * this.zoomFactor;
- width = width * this.zoomFactor;
- height = height * this.zoomFactor;
- if ( width < 1 ) width = 1;
- if ( height < 1 ) height = 1;
- var sBorderString = '';
- var sBkColor = 'background-color: transparent;';
- var sLineHack = 'font-size: 0px;'; // A hack to correctly render lines in IE6
- if ( sBorderStyle )
- {
- // special sBorderStyle values are to be set by line drawing methods
- if ( extra == 'horzLine' )
- {
- sBorderString = 'border-color:' + colorBorder + ';' + 'border-style:' + sBorderStyle + ';';
- sBorderString += 'border-left-width: 0px;' + 'border-top-width: ' + height + 'px;';
- sBorderString += 'border-right-width: 0px;' + 'border-bottom-width: 0px;';
- }
- else
- if ( extra == 'vertLine' )
- {
- sBorderString = 'border-color:' + colorBorder + ';' + 'border-style:' + sBorderStyle + ';';
- sBorderString += 'border-left-width: ' + width + 'px;' + 'border-top-width: 0px;';
- sBorderString += 'border-right-width: 0px;' + 'border-bottom-width: 0px;';
- }
- else
- {
- sBorderString = 'border-style:' + sBorderStyle + ';' + 'border-width:' + nBorderWidth + ';';
- }
- }
- this.buf.append( '<div style="position:absolute;' );
- this.buf.append( 'left:' );
- this.buf.append( x );
- this.buf.append( 'px;top:' );
- this.buf.append( y );
- this.buf.append( 'px;width:' );
- this.buf.append( width );
- this.buf.append( 'px;height:' );
- this.buf.append( height );
- this.buf.append( 'px;' );
- if ( sLineHack )
- this.buf.append( sLineHack );
- if ( sBorderString )
- this.buf.append( sBorderString );
- if ( this.ie )
- this.buf.append( 'clip:rect(0,' + width + 'px,' + height + 'px,0);' );
- if ( opacity )
- {
- this.addOpacity( opacity );
- }
- this.buf.append( sBkColor );
- this.buf.append( '"' );
- this.addId ( sId );
- this.buf.append( '><\/div>' );
- }
- this.drawPixel = function ( color, x, y, opacity )
- {
- this.div ( color, x, y, 1, 1, '', opacity );
- }
- function getFontStyle ( style )
- {
- fontStyle = "";
- if (typeof style == "undefined")
- return fontStyle;
- if (style.search (/bold/i) >= 0)
- fontStyle += "font-weight:bold;";
- if (style.search (/italic/i) >= 0)
- fontStyle += "font-style:italic;";
- return fontStyle;
- }
- }
|