The subclass IlvHyperEdgeConnector allows hyperedges to
connect to pins at the node. (See the following figure.)
Optionally, the pins can be visible. Thus, the pin connector is a
visible connector, that is, isGraphic returns true. The pin connector
contains a set of pins.
![pinconnector.gif](../usrhyperdiag/_media/pinconnector_default.gif)
Pin connector
A pin is implemented by the class IlvHyperGrapherPin or its subclasses. Before
a pin can be used, it must be added to the corresponding pin
connector. The API of IlvHyperEdgePinConnector includes the methods
listed in the following table.
Methods of IlvHyperEdgePinConnector
Method |
Description
|
---|---|
Adds the
pin to the hyperedge pin connector. If the redraw flag is true
and the pin is visible, it will be redrawn. |
|
Removes
the pin from the hyperedge pin connector. If the redraw flag is
true and the pin was visible, the area of the pin will be
redrawn. |
|
Returns
all pins of the hyperedge pin connector. |
|
Returns
the number of pins in the hyperedge pin connector. |
|
Returns
the closest pin that is suitable for the hyperedge end at the
input point p. |
|
Connects
the hyperedge end to the input pin. The pin must belong to the
hyperedge pin connector. The connector must be attached to a
node and the hyperedge end must point to this node. |
The class
IlvHyperGrapherPin
is a concrete class that is ready to use. It displays a pin as a
small rectangle at the border of the node.
You can also create subclasses of
IlvHyperGrapherPin
. You can specify whether it is possible to connect only one or
several hyperedge ends to the same pin. You can restrict even more
tightly which hyperedge ends can connect to a pin by overriding the
method allow.
The API of
IlvHyperGrapherPin
includes the methods listed in.
Methods of IlvHyperGrapherPin
Method |
Description
|
---|---|
Returns
the hyperedge ends that are currently connected to the pin. |
|
Tests
whether the input hyperedge end is connected to this pin. |
|
Returns
whether the hyperedge end is allowed to be connect to the pin.
|
|
Returns
the position of the pin in transformed view coordinates. |
|
Sets the
position of the pin in transformed view coordinates. |
|
Sets
whether the pin is currently selected. A selected pin is drawn
in a different color from unselected pins. Usually, pins get
selected during interactions that manipulate pins. |
|
Sets whether the pin is movable interactively. Interactors
check whether pins are movable before calling
setPosition
on the pin.
|
|
Sets
whether multiple hyperedge ends can be connected to the same
pin. If false is passed, a different pin must be used for each
hyperedge end. |
The position of the pin is the position
where the pin is drawn. It is the center point of the pin, since
pins can have a size.
To create a pin, use the constructor:
IlvHyperGrapherPin(IlvPoint proportionalLocation, IlvPoint absoluteLocation, float size, int direction)
The position of the pin is specified by a
proportional part and by an absolute part. The proportional part is
a position relative to the bounding box of the node. If the
proportional location is (0,0), it will be the upper left corner of
the node. If the proportional location is (1,1), it will be the
lower right of the node. The real position is calculated in the
following way:
pin.position = node.position + proportionalLocation * node.size + absoluteLocation
Hyperedges can connect to the pin position
(the center point of the pin). Since pins have a size, it is
sometimes useful to connect the hyperedges to a different point. If
the pin is on the left side of the node, it is better to connect
the hyperedge to the left side of the pin. If the pin is on the
right side of the node, it is better to connect the hyperedge to
the right side of the pin.
This behavior can be controlled by a
direction parameter passed to the constructor of the pin. If you
pass the direction 0, the pin will decide heuristically which is
the best point of the pin to connect a hyperedge to.