Package snap.view
Class ParentView
java.lang.Object
snap.props.PropObject
snap.view.View
snap.view.ParentView
- All Implemented Interfaces:
PropChange.DoChange
,XMLArchiver.Archivable
- Direct Known Subclasses:
ArrowView
,BorderView
,BoxView
,BrowserView
,ButtonBase
,CameraView
,ChildView
,CollapseView
,ComboBox
,DocView
,DrawerView
,Label
,ListArea
,ListView
,MenuBar
,RootView
,Scroller
,ScrollGroup
,ScrollView
,Spinner
,SplitView
,TabBar
,TableView
,TabView
,TextField
,TextView
,TitleView
,Trackball
,TransitionPane
,TreeView
,WindowView
,WrapView
A View subclass for views with children.
-
Field Summary
Fields inherited from class snap.view.View
_align, _borderRadius, _effect, _font, _margin, _padding, _repaintRect, _showing, _spacing, _vertical, Action, Align_Prop, Border_Prop, BorderRadius_Prop, Clip_Prop, Cursor_Prop, DEFAULT_ALIGN, DEFAULT_MARGIN, DEFAULT_PADDING, DEFAULT_SPACING, Disabled_Prop, DragEvents, Effect_Prop, Fill_Prop, Focusable_Prop, Focused_Prop, FocusWhenPressed_Prop, Font_Prop, GrowHeight_Prop, GrowWidth_Prop, Height_Prop, KeyEvents, KeyPress, KeyRelease, KeyType, LeanX_Prop, LeanY_Prop, Managed_Prop, Margin_Prop, MaxHeight_Prop, MaxWidth_Prop, MinHeight_Prop, MinWidth_Prop, MouseDrag, MouseEnter, MouseEvents, MouseExit, MouseMove, MousePress, MouseRelease, Name_Prop, Opacity_Prop, Padding_Prop, Paintable_Prop, Parent_Prop, Pickable_Prop, PrefHeight_Prop, PrefWidth_Prop, Rotate_Prop, ScaleX_Prop, ScaleY_Prop, Scroll, Showing_Prop, Spacing_Prop, Text_Prop, ToolTip_Prop, TransX_Prop, TransY_Prop, Vertical_Prop, Visible_Prop, Width_Prop, X_Prop, Y_Prop
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds the given child to the end of this view's children list.protected void
Adds the given child to this view's children list at the given index.void
Override to add this view as change listener to children on first call.protected void
childDidDeepChange
(Object aLsnr, PropChange aPC) Deep property change listener implementation to forward to this View's deep listeners.protected void
Property change listener implementation to forward changes on to deep listeners.fromXML
(XMLArchiver anArchiver, XMLElement anElement) Override to break fromXML into fromXMLView and fromXMLChildren.protected void
fromXMLChildren
(XMLArchiver anArchiver, XMLElement anElement) XML unarchival for shape children.protected void
fromXMLView
(XMLArchiver anArchiver, XMLElement anElement) XML unarchival of basic view.getChild
(int anIndex) Returns the child at the given index.getChildAt
(double aX, double aY) Returns the child at given point.getChildAt
(Point aPnt) Returns the child at given point.int
Returns the number of children associated with this view.int
Returns the number of managed children.<E extends View>
EgetChildForClass
(Class<E> aClass) Returns the child for given component class.getChildForName
(String aName) Returns the child with given name.Returns the last child of this view.View[]
Returns the array of children associated with this view.<E extends View>
E[]getChildrenForClass
(Class<E> aClass) Returns the children for given component class.protected View[]
Returns the children in paint order.View[]
Returns the managed children.protected View
getFocusNext
(View aChild) Returns the next focus View after given view (null to return first).protected View
getFocusPrev
(View aChild) Returns the next focus View after given view (null to return last).getPropValue
(String aPropName) Override to support props for this class.Returns the ViewList that holds children.protected ViewProxy<?>
Returns a ViewProxy for this View.int
indexOfChild
(View aChild) Returns the index of the given child in this view's children list.protected void
Override to support props for this class.boolean
intersectsShape
(Shape aShape) Override to forward to children.boolean
Returns whether view is currently performing layout.boolean
Returns whether needs layout.boolean
Returns whether any children need layout.boolean
Returns whether any children need repaint.void
layout()
Override to layout children.void
Lays out children deep.protected void
Lays out children deep.protected void
Called to layout floating children (those unmanaged with lean) according to their Lean, Grow and Margin.protected void
Actual method to layout children.protected void
paintAbove
(Painter aPntr) Paints above children.protected void
Override to add call to paintChildren.protected void
paintChildren
(Painter aPntr) Paint children.protected void
Override to forward to children that inherit font.void
processPropChange
(PropChange aPC, Object oldVal, Object newVal) Override to handle ParentView changes.void
relayout()
Override to really request layout from RootView.protected View
removeChild
(int anIndex) Remove's the child at the given index from this view's children list.protected int
removeChild
(View aChild) Removes the given child from this view's children list.protected void
Removes all children from this view (in reverse order).void
Override to remove this view as change listener to children when not needed.protected void
setChildren
(View... theChildren) Sets children to given list.void
Override to propagate to children.protected void
setNeedsLayout
(boolean aVal) Sets whether needs layout.protected void
setNeedsLayoutDeep
(boolean aVal) Sets whether any children need layout.protected void
setNeedsRepaintDeep
(boolean aVal) Sets whether any children need repaint.void
Override to send to children.protected void
setOwnerChildren
(ViewOwner anOwner) Forwards setOwner() call to children.void
setPropValue
(String aPropName, Object aValue) Override to support props for this class.protected void
setShowing
(boolean aValue) Override to send to children.protected void
Called when ViewTheme changes.toXML
(XMLArchiver anArchiver) Override to break toXML into toXMLView and toXMLChildren.protected void
toXMLChildren
(XMLArchiver anArchiver, XMLElement anElement) XML archival of children.protected XMLElement
toXMLView
(XMLArchiver anArchiver) XML Archival of basic view.Methods inherited from class snap.view.View
addBinding, addEventFilter, addEventHandler, clone, contains, contains, containsShape, createActionEvent, disableEvents, enableEvents, fireActionEvent, getAlign, getAlignX, getAlignY, getAnim, getAnimCleared, getAnimTimeDeep, getBestHeight, getBestSize, getBestWidth, getBinding, getBinding, getBindingCount, getBindings, getBorder, getBorderRadius, getBounds, getBoundsLocal, getBoundsParent, getBoundsShape, getBoundsShapeParent, getClip, getClipAll, getClipAllBounds, getClipBounds, getClippedRect, getCursor, getDefaultBorder, getDefaultFill, getDefaultFont, getEffect, getEnv, getEventAdapter, getFill, getFillColor, getFocusNext, getFocusPrev, getFont, getHeight, getHost, getInsetsAll, getLean, getLeanX, getLeanY, getLocalToParent, getLocalToParent, getMargin, getMaxHeight, getMaxSize, getMaxWidth, getMaxX, getMaxY, getMidX, getMidY, getMinHeight, getMinHeightImpl, getMinSize, getMinWidth, getMinWidthImpl, getName, getOpacity, getOpacityAll, getOwner, getOwner, getPadding, getParent, getParent, getParentCount, getParentToLocal, getParentToLocal, getPhysics, getPhysics, getPrefHeight, getPrefHeight, getPrefHeightImpl, getPrefSize, getPrefWidth, getPrefWidth, getPrefWidthImpl, getProp, getPropDefault, getProps, getRealClassName, getRepaintRect, getRepaintRectExpanded, getRootView, getRotate, getScale, getScaleX, getScaleY, getSize, getSpacing, getText, getToolTip, getToolTip, getTransX, getTransY, getUpdater, getValuePropName, getVisRect, getWidth, getWindow, getX, getXY, getY, indexInHost, indexInParent, isActionable, isAncestor, isClipToBounds, isDisabled, isEnabled, isFocusable, isFocused, isFocusKeysEnabled, isFocusPainted, isFocusWhenPressed, isFontSet, isGrowHeight, isGrowWidth, isGuest, isHorizontal, isLocalToParentSimple, isManaged, isManagedVisible, isMaxHeightSet, isMaxWidthSet, isMinHeightSet, isMinWidthSet, isMouseDown, isMouseOver, isNeedsRepaint, isPaintable, isPickable, isPickableVisible, isPrefHeightSet, isPrefWidthSet, isShowing, isToolTipEnabled, isVertical, isVisible, localToParent, localToParent, localToParent, localToParent, localToScreen, paintBack, paintFront, parentToLocal, parentToLocal, parentToLocal, parentToLocal, playAnimDeep, processEvent, processEventAll, processEventFilters, processEventHandlers, relayoutParent, removeBinding, removeBinding, removeEventFilter, removeEventHandler, repaint, repaint, repaint, repaintInParent, requestFocus, runDelayed, runIntervals, runLater, scrollToVisible, setActionable, setAlign, setAlignX, setAlignY, setAnimProps, setAnimString, setAnimTimeDeep, setBorder, setBorder, setBorderRadius, setBounds, setBounds, setBoundsLocal, setClip, setClipToBounds, setCursor, setDisabled, setEffect, setEnabled, setFill, setFocusable, setFocused, setFocusKeysEnabled, setFocusPainted, setFocusWhenPressed, setGrowHeight, setGrowWidth, setHeight, setLean, setLeanX, setLeanY, setManaged, setMargin, setMargin, setMaxHeight, setMaxSize, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinSize, setMinWidth, setName, setOpacity, setPadding, setPadding, setPaintable, setParent, setPickable, setPrefHeight, setPrefSize, setPrefSize, setPrefWidth, setProp, setRealClassName, setRotate, setScale, setScaleX, setScaleY, setSize, setSize, setSizeLocal, setSizeToBestSize, setSizeToPrefSize, setSpacing, setText, setToolTip, setToolTipEnabled, setTransX, setTransY, setVertical, setVisible, setWidth, setX, setXY, setXYLocal, setY, stopAnimDeep, stopIntervals, toStringProps
Methods inherited from class snap.props.PropObject
addPropChangeListener, addPropChangeListener, firePropChange, firePropChange, firePropChange, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, isPropDefault, removePropChangeListener, removePropChangeListener, setPropsString, setPropValues, toString
-
Field Details
-
_children
-
Child_Prop
- See Also:
-
NeedsLayout_Prop
- See Also:
-
-
Constructor Details
-
ParentView
public ParentView()Constructor.
-
-
Method Details
-
getViewList
Returns the ViewList that holds children. -
getChildCount
public int getChildCount()Returns the number of children associated with this view. -
getChild
Returns the child at the given index. -
getChildren
Returns the array of children associated with this view. -
addChild
Adds the given child to the end of this view's children list. -
addChild
Adds the given child to this view's children list at the given index. -
removeChild
Remove's the child at the given index from this view's children list. -
removeChild
Removes the given child from this view's children list. -
removeChildren
protected void removeChildren()Removes all children from this view (in reverse order). -
setChildren
Sets children to given list. -
getChildrenInPaintOrder
Returns the children in paint order. -
getChildForName
Returns the child with given name. -
indexOfChild
Returns the index of the given child in this view's children list. -
getChildLast
Returns the last child of this view. -
getChildForClass
Returns the child for given component class. -
getChildrenForClass
Returns the children for given component class. -
getChildAt
Returns the child at given point. -
getChildAt
Returns the child at given point. -
getChildCountManaged
public int getChildCountManaged()Returns the number of managed children. -
getChildrenManaged
Returns the managed children. -
getFocusNext
Returns the next focus View after given view (null to return first). -
getFocusPrev
Returns the next focus View after given view (null to return last). -
setFont
Override to propagate to children. -
parentFontChanged
protected void parentFontChanged()Override to forward to children that inherit font.- Overrides:
parentFontChanged
in classView
-
setShowing
protected void setShowing(boolean aValue) Override to send to children.- Overrides:
setShowing
in classView
-
setOwner
Override to send to children. -
setOwnerChildren
Forwards setOwner() call to children. -
intersectsShape
Override to forward to children.- Overrides:
intersectsShape
in classView
-
paintAll
Override to add call to paintChildren. -
paintChildren
Paint children. -
paintAbove
Paints above children. -
isNeedsRepaintDeep
public boolean isNeedsRepaintDeep()Returns whether any children need repaint. -
setNeedsRepaintDeep
protected void setNeedsRepaintDeep(boolean aVal) Sets whether any children need repaint. -
relayout
public void relayout()Override to really request layout from RootView. -
isNeedsLayout
public boolean isNeedsLayout()Returns whether needs layout. -
setNeedsLayout
protected void setNeedsLayout(boolean aVal) Sets whether needs layout. -
isNeedsLayoutDeep
public boolean isNeedsLayoutDeep()Returns whether any children need layout. -
setNeedsLayoutDeep
protected void setNeedsLayoutDeep(boolean aVal) Sets whether any children need layout. -
isInLayout
public boolean isInLayout()Returns whether view is currently performing layout. -
layout
public void layout()Override to layout children. -
layoutImpl
protected void layoutImpl()Actual method to layout children. -
layoutFloatingViews
protected void layoutFloatingViews()Called to layout floating children (those unmanaged with lean) according to their Lean, Grow and Margin. -
layoutDeep
public void layoutDeep()Lays out children deep. -
layoutDeepImpl
protected void layoutDeepImpl()Lays out children deep. -
getViewProxy
Returns a ViewProxy for this View. Some classes already have this, but I'm hoping to do something really clever with this one day, like maybe caching PrefSize info. -
processPropChange
Override to handle ParentView changes.- Specified by:
processPropChange
in interfacePropChange.DoChange
- Overrides:
processPropChange
in classPropObject
-
addDeepChangeListener
Override to add this view as change listener to children on first call.- Overrides:
addDeepChangeListener
in classPropObject
-
removeDeepChangeListener
Override to remove this view as change listener to children when not needed.- Overrides:
removeDeepChangeListener
in classPropObject
-
childDidPropChange
Property change listener implementation to forward changes on to deep listeners. -
childDidDeepChange
Deep property change listener implementation to forward to this View's deep listeners. -
themeChanged
protected void themeChanged()Called when ViewTheme changes.- Overrides:
themeChanged
in classView
-
initProps
Override to support props for this class. -
getPropValue
Override to support props for this class.- Overrides:
getPropValue
in classView
-
setPropValue
Override to support props for this class.- Overrides:
setPropValue
in classView
-
toXML
Override to break toXML into toXMLView and toXMLChildren.- Specified by:
toXML
in interfaceXMLArchiver.Archivable
- Overrides:
toXML
in classView
-
toXMLView
XML Archival of basic view. -
toXMLChildren
XML archival of children. -
fromXML
Override to break fromXML into fromXMLView and fromXMLChildren.- Specified by:
fromXML
in interfaceXMLArchiver.Archivable
- Overrides:
fromXML
in classView
-
fromXMLView
XML unarchival of basic view. -
fromXMLChildren
XML unarchival for shape children.
-