- 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>
-
- net.officefloor.gef.editor.internal.models.AdaptedChildFactory<R,O,M,E,AdaptedParent<M>>
-
- net.officefloor.gef.editor.internal.models.AdaptedParentFactory<R,O,M,E>
-
- All Implemented Interfaces:
AdaptedChildBuilder<R,O,M,E>
,AdaptedConnectableBuilder<R,O,M,E>
,AdaptedParentBuilder<R,O,M,E>
public class AdaptedParentFactory<R extends Model,O,M extends Model,E extends java.lang.Enum<E>> extends AdaptedChildFactory<R,O,M,E,AdaptedParent<M>> implements AdaptedParentBuilder<R,O,M,E>
Factory for anAdaptedParent
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AdaptedParentFactory.AdaptedParentImpl<R extends Model,O,M extends Model,E extends java.lang.Enum<E>>
AdaptedParent
implementation.-
Nested classes/interfaces inherited from class net.officefloor.gef.editor.internal.models.AdaptedChildFactory
AdaptedChildFactory.AdaptedChildImpl<R extends Model,O,M extends Model,E extends java.lang.Enum<E>,A extends AdaptedChild<M>>
-
Nested classes/interfaces inherited from class net.officefloor.gef.editor.internal.models.AbstractAdaptedConnectableFactory
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>>
-
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>>
-
Nested classes/interfaces inherited from interface net.officefloor.gef.editor.AdaptedChildBuilder
AdaptedChildBuilder.LabelChange<M extends Model>
-
-
Field Summary
-
Fields inherited from class net.officefloor.gef.editor.internal.models.AbstractAdaptedConnectableFactory
connectionFactories, connections, modelPrototype, stylesheetContent, stylesheetUrl
-
-
Constructor Summary
Constructors Constructor Description AdaptedParentFactory(java.lang.String configurationPathPrefix, M modelPrototype, AdaptedChildVisualFactory<M> viewFactory, OfficeFloorContentPartFactory<R,O> contentFactory)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
action(ModelAction<R,O,M> action, AdaptedActionVisualFactory visualFactory)
Configures anModelAction
for the parentModel
.<AM extends Model,AE extends java.lang.Enum<AE>,RE extends java.lang.Enum<RE>>
AdaptedAreaBuilder<R,O,AM,AE>area(AM areaPrototype, java.util.function.Function<M,java.util.List<AM>> getAreas, java.util.function.Function<AM,org.eclipse.gef.geometry.planar.Dimension> getDimension, java.util.function.BiConsumer<AM,org.eclipse.gef.geometry.planar.Dimension> setDimension, E... changeAreaEvents)
Adds anAdaptedArea
.void
create(ModelAction<R,O,M> parentModelProvider)
Configures creating theModel
.AdaptedModel<M>
createPrototype(OfficeFloorContentPartFactory<R,O> factory)
Creates theAdaptedModel
from thisAdaptedParent
prototype.boolean
isCreate()
Indicates whether can add a newModel
.-
Methods inherited from class net.officefloor.gef.editor.internal.models.AdaptedChildFactory
children, label, label
-
Methods inherited from class net.officefloor.gef.editor.internal.models.AbstractAdaptedConnectableFactory
connectMany, connectOne, loadModelToConnection, style, validate
-
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.AdaptedChildBuilder
children, label, label
-
Methods inherited from interface net.officefloor.gef.editor.AdaptedConnectableBuilder
connectMany, connectOne, getConfigurationPath, getModelClass, style
-
-
-
-
Constructor Detail
-
AdaptedParentFactory
public AdaptedParentFactory(java.lang.String configurationPathPrefix, M modelPrototype, AdaptedChildVisualFactory<M> viewFactory, OfficeFloorContentPartFactory<R,O> contentFactory)
Instantiate.- Parameters:
configurationPathPrefix
- Prefix to the configuration path.modelPrototype
-Model
prototype.viewFactory
-AdaptedChildVisualFactory
.contentFactory
-OfficeFloorContentPartFactory
.
-
-
Method Detail
-
isCreate
public boolean isCreate()
Indicates whether can add a newModel
.- Returns:
true
if can add a newModel
.
-
createPrototype
public AdaptedModel<M> createPrototype(OfficeFloorContentPartFactory<R,O> factory)
Creates theAdaptedModel
from thisAdaptedParent
prototype.- Parameters:
factory
-OfficeFloorContentPartFactory
.- Returns:
AdaptedModel
for the prototype.
-
create
public void create(ModelAction<R,O,M> parentModelProvider)
Description copied from interface:AdaptedParentBuilder
Configures creating theModel
.- Specified by:
create
in interfaceAdaptedParentBuilder<R extends Model,O,M extends Model,E extends java.lang.Enum<E>>
- Parameters:
parentModelProvider
-ModelAction
to provide parent.
-
action
public void action(ModelAction<R,O,M> action, AdaptedActionVisualFactory visualFactory)
Description copied from interface:AdaptedParentBuilder
Configures anModelAction
for the parentModel
.- Specified by:
action
in interfaceAdaptedParentBuilder<R extends Model,O,M extends Model,E extends java.lang.Enum<E>>
- Parameters:
action
-ModelAction
.visualFactory
-AdaptedActionVisualFactory
.
-
area
public <AM extends Model,AE extends java.lang.Enum<AE>,RE extends java.lang.Enum<RE>> AdaptedAreaBuilder<R,O,AM,AE> area(AM areaPrototype, java.util.function.Function<M,java.util.List<AM>> getAreas, java.util.function.Function<AM,org.eclipse.gef.geometry.planar.Dimension> getDimension, java.util.function.BiConsumer<AM,org.eclipse.gef.geometry.planar.Dimension> setDimension, E... changeAreaEvents)
Description copied from interface:AdaptedParentBuilder
Adds anAdaptedArea
.- Specified by:
area
in interfaceAdaptedParentBuilder<R extends Model,O,M extends Model,E extends java.lang.Enum<E>>
- Type Parameters:
AM
-Model
type.AE
-Model
event type.RE
- RootModel
event type.- Parameters:
areaPrototype
- Prototype of areaModel
to obtain theModel
class.getAreas
-Function
to obtain the areaModel
instances.getDimension
- Obtains theDimension
of the area from theModel
.setDimension
- Loads theDimension
of the area onto theModel
.changeAreaEvents
-Enum
events on parentModel
about change in areaModel
listing.- Returns:
AdaptedAreaBuilder
to build theAdaptedArea
over theModel
.
-
-