Interface SynthIcon

All Superinterfaces:
Icon
public interface SynthIcon
extends Icon

An icon that is passed a SynthContext. Subclasses need only implement the variants that take a SynthContext, but must be prepared for the SynthContext to be null.

Methods

Modifier and Type Method Description
int getIconHeight​(SynthContext context)

Returns the icon's height for the given synth context.

int getIconWidth​(SynthContext context)

Returns the icon's width for the given synth context.

void paintIcon​(SynthContext context, Graphics g, int x, int y, int width, int height)

Paints the icon at the specified location for the given synth context.

Methods declared in interface javax.swing.Icon

getIconHeight, getIconWidth, paintIcon

Methods

paintIcon

void paintIcon(SynthContext context,
               Graphics g,
               int x,
               int y,
               int width,
               int height)

Paints the icon at the specified location for the given synth context.

Parameters:
context - identifies hosting region, may be null.
g - the graphics context
x - the x location to paint to
y - the y location to paint to
width - the width of the region to paint to, may be 0
height - the height of the region to paint to, may be 0

getIconWidth

int getIconWidth(SynthContext context)

Returns the icon's width for the given synth context.

Parameters:
context - SynthContext requesting the Icon, may be null.
Returns:
an int specifying the width of the icon.

getIconHeight

int getIconHeight(SynthContext context)

Returns the icon's height for the given synth context.

Parameters:
context - SynthContext requesting the Icon, may be null.
Returns:
an int specifying the height of the icon.

© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/javax/swing/plaf/synth/SynthIcon.html