public void paintComponent(Graphics2D g2d) { // make sure that we ignore the AntiAliasing flag as it does not make sense for vertical lines g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); double scaleFactor = getModelChart().getScaleFactor(); Rectangle clipBounds = g2d.getClipBounds(); int minX = clipBounds.x; int maxX = clipBounds.x+clipBounds.width; int height = getHeight(); int lastScaledTimestamp = Integer.MIN_VALUE; for (Iterator<GCEvent> i = getModelChart().getModel().getFullGCEvents(); i.hasNext();) { GCEvent event = i.next(); int scaledTimestamp = (int)(scaleFactor * (event.getTimestamp() - getModelChart().getModel().getFirstPauseTimeStamp())); if (scaledTimestamp != lastScaledTimestamp && scaledTimestamp >= minX && scaledTimestamp <= maxX) { g2d.drawLine(scaledTimestamp, 0, scaledTimestamp, height); lastScaledTimestamp = scaledTimestamp; } } }
int lastY = Integer.MIN_VALUE; Rectangle clip = g2d.getClipBounds(); int leftBoundary = clip.x; int rightBoundary = clip.x + clip.width;
public void paint(Graphics2D g, StateColorMap colorMap) { Rectangle boundary = g.getClipBounds(); if (x > boundary.getMaxX() || x + width < boundary.getMinX()) { // no need to paint if this line isn't displayed return; } // TODO - we need to clip these to the visible states for (LifelineState state : states) { state.paint(g, colorMap); } }
public void paint(Graphics2D g, StateColorMap colorMap) { Rectangle bounds = g.getClipBounds(); if (startY > bounds.getMaxY() || startY + height < bounds.getMinY()) { return; } int x = line.getX(); int width = line.getWidth(); Color color = colorMap.getColor(stateName); g.setColor(color); g.fillRoundRect(x, startY, width, height, ARC_SIZE, ARC_SIZE); g.setColor(Color.BLACK); }
@Override public Rectangle getClipBounds() { return groupG2D.getClipBounds(); }
public Rectangle getClipBounds() { return delegate.getClipBounds(); }
public Rectangle getClipBounds(Rectangle r) { return delegate.getClipBounds(r); }
public void highlight(Graphics2D g) { Rectangle bounds = g.getClipBounds(); if (startY > bounds.getMaxY() || startY + height < bounds.getMinY()) { return; } int x = line.getX(); int width = line.getWidth(); g.drawRoundRect(x, startY, width, height, ARC_SIZE, ARC_SIZE); }
public void paint(Graphics2D g) { Rectangle boundary = g.getClipBounds(); int y = endingState.getStartY(); // don't paint if we're not in the clip area if (y + ARROW_WIDTH < boundary.getMinY() || y - ARROW_WIDTH > boundary.getMaxY()) { return; } // TODO - we need to clip by X coordinate as well. boolean isReflexsive = getStartingLine() == getEndingLine(); if (isReflexsive) { paintReflexive(g); } else { paintNormal(g); } }
@Override public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; if (selected) { Rectangle clip = g2.getClipBounds(); g2.setColor(new java.awt.Color(224, 224, 224)); g2.fillRect(clip.x, clip.y, clip.width, clip.height); } g2.setFont(Theme.SMALL_FONT); g2.setColor(Color.BLACK); g2.drawString(text, 15, 18); } }
@Override public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; if (selected) { Rectangle clip = g2.getClipBounds(); g2.setColor(Theme.NODE_ATTRIBUTES_PARAMETER_COLOR); g2.fillRect(clip.x, clip.y, clip.width, clip.height); } g2.setFont(Theme.SMALL_FONT); if (selected) { g2.setColor(Color.WHITE); } else { g2.setColor(Color.BLACK); } g2.drawString(text, 15, 18); } }
void prepare(Graphics2D g) { if (!styler.isToolTipsEnabled()) { return; } // clear lists dataPointList.clear(); Rectangle clipBounds = g.getClipBounds(); leftEdge = clipBounds.getX() + MARGIN; rightEdge = clipBounds.getMaxX() - MARGIN * 2; topEdge = clipBounds.getY() + MARGIN; bottomEdge = clipBounds.getMaxY() - MARGIN * 2; }
Rectangle clipBounds = g.getClipBounds();
@Override public Rectangle getClipBounds() { return groupG2D.getClipBounds(); }
/** {@inheritDoc} */ @Override public Rectangle getClipBounds(Rectangle r) { return g2d.getClipBounds(r); }
@Override @Deprecated public Rectangle getClipRect() { return g.getClipBounds(); // Must use getClipBounds() instead of the deprecated getClipRect() method }
@Override @Nullable public Rectangle getClipBounds() { return this.context.getClipBounds(); }
private void paintAd(Graphics2D g) { Font oldFont = g.getFont(); g.setFont(g.getFont().deriveFont(10F)); g.setColor(axisColor); Composite oldComposite = g.getComposite(); g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f)); g.drawString(AD_TEXT, g.getClipBounds().width - g.getFontMetrics().stringWidth(AD_TEXT) - spacing, g.getFontMetrics().getHeight() - spacing + 1); g.setComposite(oldComposite); g.setFont(oldFont); }
private void paintAd(Graphics2D g) { Font oldFont = g.getFont(); g.setFont(g.getFont().deriveFont(10F)); g.setColor(axisColor); Composite oldComposite = g.getComposite(); g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f)); g.drawString(AD_TEXT, g.getClipBounds().width - g.getFontMetrics().stringWidth(AD_TEXT) - spacing, g.getFontMetrics().getHeight() - spacing + 1); g.setComposite(oldComposite); g.setFont(oldFont); }
@Override public void draw(Graphics2D g) { Rectangle2D clipBounds = g.getClipBounds(); if (clipBounds != null) { Collection<Figure> c = quadTree.findIntersects(clipBounds); Collection<Figure> toDraw = sort(c); draw(g, toDraw); } else { draw(g, children); } }