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
private class FlatTableUI.RoundedSelectionGraphics extends Graphics2DProxy
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 Modifier and Type Field Description private java.awt.Color
alternateRowColor
private boolean
inPaintSelection
-
Constructor Summary
Constructors Constructor Description RoundedSelectionGraphics(java.awt.Graphics delegate, java.awt.Color alternateRowColor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Graphics
create()
java.awt.Graphics
create(int x, int y, int width, int height)
void
fill(java.awt.Shape shape)
private boolean
fillCellSelection(int x, int y, int width, int height)
void
fillRect(int x, int y, int width, int height)
private java.awt.Component
findActiveRendererComponent()
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
-
-
-
-
Method Detail
-
create
public java.awt.Graphics create()
- Overrides:
create
in classGraphics2DProxy
-
create
public java.awt.Graphics create(int x, int y, int width, int height)
- Overrides:
create
in classGraphics2DProxy
-
fillRect
public void fillRect(int x, int y, int width, int height)
- Overrides:
fillRect
in classGraphics2DProxy
-
fill
public void fill(java.awt.Shape shape)
- Overrides:
fill
in classGraphics2DProxy
-
fillCellSelection
private boolean fillCellSelection(int x, int y, int width, int height)
-
findActiveRendererComponent
private java.awt.Component findActiveRendererComponent()
A CellRendererPane may contain multiple components, if multiple renderers are used. Inactive renderer components have size0x0
.
-
-