Eclipse Draw2d
3.1

org.eclipse.draw2d.text
Class BlockBox

java.lang.Object
  extended byorg.eclipse.draw2d.text.FlowBox
      extended byorg.eclipse.draw2d.text.CompositeBox
          extended byorg.eclipse.draw2d.text.BlockBox

public class BlockBox
extends CompositeBox

A CompositeBox suitable for containing multiple LineBox fragments.

Since:
2.1

Method Summary
 void add(FlowBox box)
          Adds the given box and updates properties of this composite box.
 boolean containsPoint(int x, int y)
          This method must be called on a block that is completely positioned and committed.
 int getAscent()
          Returns the amount of line content in pixels which is above the baseline.
 int getBaseline()
          Returns y coordinate for the box's baseline.
 int getDescent()
          Returns the amount of line content in pixels which is below the baseline.
 int getHeight()
           
 void setHeight(int h)
          Sets the height.
 void setLineTop(int y)
          Positions the box vertically by setting the y coordinate for the top of the content of the line.
 
Methods inherited from class org.eclipse.draw2d.text.CompositeBox
getRecommendedWidth, setRecommendedWidth
 
Methods inherited from class org.eclipse.draw2d.text.FlowBox
getWidth, getX, requiresBidi, setWidth, setX
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

add

public void add(FlowBox box)
Description copied from class: CompositeBox
Adds the given box and updates properties of this composite box.

Specified by:
add in class CompositeBox
Parameters:
box - the child being added
See Also:
CompositeBox.add(FlowBox)

containsPoint

public boolean containsPoint(int x,
                             int y)
Description copied from class: FlowBox
This method must be called on a block that is completely positioned and committed.

Specified by:
containsPoint in class FlowBox
Parameters:
x - X
y - Y
Returns:
true if the FlowBox contains the point
See Also:
FlowBox.containsPoint(int, int)

getAscent

public int getAscent()
Description copied from class: FlowBox
Returns the amount of line content in pixels which is above the baseline. Ascent and descent are used to space consecutive lines apart. Certain types of line content, such as borders, extend beyond the ascent and descent.

Specified by:
getAscent in class FlowBox
Returns:
the descent in pixels below the baseline
See Also:
FlowBox.getAscent()

getBaseline

public int getBaseline()
Description copied from class: FlowBox
Returns y coordinate for the box's baseline.

Specified by:
getBaseline in class FlowBox
Returns:
the baseline location
See Also:
FlowBox.getBaseline()

getDescent

public int getDescent()
Description copied from class: FlowBox
Returns the amount of line content in pixels which is below the baseline.

Specified by:
getDescent in class FlowBox
Returns:
the descent in pixels
See Also:
FlowBox.getDescent()

getHeight

public int getHeight()
Returns:
Returns the height.

setHeight

public void setHeight(int h)
Sets the height.

Parameters:
h - The height

setLineTop

public void setLineTop(int y)
Description copied from class: CompositeBox
Positions the box vertically by setting the y coordinate for the top of the content of the line. For internal use only.

Specified by:
setLineTop in class CompositeBox
Parameters:
y - the y coordinate
See Also:
CompositeBox.setLineTop(int)

Eclipse Draw2d
3.1

Copyright (c) IBM Corp. and others 2000, 2005. All Rights Reserved.