@Override public void paintIcon(Component c, Graphics g, int x, int y) { genderIcon.paintIcon(c, g, x, y); int innerX = x + genderIcon.getIconWidth(); int equipmentIconHeight = genderIcon.getIconHeight(); for (int i = 0; i < equipmentColorList.size(); i++) { g.setColor(equipmentColorList.get(i)); g.fillRect(innerX + 1, y + 1, EQUIPMENT_ICON_WIDTH - 2, equipmentIconHeight - 2); g.setColor(TangoColorFactory.ALUMINIUM_5); g.drawRect(innerX + 1, y + 1, EQUIPMENT_ICON_WIDTH - 2, equipmentIconHeight - 2); innerX += EQUIPMENT_ICON_WIDTH; } }
@Override public void paintIcon(Component c, Graphics g, int x, int y) { int innerX = x; if (priorityIcon != null) { priorityIcon.paintIcon(c, g, innerX, y); innerX += priorityIcon.getIconWidth(); } for (Color skillColor : skillColorList) { g.setColor(skillColor); g.fillRect(innerX + 1, y + 1, SKILL_ICON_WIDTH - 2, SKILL_ICON_HEIGHT - 2); g.setColor(TangoColorFactory.ALUMINIUM_5); g.drawRect(innerX + 1, y + 1, SKILL_ICON_WIDTH - 2, SKILL_ICON_HEIGHT - 2); innerX += SKILL_ICON_WIDTH; } if (affinityIcon != null) { affinityIcon.paintIcon(c, g, innerX, y); innerX += affinityIcon.getIconWidth(); } }
@Override public void serialize(ImageIcon vi, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { synchronized (vi) { BufferedImage v = new BufferedImage( vi.getIconWidth(), vi.getIconHeight(), BufferedImage.TYPE_INT_RGB); Graphics g = v.createGraphics(); // paint the Icon to the BufferedImage. vi.paintIcon(null, g, 0, 0); g.dispose(); byte [] data = Images.encode(v); jgen.writeStartObject(); jgen.writeStringField("type", "ImageIcon"); jgen.writeObjectField("imageData", data); jgen.writeNumberField("width", v.getWidth()); jgen.writeNumberField("height", v.getHeight()); jgen.writeEndObject(); } }
@Override public void paint(Graphics g) { switch (getDirection()) { case BasicArrowButton.WEST: buttonLeft.paintIcon(null, g, 0, 0); break; case BasicArrowButton.EAST: buttonRight.paintIcon(null, g, 0, 0); break; case BasicArrowButton.NORTH: buttonUp.paintIcon(null, g, 0, 0); break; case BasicArrowButton.SOUTH: buttonDown.paintIcon(null, g, 0, 0); break; } } }
@Override public synchronized void paintIcon(Component c, Graphics g, int x, int y) { super.paintIcon(c, g, x, y); try { BufferedImage im2 = ImageIO.read(ImageOverlap.class.getResource(this.iconPathOverlap)); g.drawImage( im2, (this.getIconWidth() - im2.getWidth()) / 2, (this.getIconHeight() - im2.getHeight()) / 2, null ); } catch (IOException e) { LOGGER.error(e.getMessage(), e); } }
/** * Renders this graph onto graphing device * * @param g Graphics handle */ public void render(Graphics g) { byte[] imageData = getRrdGraphInfo().getBytes(); ImageIcon image = new ImageIcon(imageData); image.paintIcon(null, g, 0, 0); } }
@Override public void paintIcon(Component c, Graphics g, int x, int y) { if (texture == null) { createTexture(c.getGraphicsConfiguration()); } Graphics2D gr = (Graphics2D) g; gr.setPaint(texture); gr.fillRect(x, y, getIconWidth(), getIconHeight()); super.paintIcon(c, g, x, y); } });
/** * Icon implementation. Renders the icon specified by this property on the * given graphics context. */ public void paintIcon(Component c, Graphics g, int x, int y) { if (m_image != null) m_image.paintIcon(c, g, x, y); }
@Override public synchronized void paintIcon(Component c, Graphics g, int x, int y) { super.paintIcon(c, g, x + offset.x, y + offset.y); } };
public void paintComponent(Graphics g){ super.paintComponent(g); ImageIcon i = new ImageIcon("C:\\Users\\Bryan\\Pictures\\ship.gif"); i.paintIcon(this, g, 0, 0); }
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { int yh = y + height - 1; if (this.plusIcon != null) { this.plusIcon.paintIcon(c, g, x + 8, yh - 8); } yh -= 4; g.setColor(Color.DARK_GRAY); g.drawLine(x + 24, yh, x + 48, yh); }
public void paintIcon(Component c, Graphics g, int x, int y) { if (getIcon() != null) { icon.paintIcon(c, g, x, y); } else { g.setColor(Color.red); g.fillRect(x, y, 16, 16); g.setColor(Color.white); g.drawLine(x, y, x + 15, y + 15); g.drawLine(x + 15, y, x, y + 15); } }
public void paintIcon(Component c, Graphics g, int x, int y) { super.paintIcon(c, g, x, y); Dimension d = new Dimension(getIconWidth(), getIconHeight()); for (Icon icon : iconSet) { Dimension id = new Dimension(icon.getIconWidth(), icon.getIconHeight()); int dx = (d.width - id.width) / 2; int dy = (d.height - id.height) / 2; icon.paintIcon(c, g, x + dx, y + dy); } }
/** * paints the reader * * @param g the graphic representation of the component */ protected void paintComponent(Graphics g) { icon.paintIcon(this, g, 0, 0); g.setColor(Color.BLACK); g.setFont(new Font(simulator.getProperties().getString("ReaderLabelFont"), 0, simulator.getProperty("ReaderLabelSize"))); g.drawString(id, (18 - id.length()) * 9 / 2, simulator.getProperty("ReaderHeight")); }
public static ImageIcon makeRolloverIcon(ImageIcon srcIcon) { RescaleOp op = new RescaleOp(new float[] { 1.2f, 1.2f, 1.2f, 1.0f }, new float[] { 0f, 0f, 0f, 0f }, null); BufferedImage img = new BufferedImage(srcIcon.getIconWidth(), srcIcon.getIconHeight(), BufferedImage.TYPE_INT_ARGB); Graphics g = img.getGraphics(); //g.drawImage(srcIcon.getImage(), 0, 0, null); srcIcon.paintIcon(null, g, 0, 0); g.dispose(); return new ImageIcon(op.filter(img, null)); }
@Override public void paintIcon(Component c, Graphics g, int x, int y) { if (texture == null) { createTexture(c.getGraphicsConfiguration()); } Graphics2D gr = (Graphics2D) g; gr.setPaint(texture); gr.fillRect(x, y, getIconWidth(), getIconHeight()); super.paintIcon(c, g, x, y); } });
public void setSkin(Skin skin) { this.skinScreenXYPoint = skin.getScreenXYCoord(); BufferedImage bi = new BufferedImage(skin.getFrame().getIconWidth(), skin.getFrame().getIconHeight(), BufferedImage.TYPE_INT_ARGB); Graphics g = bi.createGraphics(); // paint the Icon to the BufferedImage. skin.getFrame().paintIcon(null, g, 0, 0); g.dispose(); this.skinBackgroundImage = bi; repaint(); }