Path: blob/trunk/third_party/closure/goog/graphics/stroke.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 Represents a stroke object for goog.graphics.17* @author [email protected] (Erik Arvidsson)18*/192021goog.provide('goog.graphics.Stroke');22232425/**26* Creates an immutable stroke object.27*28* @param {number|string} width The width of the stroke.29* @param {string} color The color of the stroke.30* @param {number=} opt_opacity The opacity of the background fill. The value31* must be greater than or equal to zero (transparent) and less than or32* equal to 1 (opaque).33* @constructor34* @deprecated goog.graphics is deprecated. It existed to abstract over browser35* differences before the canvas tag was widely supported. See36* http://en.wikipedia.org/wiki/Canvas_element for details.37*/38goog.graphics.Stroke = function(width, color, opt_opacity) {39/**40* The width of the stroke.41* @type {number|string}42* @private43*/44this.width_ = width;454647/**48* The color with which to fill.49* @type {string}50* @private51*/52this.color_ = color;535455/**56* The opacity of the fill.57* @type {number}58* @private59*/60this.opacity_ = opt_opacity == null ? 1.0 : opt_opacity;61};626364/**65* @return {number|string} The width of this stroke.66*/67goog.graphics.Stroke.prototype.getWidth = function() {68return this.width_;69};707172/**73* @return {string} The color of this stroke.74*/75goog.graphics.Stroke.prototype.getColor = function() {76return this.color_;77};787980/**81* @return {number} The opacity of this fill.82*/83goog.graphics.Stroke.prototype.getOpacity = function() {84return this.opacity_;85};868788