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
AdaptedChildVisualFactoryContextimplementation.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAdaptedModelVisualFactoryContextImpl.Actioner<M extends Model>Functioninterface to action aModelAction.static interfaceAdaptedModelVisualFactoryContextImpl.ConnectorLoader<M extends Model>Functioninterface 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 booleanisPalettePrototypeIndicates if rendering the palette prototype.protected java.lang.Class<M>modelClassClassof 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)AllowsModelActioninstances to be actioned via visual.<R extends Model,O>
javafx.scene.Nodeaction(ModelAction<R,O,M> action, AdaptedActionVisualFactory visualFactory)Convenience method to add aModelActionto be actioned viaAdaptedActionVisualFactory.javafx.scene.layout.PaneaddIndent(javafx.scene.layout.HBox parent)Adds an indentPane.<N extends javafx.scene.Node>
NaddNode(javafx.scene.layout.Pane parent, N node)Add theNodeto the parentPanereturning it.<N extends javafx.scene.layout.Region>
AdaptedModelVisualFactoryContext.Connectorconnector(AdaptedConnectorVisualFactory<N> visualFactory, java.lang.Class... connectionModelClasses)javafx.scene.NodecreateImageWithHover(java.lang.Class<?> resourceClass, java.lang.String imageFilePath, java.lang.String hoverImageFilePath)Convenience method to create aNodewithImageand hoverImage.
-
-
-
Constructor Detail
-
AdaptedModelVisualFactoryContextImpl
public AdaptedModelVisualFactoryContextImpl(java.lang.Class<M> modelClass, boolean isPalettePrototype, AdaptedModelVisualFactoryContextImpl.ConnectorLoader<M> connectorLoader, AdaptedModelVisualFactoryContextImpl.Actioner<M> actioner)
Instantiate.- Parameters:
modelClass-Classof 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:AdaptedModelVisualFactoryContextAdd the
Nodeto the parentPanereturning it.This allows for convenient adding new
Nodeinstances toPane.- Specified by:
addNodein interfaceAdaptedActionVisualFactoryContext- Specified by:
addNodein interfaceAdaptedModelVisualFactoryContext<M extends Model>- Type Parameters:
N-Nodetype.- Parameters:
parent- ParentPane.node-Node.- Returns:
- Input
Node
-
addIndent
public javafx.scene.layout.Pane addIndent(javafx.scene.layout.HBox parent)
Description copied from interface:AdaptedModelVisualFactoryContextAdds an indentPane.- Specified by:
addIndentin interfaceAdaptedModelVisualFactoryContext<M extends Model>- Parameters:
parent- ParentHBox.- Returns:
Panefor 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:
connectorin interfaceAdaptedModelVisualFactoryContext<M extends Model>- Type Parameters:
N-Nodetype.- Parameters:
visualFactory-AdaptedConnectorVisualFactory.connectionModelClasses-ConnectionModelClassinstances 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:AdaptedModelVisualFactoryContextConvenience method to create aNodewithImageand hoverImage. Typically this is to create button for the action.- Specified by:
createImageWithHoverin interfaceAdaptedActionVisualFactoryContext- Specified by:
createImageWithHoverin interfaceAdaptedModelVisualFactoryContext<M extends Model>- Parameters:
resourceClass-Classwithin the class path containing the images.imageFilePath- Path to theImage.hoverImageFilePath- Path to the hoverImage.- Returns:
Nodefor theImagewith hover.- See Also:
DefaultImages
-
action
public <R extends Model,O> void action(ModelAction<R,O,M> action)
Description copied from interface:AdaptedModelVisualFactoryContextAllows
ModelActioninstances to be actioned via visual.This allows custom visuals (e.g. button) tor trigger an action.
- Specified by:
actionin interfaceAdaptedModelVisualFactoryContext<M extends Model>- Type Parameters:
R- RootModeltype.O- Operations type.- Parameters:
action-ModelActionto be actioned.
-
action
public <R extends Model,O> javafx.scene.Node action(ModelAction<R,O,M> action, AdaptedActionVisualFactory visualFactory)
Description copied from interface:AdaptedModelVisualFactoryContextConvenience method to add aModelActionto be actioned viaAdaptedActionVisualFactory.- Specified by:
actionin interfaceAdaptedModelVisualFactoryContext<M extends Model>- Type Parameters:
R- RootModeltype.O- Operations type.- Parameters:
action-ModelActionto be actioned.visualFactory-AdaptedActionVisualFactory.- Returns:
Nodeto trigger theModelAction.
-
-