E - component typeD - decoration typeI - shape typepublic class WebShape<E extends javax.swing.JComponent,D extends WebDecoration<E,D>,I extends WebShape<E,D,I>> extends AbstractShape<E,D,I>
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
lines
Displayed decoration side lines.
|
protected Round |
round
Decoration corners rounding.
|
protected java.lang.String |
sides
Displayed decoration sides.
|
id| Constructor and Description |
|---|
WebShape() |
| Modifier and Type | Method and Description |
|---|---|
java.awt.Insets |
getBorderInsets(E c,
D d)
Returns shape borders size.
|
protected GroupingLayout |
getGroupingLayout(E c)
Returns grouping layout used to place specified component if it exists,
null otherwise. |
protected java.lang.String |
getLines(E c,
D d)
Returns descriptor for painted component lines.
|
Round |
getRound()
Returns decoration corners rounding.
|
java.awt.Shape |
getShape(ShapeType type,
java.awt.Rectangle bounds,
E c,
D d)
Returns shape provided for shade painting.
|
java.lang.Object[] |
getShapeSettings(java.awt.Rectangle bounds,
E c,
D d)
Returns exclusive shape settings used to cache the shape itself.
|
protected java.lang.String |
getSides(E c,
D d)
Returns descriptor for painted component sides.
|
StretchInfo |
getStretchInfo(java.awt.Rectangle bounds,
E c,
D d)
Returns shape stretch information.
|
boolean |
isAnyLine(E c,
D d)
Returns whether or not any of the side lines should be painted.
|
boolean |
isAnySide(E c,
D d)
Returns whether or not any of the sides should be painted.
|
boolean |
isPaintBottom(E c,
D d)
Returns whether or not bottom side should be painted.
|
boolean |
isPaintBottomLine(E c,
D d)
Returns whether or not bottom side line should be painted.
|
boolean |
isPaintLeft(E c,
D d)
Returns whether or not left side should be painted.
|
boolean |
isPaintLeftLine(E c,
D d)
Returns whether or not left side line should be painted.
|
boolean |
isPaintRight(E c,
D d)
Returns whether or not right side should be painted.
|
boolean |
isPaintRightLine(E c,
D d)
Returns whether or not right side line should be painted.
|
boolean |
isPaintTop(E c,
D d)
Returns whether or not top side should be painted.
|
boolean |
isPaintTopLine(E c,
D d)
Returns whether or not top side line should be painted.
|
boolean |
isVisible(ShapeType type,
E c,
D d)
Returns whether shape is visible within component bounds.
|
I |
merge(I shape) |
clone, getDefaultId, getId, p@XStreamAsAttribute protected Round round
@XStreamAsAttribute protected java.lang.String sides
@XStreamAsAttribute protected java.lang.String lines
public Round getRound()
protected GroupingLayout getGroupingLayout(E c)
null otherwise.c - painted componentnull otherwiseprotected java.lang.String getSides(E c, D d)
c - painted componentd - painted decorationpublic boolean isPaintTop(E c, D d)
c - painted componentd - painted decorationpublic boolean isPaintLeft(E c, D d)
c - painted componentd - painted decorationpublic boolean isPaintBottom(E c, D d)
c - painted componentd - painted decorationpublic boolean isPaintRight(E c, D d)
c - painted componentd - painted decorationpublic boolean isAnySide(E c, D d)
c - painted componentd - painted decorationprotected java.lang.String getLines(E c, D d)
c - painted componentd - painted decorationpublic boolean isPaintTopLine(E c, D d)
c - painted componentd - painted decorationpublic boolean isPaintLeftLine(E c, D d)
c - painted componentd - painted decorationpublic boolean isPaintBottomLine(E c, D d)
c - painted componentd - painted decorationpublic boolean isPaintRightLine(E c, D d)
c - painted componentd - painted decorationpublic boolean isAnyLine(E c, D d)
c - painted componentd - painted decorationpublic java.awt.Insets getBorderInsets(E c, D d)
IShapec - painted componentd - painted decoration statepublic boolean isVisible(ShapeType type, E c, D d)
IShapeisVisible in interface IShape<E extends javax.swing.JComponent,D extends WebDecoration<E,D>,I extends WebShape<E,D,I>>isVisible in class AbstractShape<E extends javax.swing.JComponent,D extends WebDecoration<E,D>,I extends WebShape<E,D,I>>type - checked shape typec - painted componentd - painted decoration statepublic java.awt.Shape getShape(ShapeType type, java.awt.Rectangle bounds, E c, D d)
IShapetype - requested shape typebounds - painting boundsc - painted componentd - painted decoration statepublic java.lang.Object[] getShapeSettings(java.awt.Rectangle bounds,
E c,
D d)
IShapegetShapeSettings in interface IShape<E extends javax.swing.JComponent,D extends WebDecoration<E,D>,I extends WebShape<E,D,I>>getShapeSettings in class AbstractShape<E extends javax.swing.JComponent,D extends WebDecoration<E,D>,I extends WebShape<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 WebDecoration<E,D>,I extends WebShape<E,D,I>>getStretchInfo in class AbstractShape<E extends javax.swing.JComponent,D extends WebDecoration<E,D>,I extends WebShape<E,D,I>>bounds - painting boundsc - painted componentd - painted decoration state