Esempio n. 1
0
  public final void drawU(UGraphic ug) {
    final StringBounder stringBounder = ug.getStringBounder();
    final TextBlockInEllipse ellipse = new TextBlockInEllipse(desc, stringBounder);
    if (getSkinParam().shadowing()) {
      ellipse.setDeltaShadow(3);
    }

    if (url != null) {
      ug.startUrl(url);
    }

    ug =
        ug.apply(stroke)
            .apply(
                new UChangeColor(
                    SkinParamUtils.getColor(
                        getSkinParam(), ColorParam.usecaseBorder, getStereo())));
    HtmlColor backcolor = getEntity().getSpecificBackColor();
    if (backcolor == null) {
      backcolor =
          SkinParamUtils.getColor(getSkinParam(), ColorParam.usecaseBackground, getStereo());
    }
    ug = ug.apply(new UChangeBackColor(backcolor));
    final UGraphic ug2 = new MyUGraphicEllipse(ug, 0, 0, ellipse.getUEllipse());

    ellipse.drawU(ug2);

    if (url != null) {
      ug.closeAction();
    }
  }
Esempio n. 2
0
  public final void drawU(UGraphic ug) {
    final UEllipse circle = new UEllipse(SIZE, SIZE);
    if (getSkinParam().shadowing()) {
      circle.setDeltaShadow(4);
    }
    ug =
        ug.apply(
                new UChangeBackColor(
                    SkinParamUtils.getColor(
                        getSkinParam(), ColorParam.classBackground, getStereo())))
            .apply(
                new UChangeColor(
                    SkinParamUtils.getColor(getSkinParam(), ColorParam.classBorder, getStereo())));
    if (url != null) {
      ug.startUrl(url);
    }
    ug.apply(new UStroke(1.5)).draw(circle);

    final Dimension2D dimDesc = desc.calculateDimension(ug.getStringBounder());
    final double widthDesc = dimDesc.getWidth();
    // final double totalWidth = Math.max(widthDesc, SIZE);

    final double x = SIZE / 2 - widthDesc / 2;
    final double y = SIZE;
    desc.drawU(ug.apply(new UTranslate(x, y)));
    if (url != null) {
      ug.closeAction();
    }
  }
Esempio n. 3
0
 public final void drawU(UGraphic ug) {
   if (url != null) {
     ug.startUrl(url);
   }
   if (getShapeType() == ShapeType.ROUND_RECTANGLE) {
     ug = drawNormal(ug);
   } else if (getShapeType() == ShapeType.OCTAGON) {
     ug = drawOctagon(ug);
   } else {
     throw new UnsupportedOperationException();
   }
   if (url != null) {
     ug.closeAction();
   }
 }
Esempio n. 4
0
 @Override
 protected void drawInternalU(UGraphic ug, double maxX, Context2D context) {
   final StringBounder stringBounder = ug.getStringBounder();
   final double xStart = getStartingX(stringBounder);
   ug = ug.apply(new UTranslate(xStart, getStartingY()));
   final Dimension2D dimensionToUse =
       new Dimension2DDouble(
           getPreferredWidth(stringBounder), comp.getPreferredHeight(stringBounder));
   if (url != null) {
     ug.startUrl(url);
   }
   comp.drawU(ug, new Area(dimensionToUse), context);
   if (url != null) {
     ug.closeAction();
   }
 }
  public final void drawU(UGraphic ug) {
    ug =
        ug.apply(
            new UChangeColor(
                SkinParamUtils.getColor(getSkinParam(), ColorParam.classBorder, getStereo())));
    ug =
        ug.apply(
            new UChangeBackColor(
                SkinParamUtils.getColor(getSkinParam(), ColorParam.classBackground, getStereo())));
    if (url != null) {
      ug.startUrl(url);
    }
    final double sizeSmall = 14;
    final double diff = (SIZE - sizeSmall) / 2;
    final UEllipse circle1 = new UEllipse(sizeSmall, sizeSmall);
    if (getSkinParam().shadowing()) {
      // circle.setDeltaShadow(4);
    }
    ug.apply(new UStroke(1.5)).apply(new UTranslate(diff, diff)).draw(circle1);
    ug = ug.apply(new UChangeBackColor(null));

    Point2D pos = bibliotekon.getShape(getEntity()).getPosition();

    final List<Line> lines = bibliotekon.getAllLineConnectedTo(getEntity());
    final UTranslate reverse = new UTranslate(pos).reverse();
    final ConnectedCircle connectedCircle = new ConnectedCircle(SIZE / 2);
    for (Line line : lines) {
      Point2D pt = line.getMyPoint(getEntity());
      pt = reverse.getTranslated(pt);
      connectedCircle.addSecondaryConnection(pt);
    }
    // connectedCircle.drawU(ug.apply(new UStroke(1.5)));
    connectedCircle.drawU(ug);

    //
    // final Dimension2D dimDesc = desc.calculateDimension(ug.getStringBounder());
    // final double widthDesc = dimDesc.getWidth();
    // // final double totalWidth = Math.max(widthDesc, SIZE);
    //
    // final double x = SIZE / 2 - widthDesc / 2;
    // final double y = SIZE;
    // desc.drawU(ug.apply(new UTranslate(x, y)));
    if (url != null) {
      ug.closeAction();
    }
  }