0
1

Hi,\nI begin my work with JGraphX. I have some problem, I would like to create cell which don't containe access port. It is possible?

\n

Thank you for answer. Martin

asked 18 Jul '11, 01:43

marrt's gravatar image

marrt
116
accept rate: 0%


It sounds like you want a cell/vertex that can accept a connection, but itself cannot create an outgoing connection. There is no property which provides this directly. You will have to override the isValidSource function of the connection handler:

\n
graph.connectionHandler.isValidSource = function(me)\n{\n    if (/*your logic here (using 'me' as the cell)*/) {\n        return false;\n    }\n    return this.graph.isValidSource(graph.getModel().getCell(me.id));\n};\n
link

answered 15 Aug '11, 08:03

jamesk's gravatar image

jamesk
111
accept rate: 0%

The Validity demo has an example of constraining the number (and type) of in/outgoing edges. But thanks for letting me know about isValidSource!

(17 Aug '11, 12:41) eisbaw

Thank you for answer, but I want find method which care about cell validate when I have mouse press and I create edge. Is there any method which I can override? \nThank you for answer Martin.

(18 Aug '11, 01:02) marrt

Yes, you can create a cell with no child cell.

link

answered 19 Jul '11, 00:10

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

But when I create cell without child. Cell has also access port. How can I create cell without access port?\nThank you for answer. Martin

(19 Jul '11, 04:01) marrt

Not sure what you mean by access port. BTW: You can disable connections by using mxCell.setConnectable(false).

(19 Jul '11, 04:13) Gaudenz

Access port is for me port in the middle every cell. What I know in every cell is possible to connect. I know that there is a method where isn't allowed to connection in cell "mxCell.setConnectable(false)". But when I want to create cell c1 and set c1.setConnectable(false) and then I want to create cell port1 as child c1 and set port1.setConnectable(true), I fount out that is possible to make connection for example cell c3 whith cell c1 or port1. And I don't know why? So I ask, "How create cell without access port?" Thank you for answer. Martin

(19 Jul '11, 09:22) marrt

I have overloaded isValidSource method but this is valid for source, is there any method for isValidTarget if we want to valid the target ?

thanks.!

(21 Sep '12, 16:00) cheyo

yes! there is.

 mxConnectionHandler.prototype.isValidTarget = function(cell)
(21 Sep '12, 16:08) cheyo
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×194
×66
×6

Asked: 18 Jul '11, 01:43

Seen: 2,170 times

Last updated: 21 Sep '12, 16:35