示例#1
0
 @Override
 protected void unregister(IViewer<Node> viewer) {
   if (edgeLabelPart != null) {
     removeAnchored(edgeLabelPart);
     getParent().removeChild(edgeLabelPart);
     edgeLabelPart = null;
   }
   super.unregister(viewer);
 }
示例#2
0
 @Override
 protected void doActivate() {
   super.doActivate();
   getContent().addPropertyChangeListener(edgeAttributesPropertyChangeListener);
   // add label part
   if (edgeLabelPart == null) {
     edgeLabelPart = injector.getInstance(EdgeLabelPart.class);
     edgeLabelPart.getVisual().getStyleClass().add(CSS_CLASS_LABEL);
     getParent().addChild(edgeLabelPart);
     edgeLabelPart.addAnchorage(this);
   }
 }
示例#3
0
 @Override
 public void setContent(Object content) {
   super.setContent(content);
   if (content == null) {
     return;
   }
   if (!(content instanceof Edge)) {
     throw new IllegalArgumentException("Content of wrong type!");
   }
   final FXConnection visual = getVisual();
   setAdapter(
       AdapterKey.get(
           Provider.class, FXDefaultFeedbackPartFactory.SELECTION_FEEDBACK_GEOMETRY_PROVIDER),
       new Provider<IGeometry>() {
         @Override
         public IGeometry get() {
           return FXUtils.localToParent(
               visual,
               FXUtils.localToParent(
                   visual.getCurveNode(),
                   ((FXGeometryNode<?>) visual.getCurveNode()).getGeometry()));
         }
       });
   setAdapter(
       AdapterKey.get(
           Provider.class, FXDefaultFeedbackPartFactory.HOVER_FEEDBACK_GEOMETRY_PROVIDER),
       new Provider<IGeometry>() {
         @Override
         public IGeometry get() {
           return FXUtils.localToParent(
               visual,
               FXUtils.localToParent(
                   visual.getCurveNode(),
                   ((FXGeometryNode<?>) visual.getCurveNode()).getGeometry()));
         }
       });
 }
示例#4
0
 @Override
 protected void register(IViewer<Node> viewer) {
   super.register(viewer);
 }
示例#5
0
 @Override
 protected void doDeactivate() {
   getContent().removePropertyChangeListener(edgeAttributesPropertyChangeListener);
   super.doDeactivate();
 }
示例#6
0
 @Override
 protected void doActivate() {
   super.doActivate();
   getContent().addPropertyChangeListener(nodeAttributesPropertyChangeListener);
 }