From: Bryan R. <rio...@gm...> - 2005-05-13 17:09:52
|
Hello, This should be an easy question for you experts... :-) So I'm creating a network comprised of nodes and edges and using=20 DisplaySurface to display it. My nodes are gray, with the border color=20 depending on what type of node it is. Some have yellow borders and some hav= e=20 blue borders. Now, when a node gets disabled, it turns red and the border= =20 stays the same color. I have a loop that goes through each node and=20 determines if it needs to be disabled and sets the disabled flag within tha= t=20 object accordingly. The node objects extend DefaultDrawableNode, so when on= e=20 is disabled, the setColor() function is called to change its color to red.= =20 After I run through this loop, I call the repaint() method in the=20 DisplaySurface class to repaint the display so the disabled nodes are shown= =20 as red. So this works fine. My problem, however, is this: the node can also= =20 be disabled by checking a boolean box when it is probed. If the widget that= =20 pops up when the node is probed covers the node, then when it is shut the= =20 node is the correct color. However, if the widget was not covering the node= ,=20 then the color doesn't change. I'm assuming this is because the=20 DisplaySurface repaints the area that the widged covered and that's it (i'm= =20 assuming this because if the widget covers half the node, then when it is= =20 shut half the node turns red). Is there a function I can call from within m= y=20 node object (which extends DefaultDrawableEdge) so that the node is=20 repainted when the boolean box is checked? I cannot call the repaint()=20 method from the node object because the DisplaySurface variable is not=20 visible to the object. The class that contains the DisplaySurface variable= =20 is also the class that creates the node objects. |