APIdia Launch Partner
Top Inners Fields Constructors Methods
javax.swing.plaf.synth

pack-priv Class SynthParser

extends DefaultHandler
Class Inheritance
Imports
java.awt.Color, .Component, .Font, .Graphics, .Image, .Insets, .Toolkit, java.io.BufferedInputStream, .IOException, .InputStream, java.net.URL, java.text.ParseException, java.util.ArrayList, .HashMap, .List, .Locale, .Map, .StringTokenizer, java.util.regex.PatternSyntaxException, javax.swing.ImageIcon, .JSplitPane, .SwingConstants, .UIDefaults, javax.swing.plaf.ColorUIResource, .DimensionUIResource, .FontUIResource, .InsetsUIResource, .UIResource, javax.xml.parsers.ParserConfigurationException, .SAXParser, .SAXParserFactory, org.xml.sax.Attributes, .InputSource, .Locator, .SAXException, .SAXParseException, org.xml.sax.helpers.DefaultHandler, com.sun.beans.decoder.DocumentHandler

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
SynthParser.LazyImageIcon

ImageIcon that lazily loads the image until needed.

Field Summary

Modifier and TypeField and Description
private Class<?>
_classResourceBase

Based class used to resolve paths.

private List<ColorType>
_colorTypes

List of ColorTypes.

private Map<String, Object>
_defaultsMap

Default properties are placed here.

private int
_depth

Indicates the depth of how many elements we've encountered but don't understand.

private DefaultSynthStyleFactory
_factory

Factory that new styles are added to.

private DocumentHandler
_handler

Lazily created, used for anything we don't understand.

private List<String>
_inputMapBindings

Bindings for the current InputMap

private String
_inputMapID

ID for the input map.

private Map<String, Object>
_mapping

Object references outside the scope of persistence.

private ParsedSynthStyle.StateInfo
_stateInfo

Current state info.

private List<ParsedSynthStyle.StateInfo>
_stateInfos

Array of state infos for the current style.</style>

private List<ParsedSynthStyle.PainterInfo>
_statePainters

List of SynthStyle.Painters that will be applied to the current state.

private ParsedSynthStyle
_style

Current style.

private List<ParsedSynthStyle.PainterInfo>
_stylePainters

List of SynthStyle.Painters that will be applied to the current style.

private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
addPainterOrMerge(List<ParsedSynthStyle.PainterInfo> painters, String method, SynthPainter painter, int direction)

public void
characters(char[] ch, int start, int length)

Overrides org.xml.sax.helpers.DefaultHandler.characters.

Implements org.xml.sax.ContentHandler.characters.

Receive notification of character data inside an element.

private Object
checkCast(Object value, Class<?> type)

If value is an instance of type it is returned, otherwise a SAXException is thrown.

public void
endDocument()

Overrides org.xml.sax.helpers.DefaultHandler.endDocument.

Implements org.xml.sax.ContentHandler.endDocument.

Receive notification of the end of the document.

public void
endElement(String uri, String local, String name)

Overrides org.xml.sax.helpers.DefaultHandler.endElement.

Implements org.xml.sax.ContentHandler.endElement.

Receive notification of the end of an element.

private void
private void
private void
public void
error(SAXParseException e)

Overrides org.xml.sax.helpers.DefaultHandler.error.

Implements org.xml.sax.ErrorHandler.error.

Receive notification of a recoverable parser error.

public void
private DocumentHandler
getHandler()

Handles beans persistence.

private URL
getResource(String path)

Returns the path to a resource.

public void
ignorableWhitespace(char[] ch, int start, int length)

Overrides org.xml.sax.helpers.DefaultHandler.ignorableWhitespace.

Implements org.xml.sax.ContentHandler.ignorableWhitespace.

Receive notification of ignorable whitespace in element content.

private boolean
isForwarding()

Returns true if we are forwarding to persistence.

private Object
lookup(String key, Class<?> type)

Returns an object created with id=key.

private int
nextInt(StringTokenizer tok, String errorMsg)

Convenience method to return the next int, or throw if there are no more valid ints.

public void
notationDecl(String name, String publicId, String systemId)

Overrides org.xml.sax.helpers.DefaultHandler.notationDecl.

Implements org.xml.sax.DTDHandler.notationDecl.

Receive notification of a notation declaration.

public void
parse(InputStream
XML document containing the styles to read
inputStream
,
DefaultSynthStyleFactory
DefaultSynthStyleFactory that new styles are added to
factory
,
Class<?>
the Class used to resolve any resources, such as Images
classResourceBase
,
Map<String, Object>
Map that UIDefaults properties are placed in
defaultsMap
)

