123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- goog.provide('goog.graphics.ext.Graphics');
- goog.require('goog.events');
- goog.require('goog.events.EventType');
- goog.require('goog.graphics');
- goog.require('goog.graphics.ext.Group');
- goog.graphics.ext.Graphics = function(
- width, height, opt_coordWidth, opt_coordHeight, opt_domHelper,
- opt_isSimple) {
- var surface = opt_isSimple ?
- goog.graphics.createSimpleGraphics(
- width, height, opt_coordWidth, opt_coordHeight, opt_domHelper) :
- goog.graphics.createGraphics(
- width, height, opt_coordWidth, opt_coordHeight, opt_domHelper);
- this.implementation_ = surface;
- goog.graphics.ext.Group.call(this, null, surface.getCanvasElement());
- goog.events.listen(
- surface, goog.events.EventType.RESIZE, this.updateChildren, false, this);
- };
- goog.inherits(goog.graphics.ext.Graphics, goog.graphics.ext.Group);
- goog.graphics.ext.Graphics.prototype.implementation_;
- goog.graphics.ext.Graphics.prototype.getImplementation = function() {
- return this.implementation_;
- };
- goog.graphics.ext.Graphics.prototype.setCoordSize = function(
- coordWidth, coordHeight) {
- this.implementation_.setCoordSize(coordWidth, coordHeight);
- goog.graphics.ext.Graphics.superClass_.setSize.call(
- this, coordWidth, coordHeight);
- };
- goog.graphics.ext.Graphics.prototype.getCoordSize = function() {
- return this.implementation_.getCoordSize();
- };
- goog.graphics.ext.Graphics.prototype.setCoordOrigin = function(left, top) {
- this.implementation_.setCoordOrigin(left, top);
- };
- goog.graphics.ext.Graphics.prototype.getCoordOrigin = function() {
- return this.implementation_.getCoordOrigin();
- };
- goog.graphics.ext.Graphics.prototype.setPixelSize = function(
- pixelWidth, pixelHeight) {
- this.implementation_.setSize(pixelWidth, pixelHeight);
- var coordSize = this.getCoordSize();
- goog.graphics.ext.Graphics.superClass_.setSize.call(
- this, coordSize.width, coordSize.height);
- };
- goog.graphics.ext.Graphics.prototype.getPixelSize = function() {
- return this.implementation_.getPixelSize();
- };
- goog.graphics.ext.Graphics.prototype.getWidth = function() {
- return this.implementation_.getCoordSize().width;
- };
- goog.graphics.ext.Graphics.prototype.getHeight = function() {
- return this.implementation_.getCoordSize().height;
- };
- goog.graphics.ext.Graphics.prototype.getPixelScaleX = function() {
- return this.implementation_.getPixelScaleX();
- };
- goog.graphics.ext.Graphics.prototype.getPixelScaleY = function() {
- return this.implementation_.getPixelScaleY();
- };
- goog.graphics.ext.Graphics.prototype.getElement = function() {
- return this.implementation_.getElement();
- };
- goog.graphics.ext.Graphics.prototype.render = function(parentElement) {
- this.implementation_.render(parentElement);
- };
- goog.graphics.ext.Graphics.prototype.transform = goog.nullFunction;
- goog.graphics.ext.Graphics.prototype.redraw = function() {
- this.transformChildren();
- };
|