Path: blob/trunk/third_party/closure/goog/graphics/ext/rectangle.js
2868 views
// Copyright 2007 The Closure Library Authors. All Rights Reserved.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// http://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is distributed on an "AS-IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.131415/**16* @fileoverview A thick wrapper around rectangles.17* @author [email protected] (Robby Walker)18*/192021goog.provide('goog.graphics.ext.Rectangle');2223goog.require('goog.graphics.ext.StrokeAndFillElement');24252627/**28* Wrapper for a graphics rectangle element.29* @param {goog.graphics.ext.Group} group Parent for this element.30* @constructor31* @extends {goog.graphics.ext.StrokeAndFillElement}32* @final33*/34goog.graphics.ext.Rectangle = function(group) {35// Initialize with some stock values.36var wrapper = group.getGraphicsImplementation().drawRect(370, 0, 1, 1, null, null, group.getWrapper());38goog.graphics.ext.StrokeAndFillElement.call(this, group, wrapper);39};40goog.inherits(41goog.graphics.ext.Rectangle, goog.graphics.ext.StrokeAndFillElement);424344/**45* Redraw the rectangle. Called when the coordinate system is changed.46* @protected47* @override48*/49goog.graphics.ext.Rectangle.prototype.redraw = function() {50goog.graphics.ext.Rectangle.superClass_.redraw.call(this);5152// Our position is already handled by transform_.53this.getWrapper().setSize(this.getWidth(), this.getHeight());54};555657