Class RMParentShape

All Implemented Interfaces:
Archivable, DeepChangeListener, RMPropertyChanger, RMTypes, PropertyChangeListener, Cloneable, EventListener
Direct Known Subclasses:
JComponentShape, ReportOwner.ShapeList, RMAnimPathShape.RMAnimPathGroup, RMCrossTab, RMCrossTabFrame, RMDocument, RMFlowShape, RMGraph, RMGraphRPGBar.BarGraphShape2D, RMLabel, RMLabels, RMLineShape, RMNestedDoc, RMPage, RMPolygonShape, RMScene3D, RMSpringShape, RMSwitchShape, RMTable, RMTableGroup, RMTableRowRPG, RMTableRPG, RMViewerShape

public class RMParentShape extends RMShape
A shape implementation that can have children.
  • Constructor Details

    • RMParentShape

      public RMParentShape()
  • Method Details

    • getChildCount

      public int getChildCount()
      Returns the number of children associated with this shape.
      Overrides:
      getChildCount in class RMShape
    • getChild

      public RMShape getChild(int anIndex)
      Returns the child at the given index.
      Overrides:
      getChild in class RMShape
    • getChildren

      public List<RMShape> getChildren()
      Returns the list of children associated with this shape.
      Overrides:
      getChildren in class RMShape
    • addChild

      public final void addChild(RMShape aChild)
      Adds the given child to the end of this shape's children list.
    • addChild

      public void addChild(RMShape aChild, int anIndex)
      Adds the given child to this shape's children list at the given index.
    • addChild

      public final void addChild(RMShape aChild, Object theConstr)
      Adds the given child with the given constraints.
    • addChild

      public final void addChild(RMShape aChild, int anIndex, Object theLayoutInfo)
      Adds the given child to this shape's children list at the given index.
    • removeChild

      public RMShape removeChild(int anIndex)
      Remove's the child at the given index from this shape's children list.
    • removeChild

      public int removeChild(RMShape aChild)
      Removes the given child from this shape's children list.
    • indexOfChild

      public int indexOfChild(RMShape aChild)
      Returns the index of the given child in this shape's children list.
    • getChildLast

      public RMShape getChildLast()
      Returns the last child of this shape.
    • getChildArray

      public RMShape[] getChildArray()
      Returns a copy of the children as an array.
    • removeChildren

      public void removeChildren()
      Removes all children from this shape (in reverse order).
    • getBoundsOfChildren

      public RMRect getBoundsOfChildren()
      Returns bounds of all children of this shape, which can sometimes differ from this shapes bounds.
    • getChildWithName

      public RMShape getChildWithName(String aName)
      Returns first child found with the given name (called recursively on children if not found at current level).
    • getChildWithClass

      public <T> T getChildWithClass(Class<T> aClass)
      Returns first child found with the given class (called recursively on children if not found at current level).
    • getChildrenWithClass

      public <T extends RMShape> List<T> getChildrenWithClass(Class<T> aClass)
      Returns all the shapes in the shape hierarchy of a particular class.
    • getChildrenWithClass

      public <T extends RMShape> List<T> getChildrenWithClass(List aList, Class<T> aClass)
      Adds all the shapes in the shape hierarchy of a particular class to the list. Returns the list as a convenience.
    • getLayout

      public RMShapeLayout getLayout()
      Returns the layout for this shape.
    • setLayout

      public void setLayout(RMShapeLayout aLayout)
      Sets the layout for this shape.
    • isSourceURLSet

      public boolean isSourceURLSet()
      Returns whether Source URL is set.
    • getSourceURL

      public WebURL getSourceURL()
      Returns the Source URL.
    • setSourceURL

      public void setSourceURL(WebURL aURL)
      Sets the Source URL.
    • getNeedsLayout

      public boolean getNeedsLayout()
      Returns whether children need to be laid out.
    • setNeedsLayout

      public void setNeedsLayout(boolean aValue)
      Sets whether children need to be laid out.
    • relayout

      public void relayout()
      Sets shape layout to invalid and requests deferred layout.
    • layout

      public void layout()
      Does immediate layout of this shape and children (if invalid).
    • layoutChildren

      protected void layoutChildren()
      Called to reposition/resize children.
    • addLayoutChild

      protected void addLayoutChild(RMShape aShape)
      Adds a child to layout manager.
    • removeLayoutChild

      protected void removeLayoutChild(RMShape aShape)
      Removes a child from layout manager.
    • computePrefWidth

      protected double computePrefWidth(double aHeight)
      Returns the shape preferred width.
      Overrides:
      computePrefWidth in class RMShape
    • computePrefHeight

      protected double computePrefHeight(double aWidth)
      Returns the shape preferred height.
      Overrides:
      computePrefHeight in class RMShape
    • isShowing

      protected boolean isShowing(RMShape aChild)
      Returns whether given child shape is showing in this parent.
    • isHittable

      protected boolean isHittable(RMShape aChild)
      Returns whether given child shape is hittable.
    • setWidth

      public void setWidth(double aValue)
      Override to trigger layout.
      Overrides:
      setWidth in class RMShape
    • setHeight

      public void setHeight(double aValue)
      Override to trigger layout.
      Overrides:
      setHeight in class RMShape
    • getChildContaining

      public RMShape getChildContaining(RMPoint aPoint)
      Returns the first (top) shape hit by the point given in this shape's coords.
    • getChildrenIntersecting

      public List<RMShape> getChildrenIntersecting(RMPath aPath)
      Returns the child shapes hit by the path given in this shape's coords.
    • divideShapeFromTop

      public RMShape divideShapeFromTop(double anAmount)
      Divides the shape by a given amount from the top. Returns a clone of the given shape with bounds set to the remainder. Divides children among the two shapes (recursively calling divide shape for those straddling).
      Overrides:
      divideShapeFromTop in class RMShape
    • bringShapesToFront

      public void bringShapesToFront(List<RMShape> shapes)
      Moves the subset of children in the given list to the front of the children list.
    • sendShapesToBack

      public void sendShapesToBack(List<RMShape> shapes)
      Moves the subset of children in the given list to the back of the children list.
    • rpgAll

      public RMShape rpgAll(ReportOwner anRptOwner, RMShape aParent)
      Generate report with report owner.
      Overrides:
      rpgAll in class RMShape
    • rpgChildren

      protected RMShape rpgChildren(ReportOwner anRptOwner, RMParentShape aParent)
      Generate report with report owner.
    • clone

      public RMParentShape clone()
      Standard implementation of Object clone. Null's out shape's parent and children.
      Overrides:
      clone in class RMShape
    • cloneDeep

      public RMParentShape cloneDeep()
      Clones all attributes of this shape with complete clones of its children as well.
      Overrides:
      cloneDeep in class RMShape
    • toXML

      public RXElement toXML(RXArchiver anArchiver)
      XML Archival generic - break toXML into toXMLShape and toXMLShapeChildren.
      Specified by:
      toXML in interface Archivable
      Overrides:
      toXML in class RMShape
    • toXMLShape

      protected RXElement toXMLShape(RXArchiver anArchiver)
      XML Archival of basic shape.
    • toXMLChildren

      protected void toXMLChildren(RXArchiver anArchiver, RXElement anElement)
      XML archival of children.
    • fromXML

      public RMShape fromXML(RXArchiver anArchiver, RXElement anElement)
      XML unarchival generic - break fromXML into fromXMLShape and fromXMLShapeChildren.
      Specified by:
      fromXML in interface Archivable
      Overrides:
      fromXML in class RMShape
    • fromXMLShape

      protected void fromXMLShape(RXArchiver anArchiver, RXElement anElement)
      XML unarchival.
    • fromXMLChildren

      protected void fromXMLChildren(RXArchiver anArchiver, RXElement anElement)
      XML unarchival for shape children.