E - component typeD - decoration typeI - shape typepublic abstract class AbstractShape<E extends javax.swing.JComponent,D extends IDecoration<E,D>,I extends AbstractShape<E,D,I>> extends java.lang.Object implements IShape<E,D,I>
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
id
Shape ID.
|
| Constructor and Description |
|---|
AbstractShape() |
| Modifier and Type | Method and Description |
|---|---|
I |
clone() |
protected java.lang.String |
getDefaultId()
Returns default shape ID.
|
java.lang.String |
getId() |
java.lang.Object[] |
getShapeSettings(java.awt.Rectangle bounds,
E c,
D d)
Returns exclusive shape settings used to cache the shape itself.
|
StretchInfo |
getStretchInfo(java.awt.Rectangle bounds,
E c,
D d)
Returns shape stretch information.
|
boolean |
isVisible(ShapeType type,
E c,
D d)
Returns whether shape is visible within component bounds.
|
I |
merge(I shape) |
protected java.awt.Point |
p(int x,
int y)
Returns point for the specified coordinates.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBorderInsets, getShapepublic java.lang.String getId()
getId in interface com.alee.api.Identifiableprotected java.lang.String getDefaultId()
public boolean isVisible(ShapeType type, E c, D d)
IShapepublic java.lang.Object[] getShapeSettings(java.awt.Rectangle bounds,
E c,
D d)
IShapegetShapeSettings in interface IShape<E extends javax.swing.JComponent,D extends IDecoration<E,D>,I extends AbstractShape<E,D,I>>bounds - painting boundsc - painted componentd - painted decoration statepublic StretchInfo getStretchInfo(java.awt.Rectangle bounds, E c, D d)
IShapenull shape is stretchable horizontally and/or vertically.
That information might be extremely useful for painting optimization, but it is not necessary to implement this method.
As an example - WebLaF uses this information to optimize (reduce amount of) shade images generation. Since generating even a small shade requires a good chunk of memory and processing time it is necessary.
getStretchInfo in interface IShape<E extends javax.swing.JComponent,D extends IDecoration<E,D>,I extends AbstractShape<E,D,I>>bounds - painting boundsc - painted componentd - painted decoration statepublic I merge(I shape)
merge in interface com.alee.api.Mergeable<I extends AbstractShape<E,D,I>>public I clone()
clone in class java.lang.Objectprotected java.awt.Point p(int x,
int y)
x - X coordinatey - Y coordinate