/** * implementiert ein Blatt * * @param name eindeutiger Name zwecks Referenzierung * @param caption Kurzbeschreibung * @param reference URL auf die verzweigt werden soll * @author Dierk Neumann */ function leaf(name, caption, reference) { this.name = (name?name:''); this.caption= (caption?caption:''); this.reference = (reference?reference:''); this.isTouched = false; this.root = null; this.paintOffset = null; leaf.prototype.register = leaf__register; leaf.prototype.setRoot = leaf__setRoot; leaf.prototype.paint = leaf__paint; leaf.prototype.touch = leaf__touch; leaf.prototype.release= leaf__release; leaf.prototype.getPaintOffset = leaf__getPaintOffset; /** * liefert den Offset in Pixel zum malen des Baums */ function leaf__getPaintOffset() { try { if (!this.root) { this.paintOffset = 19; } else { this.paintOffset = this.root.getPaintOffset() + 10; } return(this.paintOffset); } catch (error) { throw new Error(-1,"Failure in leaf[getPaintOffset] " + error.description); } } /** * vermerkt das Blatt in einer Karte * * @param map Karte in der das Blatt zu registrieren ist */ function leaf__register(map) { try { map[this.name] = this; } catch (error) { throw new Error(-1,"Failure in leaf[register] " + error.description); } } /** * weist dem Blatt eine Wurzel zu * * @param root Objekt der Wurzel */ function leaf__setRoot(root) { try { this.root = root; } catch (error) { throw new Error(-1,"Failure in leaf[setRoot] " + error.description); } } /** * anfassen des Blattes */ function leaf__touch() { try { this.isTouched = true; // ggf. übergeordnete Bäume aufklappen if (this.root && !this.root.isExpanded) { this.root.expand(); } } catch (error) { throw new Error(-1,"Failure in leaf[touch] " + error.description); } } /** * loslassen des Blattes */ function leaf__release() { try { this.isTouched = false; if (this.root) { this.root.release(); } } catch (error) { throw new Error(-1,"Failure in leaf[release] " + error.description); } } /** * malt das Blatt in Form von Zeilen einer Tabelle */ function leaf__paint() { try { // Aussehen festlegen var cssClass=null; if (!this.root) { if (this.isTouched) { cssClass='menu_isRootContext'; } else { cssClass='menu_isRoot'; } } else { if (this.isTouched) { cssClass='menu_isNormalContext'; } else { cssClass='menu_isNormal'; } } // Aussehen bei Auswahl var cssSelectorClass = null; if (this.root) { cssSelectorClass = 'menu_isNormalSelector'; } else { cssSelectorClass = 'menu_isRootSelector'; } var rowHeight=(!this.root?"28px":"20px"); document.write( '' + '' + '' + '' + this.caption + '' + '' ); } catch (error) { throw new Error(-1,"Failure in leaf[paint] " + error.description); } } } /** * implementiert einen Baum * * @param name eindeutiger Name zwecks Referenzierung * @param caption Kurzbeschreibung * @param reference URL auf die verzweigt werden soll * @param leaves zugehörige weitere Bäume bzw. Blätter * @author Dierk Neumann */ function tree(name, caption, reference, leaves) { // Properties veröffentlichen this.name = (name?name:''); this.caption = (caption?caption:''); this.reference = (reference?reference:''); this.leaves = (leaves?leaves:new Array()); this.isTouched = false; this.isExpanded = false; this.root= null; this.paintOffset = null; // die Wurzel in den zugehörigen Bäumen / Blättern vermerken for (var j=0; j' + '' + ' ' + '' + '' + '' + this.caption + '' + '' ); // das Menü ggf. aufklappen for (var i=0; i