public interface StyledRenderable
extends ej.mwt.Renderable
Stylesheet
,
Style
Modifier and Type | Method and Description |
---|---|
void |
addClassSelector(java.lang.String classSelector)
Adds a class selector.
|
Style |
getStyle()
Gets the current style of the renderable.
|
void |
mergeStyle(Style style)
Merges a style with the style of this renderable.
|
void |
removeAllClassSelectors()
Removes all the class selectors.
|
void |
removeClassSelector(java.lang.String classSelector)
Removes a class selector.
|
void |
removeInstanceStyle()
Removes the style specific to this renderable.
|
void |
renderContent(ej.microui.display.GraphicsContext g,
Style style,
Rectangle bounds)
Renders the content of the renderable without the border, margin and padding specified in the style.
|
void |
setClassSelectors(java.lang.String classSelectors)
Sets the class selectors.
|
Rectangle |
validateContent(Style style,
Rectangle bounds)
Gets the content size of the renderable without the border, margin and padding specified in the style.
|
void renderContent(ej.microui.display.GraphicsContext g, Style style, Rectangle bounds)
The given graphics context is translated and clipped according to the given bounds (the border, margin and padding are applied on this graphics context before).
g
- the graphics context where to render the content of the renderable.style
- the style to use.bounds
- the remaining size to render the content.Outline.apply(GraphicsContext, Rectangle)
,
Border.apply(GraphicsContext, Rectangle, int)
,
StyleHelper.renderWithoutContent(GraphicsContext, Rectangle, Style)
Rectangle validateContent(Style style, Rectangle bounds)
style
- the style to use.bounds
- the bounds available for the content. A width or a height equals to MWT.NONE
means no
constraint on this dimension.void mergeStyle(Style style)
Equivalent to StyleHelper.getStylesheet().addRule(new InstanceSelector(renderable), style);
style
- the style to merge.removeInstanceStyle()
,
InstanceSelector
void removeInstanceStyle()
Equivalent to StyleHelper.getStylesheet().removeRule(new InstanceSelector(renderable));
mergeStyle(Style)
,
InstanceSelector
Style getStyle()
The style is retrieved from the global stylesheet: StyleHelper.getStylesheet().getStyle(renderable);
Stylesheet.getStyle(ej.style.Element)
void addClassSelector(java.lang.String classSelector)
classSelector
- the class selector to add.java.lang.IllegalArgumentException
- if the given string contains one or more space.java.lang.NullPointerException
- if the given class selector is null
.void removeClassSelector(java.lang.String classSelector)
classSelector
- the class selector to remove.void setClassSelectors(java.lang.String classSelectors)
The given string is a space separated list of class selectors.
If there is already some class selectors, they are removed.
classSelectors
- the class selectors list to split.void removeAllClassSelectors()