Drawing terminals in a figure like the logic example [message #175403] |
Mon, 04 April 2005 13:55  |
Eclipse User |
|
|
|
Originally posted by: jdelgad.correo.ugr.es
Hi all,
I have created a figure with 2 output terminals (like the andGate in
the logic example, although in this case are input terminals). Now I would
like to know how to allow the user to set a connection to the terminal he
prefers, i.e. how to make that an output connection could be set in two
different points into the same figure.
Thank you very much.
|
|
|
|
|
Re: Drawing terminals in a figure like the logic example (another problem) [message #175585 is a reply to message #175437] |
Tue, 05 April 2005 05:57   |
Eclipse User |
|
|
|
Originally posted by: jgreenyer.s-und-n.de
Hi Jose Antonio,
I suppose you're copying the implementation of the OutputFigure in the
Logic example (I didn't get that clearly from the previous mail).
You should find out where you have the NullPointerException. I guess
maybe somewhere in your "NodeFigure" (if you inherit from this like in
the Logic example). Have a closer look on your error log and start
tracking your problem from there.
Maybe, it is because you put your Anchors in the connectionAnchors
Hashtable with other key strings and cannot be esolved correctly.
Joel
Jose wrote:
> Hi,
>
> I have already solved this problem with this code, but I have another
> problem:
>
>
> public OutputFigure() {
>
> FixedConnectionAnchor outputConnectionAnchorA, outputConnectionAnchorB;
> outputConnectionAnchorA = new FixedConnectionAnchor(this);
> outputConnectionAnchorA.offsetV = 4;
> outputConnectionAnchorB = new FixedConnectionAnchor(this);
> outputConnectionAnchorB.offsetV =10;
> outputConnectionAnchors.addElement(outputConnectionAnchorA);
> outputConnectionAnchors.addElement(outputConnectionAnchorB);
> connectionAnchors.put(Box.TERMINAL_A, outputConnectionAnchorA);
> connectionAnchors.put(Box.TERMINAL_B, outputConnectionAnchorB);
> setLayoutManager(new StackLayout());
> }
>
> Now, when I draw a connection between two nodes, the connection
> disappear and I get the following exception:
>
> Unhandled event loop exception
> Reason:
> java.lang.NullPointerException
>
> When the nodes only had one output terminal this exception didn't
> occur. The code I had then was the following:
>
> public OutputFigure() {
> outputConnectionAnchor = new FixedConnectionAnchor(this);
> outputConnectionAnchor.topDown = true;
> outputConnectionAnchor.offsetH = -1;
> outputConnectionAnchors.addElement(outputConnectionAnchor);
> connectionAnchors.put(SimpleOutput.TERMINAL_OUT, outputConnectionAnchor);
> setLayoutManager(new StackLayout());
> }
>
> Where is the problem? Please help!!
>
> --Jose Antonio.
>
>
>
>
>
>
|
|
|
Re: Drawing terminals ... PROBLEM SOLVED [message #175677 is a reply to message #175585] |
Tue, 05 April 2005 14:16  |
Eclipse User |
|
|
|
Originally posted by: jdelgad.correo.ugr.es
Hi Joel,
the problem was what you say in your previous mail. I was putting the
two anchors in the hashTable with the same key string, and they weren't
able to be resolved.
Thank you for your help
--Jose.
|
|
|
Powered by
FUDForum. Page generated in 0.04507 seconds