Parses a set of styles from inputStream, adding the resulting styles to the passed in DefaultSynthStyleFactory.

private Insets
parseInsets(String insets, String errorMsg)

Convenience method to return an Insets object.

public void
private void
register(String key, Object value)

Registers an object by name.

private void
reset()

Clears our internal state.

public InputSource
public void
private void
startBind(Attributes attributes)

private void
private void
startColor(Attributes attributes)

public void
startDocument()

Overrides org.xml.sax.helpers.DefaultHandler.startDocument.

Implements org.xml.sax.ContentHandler.startDocument.

Receive notification of the beginning of the document.

public void
startElement(String uri, String local, String name, Attributes attributes)

Overrides org.xml.sax.helpers.DefaultHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Receive notification of the start of an element.

private void
startFont(Attributes attributes)

private void
private void
private void
private void
startInsets(Attributes attributes)

private void
startOpaque(Attributes attributes)

private void
startPainter(Attributes attributes, String type)

private void
startProperty(Attributes attributes, Object property)

private void
startState(Attributes attributes)

private void
startStyle(Attributes attributes)

public void
unparsedEntityDecl(String name, String publicId, String systemId, String notationName)

Overrides org.xml.sax.helpers.DefaultHandler.unparsedEntityDecl.

Implements org.xml.sax.DTDHandler.unparsedEntityDecl.

Receive notification of an unparsed entity declaration.

public void
warning(SAXParseException e)

Overrides org.xml.sax.helpers.DefaultHandler.warning.

Implements org.xml.sax.ErrorHandler.warning.

Receive notification of a parser warning.

Inherited from org.xml.sax.helpers.DefaultHandler:
endPrefixMappingskippedEntitystartPrefixMapping

Field Detail

_classResourceBaseback to summary
private Class<?> _classResourceBase

Based class used to resolve paths.

_colorTypesback to summary
private List<ColorType> _colorTypes

List of ColorTypes. This is populated in startColorType.

_defaultsMapback to summary
private Map<String, Object> _defaultsMap

Default properties are placed here.

_depthback to summary
private int _depth

Indicates the depth of how many elements we've encountered but don't understand. This is used when forwarding to beans persistence to know when we should stop forwarding.

_factoryback to summary
private DefaultSynthStyleFactory _factory

Factory that new styles are added to.

_handlerback to summary
private DocumentHandler _handler

Lazily created, used for anything we don't understand.

_inputMapBindingsback to summary
private List<String> _inputMapBindings

Bindings for the current InputMap

_inputMapIDback to summary
private String _inputMapID

ID for the input map. This is cached as the InputMap is created AFTER the inputMapProperty has ended.

_mappingback to summary
private Map<String, Object> _mapping

Object references outside the scope of persistence.

_stateInfoback to summary
private ParsedSynthStyle.StateInfo _stateInfo

Current state info.

_stateInfosback to summary
private List<ParsedSynthStyle.StateInfo> _stateInfos

Array of state infos for the current style. These are pushed to the style when is received.

_statePaintersback to summary
private List<ParsedSynthStyle.PainterInfo> _statePainters

List of SynthStyle.Painters that will be applied to the current state.

_styleback to summary
private ParsedSynthStyle _style

Current style.

_stylePaintersback to summary
private List<ParsedSynthStyle.PainterInfo> _stylePainters

List of SynthStyle.Painters that will be applied to the current style.

