/** * Implements attaching a widget to a pin. The widget is VMDPinWidget and has object-hover and select action. * The the node id ends with "#default" then the pin is the default pin of a node and therefore it is non-visual. * @param node the node * @param pin the pin * @return the widget attached to the pin, null, if it is a default pin */ protected Widget attachPinWidget (String node, String pin) { if (pin.endsWith (PIN_ID_DEFAULT_SUFFIX)) return null; VMDPinWidget widget = new VMDPinWidget (this, scheme); ((VMDNodeWidget) findWidget (node)).attachPinWidget (widget); widget.getActions ().addAction (createObjectHoverAction ()); widget.getActions ().addAction (createSelectAction ()); return widget; }
/** * Implements attaching a widget to a pin. The widget is VMDPinWidget and has object-hover and select action. * The the node id ends with "#default" then the pin is the default pin of a node and therefore it is non-visual. * @param node the node * @param pin the pin * @return the widget attached to the pin, null, if it is a default pin */ protected Widget attachPinWidget (String node, String pin) { if (pin.endsWith (PIN_ID_DEFAULT_SUFFIX)) return null; VMDPinWidget widget = new VMDPinWidget (this, scheme); ((VMDNodeWidget) findWidget (node)).attachPinWidget (widget); widget.getActions ().addAction (createObjectHoverAction ()); widget.getActions ().addAction (createSelectAction ()); return widget; }
/** * Implements attaching a widget to a node. The widget is VMDNodeWidget and has object-hover, select, popup-menu and move actions. * @param node the node * @return the widget attached to the node */ protected Widget attachNodeWidget (String node) { VMDNodeWidget widget = new VMDNodeWidget (this, scheme); mainLayer.addChild (widget); widget.getHeader ().getActions ().addAction (createObjectHoverAction ()); widget.getActions ().addAction (createSelectAction ()); widget.getActions ().addAction (moveAction); return widget; }
/** * Implements attaching a widget to an edge. the widget is ConnectionWidget and has object-hover, select and move-control-point actions. * @param edge the edge * @return the widget attached to the edge */ protected Widget attachEdgeWidget (String edge) { VMDConnectionWidget connectionWidget = new VMDConnectionWidget (this, scheme); connectionWidget.setRouter (router); connectionLayer.addChild (connectionWidget); connectionWidget.getActions ().addAction (createObjectHoverAction ()); connectionWidget.getActions ().addAction (createSelectAction ()); connectionWidget.getActions ().addAction (moveControlPointAction); return connectionWidget; }
/** * Implements attaching a widget to a node. The widget is VMDNodeWidget and has object-hover, select, popup-menu and move actions. * @param node the node * @return the widget attached to the node */ protected Widget attachNodeWidget (String node) { VMDNodeWidget widget = new VMDNodeWidget (this, scheme); mainLayer.addChild (widget); widget.getHeader ().getActions ().addAction (createObjectHoverAction ()); widget.getActions ().addAction (createSelectAction ()); widget.getActions ().addAction (moveAction); return widget; }
/** * Implements attaching a widget to an edge. the widget is ConnectionWidget and has object-hover, select and move-control-point actions. * @param edge the edge * @return the widget attached to the edge */ protected Widget attachEdgeWidget (String edge) { VMDConnectionWidget connectionWidget = new VMDConnectionWidget (this, scheme); connectionWidget.setRouter (router); connectionLayer.addChild (connectionWidget); connectionWidget.getActions ().addAction (createObjectHoverAction ()); connectionWidget.getActions ().addAction (createSelectAction ()); connectionWidget.getActions ().addAction (moveControlPointAction); return connectionWidget; }