Package paintingcanvas.extensions
Class InfoDisplay
- java.lang.Object
-
- paintingcanvas.extensions.InfoDisplay
-
- All Implemented Interfaces:
RenderLifecycle
public class InfoDisplay extends java.lang.Object implements RenderLifecycle
Displays some information on the screen, such as the mouse position and color of the hovered pixel.// Create and attach a new InfoDisplay with default settings new InfoDisplay().attach();
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface paintingcanvas.canvas.RenderLifecycle
RenderLifecycle.AntiAliasingLifecycle, RenderLifecycle.CenteringLifecycle, RenderLifecycle.ResizeListener
-
-
Constructor Summary
Constructors Constructor Description InfoDisplay()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
renderEnd(java.awt.Graphics2D g)
Runs after everything else; theimage
inCanvasPanel
will not reflect your changes.void
setFont(java.awt.Font font)
void
setFontSize(int fontSize)
Set the font size of the displayed text-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface paintingcanvas.canvas.RenderLifecycle
Modifier and Type Method Description default void
attach()
Attach this lifecycle to the canvasdefault void
onResize(CanvasPanel canvas, java.awt.event.ComponentEvent e)
default void
postRender(java.awt.Graphics2D g)
Runs after everything else; theimage
inCanvasPanel
will reflect your changes.default void
preRender(java.awt.Graphics2D g)
Runs before everything else; theimage
inCanvasPanel
will reflect your changes.default void
renderEnd(java.awt.Graphics2D g)
Runs after everything else; theimage
inCanvasPanel
will not reflect your changes.default void
renderStart(java.awt.Graphics2D g)
Runs before everything else; theimage
inCanvasPanel
will not reflect your changes.
-
-
-
-
Method Detail
-
setFontSize
public void setFontSize(int fontSize)
Set the font size of the displayed text- Parameters:
fontSize
- The new font size
-
setFont
public void setFont(java.awt.Font font)
-
renderEnd
public void renderEnd(java.awt.Graphics2D g)
Description copied from interface:RenderLifecycle
Runs after everything else; theimage
inCanvasPanel
will not reflect your changes.- Specified by:
renderEnd
in interfaceRenderLifecycle
- Parameters:
g
- The graphics context
-
-