Search in sources :

Example 1 with ConnectorModel

use of org.freeplane.features.link.ConnectorModel in project freeplane by freeplane.

the class MMapMouseListener method mousePressed.

public void mousePressed(final MouseEvent e) {
    super.mousePressed(e);
    if (e.isPopupTrigger())
        return;
    final MapView mapView = (MapView) e.getComponent();
    final Object object = mapView.detectCollision(new Point(originX, originY));
    if (object instanceof ConnectorModel) {
        final ConnectorModel arrowLinkModel = (ConnectorModel) object;
        final Shape shape = arrowLinkModel.getShape();
        if (Shape.EDGE_LIKE.equals(shape) || Shape.LINE.equals(shape) && !arrowLinkModel.isSelfLink()) {
            return;
        }
        draggedLink = arrowLinkModel;
        draggedLinkOldStartPoint = draggedLink.getStartInclination();
        draggedLinkOldEndPoint = draggedLink.getEndInclination();
        draggedLink.setShowControlPoints(true);
        mapView.repaintVisible();
    }
}
Also used : Shape(org.freeplane.features.link.ConnectorModel.Shape) ConnectorModel(org.freeplane.features.link.ConnectorModel) MapView(org.freeplane.view.swing.map.MapView) Point(java.awt.Point)

Example 2 with ConnectorModel

use of org.freeplane.features.link.ConnectorModel in project freeplane by freeplane.

the class ConnectorProxy method setEndArrowImpl.

private void setEndArrowImpl(final ArrowType arrowType) {
    final ConnectorModel connector = getConnector();
    getLinkController().changeArrowsOfArrowLink(connector, connector.getStartArrow(), arrowType);
}
Also used : ConnectorModel(org.freeplane.features.link.ConnectorModel)

Example 3 with ConnectorModel

use of org.freeplane.features.link.ConnectorModel in project freeplane by freeplane.

the class ConnectorProxy method setStartArrowImpl.

private void setStartArrowImpl(final ArrowType arrowType) {
    final ConnectorModel connector = getConnector();
    getLinkController().changeArrowsOfArrowLink(connector, arrowType, connector.getEndArrow());
}
Also used : ConnectorModel(org.freeplane.features.link.ConnectorModel)

Example 4 with ConnectorModel

use of org.freeplane.features.link.ConnectorModel in project freeplane by freeplane.

the class ConnectorIterator method next.

public Proxy.Connector next() {
    if (!hasNext()) {
        throw new NoSuchElementException();
    }
    final ConnectorModel current = next;
    next = getNextConnectorModel();
    return new ConnectorProxy(current, scriptContext);
}
Also used : ConnectorModel(org.freeplane.features.link.ConnectorModel) NoSuchElementException(java.util.NoSuchElementException)

Example 5 with ConnectorModel

use of org.freeplane.features.link.ConnectorModel in project freeplane by freeplane.

the class NodeProxy method addConnectorTo.

// Node: R/W
public Proxy.Connector addConnectorTo(final String targetNodeID) {
    final MLinkController linkController = (MLinkController) LinkController.getController();
    final ConnectorModel connectorModel = linkController.addConnector(getDelegate(), targetNodeID);
    return new ConnectorProxy(connectorModel, getScriptContext());
}
Also used : MLinkController(org.freeplane.features.link.mindmapmode.MLinkController) ConnectorModel(org.freeplane.features.link.ConnectorModel)

Aggregations

ConnectorModel (org.freeplane.features.link.ConnectorModel)7 MLinkController (org.freeplane.features.link.mindmapmode.MLinkController)2 Font (java.awt.Font)1 Point (java.awt.Point)1 NoSuchElementException (java.util.NoSuchElementException)1 Shape (org.freeplane.features.link.ConnectorModel.Shape)1 NodeLinkModel (org.freeplane.features.link.NodeLinkModel)1 INodeView (org.freeplane.features.map.INodeView)1 NodeModel (org.freeplane.features.map.NodeModel)1 MapView (org.freeplane.view.swing.map.MapView)1 ConnectorView (org.freeplane.view.swing.map.link.ConnectorView)1 EdgeLinkView (org.freeplane.view.swing.map.link.EdgeLinkView)1 ILinkView (org.freeplane.view.swing.map.link.ILinkView)1