Example #1
0
 @Override
 public void updatePropertiesFromWKFPreferences() {
   super.updatePropertiesFromWKFPreferences();
   setTextStyle(
       TextStyle.makeTextStyle(
           Color.BLACK,
           getWorkflow() != null
               ? getWorkflow().getEventFont(WKFPreferences.getEventNodeFont()).getFont()
               : WKFPreferences.getEventNodeFont().getFont()));
   setIsMultilineAllowed(true);
   getShadowStyle().setShadowDepth(1);
   getShadowStyle().setShadowBlur(3);
 }
  public EntitySpecializationGR(EntitySpecialization anEntitySpecialization, Drawing<?> aDrawing) {
    super(
        ConnectorType.RECT_POLYLIN,
        (ShapeGraphicalRepresentation<?>)
            aDrawing.getGraphicalRepresentation(anEntitySpecialization.getSpecializedEntity()),
        (ShapeGraphicalRepresentation<?>)
            aDrawing.getGraphicalRepresentation(anEntitySpecialization.getParentEntity()),
        anEntitySpecialization,
        aDrawing);
    // setText(getRole().getName());

    updateStyles();

    propertyNameStyle = TextStyle.makeTextStyle(Color.DARK_GRAY, ATTRIBUTE_FONT);

    setTextStyle(propertyNameStyle);

    getConnector().setIsRounded(true);
    getConnector().setRectPolylinConstraints(RectPolylinConstraints.VERTICAL_LAYOUT);
    getConnector().setAdjustability(RectPolylinAdjustability.FULLY_ADJUSTABLE);
    getConnector().setStraightLineWhenPossible(true);
    getConnector().setPixelOverlap(30);

    setEndSymbol(EndSymbolType.PLAIN_ARROW);
    setEndSymbolSize(15);

    if (getSpecializedEntity().hasGraphicalPropertyForKey(getStoredPolylinKey())) {
      ensurePolylinConverterIsRegistered();
      polylinIWillBeAdustedTo =
          (FGERectPolylin) getSpecializedEntity()._graphicalPropertyForKey(getStoredPolylinKey());
      getConnector().setWasManuallyAdjusted(true);
    }

    setForeground(ForegroundStyle.makeStyle(Color.DARK_GRAY, 1.6f));

    setIsFocusable(true);

    addToMouseClickControls(new ResetLayout(), true);
    addToMouseClickControls(new ERDiagramController.ShowContextualMenuControl());
    if (ToolBox.getPLATFORM() != ToolBox.MACOS) {
      addToMouseClickControls(new ERDiagramController.ShowContextualMenuControl(true));
    }
    // addToMouseDragControls(new DrawRoleSpecializationControl());

  }