private SegmentColored getSegment(StringBounder stringBounder) { final SegmentColored segment = p1.getLiveThicknessAt(stringBounder, getStartingY()); final SegmentColored segment2 = p1.getLiveThicknessAt( stringBounder, getStartingY() + comp.getPreferredHeight(stringBounder)); return segment.merge(segment2); }
@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(); } }
protected final void afterMessage(StringBounder stringBounder, LifeEvent n, final double pos) { final Participant p = n.getParticipant(); final LifeLine line = drawingSet.getLivingParticipantBox(p).getLifeLine(); if (n.getType() == LifeEventType.ACTIVATE || n.getType() == LifeEventType.CREATE) { return; } if (n.getType() == LifeEventType.DESTROY) { final Component comp = drawingSet .getSkin() .createComponent(ComponentType.DESTROY, drawingSet.getSkinParam(), null); final double delta = comp.getPreferredHeight(stringBounder) / 2; final LifeDestroy destroy = new LifeDestroy( pos - delta, drawingSet.getLivingParticipantBox(p).getParticipantBox(), comp); drawingSet.addEvent(n, destroy); } else if (n.getType() != LifeEventType.DEACTIVATE) { throw new IllegalStateException(); } line.addSegmentVariation(LifeSegmentVariation.SMALLER, pos, n.getSpecificBackColor()); }
@Override public final double getPreferredHeight(StringBounder stringBounder) { return comp.getPreferredHeight(stringBounder); }
public Dimension2D calculateDimension(StringBounder stringBounder) { final double height = comp.getPreferredHeight(stringBounder); final double width = comp.getPreferredWidth(stringBounder); return new Dimension2DDouble(width, height); }