Package com.tonic.vellum
Class Section
- java.lang.Object
-
- com.tonic.vellum.Section
-
- Direct Known Subclasses:
AbstractListSection,BorderSection,ScrollSection,SingleRowSection,Split,StatusBar,TabHost,TextInput,TextSection
public abstract class Section extends java.lang.ObjectThe base unit of a Vellum UI: every visible element is a Section, and containers are Sections that hold other Sections. The framework assigns bounds during layout, routes keys to the focused section, and repaints dirty subtrees.
-
-
Constructor Summary
Constructors Constructor Description Section()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Sectionbordered()Wraps this section in a border.Sectionbordered(java.lang.String title)Wraps this section in a titled border.Rectbounds()booleanisFocused()Sectionparent()voidrequestRedraw()Marks this section dirty; the framework batches and repaints the dirty subtree.
-
-
-
Method Detail
-
requestRedraw
public final void requestRedraw()
Marks this section dirty; the framework batches and repaints the dirty subtree.- Throws:
java.lang.IllegalStateException- if called off the UI thread
-
isFocused
public final boolean isFocused()
- Returns:
- true if this section is on the focus path
-
bounds
public final Rect bounds()
- Returns:
- this section's current bounds
-
parent
public final Section parent()
- Returns:
- the parent section, or null if this is the root or unattached
-
bordered
public final Section bordered()
Wraps this section in a border.- Returns:
- the wrapping bordered section
-
bordered
public final Section bordered(java.lang.String title)
Wraps this section in a titled border.- Parameters:
title- the border title- Returns:
- the wrapping bordered section
-
-