@Override public Image getImage() { if (image == null) { image = new BufferedImage(getIconWidth(), getIconHeight(), BufferedImage.TYPE_INT_ARGB); // [PENDING] this is obviously ugly, but how should we decide what is the // default fg for the Main Window toolbar area? Background is irrelevant, // since we use alpha channel. But have to guess at the foreground. comp.setForeground(Color.black); comp.paint(image.getGraphics()); } return image; } }
10); g.setColor(Color.black); textLabel.paint(g); Graphics g2 = image.getGraphics(); g2.drawImage(bi, 20, 20, f);
@Override public void paintIcon(Component c, Graphics g, int x, int y) { // When enabled, tracks color choices of container: comp.setBackground(c.getBackground()); comp.setForeground(c.getForeground()); Graphics clip = g.create(x, y, getIconWidth(), getIconHeight()); comp.paint(clip); }
public void paintPlain(Graphics g) { super.paint(g); }
@Override public void paint(Graphics g) { BufferedImage image = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = image.createGraphics(); if (shadowRenderer != null) { shadowRenderer.paintComponent(g2); g2.translate((shadowSize - shadowOffset), (shadowSize - shadowOffset)); } super.paint(g2); Graphics2D g2d = (Graphics2D) g; ((Graphics2D) g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, opacity)); g2d.drawImage(image, 0, 0, null, null); } //</editor-fold>
@Override public Image getImage() { if (image == null) { image = new BufferedImage(getIconWidth(), getIconHeight(), BufferedImage.TYPE_INT_ARGB); // [PENDING] this is obviously ugly, but how should we decide what is the // default fg for the Main Window toolbar area? Background is irrelevant, // since we use alpha channel. But have to guess at the foreground. comp.setForeground(Color.black); comp.paint(image.getGraphics()); } return image; } }
public void paint(Graphics g) { super.paint(g);
@Override public void paintIcon(Component c, Graphics g, int x, int y) { // When enabled, tracks color choices of container: comp.setBackground(c.getBackground()); comp.setForeground(c.getForeground()); Graphics clip = g.create(x, y, getIconWidth(), getIconHeight()); comp.paint(clip); }
BufferedImage.TYPE_INT_ARGB); Graphics g = bi.createGraphics(); tileSet.paint(g); g.dispose();
/** * Overridden to calculate a font height on the first paint */ @Override public void paint(Graphics g) { if (fontHeight == -1) { fontHeight = g.getFontMetrics(lbl.getFont()).getHeight(); } super.paint(g); }
private void paintBackgroundComponent(final Graphics g) { final Graphics backgroundGraphics = g.create(); try { setBackgroundComponentLocation(backgroundGraphics); backgroundComponent.paint(backgroundGraphics); } finally { backgroundGraphics.dispose(); } }
/** * DOCUMENT ME! * * @param g DOCUMENT ME! */ @Override public void paint(Graphics g) { super.paint(g); paintComponent(g); }
public void captureComponent(JComponent component, File imageFile) throws IOException { BufferedImage bufImage = new BufferedImage(component.getSize().width, component.getSize().height, BufferedImage.TYPE_INT_RGB); component.paint(bufImage.createGraphics()); imageFile.createNewFile(); ImageIO.write(bufImage, "jpeg", imageFile); }
protected Image createImage() { JComponent component = getRendererComponent(); component.setSize(getRendererComponentSize()); // component.setOpaque(false); BufferedImage img = new BufferedImage(component.getWidth(), component.getHeight(), BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = img.createGraphics(); g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC, 0.6f)); component.paint(g2); return img; }
protected Image createImage() { JComponent component = getRendererComponent(); component.setSize(getRendererComponentSize()); // component.setOpaque(false); BufferedImage img = new BufferedImage(component.getWidth(), component.getHeight(), BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = img.createGraphics(); g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC, 0.6f)); component.paint(g2); return img; }
@Override public void paint(final Graphics g) { final Icon latexIcon = teXFormula.createTeXIcon(TeXConstants.STYLE_DISPLAY, DEFAULT_FONT_SIZE * zoom); final Insets insets = getInsets(); latexIcon.paintIcon(this, g, insets.left, insets.top); super.paint(g); }
@Override public void paint(Graphics g) { if(isHierarchyVisible()) { super.paint(g); paintDecoration((Graphics2D) g); } }
public void paintIcon (Component c, Graphics g, int x, int y) { // When enabled, tracks color choices of container: comp.setBackground (c.getBackground ()); comp.setForeground (c.getForeground ()); Graphics clip = g.create (x, y, getIconWidth (), getIconHeight ()); comp.paint (clip); }
@Override public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; VScale scale = TransformingParent.getScale(mainCanvas); if (!scale.isIdentity()) { g2.setTransform(AffineTransform.getScaleInstance(scale.getScaleX(), scale.getScaleY())); } super.paint(g); locationIndicator.paint(g, getMainCanvas().getStyle(), getSize()); }
@Override final public void paint(final Graphics g) { final NodeView parent = (NodeView) getParent(); final PaintingMode paintingMode = parent.getMap().getPaintingMode(); if(paintingMode.equals(PaintingMode.CLOUDS)) return; final boolean selected = parent.isSelected(); if(paintingMode.equals(PaintingMode.SELECTED_NODES) == selected) super.paint(g); }