Class AbstractAdaptedConnectableFactory<R extends Model,O,M extends Model,E extends java.lang.Enum<E>,A extends AdaptedModel<M>>
- java.lang.Object
-
- net.officefloor.gef.editor.internal.models.AbstractAdaptedFactory<R,O,M,E,A>
-
- net.officefloor.gef.editor.internal.models.AbstractAdaptedConnectableFactory<R,O,M,E,A>
-
- All Implemented Interfaces:
AdaptedConnectableBuilder<R,O,M,E>
- Direct Known Subclasses:
AdaptedAreaFactory
,AdaptedChildFactory
public abstract class AbstractAdaptedConnectableFactory<R extends Model,O,M extends Model,E extends java.lang.Enum<E>,A extends AdaptedModel<M>> extends AbstractAdaptedFactory<R,O,M,E,A> implements AdaptedConnectableBuilder<R,O,M,E>
Factory for a connectableAdaptedModel
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractAdaptedConnectableFactory.AbstractAdaptedConnectable<R extends Model,O,M extends Model,E extends java.lang.Enum<E>,A extends AdaptedConnectable<M>,F extends AbstractAdaptedConnectableFactory<R,O,M,E,A>>
AdaptedChild
implementation.-
Nested classes/interfaces inherited from class net.officefloor.gef.editor.internal.models.AbstractAdaptedFactory
AbstractAdaptedFactory.AbstractAdaptedModel<R extends Model,O,M extends Model,E extends java.lang.Enum<E>,A extends AdaptedModel<M>,F extends AbstractAdaptedFactory<R,O,M,E,A>>
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<net.officefloor.gef.editor.internal.models.AbstractAdaptedConnectableFactory.ConnectionKey,AdaptedConnectionFactory<R,O,?,?,?>>
connectionFactories
protected java.util.Map<java.lang.Class<? extends ConnectionModel>,ModelToConnection<R,O,M,E,? extends ConnectionModel>>
connections
ModelToConnection
instances.protected M
modelPrototype
Model
prototype.protected javafx.beans.property.Property<java.lang.String>
stylesheetContent
Stylesheet content.protected javafx.beans.property.ReadOnlyProperty<java.net.URL>
stylesheetUrl
ReadOnlyProperty
to the style sheetURL
.
-
Constructor Summary
Constructors Modifier Constructor Description AbstractAdaptedConnectableFactory(java.lang.String configurationPathPrefix, M modelPrototype, java.util.function.Supplier<A> newAdaptedModel, AbstractAdaptedFactory<R,O,?,?,?> parentAdaptedFactory)
Instantiate asAdaptedChild
.protected
AbstractAdaptedConnectableFactory(java.lang.String configurationPathPrefix, M modelPrototype, java.util.function.Supplier<A> newAdaptedModel, OfficeFloorContentPartFactory<R,O> contentPartFactory)
AllowAdaptedParentBuilder
inheritance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <C extends ConnectionModel>
AdaptedConnectionBuilder<R,O,M,C,E>connectMany(java.lang.Class<C> connectionClass, java.util.function.Function<M,java.util.List<C>> getConnections, java.util.function.Function<C,M> getSource, E... connectionChangeEvents)
Registers multipleConnectionModel
from thisAdaptedModel
.<C extends ConnectionModel>
AdaptedConnectionBuilder<R,O,M,C,E>connectOne(java.lang.Class<C> connectionClass, java.util.function.Function<M,C> getConnection, java.util.function.Function<C,M> getSource, E... connectionChangeEvents)
Registers aConnectionModel
from thisAdaptedModel
.void
loadModelToConnection(java.lang.Class<? extends ConnectionModel> connectionClass, ModelToConnection<R,O,?,?,?> modelToConnection)
Loads theModel
toConnectionModel
.javafx.beans.property.Property<java.lang.String>
style()
Obtains theProperty
to the style sheet rules for theAdaptedChild
.void
validate()
Undertake validation.-
Methods inherited from class net.officefloor.gef.editor.internal.models.AbstractAdaptedFactory
getAdaptedModel, getConfigurationPath, getContentPartFactory, getInjector, getModelClass, getModelFactory, init, newAdaptedModel, registerEventListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.officefloor.gef.editor.AdaptedConnectableBuilder
getConfigurationPath, getModelClass
-
-
-
-
Field Detail
-
stylesheetContent
protected final javafx.beans.property.Property<java.lang.String> stylesheetContent
Stylesheet content.
-
connections
protected final java.util.Map<java.lang.Class<? extends ConnectionModel>,ModelToConnection<R extends Model,O,M extends Model,E extends java.lang.Enum<E>,? extends ConnectionModel>> connections
ModelToConnection
instances.
-
connectionFactories
protected final java.util.Map<net.officefloor.gef.editor.internal.models.AbstractAdaptedConnectableFactory.ConnectionKey,AdaptedConnectionFactory<R extends Model,O,?,?,?>> connectionFactories
-
stylesheetUrl
protected javafx.beans.property.ReadOnlyProperty<java.net.URL> stylesheetUrl
ReadOnlyProperty
to the style sheetURL
.
-
-
Constructor Detail
-
AbstractAdaptedConnectableFactory
public AbstractAdaptedConnectableFactory(java.lang.String configurationPathPrefix, M modelPrototype, java.util.function.Supplier<A> newAdaptedModel, AbstractAdaptedFactory<R,O,?,?,?> parentAdaptedFactory)
Instantiate asAdaptedChild
.- Parameters:
configurationPathPrefix
- Prefix on the configuration path.modelPrototype
-Model
prototype.newAdaptedModel
-Supplier
for theAdaptedModel
.parentAdaptedFactory
- ParentAbstractAdaptedFactory
.
-
AbstractAdaptedConnectableFactory
protected AbstractAdaptedConnectableFactory(java.lang.String configurationPathPrefix, M modelPrototype, java.util.function.Supplier<A> newAdaptedModel, OfficeFloorContentPartFactory<R,O> contentPartFactory)
AllowAdaptedParentBuilder
inheritance.- Parameters:
configurationPathPrefix
- Prefix on the configuration path.modelPrototype
-Model
prototype.newAdaptedModel
-Supplier
for theAdaptedModel
.contentPartFactory
-OfficeFloorContentPartFactory
.
-
-
Method Detail
-
loadModelToConnection
public void loadModelToConnection(java.lang.Class<? extends ConnectionModel> connectionClass, ModelToConnection<R,O,?,?,?> modelToConnection)
Loads theModel
toConnectionModel
.- Parameters:
connectionClass
-Class
of theConnectionModel
.modelToConnection
-ModelToConnection
.
-
validate
public void validate() throws java.lang.IllegalStateException
Description copied from class:AbstractAdaptedFactory
Undertake validation.
-
style
public javafx.beans.property.Property<java.lang.String> style()
Description copied from interface:AdaptedConnectableBuilder
Obtains the
Property
to the style sheet rules for theAdaptedChild
.Note: this is NOT the style sheet
URL
. This is the style sheet rules (content of style sheet) and theAdaptedChild
will handle making available toParent
as aURL
.
-
connectOne
@SafeVarargs public final <C extends ConnectionModel> AdaptedConnectionBuilder<R,O,M,C,E> connectOne(java.lang.Class<C> connectionClass, java.util.function.Function<M,C> getConnection, java.util.function.Function<C,M> getSource, E... connectionChangeEvents)
Description copied from interface:AdaptedConnectableBuilder
Registers aConnectionModel
from thisAdaptedModel
.- Specified by:
connectOne
in interfaceAdaptedConnectableBuilder<R extends Model,O,M extends Model,E extends java.lang.Enum<E>>
- Type Parameters:
C
-ConnectionModel
type.- Parameters:
connectionClass
-ConnectionModel
Class
.getConnection
-Function
to get theConnectionModel
from theModel
.getSource
-Function
to get the sourceModel
from theConnectionModel
.connectionChangeEvents
-Enum
events fired by the model forConnectionModel
change.- Returns:
AdaptedConnectionBuilder
for theConnectionModel
.
-
connectMany
@SafeVarargs public final <C extends ConnectionModel> AdaptedConnectionBuilder<R,O,M,C,E> connectMany(java.lang.Class<C> connectionClass, java.util.function.Function<M,java.util.List<C>> getConnections, java.util.function.Function<C,M> getSource, E... connectionChangeEvents)
Description copied from interface:AdaptedConnectableBuilder
Registers multipleConnectionModel
from thisAdaptedModel
.- Specified by:
connectMany
in interfaceAdaptedConnectableBuilder<R extends Model,O,M extends Model,E extends java.lang.Enum<E>>
- Type Parameters:
C
-ConnectionModel
type.- Parameters:
connectionClass
-ConnectionModel
class.getConnections
-Function
to get theList
ofConnectionModel
instances from theModel
.getSource
-Function
to get the sourceModel
from theConnectionModel
.connectionChangeEvents
-Enum
events fired by the model forConnectionModel
change.- Returns:
AdaptedConnectionBuilder
for theConnectionModel
.
-
-