Ejemplo n.º 1
0
  public EndOperationNodeGR(
      OperationNode operationNode, ProcessRepresentation aDrawing, boolean isInPalet) {
    super(operationNode, ShapeType.CIRCLE, aDrawing, isInPalet);

    // Important: width is different from height here to avoid connector blinking when editing
    // layout
    // This little difference allows a kind of hysteresis favourizing horizontal layout
    setWidth(30.1);
    setHeight(30);

    setIsFloatingLabel(true);

    foreground = ForegroundStyle.makeStyle(Color.BLACK);
    foreground.setLineWidth(0.2);
    background = BackgroundStyle.makeColoredBackground(getMainBgColor());
    setForeground(foreground);
    setBackground(background);
    setDimensionConstraints(DimensionConstraints.UNRESIZABLE);

    painterForeground = ForegroundStyle.makeStyle(Color.DARK_GRAY);
    painterForeground.setLineWidth(2.0);
    painterBackground = BackgroundStyle.makeColoredBackground(Color.DARK_GRAY);

    setShapePainter(
        new ShapePainter() {
          @Override
          public void paintShape(FGEShapeGraphics g) {
            g.useBackgroundStyle(painterBackground);
            g.fillCircle(0.2, 0.2, 0.6, 0.6);
          }
        });
  }
Ejemplo n.º 2
0
  public OperatorGR(O operatorNode, ProcessRepresentation aDrawing, boolean isInPalet) {
    super(operatorNode, ShapeType.LOSANGE, aDrawing, isInPalet);
    // setX(getOperatorNode().getPosX());
    // setY(getOperatorNode().getPosY());
    setWidth(35);
    setHeight(35);

    // setText(getOperatorNode().getName());
    // setAbsoluteTextX(getOperatorNode().getNodeLabelPosX());
    // setAbsoluteTextY(getOperatorNode().getNodeLabelPosY());
    setIsFloatingLabel(true);

    foreground = ForegroundStyle.makeStyle(Color.BLACK);
    foreground.setLineWidth(0.6);

    if (getImageIcon() != null) {
      background = BackgroundStyle.makeImageBackground(getImageIcon());
      ((BackgroundStyle.BackgroundImage) background).setScaleX(1);
      ((BackgroundStyle.BackgroundImage) background).setScaleY(1);
      ((BackgroundStyle.BackgroundImage) background).setDeltaX(-2);
      ((BackgroundStyle.BackgroundImage) background).setDeltaY(-3);
    } else {
      background = BackgroundStyle.makeEmptyBackground();
    }

    setForeground(foreground);
    setBackground(background);

    setDimensionConstraints(DimensionConstraints.UNRESIZABLE);

    if (getOperatorNode().getLevel() == FlexoLevel.ACTIVITY) {
      setLayer(ACTIVITY_LAYER);
    } else if (getOperatorNode().getLevel() == FlexoLevel.OPERATION) {
      setLayer(OPERATION_LAYER);
    } else if (getOperatorNode().getLevel() == FlexoLevel.ACTION) {
      setLayer(ACTION_LAYER);
    }

    updatePropertiesFromWKFPreferences();
  }