Icon
public interface SynthIcon extends Icon
SynthContext
. Subclasses need only implement the variants that take a SynthContext
, but must be prepared for the SynthContext
to be null.Modifier and Type | Method | Description |
---|---|---|
default int |
getIconHeight() |
Returns the icon's height. |
int |
getIconHeight |
Returns the icon's height for the given synth context. |
default int |
getIconWidth() |
Returns the icon's width. |
int |
getIconWidth |
Returns the icon's width for the given synth context. |
default void |
paintIcon |
Draw the icon at the specified location. |
void |
paintIcon |
Paints the icon at the specified location for the given synth context. |
void paintIcon(SynthContext context, Graphics g, int x, int y, int width, int height)
context
- identifies hosting region, may be null.g
- the graphics contextx
- the x location to paint toy
- the y location to paint towidth
- the width of the region to paint to, may be 0height
- the height of the region to paint to, may be 0int getIconWidth(SynthContext context)
context
- SynthContext
requesting the Icon, may be null.int getIconHeight(SynthContext context)
context
- SynthContext
requesting the Icon, may be null.default void paintIcon(Component c, Graphics g, int x, int y)
Icon
default int getIconWidth()
Icon
getIconWidth
in interface Icon
default int getIconHeight()
Icon
getIconHeight
in interface Icon
© 1993, 2023, 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/21/docs/api/java.desktop/javax/swing/plaf/synth/SynthIcon.html