1
/* This notice must be untouched at all times.
4
The latest version is available at
5
http://www.openjacob.org
7
Copyright (c) 2006 Andreas Herz. All rights reserved.
8
Created 5. 11. 2006 by Andreas Herz (Web: http://www.freegroup.de )
12
This library is free software; you can redistribute it and/or
13
modify it under the terms of the GNU Lesser General Public
14
License (LGPL) as published by the Free Software Foundation; either
15
version 2.1 of the License, or (at your option) any later version.
17
This library is distributed in the hope that it will be useful,
18
but WITHOUT ANY WARRANTY; without even the implied warranty of
19
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
Lesser General Public License for more details.
22
You should have received a copy of the GNU Lesser General Public
23
License along with this library; if not, write to the Free Software
24
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA,
25
or see http://www.gnu.org/copyleft/lesser.html
31
* @author Andreas Herz
34
draw2d.LineColorDialog=function(figure /*:draw2d.Figure*/)
36
draw2d.ColorDialog.call(this);
40
var color = figure.getColor();
41
this.updateH(this.rgb2hex(color.getRed(),color.getGreen(),color.getBlue()));
44
draw2d.LineColorDialog.prototype = new draw2d.ColorDialog;
46
draw2d.LineColorDialog.prototype.type="LineColorDialog";
52
draw2d.LineColorDialog.prototype.onOk=function()
54
var oldWorkflow = this.workflow;
55
draw2d.ColorDialog.prototype.onOk.call(this);
56
if(typeof this.figure.setColor =="function")
58
// 1.) undo/redo support
59
oldWorkflow.getCommandStack().execute(new draw2d.CommandSetColor(this.figure, this.getSelectedColor()));
61
// 2.) without undo/redo
62
//this.figure.setColor(this.getSelectedColor());
65
// update the workflow with the new property of the object
66
// ( propagate a selection event )
67
if(oldWorkflow.getCurrentSelection()==this.figure)
68
oldWorkflow.setCurrentSelection(this.figure);