< prev index next >
application/org.openjdk.jmc.ui/src/main/java/org/openjdk/jmc/ui/charts/QuantitySpanRenderer.java
Print this page
*** 73,82 ****
--- 73,86 ----
private static int calcMargin(int height) {
return Math.min(5, (height + 10) / 20);
}
+ public String getName() {
+ return text;
+ }
+
@Override
public IRenderedRow render(Graphics2D context, SubdividedQuantityRange xRange, int height) {
int margin = calcMargin(height);
int innerHeight = height - 2 * margin;
context.translate(0, margin);
*** 99,124 ****
--- 103,131 ----
private final XYQuantities<?> points;
private final IRenderedRow content;
private final Paint paint;
private final int margin;
private String description;
+ private String text;
public QuantitySpanRendering(int margin, XYQuantities<?> points, IRenderedRow content, Paint paint, String text,
String description) {
super(Arrays.asList(new RenderedRowBase(margin), content, new RenderedRowBase(margin)),
content.getHeight() + 2 * margin, text, description, null);
this.margin = margin;
this.points = points;
this.content = content;
this.paint = paint;
this.description = description;
+ this.text = text;
}
@Override
public void infoAt(IChartInfoVisitor visitor, int x, int y, Point offset) {
offset = new Point(offset.x, offset.y + margin);
content.infoAt(visitor, x, y, offset);
+ visitor.enterScope(text, true);
// FIXME: Only output this if near the boundaries? At least handle infinite lengths.
if (points != null) {
int bucket = points.floorIndexAtX(x);
if (bucket < points.getSize()) {
*** 172,181 ****
--- 179,193 ----
IQuantity org = super.getEndX();
return (org == MISSING_END) ? null : org;
}
@Override
+ public String getName() {
+ return text;
+ }
+
+ @Override
public String getDescription() {
return description;
}
}
< prev index next >