Example #1
0
  @Override
  protected void paint(PPaintContext pc) {
    Graphics2D g2 = pc.getGraphics();
    g2.setColor(Color.BLACK);
    g2.setStroke(STROKE_ARROW);
    g2.draw(line);

    g2.draw(arrowHead);
    g2.fill(arrowHead);
  }
Example #2
0
  protected void paint(PPaintContext paintContext) {
    Graphics2D g2 = paintContext.getGraphics();

    g2.setPaint(getPaint());
    g2.draw(getBoundsReference());
    g2.setFont(CalendarNode.DEFAULT_FONT);

    float y = (float) getY() + CalendarNode.TEXT_Y_OFFSET;
    paintContext
        .getGraphics()
        .drawString(dayOfMonthString, (float) getX() + CalendarNode.TEXT_X_OFFSET, y);

    if (hasWidthFocus && hasHeightFocus) {
      paintContext.pushClip(getBoundsReference());
      for (int i = 0; i < lines.size(); i++) {
        y += 10;
        g2.drawString((String) lines.get(i), (float) getX() + CalendarNode.TEXT_X_OFFSET, y);
      }
      paintContext.popClip(getBoundsReference());
    }
  }