Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Controling the number of connections
Controling the number of connections [message #171916] Tue, 15 March 2005 17:40 Go to next message
Eclipse UserFriend
Originally posted by: i92deosj.uco.es

Hi!

I have created several figures, and now I want to connect them
one-to-one, i.e. only one input connection and one output connection. How
can I know if the connection been created is the second connection? And
how can I know if this connection is an input connection or an output
connection?

If someone could give me any example, I would be grateful.

Thank you very much
Re: Controling the number of connections [message #171937 is a reply to message #171916] Tue, 15 March 2005 19:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: huangjun.cs.umb.edu

I suppose we are talking gef, so,
all pieces of information you need are just in your model, right?
From an editpart you can get underlying model thru getModel() medthod and
then it's your own logic.

In class AbstractGraphicalEditPart you see getModelSourceConnections(output
connections) method and getModelTargetConnections(input connections) method.
You just need return a one-element-list in these two methods of your
customized editpart class to implement one input and one output.

Say, a model like this
interface model_node {
model_line getInput();
model_line getOutput();
...
}

and a connection model like this
interface model_line {
model_node getSource();
model_node getTarget();
...
}

then
class model_node_editpart {
protected List getModelSourceConnections() {
// return a list containing only
((model_node)getModel()).getOutput()
// or an empty list if no output;
}

protected List getModelTargetConnections() {
// return a list containing only ((model_node)getModel()).getInput()
// or an empty list if no input;
}
}

Then your customized model_line_editpart will be created as controller of
model_line instance.

Correct me if I am wrong. Good luck!

Best,
Jun

" Jose Antonio" <i92deosj@uco.es> wrote in message
news:d176mr$131$1@www.eclipse.org...
> Hi!
>
> I have created several figures, and now I want to connect them
> one-to-one, i.e. only one input connection and one output connection. How
> can I know if the connection been created is the second connection? And
> how can I know if this connection is an input connection or an output
> connection?
>
> If someone could give me any example, I would be grateful.
>
> Thank you very much
>
2-level graphical editor [message #172415 is a reply to message #171916] Thu, 17 March 2005 22:39 Go to previous messageGo to next message
benedict heal is currently offline benedict healFriend
Messages: 28
Registered: July 2009
Junior Member
I want to have one graphical editor showing the high-level view of a
network of nodes, and a more detailed graphical editor to edit the
'current' node.

I can put an action in the right-click popup menu, but don't know how to
launch the second editor on the current node.

Any help much appreciated.

Thanks,
Benedict
Re: 2-level graphical editor [message #172423 is a reply to message #172415] Thu, 17 March 2005 23:28 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Search this newsgroup (or the platform newsgroup, since that is where this
question really belongs). BTW, you might want to do the same for REQ_OPEN,
and then your detailed editor would open when the user double-clicks on the
node.

"benedict heal" <bh@benedictheal.com> wrote in message
news:d1d0v3$5ib$1@www.eclipse.org...
>
> I want to have one graphical editor showing the high-level view of a
> network of nodes, and a more detailed graphical editor to edit the
> 'current' node.
>
> I can put an action in the right-click popup menu, but don't know how to
> launch the second editor on the current node.
>
> Any help much appreciated.
>
> Thanks,
> Benedict
Previous Topic:FigureCanvas vs. ScrollPane: a question
Next Topic:multiple events being fired on updating figures?
Goto Forum:
  


Current Time: Wed Apr 24 22:29:02 GMT 2024

Powered by FUDForum. Page generated in 0.02844 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top