com.levigo.jadice.document
Class Selections

java.lang.Object
  extended by com.levigo.jadice.document.Selections

public class Selections
extends Object

Utility class for Selection objects.


Constructor Summary
Selections()
           
 
Method Summary
static Selection selectRect(Page page)
          Creates a Selection containing the whole page.
static Selection selectRect(Page page, Rectangle2D bounds)
          Creates a Selection for the given Page with the specified bounds.
static Selection selectText(Page page)
          Creates a Selection for the given Page containing the whole textual content of the page.
static Selection selectText(Page page, Rectangle2D bounds)
          Creates a Selection for the given Page containing the textual content within the given bounds of the page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Selections

public Selections()
Method Detail

selectRect

public static Selection selectRect(Page page)
                            throws IllegalArgumentException
Creates a Selection containing the whole page. In contrast to selectText(Page) the resulting selection will be a single Rectangle and not multiple representing each line of text.

This method is s shortcut for selectRect(Page, Rectangle2D), where the second parameter will be constructed using the current page size.

Parameters:
page - the page for which the selection shall be created
Returns:
a Selection containing the whole page
Throws:
IllegalArgumentException

selectRect

public static Selection selectRect(Page page,
                                   Rectangle2D bounds)
                            throws IllegalArgumentException
Creates a Selection for the given Page with the specified bounds. In contrast to selectText(Page, Rectangle2D) the resulting selection will be a single Rectangle2D and not multiple representing each line of text.

Parameters:
page - the page for which the selection shall be created
bounds - the area within the page that shall be selected
Returns:
a Selection for the given bounds
Throws:
IllegalArgumentException - if page and/or bounds are null

selectText

public static Selection selectText(Page page)
                            throws IllegalArgumentException
Creates a Selection for the given Page containing the whole textual content of the page. In constrast to selectRect(Page) this method will create a selection that contains the full page text only.

Parameters:
page - the page for which the selection shall be created
Returns:
a Selection containing the whole text of the page.
Throws:
IllegalArgumentException - if page is null

selectText

public static Selection selectText(Page page,
                                   Rectangle2D bounds)
                            throws IllegalArgumentException
Creates a Selection for the given Page containing the textual content within the given bounds of the page.

Parameters:
page - the page for which the selection shall be created
bounds - the bounds within the page to select the textual content from.
Returns:
a Selection containing the whole text of the page.
Throws:
IllegalArgumentException - if page or bounds are null


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.