Beispiel #1
0
  public EntityImageNote2(IEntity entity, ISkinParam skinParam, Collection<Link> links) {
    super(entity, skinParam);

    final Rose skin = new Rose();

    comp = skin.createComponent(ComponentType.NOTE, null, skinParam, entity.getDisplay());
  }
  public void drawU(
      UGraphic ug,
      double xTheoricalPosition,
      double yTheoricalPosition,
      double marginWidth,
      double marginHeight) {
    final Dimension2D dim = getDimension(ug.getStringBounder());

    final double widthTotal = dim.getWidth() + 2 * marginWidth;
    final double heightTotal = dim.getHeight() + 2 * marginHeight;
    final URectangle rect = new URectangle(widthTotal, heightTotal);

    // if (entity.getParent() == null) {
    if (entity.getType() != EntityType.GROUP) {
      ug.getParam().setBackcolor(rose.getHtmlColor(param, ColorParam.classBackground));
      ug.getParam().setColor(rose.getHtmlColor(param, ColorParam.classBorder));
      ug.draw(xTheoricalPosition - marginWidth, yTheoricalPosition - marginHeight, rect);
      // name.drawU(ug, xTheoricalPosition + margin, yTheoricalPosition + margin);
      name.drawU(ug, xTheoricalPosition + 0, yTheoricalPosition + 0);
    } else {
      // final Frame frame = new Frame(StringUtils.getWithNewlines(entity.getDisplay()),
      // Color.BLACK, param
      // .getFont(FontParam.CLASS), rose.getHtmlColor(param, ColorParam.classBorder).getColor());
      final Frame frame = new Frame(entity.getDisplay2(), param);

      ug.getParam().setBackcolor(rose.getHtmlColor(param, ColorParam.background));
      ug.getParam().setColor(null);
      ug.draw(xTheoricalPosition - marginWidth, yTheoricalPosition - marginWidth, rect);

      final double oldX = ug.getTranslateX();
      final double oldY = ug.getTranslateY();
      ug.translate(xTheoricalPosition - marginWidth, yTheoricalPosition - marginHeight);
      frame.drawU(ug, new Area(new Dimension2DDouble(widthTotal, heightTotal)), null);
      // ug.translate(-xTheoricalPosition + marginWidth,
      // -yTheoricalPosition + marginHeight);
      ug.setTranslate(oldX, oldY);

      // playField.drawInternal(UGraphicUtils.translate(ug, xTheoricalPosition + margin,
      // yTheoricalPosition +
      // margin
      // + frame.getPreferredHeight(ug.getStringBounder())));
      playField.drawInternal(
          UGraphicUtils.translate(
              ug,
              xTheoricalPosition + 0,
              yTheoricalPosition + 0 + frame.getPreferredHeight(ug.getStringBounder())));
    }
  }
Beispiel #3
0
  public void drawU(UGraphic ug, Area area, Context2D context) {
    final Dimension2D dimensionToUse = area.getDimensionToUse();
    final HtmlColor lineColor = rose.getHtmlColor(skinParam, ColorParam.packageBorder);
    ug.getParam().setColor(lineColor);
    ug.getParam().setBackcolor(null);
    ug.getParam().setStroke(new UStroke(1.4));
    ug.draw(0, 0, new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight()));
    ug.getParam().setStroke(new UStroke());

    final TextBlock textBlock = createTextBloc();
    textBlock.drawU(ug, 2, 2);

    final Dimension2D textDim = getTextDim(ug.getStringBounder());
    final double x = textDim.getWidth() + 6;
    final double y = textDim.getHeight() + 6;
    final UPolygon poly = new UPolygon();
    poly.addPoint(x, 0);
    poly.addPoint(x, y - 6);
    poly.addPoint(x - 6, y);
    poly.addPoint(0, y);
    poly.addPoint(0, 0);
    ug.getParam().setColor(lineColor);
    ug.getParam().setStroke(new UStroke(1.4));
    ug.draw(0, 0, poly);
    ug.getParam().setStroke(new UStroke());
  }
 protected HtmlColor getInLinkRenderingColor(Ftile tile) {
   final HtmlColor color;
   final LinkRendering linkRendering = tile.getInLinkRendering();
   if (linkRendering == null || linkRendering.getColor() == null) {
     color = rose.getHtmlColor(getSkinParam(), ColorParam.activityArrow);
   } else {
     color = linkRendering.getColor();
   }
   return color;
 }
 protected final TextBlock getTextBlock(Display display) {
   if (Display.isNull(display)) {
     return null;
   }
   final ISkinParam skinParam = getSkinParam();
   final UFont font = skinParam.getFont(FontParam.ACTIVITY_ARROW, null, false);
   final HtmlColor color = rose.getFontColor(skinParam, FontParam.ACTIVITY_ARROW);
   final FontConfiguration fontConfiguration =
       new FontConfiguration(
           font, color, skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink());
   return display.create(
       fontConfiguration, HorizontalAlignment.LEFT, this, CreoleMode.SIMPLE_LINE);
 }
Beispiel #6
0
 protected final HtmlColor getColor(ColorParam colorParam, Stereotype stereo) {
   final String s = stereo == null ? null : stereo.getLabel();
   return rose.getHtmlColor(skinParam, colorParam, s);
 }
 public EntityImageNoteLink(Display note, Colors colors, ISkinParam skinParam) {
   final Rose skin = new Rose();
   comp = skin.createComponent(ComponentType.NOTE, null, colors.mute(skinParam), note);
 }