示例#1
0
  @Override
  protected final void paintBarArea(final Rectangle thisArea, final MColor thisBGColor) {
    // The bar drawing rectangle without margins
    Rectangle barDrawingRect =
        new Rectangle(
            barAreaRect.x + marginLeft,
            barAreaRect.y + marginTop,
            barAreaRect.width - marginLeft - marginRight,
            barAreaRect.height - marginTop - marginBottom);
    // actual bar box
    Rectangle barBox;

    // calculate the biggest bar Index
    biggestBarIndex = calcBiggestBarIndex();
    // Draw the background
    thisBGColor.setColor(gc);
    thisBGColor.setBGColor(gc);
    gc.fillRectangle(thisArea);
    if (bars.size() > 0) {
      for (int i = currentShift; i < currentShift + barCount; i++) {
        // Only shift when the bar is no overlay bar.
        barBox = calculateBarContainer(barDrawingRect, ((Bar) bars.get(i)).getIndex());
        // barBox = calculateBarContainer(barDrawingRect, ((Bar)bars.get(i)).getIndex(),
        // biggestBarIndex);
        ((Bar) bars.get(i)).setBox(barBox);
        ((Bar) bars.get(i)).setGC(gc);
        ((Bar) bars.get(i)).drawBar();
      }
    }
  }
示例#2
0
  @Override
  protected final void paintDescTopArea(
      final Rectangle thisArea, final MColor thisBGColor, final MColor thisFontColor) {
    thisBGColor.setColor(gc);
    thisBGColor.setBGColor(gc);
    gc.fillRectangle(thisArea);

    thisFontColor.setColor(gc);
  }
示例#3
0
  @Override
  protected final void paintDescBottomArea(
      final Rectangle thisArea, final MColor thisBGColor, final MColor thisFontColor) {
    // The bar drawing rectangle without margins
    Rectangle descDrawingRect =
        new Rectangle(
            barAreaRect.x + marginLeft,
            descBottomRect.y,
            barAreaRect.width - marginLeft - marginRight,
            descBottomRect.height);
    // actual bar box
    Rectangle textBox;

    thisBGColor.setColor(gc);
    thisBGColor.setBGColor(gc);
    gc.fillRectangle(thisArea);

    thisFontColor.setColor(gc);
    for (int i = currentShift; i < currentShift + barCount; i++) {
      textBox = calculateTextContainer(descDrawingRect, ((Bar) bars.get(i)).getIndex());
      ((Bar) bars.get(i)).drawLowerLabel(textBox, gc);
    }
  }