ATTRIBUTE_ACTIONback to summary
private static final String ATTRIBUTE_ACTION
ATTRIBUTE_BOTTOMback to summary
private static final String ATTRIBUTE_BOTTOM
ATTRIBUTE_CENTERback to summary
private static final String ATTRIBUTE_CENTER
ATTRIBUTE_CLONEback to summary
private static final String ATTRIBUTE_CLONE
ATTRIBUTE_DEST_INSETSback to summary
private static final String ATTRIBUTE_DEST_INSETS
ATTRIBUTE_DIRECTIONback to summary
private static final String ATTRIBUTE_DIRECTION
ATTRIBUTE_IDback to summary
private static final String ATTRIBUTE_ID
ATTRIBUTE_IDREFback to summary
private static final String ATTRIBUTE_IDREF
ATTRIBUTE_KEYback to summary
private static final String ATTRIBUTE_KEY
ATTRIBUTE_LEFTback to summary
private static final String ATTRIBUTE_LEFT
ATTRIBUTE_METHODback to summary
private static final String ATTRIBUTE_METHOD
ATTRIBUTE_NAMEback to summary
private static final String ATTRIBUTE_NAME
ATTRIBUTE_PAINT_CENTERback to summary
private static final String ATTRIBUTE_PAINT_CENTER
ATTRIBUTE_PATHback to summary
private static final String ATTRIBUTE_PATH
ATTRIBUTE_RIGHTback to summary
private static final String ATTRIBUTE_RIGHT
ATTRIBUTE_SIZEback to summary
private static final String ATTRIBUTE_SIZE
ATTRIBUTE_SOURCE_INSETSback to summary
private static final String ATTRIBUTE_SOURCE_INSETS
ATTRIBUTE_STRETCHback to summary
private static final String ATTRIBUTE_STRETCH
ATTRIBUTE_STYLEback to summary
private static final String ATTRIBUTE_STYLE
ATTRIBUTE_TOPback to summary
private static final String ATTRIBUTE_TOP
ATTRIBUTE_TYPEback to summary
private static final String ATTRIBUTE_TYPE
ATTRIBUTE_VALUEback to summary
private static final String ATTRIBUTE_VALUE
ELEMENT_BINDback to summary
private static final String ELEMENT_BIND
ELEMENT_BIND_KEYback to summary
private static final String ELEMENT_BIND_KEY
ELEMENT_COLORback to summary
private static final String ELEMENT_COLOR
ELEMENT_DEFAULTS_PROPERTYback to summary
private static final String ELEMENT_DEFAULTS_PROPERTY
ELEMENT_FONTback to summary
private static final String ELEMENT_FONT
ELEMENT_IMAGE_ICONback to summary
private static final String ELEMENT_IMAGE_ICON
ELEMENT_IMAGE_PAINTERback to summary
private static final String ELEMENT_IMAGE_PAINTER
ELEMENT_INPUT_MAPback to summary
private static final String ELEMENT_INPUT_MAP
ELEMENT_INSETSback to summary
private static final String ELEMENT_INSETS
ELEMENT_OPAQUEback to summary
private static final String ELEMENT_OPAQUE
ELEMENT_PAINTERback to summary
private static final String ELEMENT_PAINTER
ELEMENT_PROPERTYback to summary
private static final String ELEMENT_PROPERTY
ELEMENT_STATEback to summary
private static final String ELEMENT_STATE
ELEMENT_STYLEback to summary
private static final String ELEMENT_STYLE
ELEMENT_SYNTHback to summary
private static final String ELEMENT_SYNTH
ELEMENT_SYNTH_GRAPHICSback to summary
private static final String ELEMENT_SYNTH_GRAPHICS

Constructor Detail

SynthParserback to summary
pack-priv SynthParser()

Method Detail

addPainterOrMergeback to summary
private void addPainterOrMerge(List<ParsedSynthStyle.PainterInfo> painters, String method, SynthPainter painter, int direction)
charactersback to summary
public void characters(char[] ch, int start, int length) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.characters.

Implements org.xml.sax.ContentHandler.characters.

Doc from org.xml.sax.helpers.DefaultHandler.characters.

Receive notification of character data inside an element.

By default, do nothing. Application writers may override this method to take specific actions for each chunk of character data (such as adding the data to a node or buffer, or printing it to a file).

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
checkCastback to summary
private Object checkCast(Object value, Class<?> type) throws SAXException

If value is an instance of type it is returned, otherwise a SAXException is thrown.

endDocumentback to summary
public void endDocument() throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.endDocument.

Implements org.xml.sax.ContentHandler.endDocument.

Doc from org.xml.sax.helpers.DefaultHandler.endDocument.

Receive notification of the end of the document.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of a document (such as finalising a tree or closing an output file).

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
endElementback to summary
public void endElement(String uri, String local, String name) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.endElement.

Implements org.xml.sax.ContentHandler.endElement.

Doc from org.xml.sax.helpers.DefaultHandler.endElement.

Receive notification of the end of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
endInputMapback to summary
private void endInputMap() throws SAXException
endStateback to summary
private void endState()
endStyleback to summary
private void endStyle()
errorback to summary
public void error(SAXParseException e) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.error.

Implements org.xml.sax.ErrorHandler.error.

Doc from org.xml.sax.helpers.DefaultHandler.error.

Receive notification of a recoverable parser error.

The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each error, such as inserting the message in a log file or printing it to the console.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
fatalErrorback to summary
public void fatalError(SAXParseException e) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.fatalError.

Implements org.xml.sax.ErrorHandler.fatalError.

