Package com.formdev.flatlaf.ui
Class FlatTableUI.RoundedSelectionGraphics
java.lang.Object
java.awt.Graphics
java.awt.Graphics2D
com.formdev.flatlaf.util.Graphics2DProxy
com.formdev.flatlaf.ui.FlatTableUI.RoundedSelectionGraphics
- Enclosing class:
FlatTableUI
Because selection painting is done in the cell renderer, it would be
necessary to require a FlatLaf specific renderer to implement rounded selection.
Using a LaF specific renderer was avoided because often a custom renderer is
already used in applications. Then either the rounded selection is not used,
or the application has to be changed to extend a FlatLaf renderer.
To solve this, a graphics proxy is used that paints rounded selection if row/column/cell is selected and the renderer wants to fill the background.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate()
create
(int x, int y, int width, int height) void
private boolean
fillCellSelection
(int x, int y, int width, int height) void
fillRect
(int x, int y, int width, int height) private Component
A CellRendererPane may contain multiple components, if multiple renderers are used.Methods inherited from class com.formdev.flatlaf.util.Graphics2DProxy
addRenderingHints, clearRect, clip, clipRect, copyArea, dispose, draw, draw3DRect, drawArc, drawBytes, drawChars, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawPolygon, drawPolygon, drawPolyline, drawRect, drawRenderableImage, drawRenderedImage, drawRoundRect, drawString, drawString, drawString, drawString, fill3DRect, fillArc, fillOval, fillPolygon, fillPolygon, fillRoundRect, getBackground, getClip, getClipBounds, getClipBounds, getClipRect, getColor, getComposite, getDeviceConfiguration, getFont, getFontMetrics, getFontMetrics, getFontRenderContext, getPaint, getRenderingHint, getRenderingHints, getStroke, getTransform, hit, hitClip, rotate, rotate, scale, setBackground, setClip, setClip, setColor, setComposite, setFont, setPaint, setPaintMode, setRenderingHint, setRenderingHints, setStroke, setTransform, setXORMode, shear, toString, transform, translate, translate
-
Field Details
-
alternateRowColor
-
inPaintSelection
private boolean inPaintSelection
-
-
Constructor Details
-
RoundedSelectionGraphics
-
-
Method Details
-
create
- Overrides:
create
in classGraphics2DProxy
-
create
- Overrides:
create
in classGraphics2DProxy
-
fillRect
public void fillRect(int x, int y, int width, int height) - Overrides:
fillRect
in classGraphics2DProxy
-
fill
- Overrides:
fill
in classGraphics2DProxy
-
fillCellSelection
private boolean fillCellSelection(int x, int y, int width, int height) -
findActiveRendererComponent
A CellRendererPane may contain multiple components, if multiple renderers are used. Inactive renderer components have size0x0
.
-