AsyncBufferedImage

Methods
2
Fields
None

Getting one

itemManager:getImage(…)

Methods

MethodReturnsDescription
onLoaded(() -> ())()Run r on the client thread once the image has loaded: at the next client tick when it already has, else with the image's other listeners,…
addTo(JButton)()(AsyncBufferedImage, JButton) -> (): Show this image on c: c:setIcon(ImageIcon.new(image)), and while the image has not loaded, `c:re…
addTo(JLabel)()

Returned by

MethodReturnsDescription
ItemManager.getImageAsyncBufferedImage(ItemManager, number) -> AsyncBufferedImage: The item's 36x32 icon, with no quantity: getImage(itemId, 1, false).

Method details

onLoaded

onLoaded: (AsyncBufferedImage, () -> ()) -> ()

Run r on the client thread once the image has loaded: at the next client tick when it already has, else with the image's other listeners, in the order added, at the client tick it loads by. Never inside this call. An image whose item never renders never runs r.

addTo

addTo: ((AsyncBufferedImage, JButton) -> ()) & ((AsyncBufferedImage, JLabel) -> ())

(AsyncBufferedImage, JButton) -> (): Show this image on c: c:setIcon(ImageIcon.new(image)), and while the image has not loaded, c:repaint() with its onLoaded listeners, so the item shows once it renders (the icon shares the image's pixels).

(AsyncBufferedImage, JLabel) -> (): Show this image on c: c:setIcon(ImageIcon.new(image)), and while the image has not loaded, c:repaint() with its onLoaded listeners, so the item shows once it renders (the icon shares the image's pixels).