예제 #1
0
  public boolean render(MiPart obj, MiRenderer renderer) {
    if (!enabled) return (true);

    if (!(obj instanceof MiMultiPointShape)) return (true);

    MiDistance size;
    MiAttributes attributes = obj.getAttributes();
    Graphics g = renderer.getWindowSystemRenderer();
    MiPoint basePoint = new MiPoint();
    MiPoint endPoint = new MiPoint();

    // FIX: if line length < lineEndSize then exit

    int style = attributes.getLineStartStyle();
    int lwidth = renderer.getLineWidth();
    Color color;
    Color fillColor;
    if (useTargetObjectAttributes) color = attributes.getColor();
    else color = getAttributes().getColor();

    if (useTargetObjectAttributes) fillColor = attributes.getBackgroundColor();
    else fillColor = getAttributes().getBackgroundColor();

    if (style != Mi_NONE) {
      size = attributes.getLineStartSize();
      if (attributes.getLineEndsSizeFnOfLineWidth()) size += attributes.getLineWidth();

      double exitAngle = obj.getPointExitAngle(0) + Math.PI;
      obj.getPoint(0, basePoint);
      calcNewLineEndPoint(renderer, exitAngle, style, size, basePoint);
      obj.getPoint(0, endPoint);
      renderLineEnd(
          renderer, exitAngle, style, size, basePoint, endPoint, lwidth, color, fillColor);
    }
    style = attributes.getLineEndStyle();
    if (style != Mi_NONE) {
      size = attributes.getLineEndSize();
      if (attributes.getLineEndsSizeFnOfLineWidth()) size += attributes.getLineWidth();

      double entryAngle = obj.getPointEntryAngle(-1);
      obj.getPoint(-1, basePoint);
      calcNewLineEndPoint(renderer, entryAngle, style, size, basePoint);
      g.setColor(attributes.getColor());
      obj.getPoint(-1, endPoint);
      renderLineEnd(
          renderer, entryAngle, style, size, basePoint, endPoint, lwidth, color, fillColor);
    }
    return (true);
  }
예제 #2
0
 public Color getColor() {
   if (graphics != null) return (graphics.getColor());
   return (attributes.getColor());
 }