Class RBlock

    • Field Detail

      • logger

        protected static final java.util.logging.Logger logger
      • listNesting

        protected final int listNesting
      • cachedLayout

        protected final java.util.Map cachedLayout
      • vScrollBar

        protected javax.swing.JScrollBar vScrollBar
      • hScrollBar

        protected javax.swing.JScrollBar hScrollBar
      • hasHScrollBar

        protected boolean hasHScrollBar
      • hasVScrollBar

        protected boolean hasVScrollBar
      • defaultOverflowX

        protected int defaultOverflowX
      • defaultOverflowY

        protected int defaultOverflowY
      • INVALID_SIZE

        protected static final java.lang.Integer INVALID_SIZE
      • delayedPairs

        protected java.util.Collection delayedPairs
        A list of absolute positioned or float parent-child pairs.
      • backgroundColor

        protected java.awt.Color backgroundColor
        Background color which may be different to that from RenderState in the case of a Document node.
      • backgroundImage

        protected volatile java.awt.Image backgroundImage
      • zIndex

        protected int zIndex
      • borderTopColor

        protected java.awt.Color borderTopColor
      • borderLeftColor

        protected java.awt.Color borderLeftColor
      • borderBottomColor

        protected java.awt.Color borderBottomColor
      • borderRightColor

        protected java.awt.Color borderRightColor
      • borderInsets

        protected java.awt.Insets borderInsets
      • marginInsets

        protected java.awt.Insets marginInsets
      • paddingInsets

        protected java.awt.Insets paddingInsets
      • lastBackgroundImageUri

        protected java.net.URL lastBackgroundImageUri
      • defaultMarginInsets

        protected java.awt.Insets defaultMarginInsets
      • defaultPaddingInsets

        protected java.awt.Insets defaultPaddingInsets
      • overflowX

        protected int overflowX
      • overflowY

        protected int overflowY
      • layoutDeepCanBeInvalidated

        protected boolean layoutDeepCanBeInvalidated
      • SELECTION_COLOR

        protected static final java.awt.Color SELECTION_COLOR
      • SELECTION_XOR

        protected static final java.awt.Color SELECTION_XOR
      • modelNode

        protected final ModelNode modelNode
      • x

        public int x
      • y

        public int y
      • width

        public int width
      • height

        public int height
      • layoutUpTreeCanBeInvalidated

        protected boolean layoutUpTreeCanBeInvalidated
        Starts as true because ancestors could be invalidated.
      • parent

        protected RCollection parent
        Parent for graphics coordinates.
      • originalParent

        protected RCollection originalParent
        Parent for invalidation.
    • Method Detail

      • getVScrollBarWidth

        public int getVScrollBarWidth()
        Gets the width the vertical scrollbar has when shown.
      • finalize

        public void finalize()
                      throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • getVAlign

        public int getVAlign()
        Description copied from interface: RElement
        Vertical alignment for elements rendered in a line. Returns one of the constants defined in this class.
        Specified by:
        getVAlign in interface RElement
      • ensureVisible

        public void ensureVisible​(java.awt.Point point)
      • isOverflowVisibleX

        public final boolean isOverflowVisibleX()
      • isOverflowVisibleY

        public final boolean isOverflowVisibleY()
      • getFirstLineHeight

        public int getFirstLineHeight()
      • getFirstBaselineOffset

        public int getFirstBaselineOffset()
      • setSelectionEnd

        public void setSelectionEnd​(RenderableSpot rpoint)
      • setSelectionStart

        public void setSelectionStart​(RenderableSpot rpoint)
      • getViewportListNesting

        public int getViewportListNesting​(int blockNesting)
      • paint

        public void paint​(java.awt.Graphics g)
        All overriders should call super implementation.
        Specified by:
        paint in interface Renderable
      • layout

        public final void layout​(int availWidth,
                                 int availHeight,
                                 boolean expandWidth,
                                 boolean expandHeight,
                                 int defaultOverflowX,
                                 int defaultOverflowY,
                                 boolean sizeOnly)
      • layout

        public final void layout​(int availWidth,
                                 int availHeight,
                                 boolean expandWidth,
                                 boolean expandHeight,
                                 org.lobobrowser.html.renderer.FloatingBoundsSource floatBoundsSource,
                                 boolean sizeOnly)
      • layout

        public final void layout​(int availWidth,
                                 int availHeight,
                                 boolean expandWidth,
                                 boolean expandHeight,
                                 org.lobobrowser.html.renderer.FloatingBoundsSource floatBoundsSource,
                                 int defaultOverflowX,
                                 int defaultOverflowY,
                                 boolean sizeOnly)
      • doLayout

        public final void doLayout​(int availWidth,
                                   int availHeight,
                                   boolean sizeOnly)
      • doLayout

        public void doLayout​(int availWidth,
                             int availHeight,
                             boolean expandWidth,
                             boolean expandHeight,
                             org.lobobrowser.html.renderer.FloatingBoundsSource floatBoundsSource,
                             int defaultOverflowX,
                             int defaultOverflowY,
                             boolean sizeOnly)
        Lays out and sets dimensions only if RBlock is invalid (or never before layed out), if the parameters passed differ from the last layout, or if the current font differs from the font for the last layout.
        Parameters:
        availWidth -
        availHeight -
      • paintSelection

        public boolean paintSelection​(java.awt.Graphics g,
                                      boolean inSelection,
                                      RenderableSpot startPoint,
                                      RenderableSpot endPoint)
        Description copied from interface: BoundableRenderable
        Asks the Renderable to paint the selection between two points. Nothing will be done if the points are outside the Renderable.
        Specified by:
        paintSelection in interface BoundableRenderable
        Returns:
        True iff it's in selection when finished painting.
      • invalidateLayoutLocal

        public void invalidateLayoutLocal()
        RBlocks should only be invalidated if one of their properties change, or if a descendent changes, or if a style property of an ancestor is such that it could produce layout changes in this RBlock.
      • clearStyle

        protected void clearStyle​(boolean isRootBlock)
      • onMouseClick

        public boolean onMouseClick​(java.awt.event.MouseEvent event,
                                    int x,
                                    int y)
        Specified by:
        onMouseClick in interface BoundableRenderable
      • onDoubleClick

        public boolean onDoubleClick​(java.awt.event.MouseEvent event,
                                     int x,
                                     int y)
        Specified by:
        onDoubleClick in interface BoundableRenderable
      • onMousePressed

        public boolean onMousePressed​(java.awt.event.MouseEvent event,
                                      int x,
                                      int y)
        Description copied from interface: BoundableRenderable
        Returns false if the event is consumed. True to propagate further.
        Specified by:
        onMousePressed in interface BoundableRenderable
      • repaint

        public void repaint​(ModelNode modelNode)
        Description copied from interface: UINode
        Called
        Specified by:
        repaint in interface UINode
      • updateWidgetBounds

        public void updateWidgetBounds​(int guiX,
                                       int guiY)
        Updates bounds of all descendent's GUI components, based on root bounds.
        Specified by:
        updateWidgetBounds in interface RCollection
      • scrollHorizontalTo

        public void scrollHorizontalTo​(int newX)
      • scrollVerticalTo

        public void scrollVerticalTo​(int newY)
      • scrollByUnits

        public void scrollByUnits​(int orientation,
                                  int units)
      • scrollBy

        public void scrollBy​(int orientation,
                             int offset)
      • scrollTo

        public void scrollTo​(java.awt.Rectangle bounds,
                             boolean xIfNeeded,
                             boolean yIfNeeded)
        Scrolls the viewport's origin to the given location, or as close to it as possible.

        This method should be invoked in the GUI thread.

        Parameters:
        bounds - The bounds of the scrollable area that should become visible.
        xIfNeeded - If this parameter is true the x coordinate is changed only if the horizontal bounds are not currently visible.
        yIfNeeded - If this parameter is true the y coordinate is changed only if the vertical bounds are not currently visible.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getExportableFloatingInfo

        public FloatingInfo getExportableFloatingInfo()
      • getDefaultOverflowX

        public int getDefaultOverflowX()
      • getDefaultOverflowY

        public int getDefaultOverflowY()
      • setDefaultOverflowX

        public void setDefaultOverflowX​(int defaultOverflowX)
      • setDefaultOverflowY

        public void setDefaultOverflowY​(int defaultOverflowY)
      • setDefaultPaddingInsets

        public void setDefaultPaddingInsets​(java.awt.Insets insets)
      • setDefaultMarginInsets

        public void setDefaultMarginInsets​(java.awt.Insets insets)
      • getAlignmentX

        public float getAlignmentX()
      • getAlignmentY

        public float getAlignmentY()
      • invalidateLayoutDeep

        public final void 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
      • getDeclaredWidth

        protected java.lang.Integer getDeclaredWidth​(RenderState renderState,
                                                     int actualAvailWidth)
      • hasDeclaredWidth

        public final boolean hasDeclaredWidth()
      • getDeclaredHeight

        protected java.lang.Integer getDeclaredHeight​(RenderState renderState,
                                                      int actualAvailHeight)
      • getDeclaredHeightImpl

        protected int getDeclaredHeightImpl​(RenderState renderState,
                                            int availHeight)
      • layout

        public final void layout​(int availWidth,
                                 int availHeight,
                                 boolean sizeOnly)
        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.
      • sendGUIComponentsToParent

        protected final void sendGUIComponentsToParent()
      • clearGUIComponents

        protected final void clearGUIComponents()
      • updateWidgetBounds

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

        protected void applyStyle​(int availWidth,
                                  int availHeight)
      • loadBackgroundImage

        protected void loadBackgroundImage​(java.net.URL imageURL)
      • prePaint

        protected void prePaint​(java.awt.Graphics g)
      • imageUpdate

        public boolean imageUpdate​(java.awt.Image img,
                                   int infoflags,
                                   int x,
                                   int y,
                                   int w,
                                   int h)
        Specified by:
        imageUpdate in interface java.awt.image.ImageObserver
      • getInsets

        public java.awt.Insets getInsets​(boolean hscroll,
                                         boolean vscroll)
        Gets insets of content area. It includes margin, borders and scrollbars, but not padding.
      • sendDelayedPairsToParent

        protected final void sendDelayedPairsToParent()
      • isContainedByNode

        public boolean isContainedByNode()
        Description copied from interface: BoundableRenderable
        Returns true if the renderable is fully contained by its modelNode, but said modelNode does not fully contain an ancestor renderable.
        Specified by:
        isContainedByNode in interface BoundableRenderable
      • isMarginBoundary

        protected boolean isMarginBoundary()
      • onRightClick

        public boolean onRightClick​(java.awt.event.MouseEvent event,
                                    int x,
                                    int y)
        Specified by:
        onRightClick in interface BoundableRenderable
      • markLayoutValid

        public void markLayoutValid()
      • contains

        public boolean contains​(int x,
                                int y)
      • invalidateLayoutUpTree

        public final void invalidateLayoutUpTree()
        Invalidates this Renderable and its parent (i.e. all ancestors).
        Specified by:
        invalidateLayoutUpTree in interface BoundableRenderable
      • isValid

        protected boolean isValid()
      • relayout

        public void relayout()
        Invalidates the current Renderable (which invalidates its ancestors) and then requests the top level GUI container to do the layout and repaint. It's safe to call this method outside the GUI thread.
        Specified by:
        relayout in interface BoundableRenderable
      • relayoutIfValid

        public void relayoutIfValid()
      • repaint

        public void repaint​(int x,
                            int y,
                            int width,
                            int height)
        Specified by:
        repaint in interface BoundableRenderable
      • getBlockBackgroundColor

        public java.awt.Color getBlockBackgroundColor()
      • paintTranslated

        public final void paintTranslated​(java.awt.Graphics g)
        Description copied from interface: BoundableRenderable
        Paints by either creating a new clipped graphics context corresponding to the bounds of the Renderable, or by translating the origin.
        Specified by:
        paintTranslated in interface BoundableRenderable
        Parameters:
        g - Parent's Graphics context.
      • translateDescendentPoint

        protected final java.awt.Point translateDescendentPoint​(BoundableRenderable descendent,
                                                                int x,
                                                                int y)
      • getOrdinal

        public int getOrdinal()
      • setOrdinal

        public void setOrdinal​(int ordinal)