C
- component typeD
- decoration typeI
- content typepublic abstract class AbstractIconContent<C extends JComponent,D extends IDecoration<C,D>,I extends AbstractIconContent<C,D,I>> extends AbstractContent<C,D,I>
IContent
implementation.
Override getIcon(JComponent, IDecoration)
method to return displayed icon.bounds, constraints, id, opacity, overwrite, padding, rotation, size
Constructor and Description |
---|
AbstractIconContent() |
Modifier and Type | Method and Description |
---|---|
protected Dimension |
getContentPreferredSize(C c,
D d,
Dimension available)
Returns content preferred size.
|
protected abstract Icon |
getIcon(C c,
D d)
Returns icon to paint.
|
String |
getId() |
boolean |
isEmpty(C c,
D d)
Returns whether or not this content is empty.
|
protected void |
paintContent(Graphics2D g2d,
C c,
D d,
Rectangle bounds)
Paints content.
|
activate, deactivate, getActualRotation, getBaseline, getBaselineResizeBehavior, getBoundsType, getConstraints, getContentBaseline, getContentBaselineResizeBehavior, getOpacity, getPadding, getPreferredSize, getRotation, getSize, hasBaseline, hasContentBaseline, isLeftToRight, isOverwrite, paint
@NotNull public String getId()
getId
in interface Identifiable
getId
in class AbstractContent<C extends JComponent,D extends IDecoration<C,D>,I extends AbstractIconContent<C,D,I>>
public boolean isEmpty(@NotNull C c, @NotNull D d)
IContent
c
- painted componentd
- painted decoration stateprotected void paintContent(@NotNull Graphics2D g2d, @NotNull C c, @NotNull D d, @NotNull Rectangle bounds)
AbstractContent
paintContent
in class AbstractContent<C extends JComponent,D extends IDecoration<C,D>,I extends AbstractIconContent<C,D,I>>
g2d
- graphics contextc
- painted componentd
- painted decoration statebounds
- painting bounds@NotNull protected Dimension getContentPreferredSize(@NotNull C c, @NotNull D d, @NotNull Dimension available)
AbstractContent
getContentPreferredSize
in class AbstractContent<C extends JComponent,D extends IDecoration<C,D>,I extends AbstractIconContent<C,D,I>>
c
- painted componentd
- painted decoration stateavailable
- available spaceCopyright © 2020. All rights reserved.