Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
GObject
org.gnu.pango.Layout
public class Layout
extends GObject
Constructor Summary | |
| |
Method Summary | |
void |
|
Alignment |
|
AttrList |
|
Context |
|
int |
|
int |
|
boolean |
|
boolean |
|
static Layout |
|
LayoutLine |
|
int |
|
int |
|
int |
|
boolean |
|
int |
|
Rectangle |
|
TabArray |
|
String |
|
Rectangle |
|
int |
|
WrapMode |
|
WrapMode |
|
Rectangle |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
public Layout(Handle handle)
Construct a new Layout with a handle that has been returned from a native call.
- Parameters:
handle
- The handle to the native resource.
public Layout(Context context)
Construct a new Layout with the given Context.
- Parameters:
context
- The context to use for the Layout construction.
public Layout(Layout layout)
Construct a new Layout that is a copy of the provided Layout.
- Parameters:
layout
-
public void contextChanged()
Forces recomputation of any state in the Layout that might depend on the layout's context. This method should be called if you make changes to the context subsequent to creating the layout
public Alignment getAlignment()
Gets the alignment for the layout (how partial lines are positioned within the horizontal space available.)
public int getHeight()
Return the logical height of the Layout in Pango units.
public int getIndent()
Gets the amount by which the first line should be shorter than the rest of the lines.
public boolean getJustified()
Deprecated.
Gets whether or not each complete line should be stretched to fill the entire width of the layout.
public boolean getJustify()
Gets whether or not each complete line should be stretched to fill the entire width of the layout.
public static Layout getLayoutFromHandle(Handle handle)
Static factory method that should only be used interally by Java-Gnome.
public LayoutLine getLine(int line)
Retrieves a particular line from a Layout.
- Parameters:
line
- the index of a line, which must be between 0 and pango_layout_get_line_count(layout) - 1, inclusive.
- Returns:
- the requested LayoutLine.
public int getLineCount()
Retrieve the count of lines for the layout
public int getPixelHeight()
Return the logical height of the Layout in device units.
public int getPixelWidth()
Return the logical width of the Layout in device units.
public boolean getSingleParagraphMode()
Obtains the value set bysetSingleParagraphMode(boolean)
.
public int getSpacing()
Gets the amount of spacing between the lines of the layout.
- Returns:
- the spacing (in thousandths of a device unit)
public Rectangle getStrongCursorPosition(int index)
Given an index within a layout, determines the positions that of the strong cursor if the insertion point is at that index. The position of each cursor is stored as a zero-width rectangle. The strong cursor location is the location where characters of the directionality equal to the base direction of the layout are inserted.
- Parameters:
index
-
public TabArray getTabs()
Gets the current TabArray used by this layout. If no TabArray has been set, then the default tabs are in use and null is returned. Default tabs are every 8 spaces.
public String getText()
Gets the text in the layout.
public Rectangle getWeakCursorPosition(int index)
Given an index within a layout, determines the positions that of the weak cursor if the insertion point is at that index. The position of each cursor is stored as a zero-width rectangle. The weak cursor location is the location where characters of the directionality opposite to the base direction of the layout are inserted.
- Parameters:
index
-
public int getWidth()
Gets the width to which the lines of the PangoLayout should be wrapped.
public Rectangle indexToPos(int index)
Converts from an index within a Layout to the onscreen position corresponding to the grapheme at that index, which is represented as rectangle. Note that pos->x is always the leading edge of the grapheme and pos->x + pos->width the trailing edge of the grapheme. If the directionality of the grapheme is right-to-left, then pos->width will be negative.
- Parameters:
index
-
public void setAlignment(Alignment alignment)
Sets the alignment for the layout (how partial lines are positioned within the horizontal space available.)
public void setAttributes(AttrList attributes)
Sets the text attributes for a layout object
public void setFontDescription(FontDescription desc)
Set the default font description for the layout. If no font description is set on the layout, the font description from the layout's context is used.
public void setIndent(int indent)
Sets the amount by which the first line should be shorter than the rest of the lines. This may be negative, in which case the subsequent lines will be shorter than the first line. (However, in either case, the entire width of the layout will be given by the value
public void setJustification(boolean justify)
Deprecated.
Sets whether or not each complete line should be stretched to fill the entire width of the layout. This stretching is typically done by adding whitespace, but for some scripts (such as Arabic), the justification is done by extending the characters.
public void setJustify(boolean justify)
Sets whether or not each complete line should be stretched to fill the entire width of the layout. This stretching is typically done by adding whitespace, but for some scripts (such as Arabic), the justification is done by extending the characters.
public void setMarkup(String markup)
Same assetMarkup(String,char)
, but the markup text isn't scanned for accelerators.
public void setMarkup(String markup, char accelMarker)
Sets the layout text and attribute list from marked-up text (see markup format). Replaces the current text and attribute list. If accelMarker is nonzero, the given character will mark the character following it as an accelerator. For example, the accel marker might be an ampersand or underscore. All characters marked as an accelerator will receive aUnderline.LOW
attribute. Two accelMarker characters following each other produce a single literal accelMarker character.
- Parameters:
markup
- some marked-up textaccelMarker
- : marker for accelerators in the text
public void setSingleParagraphMode(boolean setting)
If setting is TRUE, do not treat newlines and similar characters as paragraph separators; instead, keep all text in a single paragraph, and display a glyph for paragraph separator characters. Used when you want to allow editing of newlines on a single text line.
public void setSpacing(int spacing)
Sets the amount of spacing between the lines of the layout.
public void setTabs(TabArray tabs)
Sets the tabs to use for layout, overriding the default tabs (by default, tabs are every 8 spaces).
public void setText(String text)
Set the text of the layout.
public void setWidth(int width)
Sets the width to which the lines of the PangoLayout should be wrapped.
public void setWrap(WrapMode wrap)
Sets the wrap style; the wrap style only has an effect if a width is set on the layout withsetWidth(int)
To turn off wrapping, set the width to -1.
public void setWrapStyle(WrapMode wrap)
Deprecated.
Sets the wrap style; the wrap style only has an effect if a width is set on the layout withsetWidth(int)
To turn off wrapping, set the width to -1.