@Override
	public void paint(JComponent c, Graphics g, PaintContext context,
			Rectangle clip, FieldBackgroundColorManager map, RowColLocation cursorLoc,
			int rowHeight) {
		if (imageIon == null) {
			return;
		}

		int tmpWidth = imageIon.getIconWidth();
		int tmpHeight = imageIon.getIconHeight();
		int xoffset = 0;
		int yoffset = 0;

		// if we are centering the image, then compute the offsets
		//
		if (center) {
			if (width > imageIon.getIconWidth()) {
				xoffset = width / 2 - imageIon.getIconWidth() / 2;
			}
			if (height > imageIon.getIconHeight()) {
				yoffset = height / 2 - imageIon.getIconHeight() / 2;
			}
		}

		// check to make sure that we are not going to draw outside the
		// max rectangle
		//
		if (tmpWidth > width) {
			tmpWidth = width;
		}
		if (tmpHeight > height) {
			tmpHeight = height;
		}

		// draw the image, scaling to fit inside specified rectangle
		//

		g.drawImage(imageIon.getImage(), startX + xoffset, -heightAbove + yoffset, tmpWidth,
			tmpHeight,
			null);

		if (cursorLoc != null) {
			g.setColor(context.getCursorColor());
			Rectangle rect = getCursorBounds(cursorLoc.row(), cursorLoc.col());
			g.drawRect(rect.x, rect.y, tmpWidth - 1, tmpHeight - 1);
		}
	}
Constructs a new field for displaying an image.
@param icon the image icon to display
@param metrics the font metrics
@param startX the starting x coordinate of the field.
@param startY the starting y coordinate of the field.
@param width the width of the field.
@param center flag to center the image in the field.
Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/field/SimpleImageField.java