Package com.iizix.prop.ui
Class LayoutMgr<LAYOUT_PROP extends LayoutProp>
- All Implemented Interfaces:
EventListener
,IGProp<GProp<?>[]>
,IPropCnr
,Cloneable
- Direct Known Subclasses:
AbsoluteLayout
,AccordionLayout
,BorderLayout
,CalendarLayout
,ContextMenuLayout
,FlexLayout
,GridLayout
,HeadingLayout
,ListLayout
,MapLayout
,MenuBarLayout
,MenuLayout
,MLGroupLayout
,MListLayout
,SwapLayout
,TabBarLayout
,TabLayout
,UITableLayout
LayoutMgr is the class that handles layout of UIComp's in a UI container.
The component has a data container that is not persistent, i.e. is not written e.g. to disk.
- Author:
- Christopher Mindus
Field Summary
Fields inherited from class com.iizix.prop.PropCnr
EMPTY, EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_ID
Fields inherited from class com.iizix.prop.GProp
GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2
Fields inherited from interface com.iizix.prop.IGProp
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_INCLUDE_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a LayoutMgr without name with a null value.protected
Creates a LayoutMgr with the specified name with a null value.protected
Creates a LayoutMgr with the specified name and properties.Method Summary
Modifier and TypeMethodDescriptionfinal LAYOUT_PROP
Adds the component last.final LAYOUT_PROP
Adds the component at a specific index.final LAYOUT_PROP
add
(UIComp component, int index, IComplexOperation op) Adds the component at a specific index.LayoutMgr<?>
clone()
Creates a clone out of this property.abstract LAYOUT_PROP
createDefaultLayoutProp
(UIComp uiComp) Creates the default LayoutProp to use for a new component that is inserted directly into the UIComps container.final UIComps
Gets the container associated with this layout manager and the UI container.abstract Class<LAYOUT_PROP>
Returns the class required for this layout property.UIComp[]
Gets all components for the container of the layout manager.Gets the UI container.Gets the panel for the UI component.protected boolean
Verifies if this container has an implicit height due to e.g.protected boolean
Verifies if this container has an implicit width due to e.g.protected boolean
hasHeight0
(LAYOUT_PROP layout) Verifies if the layout data has a height.boolean
Returns if the layout causes implicit component horizontal fill.boolean
Returns if the layout causes implicit component vertical fill.protected boolean
hasWidth0
(LAYOUT_PROP layout) Verifies if the layout data has a width.boolean
Does this component require a height?boolean
Does this component require a width?void
onBeforeAdd
(UIComp component, LayoutProp layout, int index, IComplexOperation op) Called prior to adding the new component to the layout in order to adjust the layout data.final boolean
Removes a component.protected final LayoutMgr<?>
virtualize
(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace) Call this method to "virtualize" a property tree.Methods inherited from class com.iizix.prop.PropCnr
__transferChildProps, addPredefinedProps, addProp, addProp, addProp2, addProp2, appendPropValue, canRequestFocus, completeVirtualize, containsProp, containsProp, convertLoadedProp, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getPredefinedProps, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasFocus, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropDispose, onPropRemoved, onPropTreeInitialized, onReferenceEvent, onVirtualContainerCreated, onVirtualizationCompleted, paramString, prepare, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocus, requestFocusEx, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, shouldSerializeToXML, toElementString, toNativeValue0, usePropHashMap, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verify, verifyInternalUseOnly, verifyTree
Methods inherited from class com.iizix.prop.GProp
addPropError, addPropListener, appendProp, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferencePropNameNoAssert, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParentNoAssert, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, isSibling, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, onRemoteEvent, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.iizix.prop.IGProp
addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, isSibling, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onEventSelf, onRemoteEvent, removePropError, removePropListener, renameProp, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning
Methods inherited from interface com.iizix.prop.IPropCnr
canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
Constructor Details
LayoutMgr
protected LayoutMgr()Creates a LayoutMgr without name with a null value.LayoutMgr
Creates a LayoutMgr with the specified name with a null value.- Parameters:
propertyAtom
- the property atom.
LayoutMgr
Creates a LayoutMgr with the specified name and properties.- Parameters:
propertyAtom
- the property atom.properties
- the property array value for the layout manager.- Throws:
PropException
- as structural changes in containers on client is prohibited.
Method Details
clone
Creates a clone out of this property. The cloning is overridden by the subclasses in order to handle cloning of its class variables appropriately.virtualize
protected final LayoutMgr<?> virtualize(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace) throws CloneNotSupportedException, PropException Call this method to "virtualize" a property tree. This method is used at runtime in the Server for the application session of virtual instances of VirtualSpace, but also virtual instances of panels, for the individual client session. The VirtualSpace is virtualized once for the application session and is shared for parallel client sessions.This method is similar to cloning, but enables references that are already resolved to remain if they point to a shared instance, e.g. the VirtualSpace pointing to its participants in the application property container shared instance, or a panel with references to text IDs, assets, etc.
It is up to the property class to handle this by overriding this method.
- Overrides:
virtualize
in classPropCnr
- Parameters:
appGyro
- The application gyro instance performing the virtualization.clientGyro
- The client gyro session, can benull
if not initialized from the client gyro.virtualSpace
- The virtualized VirtualSpace.- Returns:
- The virtualized property.
- Throws:
CloneNotSupportedException
- If a subclass doesn't allow cloning, e.g. the client properties.PropException
- For property errors during the virtualization.
getUIPanel
Gets the panel for the UI component.This method is defined for all UI components and only serves the purpose of a call in the default implementation in this interface.
- Returns:
- The panel, or null if layout manager is not added to a panel.
getCompsCnr
Gets the container associated with this layout manager and the UI container.- Returns:
- The UI components container, or null if currently being destroyed.
getUIComps
Gets all components for the container of the layout manager.- Returns:
- The components in the container for the layout manager.
getUIContainer
Gets the UI container.- Returns:
- The container, or null if orphan.
createDefaultLayoutProp
Creates the default LayoutProp to use for a new component that is inserted directly into the UIComps container.Note that the layout property is just created and not assigned to the component.
- Parameters:
uiComp
- The component requesting the default layout property.- Returns:
- A new instance of the layout data of this layout manager.
getLayoutPropClass
Returns the class required for this layout property.- Returns:
- The class for the layout property required.
add
Adds the component last.- Parameters:
component
- The component to add.- Returns:
- The layout data for the component.
- Throws:
PropException
- for property errors.
add
Adds the component at a specific index.- Parameters:
component
- The component to add.index
- The insertion index of the property in the UIComps container, -1 for last.- Returns:
- The layout data for the component.
- Throws:
PropException
- for property errors.
add
public final LAYOUT_PROP add(UIComp component, int index, IComplexOperation op) throws PropException Adds the component at a specific index.- Parameters:
component
- The component to add.index
- The insertion index of the property in the UIComps container, -1 for last.op
- The complex operation, null for none.- Returns:
- The layout data for the component.
- Throws:
PropException
- for property errors.
onBeforeAdd
public void onBeforeAdd(UIComp component, LayoutProp layout, int index, IComplexOperation op) throws PropException Called prior to adding the new component to the layout in order to adjust the layout data.- Parameters:
component
- Component about to be added.layout
- The layout data of the component, can be cast to the appropriate value for the layout manager.index
- The index of the component.op
- The complex operation, null for none.- Throws:
PropException
- for property errors.
remove
Removes a component.- Parameters:
component
- the component to add.- Returns:
- true for success, false for failure.
- Throws:
PropException
- when the container cannot accept the component with the specific layout property.
hasWidth0
Verifies if the layout data has a width.- Parameters:
layout
- The layout data.- Returns:
- true if the width is defined and non-zero, false otherwise.
hasHeight0
Verifies if the layout data has a height.- Parameters:
layout
- The layout data.- Returns:
- true if the height is defined and non-zero, false otherwise.
hasImplicitAlignFillX
public boolean hasImplicitAlignFillX()Returns if the layout causes implicit component horizontal fill.- Returns:
- true means component will always fill the space in X, false otherwise.
hasImplicitAlignFillY
public boolean hasImplicitAlignFillY()Returns if the layout causes implicit component vertical fill.- Returns:
- true means component will always fill the space in Y, false otherwise.
mustHaveWidth
public boolean mustHaveWidth()Does this component require a width?- Returns:
- true if the width must be defined and non-zero, false (default) otherwise.
mustHaveHeight
public boolean mustHaveHeight()Does this component require a height?- Returns:
- true if the height must be defined and non-zero, false (default) otherwise.
hasContainerLayoutImplicitWidth
protected boolean hasContainerLayoutImplicitWidth()Verifies if this container has an implicit width due to e.g. children.- Returns:
- true if an implicit width is present, false (default) otherwise.
hasContainerLayoutImplicitHeight
protected boolean hasContainerLayoutImplicitHeight()Verifies if this container has an implicit height due to e.g. children.- Returns:
- true if an implicit width is present, false (default) otherwise.