@Override public void paint(Graphics g) { if (!image.render(g, 0, 0)) { super.paint(g); } }
public BufferedImage createImage(JPanel panel) { int w = panel.getWidth(); int h = panel.getHeight(); BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); Graphics2D g = bi.createGraphics(); panel.paint(g); return bi; }
@Override public void paint(Graphics g) { super.paint(g); g.setColor(TRACK_COLOR); g.fillRect(0, this.getHeight() / 2 - 2, this.getWidth() - KNOB_WIDTH, 5); g.setColor(KNOB_COLOR); g.fillRect(value - KNOB_WIDTH / 2, this.getHeight() / 2 - KNOB_HEIGHT / 2, KNOB_WIDTH, KNOB_HEIGHT); }
@Override public void paint(Graphics g) { super.paint(g); for (int x = 0; x < getWidth(); x += CHECKER_SIZE) { for (int y = 0; y < getHeight(); y += CHECKER_SIZE) { int val = (x / CHECKER_SIZE + y / CHECKER_SIZE) % 2; g.setColor(val == 0 ? Color.LIGHT_GRAY : Color.WHITE); g.fillRect(x, y, CHECKER_SIZE, CHECKER_SIZE); } } g.setColor(color); g.fillRect(0, 0, this.getWidth(), this.getHeight()); } }
@Override public void paint(Graphics g) { super.paint(g); if (zoomBoxStartX != -1 && zoomBoxStartY != -1 && zoomBoxWidth != -1 && zoomBoxHeight != -1) { Graphics2D g2 = (Graphics2D) g.create(); Composite old = g2.getComposite(); g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f)); g2.setColor(Color.BLUE); // g2.drawRect(zoomBoxStartX, zoomBoxStartY, zoomBoxWidth, zoomBoxHeight); // g2.setBackground(Color.BLUE); g2.fillRect(getBoxX(), getBoxY(), getBoxWidth(), getBoxHeight()); g2.setComposite(old); } } }
JScrollPane scroll = new JScrollPane(table); JPanel p = new JPanel(new BorderLayout()); p.add(scroll, BorderLayout.CENTER); JOptionPane.showMessageDialog(null, p); table.addNotify(); p.doLayout(); BufferedImage bi = new BufferedImage(p.getWidth() + 100, p.getHeight() + 100, BufferedImage.TYPE_INT_RGB); Graphics g = bi.createGraphics(); p.paint(g); g.dispose();
public void paint(Graphics g) { super.paint(g); Graphics2D g2d = (Graphics2D) g; g2d.setColor(Color.black); g2d.setTransform( AffineTransform.getTranslateInstance( -shp.getBounds().getMinX(), -shp.getBounds().getMinY())); g2d.draw(shp); g2d.dispose(); } }
@Override public void paint(Graphics g) { super.paint(g); } }
@Override public void paint(Graphics g) { super.paint(g); if (CHANGE_BUTTON) { shiftRect = shift.getBounds(); } }
public void paint(Graphics g) { //JMH I am only overriding this to get a picture of the time taken to paint long start = System.currentTimeMillis(); super.paint(g); long elapsed = System.currentTimeMillis()-start; System.out.println("Paint time = "+elapsed); }
@Override public void paint(Graphics g) { super.paint(g); Graphics2D g2d = (Graphics2D) g; Collection<Shape> grid = rTree.getGrid(); log.info("grid size is {}", grid.size()); for (Shape r : grid) { g2d.draw(r); } } };
@Override public void paint(final Graphics g) { super.paint(g); paintLogos(g); }
/*************************************************************************** * * **************************************************************************/ @Override public void paint (final Graphics g) { super.paint(g); logger.fine("paint() - " + getBounds()); }
@Override public void paint(Graphics g) { super.paint(g); if (comp != null) { Graphics2D g2 = (Graphics2D) g.create(); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setStroke(STROKE_OBJ); paintHighlight(g2); g2.dispose(); } }
private void doPaint(final Graphics g) { doTranslate((x, y) -> g.translate(x, y)); final Composite oldComposite = ((Graphics2D) g).getComposite(); //if (myTabs instanceof JBEditorTabs && !myTabs.isSingleRow() && myTabs.getSelectedInfo() != myInfo) { // ((Graphics2D)g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.9f)); //} super.paint(g); ((Graphics2D) g).setComposite(oldComposite); doTranslate((x2, y2) -> g.translate(-x2, -y2)); }
void TakeSnapShot(JPanel panel,String Locatefile){ BufferedImage bi = new BufferedImage(panel.getSize().width, panel.getSize().height,BufferedImage.TYPE_INT_RGB); panel.paint(bi.createGraphics()); File image = new File(Locatefile); try{ image.createNewFile(); ImageIO.write(bi, "png", image); }catch(Exception ex){ } }
@Override public void paint(Graphics g) { super.paint(g); BackgroundPanelUi ui = (BackgroundPanelUi) getUI(); ui.paintForeground(g, this); }
@Override public void paint(Graphics g) { super.paint(g); gauge.setPanel(this); gauge.paintGauge(g); } };
@Override public void paint(Graphics g) { if ((getInvokeCondition() & INVOKE_ON_PAINT) != 0) { initialize(); } super.paint(g); }
@Override public void paint(Graphics g) { super.paint(g); paintResizableMark(g); paintTimeMarks(g); }