Class BaseElementRenderable

All Implemented Interfaces:
ImageObserver, UINode, BoundableRenderable, RCollection, RElement, Renderable, RenderableContainer
Direct Known Subclasses:
RBlock, RInlineBlock, RTable, RUIControl

public abstract class BaseElementRenderable extends BaseRCollection implements RElement, RenderableContainer, ImageObserver

Abstract BaseElementRenderable class.

  • Field Details

    • INVALID_SIZE

      protected static final Integer INVALID_SIZE
      Constant INVALID_SIZE
    • SCROLL_BAR_THICKNESS

      protected static final int SCROLL_BAR_THICKNESS
      Constant SCROLL_BAR_THICKNESS=16
      See Also:
    • userAgentContext

      protected final UserAgentContext userAgentContext
    • backgroundColor

      protected Color backgroundColor
    • borderLeftColor

      protected Color borderLeftColor
    • borderRightColor

      protected Color borderRightColor
    • borderTopColor

      protected Color borderTopColor
    • borderBottomColor

      protected Color borderBottomColor
    • backgroundImage

      protected volatile Image backgroundImage
    • borderInfo

      protected BorderInfo borderInfo
    • borderInsets

      protected Insets borderInsets
    • marginInsets

      protected Insets marginInsets
    • paddingInsets

      protected Insets paddingInsets
    • delayedPairs

      protected List<DelayedPair> delayedPairs
    • lastBackgroundImageUri

      protected URL lastBackgroundImageUri
    • layoutDeepCanBeInvalidated

      protected boolean layoutDeepCanBeInvalidated
    • overflowX

      protected int overflowX
    • overflowY

      protected int overflowY
    • relativeOffsetX

      protected int relativeOffsetX
    • relativeOffsetY

      protected int relativeOffsetY
    • zIndex

      protected int zIndex
  • Constructor Details

  • Method Details

    • addComponent

      public Component addComponent(Component component)

      addComponent.

      Specified by:
      addComponent in interface RenderableContainer
      Parameters:
      component - a Component object.
      Returns:
      a Component object.
    • getBorderInsets

      public Insets getBorderInsets()

      Getter for the field borderInsets.

      Returns:
      a Insets object.
    • addDelayedPair

      public void addDelayedPair(DelayedPair pair)

      addDelayedPair.

      Specified by:
      addDelayedPair in interface RenderableContainer
      Parameters:
      pair - a DelayedPair object.
    • applyStyle

      protected void applyStyle(int availWidth, int availHeight)

      applyStyle.

      Parameters:
      availWidth - a Integer object.
      availHeight - a Integer object.
    • clearDelayedPairs

      public final void clearDelayedPairs()

      clearDelayedPairs.

      Specified by:
      clearDelayedPairs in interface RenderableContainer
    • clearGUIComponents

      protected final void clearGUIComponents()

      clearGUIComponents.

    • clearStyle

      protected void clearStyle(boolean isRootBlock)

      clearStyle.

      Parameters:
      isRootBlock - a boolean.
    • setupRelativePosition

      public void setupRelativePosition(RenderableContainer container)

      setupRelativePosition.

      Specified by:
      setupRelativePosition in interface RElement
      Parameters:
      container - a RenderableContainer object.
    • doLayout

      protected abstract void doLayout(int availWidth, int availHeight, boolean sizeOnly)

      doLayout.

      Parameters:
      availWidth - a Integer object.
      availHeight - a Integer object.
      sizeOnly - a boolean.
    • getCollapsibleMarginBottom

      public int getCollapsibleMarginBottom()

      getCollapsibleMarginBottom.

      Specified by:
      getCollapsibleMarginBottom in interface RElement
      Returns:
      a Integer object.
    • getCollapsibleMarginTop

      public int getCollapsibleMarginTop()

      getCollapsibleMarginTop.

      Specified by:
      getCollapsibleMarginTop in interface RElement
      Returns:
      a Integer object.
    • getDeclaredHeight

      public Integer getDeclaredHeight(int actualAvailHeight)

      Getter for the field declaredHeight.

      Parameters:
      actualAvailHeight - a Integer object.
      Returns:
      a Integer object.
    • getDeclaredWidth

      protected Integer getDeclaredWidth(int actualAvailWidth)

      Getter for the field declaredWidth.

      Parameters:
      actualAvailWidth - a Integer object.
      Returns:
      a Integer object.
    • getDeclaredMaxWidth

      protected Integer getDeclaredMaxWidth(RenderState renderState, int actualAvailWidth)
    • getDeclaredMinWidth

      protected Integer getDeclaredMinWidth(RenderState renderState, int actualAvailWidth)
    • getDeclaredMaxHeight

      protected Integer getDeclaredMaxHeight(RenderState renderState, int actualAvailHeight)
    • getDeclaredMinHeight

      protected Integer getDeclaredMinHeight(RenderState renderState, int actualAvailHeight)
    • getDelayedPairs

      public final List<DelayedPair> getDelayedPairs()

      getDelayedPairs.

      Specified by:
      getDelayedPairs in interface RenderableContainer
      Returns:
      a List object.
    • getInnerWidth

      public int getInnerWidth()

      getInnerWidth.

      Specified by:
      getInnerWidth in interface RenderableContainer
      Returns:
      a Integer object.
    • getInnerHeight

      public int getInnerHeight()

      getInnerHeight.

      Specified by:
      getInnerHeight in interface RenderableContainer
      Returns:
      a Integer object.
    • getInsets

      public Insets getInsets(boolean hscroll, boolean vscroll)

      getInsets.

      Specified by:
      getInsets in interface RenderableContainer
      Parameters:
      hscroll - a boolean.
      vscroll - a boolean.
      Returns:
      a Insets object.
    • getInsetsMarginBorder

      public Insets getInsetsMarginBorder(boolean hscroll, boolean vscroll)

      getInsetsMarginBorder.

      Specified by:
      getInsetsMarginBorder in interface RenderableContainer
      Parameters:
      hscroll - a boolean.
      vscroll - a boolean.
      Returns:
      a Insets object.
    • getInsetsPadding

      public Insets getInsetsPadding(boolean hscroll, boolean vscroll)

      getInsetsPadding.

      Parameters:
      hscroll - a boolean.
      vscroll - a boolean.
      Returns:
      a Insets object.
    • getMarginBottom

      public int getMarginBottom()

      getMarginBottom.

      Specified by:
      getMarginBottom in interface RElement
      Returns:
      a Integer object.
    • getMarginLeft

      public int getMarginLeft()

      getMarginLeft.

      Specified by:
      getMarginLeft in interface RElement
      Returns:
      a Integer object.
    • getMarginRight

      public int getMarginRight()

      getMarginRight.

      Specified by:
      getMarginRight in interface RElement
      Returns:
      a Integer object.
    • getMarginTop

      public int getMarginTop()

      getMarginTop.

      Specified by:
      getMarginTop in interface RElement
      Returns:
      a Integer object.
    • getParentContainer

      public RenderableContainer getParentContainer()

      getParentContainer.

      Specified by:
      getParentContainer in interface RenderableContainer
      Returns:
      a RenderableContainer object.
    • getZIndex

      public int getZIndex()

      getZIndex.

      Specified by:
      getZIndex in interface BoundableRenderable
      Returns:
      a Integer object.
    • hasDeclaredWidth

      public final boolean hasDeclaredWidth()

      hasDeclaredWidth.

      Returns:
      a boolean.
    • imageUpdate

      public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h)
      Specified by:
      imageUpdate in interface ImageObserver
    • layout

      public void layout(int availWidth, int availHeight, boolean sizeOnly)
      Lays out the subtree below the RElement. The RElement is expected to set its own dimensions, but not its origin. Lays out children, and deals with "valid" state. Override doLayout method instead of this one.
      Specified by:
      layout in interface RElement
      Parameters:
      availWidth - The available width from the parent's canvas.
      availHeight - The available height from the parent's canvas.
      sizeOnly - Whether the layout is for sizing determination only.
    • invalidateLayoutDeep

      public final void invalidateLayoutDeep()

      invalidateLayoutDeep.

      Invalidates this Renderable and all descendents. This is only used in special cases, such as when a new style sheet is added.
      Specified by:
      invalidateLayoutDeep in interface RCollection
      Overrides:
      invalidateLayoutDeep in class BaseRCollection
    • translateDescendentPoint

      public Point translateDescendentPoint(BoundableRenderable descendent, int x, int y)

      translateDescendentPoint.

      Specified by:
      translateDescendentPoint in interface RenderableContainer
      Parameters:
      descendent - a BoundableRenderable object.
      x - a Integer object.
      y - a Integer object.
      Returns:
      a Point object.
    • invalidateLayoutLocal

      protected void invalidateLayoutLocal()

      invalidateLayoutLocal.

      Specified by:
      invalidateLayoutLocal in class BaseBoundableRenderable
    • isContainedByNode

      public boolean isContainedByNode()

      isContainedByNode.

      Specified by:
      isContainedByNode in interface BoundableRenderable
      Returns:
      a boolean.
    • isMarginBoundary

      protected boolean isMarginBoundary()

      isMarginBoundary.

      Returns:
      a boolean.
    • paint

      public void paint(Graphics g)

      paint.

      Specified by:
      paint in interface Renderable
      Parameters:
      g - a Graphics object.
    • getClipBounds

      public Rectangle getClipBounds()

      getClipBounds.

      Specified by:
      getClipBounds in interface RCollection
      Returns:
      a Rectangle object.
    • sendDelayedPairsToParent

      protected final void sendDelayedPairsToParent()

      sendDelayedPairsToParent.

    • sendGUIComponentsToParent

      protected final void sendGUIComponentsToParent()

      sendGUIComponentsToParent.

    • updateAllWidgetBounds

      public void updateAllWidgetBounds()

      updateAllWidgetBounds.

      Specified by:
      updateAllWidgetBounds in interface RenderableContainer
    • updateWidgetBounds

      public void updateWidgetBounds()
      Updates widget bounds below this node only. Should not be called during general rendering.
    • prePaint

      protected void prePaint(Graphics g)

      prePaint.

      Parameters:
      g - a Graphics object.