Example usage for java.awt TextComponent getHeight

List of usage examples for java.awt TextComponent getHeight

Introduction

In this page you can find the example usage for java.awt TextComponent getHeight.

Prototype

public int getHeight() 

Source Link

Document

Returns the current height of this component.

Usage

From source file:edworld.pdfreader4humans.PDFReader.java

private boolean consecutiveText(TextComponent component1, TextComponent component2, Component container) {
    if (component1 == null)
        return false;
    if (component1.consecutive(component2, true))
        return true;
    if (alignedToCenter(component1, component2, container))
        return false;
    int nextWordLength = Math.min(5, (component2.getText() + SPACE).indexOf(SPACE)) + 1;
    return component1.getToX() + nextWordLength * component1.getAverageCharacterWidth() > container.getToX()
            && (alignedToRight(component1, component2, container)
                    || component2.getFromX() - component2.getAverageCharacterWidth() < component1.getFromX())
            && component1.getToX() > component2.getFromX()
            && component1.getToX() + nextWordLength * component1.getAverageCharacterWidth() > component2
                    .getToX()/*from  w  w w .ja v  a 2 s . co  m*/
            && component2.getFromY() - component1.getToY() < Math.max(component1.getHeight(),
                    component2.getHeight());
}