Thanks for the reply.  What I am essentially trying to do is change the color 
of a processor after I click it.  I believe I am grabbing the correct 
GraphViewComponent because the getLabel() method returns the correct name of 
the processor.  The problem is that setColor() seems to have no effect.  Here 
is my code.

Dataflow dataflow = (Dataflow) getContextualSelection().getParent();
Processor processor = (Processor) getContextualSelection().getSelection();

GraphController controller = 
GraphViewComponent.graphControllerMap.get(dataflow);
GraphElement procElement = controller.getElement(dataflow.getLocalName() + 
processor.getLocalName());

System.out.println(procElement.getLabel()); //Prints the correct name of the 
processor

procElement.setColor(Color.red); //Appears to do nothing
procElement.setFillColor(Color.red); //Appears to do nothing

Thanks again!
Daniel Kuc

-----Original Message-----
From: David Withers <[email protected]>
To: [email protected]
Date: Fri, 05 Mar 2010 12:20:18 -0800
Subject: Re: [Taverna-hackers] Changing color of dataflow components

On 01/03/2010 16:13, Daniel Kuc wrote:
> Hello,
> 
> Thanks for your help so far.
> 
> What I want to do is change the color while editing the workflow.  I
> was able to get a GraphComponent from the GraphController.  When I
> call the setColor() method it is not reflected  on screen, but if I
> call getColor() it is set to the new value.
> 
> Do I need to refresh the workflow?
> 
> Any help is greatly appreciated.

Calling setColor on a GraphElement should change the colour on screen
(assuming the corresponding GraphViewComponent is being displayed).

I think I'll need to see the code you're calling setColor from to try
and work out the problem.

David.

-- 
David Withers
School of Computer Science, University of Manchester,
Oxford Road, Manchester, M13 9PL, UK.
+44 (0)161 275 0683

------------------------------------------------------------------------------
Download IntelĀ® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
taverna-hackers mailing list
[email protected]
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/taverna-mailing-lists/
Developers Guide: http://www.mygrid.org.uk/tools/developer-information




------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
taverna-hackers mailing list
[email protected]
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/taverna-mailing-lists/
Developers Guide: http://www.mygrid.org.uk/tools/developer-information

Reply via email to