Doc from org.xml.sax.helpers.DefaultHandler.fatalError.

Report a fatal XML parsing error.

The default implementation throws a SAXParseException. Application writers may override this method in a subclass if they need to take specific actions for each fatal error (such as collecting all of the errors into a single report): in any case, the application must stop all regular processing when this method is invoked, since the document is no longer reliable, and the parser may no longer report parsing events.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
getHandlerback to summary
private DocumentHandler getHandler()

Handles beans persistence.

getResourceback to summary
private URL getResource(String path)

Returns the path to a resource.

ignorableWhitespaceback to summary
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.ignorableWhitespace.

Implements org.xml.sax.ContentHandler.ignorableWhitespace.

Doc from org.xml.sax.helpers.DefaultHandler.ignorableWhitespace.

Receive notification of ignorable whitespace in element content.

By default, do nothing. Application writers may override this method to take specific actions for each chunk of ignorable whitespace (such as adding data to a node or buffer, or printing it to a file).

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
isForwardingback to summary
private boolean isForwarding()

Returns true if we are forwarding to persistence.

lookupback to summary
private Object lookup(String key, Class<?> type) throws SAXException

Returns an object created with id=key. If the object is not of type type, this will throw an exception.

nextIntback to summary
private int nextInt(StringTokenizer tok, String errorMsg) throws SAXException

Convenience method to return the next int, or throw if there are no more valid ints.

notationDeclback to summary
public void notationDecl(String name, String publicId, String systemId) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.notationDecl.

Implements org.xml.sax.DTDHandler.notationDecl.

Doc from org.xml.sax.helpers.DefaultHandler.notationDecl.

Receive notification of a notation declaration.

By default, do nothing. Application writers may override this method in a subclass if they wish to keep track of the notations declared in a document.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
parseback to summary
public void parse(InputStream inputStream, DefaultSynthStyleFactory factory, Class<?> classResourceBase, Map<String, Object> defaultsMap) throws ParseException, IllegalArgumentException

Parses a set of styles from inputStream, adding the resulting styles to the passed in DefaultSynthStyleFactory.

Parameters
inputStream:InputStream

XML document containing the styles to read

factory:DefaultSynthStyleFactory

DefaultSynthStyleFactory that new styles are added to

classResourceBase:Class<?>

the Class used to resolve any resources, such as Images

defaultsMap:Map<String, Object>

Map that UIDefaults properties are placed in

parseInsetsback to summary
private Insets parseInsets(String insets, String errorMsg) throws SAXException

Convenience method to return an Insets object.

processingInstructionback to summary
public void processingInstruction(String target, String data) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.processingInstruction.

Implements org.xml.sax.ContentHandler.processingInstruction.

Doc from org.xml.sax.helpers.DefaultHandler.processingInstruction.

Receive notification of a processing instruction.

By default, do nothing. Application writers may override this method in a subclass to take specific actions for each processing instruction, such as setting status variables or invoking other methods.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
registerback to summary
private void register(String key, Object value) throws SAXException

Registers an object by name. This will throw an exception if an object has already been registered under the given name.

resetback to summary
private void reset()

Clears our internal state.

resolveEntityback to summary
public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException

Overrides org.xml.sax.helpers.DefaultHandler.resolveEntity.

Implements org.xml.sax.EntityResolver.resolveEntity.

Doc from org.xml.sax.helpers.DefaultHandler.resolveEntity.

Resolve an external entity.

Always return null, so that the parser will use the system identifier provided in the XML document. This method implements the SAX default behaviour: application writers can override it in a subclass to do special translations such as catalog lookups or URI redirection.

Exceptions
IOException:
If there is an error setting up the new input source.
SAXException:
Any SAX exception, possibly wrapping another exception.
setDocumentLocatorback to summary
public void setDocumentLocator(Locator locator)

Overrides org.xml.sax.helpers.DefaultHandler.setDocumentLocator.

Implements org.xml.sax.ContentHandler.setDocumentLocator.

Doc from org.xml.sax.helpers.DefaultHandler.setDocumentLocator.

Receive a Locator object for document events.

By default, do nothing. Application writers may override this method in a subclass if they wish to store the locator for use with other document events.

startBindback to summary
private void startBind(Attributes attributes) throws SAXException
startBindKeyback to summary
private void startBindKey(Attributes attributes) throws SAXException
startColorback to summary
private void startColor(Attributes attributes) throws SAXException
startDocumentback to summary
public void startDocument() throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.startDocument.

Implements org.xml.sax.ContentHandler.startDocument.

