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 voidrenderEnd(java.awt.Graphics2D g)Runs after everything else; theimageinCanvasPanelwill not reflect your changes.voidsetFont(java.awt.Font font)voidsetFontSize(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 voidattach()Attach this lifecycle to the canvasdefault voidonResize(CanvasPanel canvas, java.awt.event.ComponentEvent e)default voidpostRender(java.awt.Graphics2D g)Runs after everything else; theimageinCanvasPanelwill reflect your changes.default voidpreRender(java.awt.Graphics2D g)Runs before everything else; theimageinCanvasPanelwill reflect your changes.default voidrenderEnd(java.awt.Graphics2D g)Runs after everything else; theimageinCanvasPanelwill not reflect your changes.default voidrenderStart(java.awt.Graphics2D g)Runs before everything else; theimageinCanvasPanelwill 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:RenderLifecycleRuns after everything else; theimageinCanvasPanelwill not reflect your changes.- Specified by:
renderEndin interfaceRenderLifecycle- Parameters:
g- The graphics context
-
-