<@class name="SvgFlippable" inherit="SvgClickable" hide="yes"> A flippable element behavior (c) SAP AG 2003-2006. All rights reserved. // constructor function SvgFlippable(peer, props) { if (!peer) return; SvgClickable.apply(this, arguments); this.state = POS(this.state) % this.symbols.length; this.symbolObj = peer; this.peer.flipBehavior = this; this.peer.setState = SvgFlippable.peerSetState; } SVG.declareClass(SvgFlippable, SvgClickable); ////////////////////////////////////////////////////////////////////////////////////// // PROPERTIES <@prop name="state:n">The flipper state (0,1,...n) <@prop name="symbols:String[]">The list of symbol Ids to use for each state of the flipper ////////////////////////////////////////////////////////////////////////////////////// // PRIVATE SvgFlippable.prototype.doclick = function(timer) { this.setState(this.state+1); this.count = (timer && timer.count || 0) + 1; this.callTarget(this.onClick); } SvgFlippable.prototype.setState = function(state) { this.state = POS(state) % this.symbols.length; var symbol = this.symbols[this.state]; SVG.setProperty(this.symbolObj, 'href', '#'+symbol); } SvgFlippable.peerSetState = function(state) { this.flipBehavior.setState(state); }