public class TemplateStripeStyleRenderer extends Object implements IStripeStyleRenderer, ILookup, IVisualCreator
IStripeStyleRenderer
interface that can render TemplateStripeStyle
instances.TemplateStripeStyle
Constructor and Description |
---|
TemplateStripeStyleRenderer() |
Modifier and Type | Method and Description |
---|---|
protected void |
configure()
Prepares this instance for subsequent calls after the style and stripe have been initialized.
|
Node |
createVisual(IRenderContext context)
Creates the visual by delegating to
TemplateStripeStyle.createControl(IRenderContext, IStripe) and then
initializing the control with the context. |
ILookup |
getContext(IStripe stripe,
IStripeStyle style)
|
protected IContextLookup |
getContextLookup(TemplateStripeStyle style)
Gets the context by delegating to
ContextLookup . |
IRectangle |
getLayout()
Returns the
Layout of the stripe this renderer is currently configured for. |
protected IStripe |
getStripe()
Gets the currently configured stripe.
|
protected TemplateStripeStyle |
getStyle()
Gets the currently configured style.
|
IVisualCreator |
getVisualCreator(IStripe stripe,
IStripeStyle style)
|
<TLookup> TLookup |
lookup(Class<TLookup> type)
Implementation of the
ILookup.lookup(Class) method. |
protected void |
setStripe(IStripe value)
Sets the currently configured stripe.
|
protected void |
setStyle(TemplateStripeStyle value)
Sets the currently configured style.
|
Node |
updateVisual(IRenderContext context,
Node oldVisual)
Updates the
Node correspondingly. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createDictionaryLookup, createDynamic, createSingle, createSingle, createWrapped, lookup, lookup, safeLookup
protected void configure()
Upon invocation the Style
and Stripe
properties have been populated by the getVisualCreator(IStripe, IStripeStyle)
or getContext(IStripe, IStripeStyle)
methods.
This is an empty implementation. Subclasses might have to override this method.
public Node createVisual(IRenderContext context)
TemplateStripeStyle.createControl(IRenderContext, IStripe)
and then
initializing the control with the context.createVisual
in interface IVisualCreator
context
- The context for the creation.IVisualCreator.updateVisual(IRenderContext, Node)
public ILookup getContext(IStripe stripe, IStripeStyle style)
style
and stripe
parameters, does not call configure()
and returns
this
.
As this method may be called often it will not automatically call configure()
, instead subclasses should ensure
that in the lookup(Class)
method call they should call configure()
only if needed, i.e. if they decide
to return this
or an instance that depends on a correctly configured this
.
getContext
in interface IStripeStyleRenderer
stripe
- The stripe to query the context for. The value will be stored in the Stripe
property.style
- The style to associate with the stripe. The value will be stored in the Style
property.this
lookup(Class)
protected IContextLookup getContextLookup(TemplateStripeStyle style)
ContextLookup
.public final IRectangle getLayout()
Layout
of the stripe this renderer is currently configured for.
Returns Stripe.Layout
.
protected final IStripe getStripe()
setStripe(IStripe)
protected final TemplateStripeStyle getStyle()
setStyle(TemplateStripeStyle)
public IVisualCreator getVisualCreator(IStripe stripe, IStripeStyle style)
getVisualCreator
in interface IStripeStyleRenderer
stripe
- The stripe to retrieve the IVisualCreator
for. The value will be stored in the Stripe
property.style
- The style to associate with the stripe. The value will be stored in the Style
property.this
createVisual(IRenderContext)
,
updateVisual(IRenderContext, Node)
public <TLookup> TLookup lookup(Class<TLookup> type)
ILookup.lookup(Class)
method.
Delegates to the lookup returned by getContextLookup(TemplateStripeStyle)
, first. Last, it returns this class
if it implements the queried type
.
protected final void setStripe(IStripe value)
value
- The Stripe to set.getStripe()
protected final void setStyle(TemplateStripeStyle value)
value
- The Style to set.getStyle()
public Node updateVisual(IRenderContext context, Node oldVisual)
Node
correspondingly.updateVisual
in interface IVisualCreator
context
- The context for the creation.oldVisual
- The currently rendered visual.IVisualCreator.createVisual(IRenderContext)
,
ICanvasObjectDescriptor
,
CanvasControl