Class AdaptedModelVisualFactoryContextImpl<M extends Model>
- java.lang.Object
-
- net.officefloor.gef.editor.internal.parts.AdaptedModelVisualFactoryContextImpl<M>
-
- All Implemented Interfaces:
AdaptedActionVisualFactoryContext
,AdaptedConnectorVisualFactoryContext
,AdaptedModelVisualFactoryContext<M>
- Direct Known Subclasses:
AdaptedChildVisualFactoryContextImpl
public class AdaptedModelVisualFactoryContextImpl<M extends Model> extends java.lang.Object implements AdaptedModelVisualFactoryContext<M>, AdaptedActionVisualFactoryContext
AdaptedChildVisualFactoryContext
implementation.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AdaptedModelVisualFactoryContextImpl.Actioner<M extends Model>
Function
interface to action aModelAction
.static interface
AdaptedModelVisualFactoryContextImpl.ConnectorLoader<M extends Model>
Function
interface to load connectors.-
Nested classes/interfaces inherited from interface net.officefloor.gef.editor.AdaptedModelVisualFactoryContext
AdaptedModelVisualFactoryContext.Connector
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
isPalettePrototype
Indicates if rendering the palette prototype.protected java.lang.Class<M>
modelClass
Class
of theModel
.
-
Constructor Summary
Constructors Constructor Description AdaptedModelVisualFactoryContextImpl(java.lang.Class<M> modelClass, boolean isPalettePrototype, AdaptedModelVisualFactoryContextImpl.ConnectorLoader<M> connectorLoader, AdaptedModelVisualFactoryContextImpl.Actioner<M> actioner)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R extends Model,O>
voidaction(ModelAction<R,O,M> action)
AllowsModelAction
instances to be actioned via visual.<R extends Model,O>
javafx.scene.Nodeaction(ModelAction<R,O,M> action, AdaptedActionVisualFactory visualFactory)
Convenience method to add aModelAction
to be actioned viaAdaptedActionVisualFactory
.javafx.scene.layout.Pane
addIndent(javafx.scene.layout.HBox parent)
Adds an indentPane
.<N extends javafx.scene.Node>
NaddNode(javafx.scene.layout.Pane parent, N node)
Add theNode
to the parentPane
returning it.<N extends javafx.scene.layout.Region>
AdaptedModelVisualFactoryContext.Connectorconnector(AdaptedConnectorVisualFactory<N> visualFactory, java.lang.Class... connectionModelClasses)
javafx.scene.Node
createImageWithHover(java.lang.Class<?> resourceClass, java.lang.String imageFilePath, java.lang.String hoverImageFilePath)
Convenience method to create aNode
withImage
and hoverImage
.
-
-
-
Constructor Detail
-
AdaptedModelVisualFactoryContextImpl
public AdaptedModelVisualFactoryContextImpl(java.lang.Class<M> modelClass, boolean isPalettePrototype, AdaptedModelVisualFactoryContextImpl.ConnectorLoader<M> connectorLoader, AdaptedModelVisualFactoryContextImpl.Actioner<M> actioner)
Instantiate.- Parameters:
modelClass
-Class
of theModel
.isPalettePrototype
- Indicates if rendering the palette prototype.connectorLoader
-AdaptedModelVisualFactoryContextImpl.ConnectorLoader
.actioner
-AdaptedModelVisualFactoryContextImpl.Actioner
.
-
-
Method Detail
-
addNode
public <N extends javafx.scene.Node> N addNode(javafx.scene.layout.Pane parent, N node)
Description copied from interface:AdaptedModelVisualFactoryContext
Add the
Node
to the parentPane
returning it.This allows for convenient adding new
Node
instances toPane
.- Specified by:
addNode
in interfaceAdaptedActionVisualFactoryContext
- Specified by:
addNode
in interfaceAdaptedModelVisualFactoryContext<M extends Model>
- Type Parameters:
N
-Node
type.- Parameters:
parent
- ParentPane
.node
-Node
.- Returns:
- Input
Node
-
addIndent
public javafx.scene.layout.Pane addIndent(javafx.scene.layout.HBox parent)
Description copied from interface:AdaptedModelVisualFactoryContext
Adds an indentPane
.- Specified by:
addIndent
in interfaceAdaptedModelVisualFactoryContext<M extends Model>
- Parameters:
parent
- ParentHBox
.- Returns:
Pane
for the indent.
-
connector
public <N extends javafx.scene.layout.Region> AdaptedModelVisualFactoryContext.Connector connector(AdaptedConnectorVisualFactory<N> visualFactory, java.lang.Class... connectionModelClasses)
Description copied from interface:AdaptedModelVisualFactoryContext
- Specified by:
connector
in interfaceAdaptedModelVisualFactoryContext<M extends Model>
- Type Parameters:
N
-Node
type.- Parameters:
visualFactory
-AdaptedConnectorVisualFactory
.connectionModelClasses
-ConnectionModel
Class
instances that this connector satisfies.- Returns:
AdaptedModelVisualFactoryContext.Connector
.- See Also:
DefaultConnectors
-
createImageWithHover
public javafx.scene.Node createImageWithHover(java.lang.Class<?> resourceClass, java.lang.String imageFilePath, java.lang.String hoverImageFilePath)
Description copied from interface:AdaptedModelVisualFactoryContext
Convenience method to create aNode
withImage
and hoverImage
. Typically this is to create button for the action.- Specified by:
createImageWithHover
in interfaceAdaptedActionVisualFactoryContext
- Specified by:
createImageWithHover
in interfaceAdaptedModelVisualFactoryContext<M extends Model>
- Parameters:
resourceClass
-Class
within the class path containing the images.imageFilePath
- Path to theImage
.hoverImageFilePath
- Path to the hoverImage
.- Returns:
Node
for theImage
with hover.- See Also:
DefaultImages
-
action
public <R extends Model,O> void action(ModelAction<R,O,M> action)
Description copied from interface:AdaptedModelVisualFactoryContext
Allows
ModelAction
instances to be actioned via visual.This allows custom visuals (e.g. button) tor trigger an action.
- Specified by:
action
in interfaceAdaptedModelVisualFactoryContext<M extends Model>
- Type Parameters:
R
- RootModel
type.O
- Operations type.- Parameters:
action
-ModelAction
to be actioned.
-
action
public <R extends Model,O> javafx.scene.Node action(ModelAction<R,O,M> action, AdaptedActionVisualFactory visualFactory)
Description copied from interface:AdaptedModelVisualFactoryContext
Convenience method to add aModelAction
to be actioned viaAdaptedActionVisualFactory
.- Specified by:
action
in interfaceAdaptedModelVisualFactoryContext<M extends Model>
- Type Parameters:
R
- RootModel
type.O
- Operations type.- Parameters:
action
-ModelAction
to be actioned.visualFactory
-AdaptedActionVisualFactory
.- Returns:
Node
to trigger theModelAction
.
-
-