Doc from org.xml.sax.helpers.DefaultHandler.startDocument.

Receive notification of the beginning of the document.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the beginning of a document (such as allocating the root node of a tree or creating an output file).

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
startElementback to summary
public void startElement(String uri, String local, String name, Attributes attributes) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Doc from org.xml.sax.helpers.DefaultHandler.startElement.

Receive notification of the start of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
startFontback to summary
private void startFont(Attributes attributes) throws SAXException
startGraphicsback to summary
private void startGraphics(Attributes attributes) throws SAXException
startImageIconback to summary
private void startImageIcon(Attributes attributes) throws SAXException
startInputMapback to summary
private void startInputMap(Attributes attributes) throws SAXException
startInsetsback to summary
private void startInsets(Attributes attributes) throws SAXException
startOpaqueback to summary
private void startOpaque(Attributes attributes)
startPainterback to summary
private void startPainter(Attributes attributes, String type) throws SAXException
startPropertyback to summary
private void startProperty(Attributes attributes, Object property) throws SAXException
startStateback to summary
private void startState(Attributes attributes) throws SAXException
startStyleback to summary
private void startStyle(Attributes attributes) throws SAXException
unparsedEntityDeclback to summary
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.unparsedEntityDecl.

Implements org.xml.sax.DTDHandler.unparsedEntityDecl.

Doc from org.xml.sax.helpers.DefaultHandler.unparsedEntityDecl.

Receive notification of an unparsed entity declaration.

By default, do nothing. Application writers may override this method in a subclass to keep track of the unparsed entities declared in a document.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
warningback to summary
public void warning(SAXParseException e) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.warning.

Implements org.xml.sax.ErrorHandler.warning.

Doc from org.xml.sax.helpers.DefaultHandler.warning.

Receive notification of a parser warning.

The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each warning, such as inserting the message in a log file or printing it to the console.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
javax.swing.plaf.synth back to summary

private Class SynthParser.LazyImageIcon

extends ImageIcon
implements UIResource
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.UIResource
Annotations
@SuppressWarnings:serial

ImageIcon that lazily loads the image until needed.

Field Summary

Modifier and TypeField and Description
private URL
Inherited from javax.swing.ImageIcon:
componenttracker

Constructor Summary

AccessConstructor and Description
public
LazyImageIcon(URL location)

Method Summary

Modifier and TypeMethod and Description
public int
getIconHeight()

Overrides javax.swing.ImageIcon.getIconHeight.

Implements javax.swing.Icon.getIconHeight.

Gets the height of the icon.

public int
getIconWidth()

Overrides javax.swing.ImageIcon.getIconWidth.

Implements javax.swing.Icon.getIconWidth.

Gets the width of the icon.

public Image
getImage()

Overrides javax.swing.ImageIcon.getImage.

Returns this icon's Image.

public void
paintIcon(Component c, Graphics g, int x, int y)

Overrides javax.swing.ImageIcon.paintIcon.

Implements javax.swing.Icon.paintIcon.

Paints the icon.

Inherited from javax.swing.ImageIcon:
getAccessibleContextgetDescriptiongetImageLoadStatusgetImageObserverloadImagesetDescriptionsetImagesetImageObservertoString

Field Detail

locationback to summary
private URL location

Hides javax.swing.ImageIcon.location.

Constructor Detail

LazyImageIconback to summary
public LazyImageIcon(URL location)

Method Detail

getIconHeightback to summary
public int getIconHeight()

Overrides javax.swing.ImageIcon.getIconHeight.

Implements javax.swing.Icon.getIconHeight.

Doc from javax.swing.ImageIcon.getIconHeight.

Gets the height of the icon.

getIconWidthback to summary
public int getIconWidth()

Overrides javax.swing.ImageIcon.getIconWidth.

Implements javax.swing.Icon.getIconWidth.

Doc from javax.swing.ImageIcon.getIconWidth.

Gets the width of the icon.

getImageback to summary
public Image getImage()

Overrides javax.swing.ImageIcon.getImage.

Doc from javax.swing.ImageIcon.getImage.

Returns this icon's Image.

paintIconback to summary
public void paintIcon(Component c, Graphics g, int x, int y)

Overrides javax.swing.ImageIcon.paintIcon.

Implements javax.swing.Icon.paintIcon.

Doc from javax.swing.ImageIcon.paintIcon.

Paints the icon. The top-left corner of the icon is drawn at the point (x, y) in the coordinate space of the graphics context g. If this icon has no image observer, this method uses the c component as the observer.