public class DefaultStripeInputVisualizationHelper extends Object implements IStripeInputVisualizationHelper
IStripeInputVisualizationHelper
that uses
IVisualTemplate
s for the actual visualization.
If you want to change the global behavior, you can just provide a different IVisualTemplate
for the various
predefined template keys in the application resources. If you want to override the visualization for a specific stripe
only, assign a different IVisualTemplate
to the instance that is already present in the stripe's lookup.
Modifier and Type | Field and Description |
---|---|
static ResourceKey |
DRAG_SOURCE_STRIPE_TEMPLATE_KEY
A
ResourceKey that can be used to store a IVisualTemplate that can be used to create the visual that
will be used to draw the highlight for the current source of a stripe reparent operation. |
static ResourceKey |
DROP_TARGET_STRIPE_TEMPLATE_KEY
A
ResourceKey that can be used to store a IVisualTemplate that can be used to create the visual that
will be used to draw the highlight for the current target of a stripe reparent operation. |
static ResourceKey |
RESIZE_STRIPE_TEMPLATE_KEY
A
ResourceKey that can be used to store a IVisualTemplate that can be used to create the visual that
will be used to draw the highlight for the stripe that is resized. |
static ResourceKey |
SELECTED_STRIPE_TEMPLATE_KEY
A
ResourceKey that can be used to store a IVisualTemplate that can be used to create the visual that
will be used to draw the highlight for the stripe that is selected. |
Constructor and Description |
---|
DefaultStripeInputVisualizationHelper(IStripe stripe)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected IVisualTemplate |
findTemplate(IInputModeContext context,
StripeVisualizationType type)
Provide a
IVisualTemplate that is used to visualize type . |
IVisualTemplate |
getDragSourceStripeTemplate()
Data template that is used to visualize the current source of a stripe reparent operation.
|
IVisualTemplate |
getDropTargetStripeTemplate()
Data template that is used to visualize the current target of a stripe reparent operation.
|
IVisualTemplate |
getResizeStripeTemplate()
Data template that is used to visualize the current stripe resize operation.
|
IVisualTemplate |
getSelectedStripeTemplate()
Data template that is used to visualize the current stripe resize operation.
|
IVisualCreator |
getVisualCreator(IInputModeContext context,
INode tableNode,
StripeVisualizationType type)
Return an
IVisualCreator that is used to visualize the input operation specified by type . |
void |
setDragSourceStripeTemplate(IVisualTemplate value)
Data template that is used to visualize the current source of a stripe reparent operation.
|
void |
setDropTargetStripeTemplate(IVisualTemplate value)
Data template that is used to visualize the current target of a stripe reparent operation.
|
void |
setResizeStripeTemplate(IVisualTemplate value)
Data template that is used to visualize the current stripe resize operation.
|
void |
setSelectedStripeTemplate(IVisualTemplate value)
Data template that is used to visualize the current stripe resize operation.
|
public static final ResourceKey DRAG_SOURCE_STRIPE_TEMPLATE_KEY
ResourceKey
that can be used to store a IVisualTemplate
that can be used to create the visual that
will be used to draw the highlight for the current source of a stripe reparent operation.
This template is used for StripeVisualizationType.DRAG_SOURCE
public static final ResourceKey DROP_TARGET_STRIPE_TEMPLATE_KEY
ResourceKey
that can be used to store a IVisualTemplate
that can be used to create the visual that
will be used to draw the highlight for the current target of a stripe reparent operation.
This template is used for StripeVisualizationType.DROP_TARGET
public static final ResourceKey RESIZE_STRIPE_TEMPLATE_KEY
ResourceKey
that can be used to store a IVisualTemplate
that can be used to create the visual that
will be used to draw the highlight for the stripe that is resized.
This template is used for StripeVisualizationType.RESIZE
public static final ResourceKey SELECTED_STRIPE_TEMPLATE_KEY
ResourceKey
that can be used to store a IVisualTemplate
that can be used to create the visual that
will be used to draw the highlight for the stripe that is selected.
This template is used for StripeVisualizationType.SELECTION
public DefaultStripeInputVisualizationHelper(IStripe stripe)
stripe
- The stripe for which the visualizations are intendedprotected IVisualTemplate findTemplate(IInputModeContext context, StripeVisualizationType type)
IVisualTemplate
that is used to visualize type
.context
- The input mode context. Allows you to access the CanvasControl
to retrieve the
resources.type
- The visualization typeIVisualTemplate
that is used to visualize type
.public final IVisualTemplate getDragSourceStripeTemplate()
This template is used for StripeVisualizationType.DRAG_SOURCE
null
in which case the default template that is stored under
DRAG_SOURCE_STRIPE_TEMPLATE_KEY
is used.getVisualCreator(IInputModeContext, INode, StripeVisualizationType)
,
setDragSourceStripeTemplate(IVisualTemplate)
public final IVisualTemplate getDropTargetStripeTemplate()
This template is used for StripeVisualizationType.DROP_TARGET
null
in which case the default template that is stored under
DROP_TARGET_STRIPE_TEMPLATE_KEY
is used.getVisualCreator(IInputModeContext, INode, StripeVisualizationType)
,
setDropTargetStripeTemplate(IVisualTemplate)
public final IVisualTemplate getResizeStripeTemplate()
This template is used for StripeVisualizationType.RESIZE
null
in which case the default template that is stored under
RESIZE_STRIPE_TEMPLATE_KEY
is used.getVisualCreator(IInputModeContext, INode, StripeVisualizationType)
,
setResizeStripeTemplate(IVisualTemplate)
public final IVisualTemplate getSelectedStripeTemplate()
This template is used for StripeVisualizationType.SELECTION
null
in which case the default template that is stored under
SELECTED_STRIPE_TEMPLATE_KEY
is used.getVisualCreator(IInputModeContext, INode, StripeVisualizationType)
,
setSelectedStripeTemplate(IVisualTemplate)
public final IVisualCreator getVisualCreator(IInputModeContext context, INode tableNode, StripeVisualizationType type)
IVisualCreator
that is used to visualize the input operation specified by type
.
This implementation uses IVisualTemplate
s for the actual visualization.
getVisualCreator
in interface IStripeInputVisualizationHelper
context
- The input mode context which provides further information.tableNode
- The node where the stripe's owner is currently bound to.type
- The actual visualization typeIVisualCreator
instance that renders a representation for the current operation.getResizeStripeTemplate()
public final void setDragSourceStripeTemplate(IVisualTemplate value)
This template is used for StripeVisualizationType.DRAG_SOURCE
value
- The template for the stripe resize visualization or null
in which case the default template that is stored under
DRAG_SOURCE_STRIPE_TEMPLATE_KEY
is used.getVisualCreator(IInputModeContext, INode, StripeVisualizationType)
,
getDragSourceStripeTemplate()
public final void setDropTargetStripeTemplate(IVisualTemplate value)
This template is used for StripeVisualizationType.DROP_TARGET
value
- The template for the stripe resize visualization or null
in which case the default template that is stored under
DROP_TARGET_STRIPE_TEMPLATE_KEY
is used.getVisualCreator(IInputModeContext, INode, StripeVisualizationType)
,
getDropTargetStripeTemplate()
public final void setResizeStripeTemplate(IVisualTemplate value)
This template is used for StripeVisualizationType.RESIZE
value
- The template for the stripe resize visualization or null
in which case the default template that is stored under
RESIZE_STRIPE_TEMPLATE_KEY
is used.getVisualCreator(IInputModeContext, INode, StripeVisualizationType)
,
getResizeStripeTemplate()
public final void setSelectedStripeTemplate(IVisualTemplate value)
This template is used for StripeVisualizationType.SELECTION
value
- The template for the stripe resize visualization or null
in which case the default template that is stored under
SELECTED_STRIPE_TEMPLATE_KEY
is used.getVisualCreator(IInputModeContext, INode, StripeVisualizationType)
,
getSelectedStripeTemplate()