/** * Draws the block. * * @param g2 the graphics device. * @param area the area. */ public void draw(Graphics2D g2, Rectangle2D area) { draw(g2, area, null); }
/** * Applies the attributes of this theme to the specified block. * * @param b the block. */ protected void applyToBlock(Block b) { if (b instanceof Title) { applyToTitle((Title) b); } else if (b instanceof LabelBlock) { LabelBlock lb = (LabelBlock) b; lb.setFont(this.regularFont); lb.setPaint(this.legendItemPaint); } }
BlockContainer blockcontainer = new BlockContainer(new BorderArrangement()); LabelBlock labelblock = new LabelBlock(createLabel(newScale, rows), new Font("SansSerif", 1, 12)); labelblock.setPadding(5D, 5D, 5D, 5D); blockcontainer.add(labelblock, RectangleEdge.TOP);
area = trimMargin(area); drawBorder(g2, area); area = trimBorder(area); area = trimPadding(area);
/** * Arranges the contents of the block, within the given constraints, and * returns the block size. * * @param g2 the graphics device. * @param constraint the constraint ({@code null} not permitted). * * @return The block size (in Java2D units, never {@code null}). */ @Override public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) { g2.setFont(this.font); Size2D s = this.label.calculateDimensions(g2); return new Size2D(calculateTotalWidth(s.getWidth()), calculateTotalHeight(s.getHeight())); }
BlockContainer blockcontainer = new BlockContainer(new BorderArrangement()); LabelBlock labelblock = new LabelBlock(createLabel(newScale, rows), new Font("SansSerif", 1, 12)); labelblock.setPadding(5D, 5D, 5D, 5D); blockcontainer.add(labelblock, RectangleEdge.TOP);
area = trimMargin(area); drawBorder(g2, area); area = trimBorder(area); area = trimPadding(area);
/** * Arranges the contents of the block, within the given constraints, and * returns the block size. * * @param g2 the graphics device. * @param constraint the constraint (<code>null</code> not permitted). * * @return The block size (in Java2D units, never <code>null</code>). */ public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) { g2.setFont(this.font); Size2D s = this.label.calculateDimensions(g2); return new Size2D(calculateTotalWidth(s.getWidth()), calculateTotalHeight(s.getHeight())); }
textPaint = this.itemPaint; LabelBlock labelBlock = new LabelBlock(item.getLabel(), textFont, textPaint); labelBlock.setPadding(this.itemLabelPadding); legendItem.add(labelBlock); legendItem.setToolTipText(item.getToolTipText());
/** * Applies the attributes of this theme to the specified block. * * @param b the block. */ protected void applyToBlock(Block b) { if (b instanceof Title) { applyToTitle((Title) b); } else if (b instanceof LabelBlock) { LabelBlock lb = (LabelBlock) b; lb.setFont(this.regularFont); lb.setPaint(this.legendItemPaint); } }
/** * Draws the block. * * @param g2 the graphics device. * @param area the area. */ @Override public void draw(Graphics2D g2, Rectangle2D area) { draw(g2, area, null); }
textPaint = this.itemPaint; LabelBlock labelBlock = new LabelBlock(item.getLabel(), textFont, textPaint); labelBlock.setPadding(this.itemLabelPadding); legendItem.add(labelBlock); legendItem.setToolTipText(item.getToolTipText());