|
From: Jesus M. S. Jr. <jm...@ih...> - 2001-05-03 20:31:14
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Although the actual String has been changed, it has never been rendered.
As soon as an Edge is added to the Graph, and it has a corresponding
VisualGraph, the VisualGraph is told to repaint() itself so that the new
VisualEdge is drawn. Your setText() is called after the repaint() of the
VisualGraph. So you need to call repaint() again.
On Fri, 4 May 2001 01:31, Patrick Hartling wrote:
> I am having a problem trying to override the default text assigned to a
> VisualEdge object. My code is roughly like the following:
>
> public class MyClass extends VisualGraph {
> public boolean connectNodes (Vertex from, Vertex to) {
> try {
> Edge edge = getGraph().addEdge(from, to);
> VisualEdge vis_edge = getVisualEdge(edge);
>
> vis_edge.setText("My label");
> }
> catch (Exception e) {
> // Handle exception ...
> }
> }
> }:
>
> If I call vis_edge.getText(), it gives me a String containing "My label",
> but in the visual graph, the label always displays the from -> to
> relationship. What am I doing wrong?
>
> -Patrick
>
>
> Patrick L. Hartling | Research Assistant, VRAC
> pa...@13... | 2624 Howe Hall -- (515)294-4916
> http://www.137.org/patrick/ | http://www.vrac.iastate.edu/
>
> _______________________________________________
> Openjgraph-development mailing list
> Ope...@li...
> http://lists.sourceforge.net/lists/listinfo/openjgraph-development
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iEYEARECAAYFAjrxwQ8ACgkQAvd5SY4qWYxemgCfahEy+qCd1rf4We7clG3s3DQq
TQUAoIPuIUhZQJBMcv0SAnqaxhGseH3E
=NCP7
-----END PGP SIGNATURE-----
|