Package com.iizix.prop.ui
Class LayoutMgr<LAYOUT_PROP extends LayoutProp>
- java.lang.Object
- com.iizix.prop.GProp<GProp<?>[]>
- com.iizix.prop.PropCnr
- com.iizix.prop.ui.LayoutMgr<LAYOUT_PROP>
- All Implemented Interfaces:
EventListener
,IGProp<GProp<?>[]>
,IPropCnr
,java.lang.Cloneable
- Direct Known Subclasses:
AbsoluteLayout
,AccordionLayout
,BorderLayout
,CalendarLayout
,ContextMenuLayout
,FlexLayout
,GridLayout
,HeadingLayout
,ListLayout
,MapLayout
,MenuBarLayout
,MenuLayout
,MLGroupLayout
,MListLayout
,SwapLayout
,TabBarLayout
,TabLayout
,UITableLayout
public abstract class LayoutMgr<LAYOUT_PROP extends LayoutProp> extends PropCnr
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_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
Constructors Modifier Constructor Description protected
LayoutMgr()
Creates a LayoutMgr without name with a null value.protected
LayoutMgr(Atom propertyAtom)
Creates a LayoutMgr with the specified name with a null value.protected
LayoutMgr(Atom propertyAtom, GProp<?>[] properties)
Creates a LayoutMgr with the specified name and properties.
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description LAYOUT_PROP
add(UIComp component)
Adds the component last.LAYOUT_PROP
add(UIComp component, int index)
Adds the component at a specific index.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.UIComps
getCompsCnr()
Gets the container associated with this layout manager and the UI container.abstract java.lang.Class<LAYOUT_PROP>
getLayoutPropClass()
Returns the class required for this layout property.UIComp[]
getUIComps()
Gets all components for the container of the layout manager.UIContainer
getUIContainer()
Gets the UI container.UIPanelBase
getUIPanel()
Gets the panel for the UI component.protected boolean
hasContainerLayoutImplicitHeight()
Verifies if this container has an implicit height due to e.g.protected boolean
hasContainerLayoutImplicitWidth()
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
hasImplicitAlignFillX()
Returns if the layout causes implicit component horizontal fill.boolean
hasImplicitAlignFillY()
Returns if the layout causes implicit component vertical fill.protected boolean
hasWidth0(LAYOUT_PROP layout)
Verifies if the layout data has a width.boolean
mustHaveHeight()
Does this component require a height?boolean
mustHaveWidth()
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.boolean
remove(UIComp component)
Removes a component.LayoutMgr<?>
virtualize(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, PropCnr virtualizedProp)
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, doVirtualizePropCnr, 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, getReferences, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasFocus, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, isSibling, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropDispose, onPropRemoved, onPropTreeInitialized, onReferenceEvent, 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, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, extendsClone, 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, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParent, getTreeLock, hasChanged, 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, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, onRemoteEvent, onVirtualizationCompleted, onVirtualized, 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, verifyHasPropertyItem, 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, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, 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, verifyHasPropertyItem, warning, warning, warning
Methods inherited from interface com.iizix.prop.IPropCnr
canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
Constructor Detail
LayoutMgr
protected LayoutMgr()
Creates a LayoutMgr without name with a null value.
LayoutMgr
protected LayoutMgr(Atom propertyAtom)
Creates a LayoutMgr with the specified name with a null value.- Parameters:
propertyAtom
- the property atom.
LayoutMgr
protected LayoutMgr(Atom propertyAtom, GProp<?>[] properties) throws PropException
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 Detail
clone
public LayoutMgr<?> 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
public LayoutMgr<?> virtualize(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, PropCnr virtualizedProp) throws java.lang.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.virtualizedProp
- The property being virtualized.- Returns:
- The virtualized property.
- Throws:
java.lang.CloneNotSupportedException
- If a subclass doesn't allow cloning, e.g. the client properties.PropException
- For property errors during the virtualization.
getUIPanel
public UIPanelBase 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
public final UIComps 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
public UIComp[] getUIComps()
Gets all components for the container of the layout manager.- Returns:
- The components in the container for the layout manager.
getUIContainer
public UIContainer getUIContainer()
Gets the UI container.- Returns:
- The container, or null if orphan.
createDefaultLayoutProp
public abstract LAYOUT_PROP createDefaultLayoutProp(UIComp uiComp)
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
public abstract java.lang.Class<LAYOUT_PROP> getLayoutPropClass()
Returns the class required for this layout property.
add
public final LAYOUT_PROP add(UIComp component) throws PropException
Adds the component last.- Parameters:
component
- The component to add.- Returns:
- The layout data for the component.
- Throws:
PropException
- for property errors.
add
public final LAYOUT_PROP add(UIComp component, int index) 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.- 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.op
- The complex operation, null for none.- Throws:
PropException
- for property errors.
remove
public final boolean remove(UIComp component) throws PropException
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
protected boolean hasWidth0(LAYOUT_PROP layout)
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
protected boolean hasHeight0(LAYOUT_PROP layout)
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.