Class Line
- java.lang.Object
-
- com.realtime.crossfire.jxclient.gui.log.Line
-
-
Constructor Summary
Constructors Constructor Description Line()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSegment(@NotNull java.lang.String text, boolean bold, boolean italic, boolean underline, @NotNull FontID font, @Nullable java.awt.Color color)Appends aSegmentto the end of the line.intgetHeight()Returns the height of this line.@Nullable SegmentgetLastSegment()Returns the last segment.@NotNull java.util.Iterator<Segment>iterator()voidremoveLastSegment()Removes the last segment.voidsetHeight(int height)Returns the height of this line.voidupdateAttributes(int begin, int end, int y, @NotNull Fonts fonts, @NotNull java.awt.font.FontRenderContext context)Updates the cached attributes of someSegments.
-
-
-
Method Detail
-
addSegment
public void addSegment(@NotNull @NotNull java.lang.String text, boolean bold, boolean italic, boolean underline, @NotNull @NotNull FontID font, @Nullable @Nullable java.awt.Color color)Appends aSegmentto the end of the line.- Parameters:
text- the text to displaybold- whether bold face is enableditalic- whether italic face is enabledunderline- whether underlining is enabledfont- the font to usecolor- the color to use;nullmeans "default color"
-
iterator
@NotNull public @NotNull java.util.Iterator<Segment> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<Segment>
-
getLastSegment
@Nullable public @Nullable Segment getLastSegment()
Returns the last segment.- Returns:
- the last segment or
nullif the line is empty
-
removeLastSegment
public void removeLastSegment()
Removes the last segment. The line must not be empty.
-
getHeight
public int getHeight()
Returns the height of this line. Returns-1untilsetHeight(int)was called.- Returns:
- the height of this line
-
setHeight
public void setHeight(int height)
Returns the height of this line.- Parameters:
height- the height
-
updateAttributes
public void updateAttributes(int begin, int end, int y, @NotNull @NotNull Fonts fonts, @NotNull @NotNull java.awt.font.FontRenderContext context)Updates the cached attributes of someSegments.- Parameters:
begin- the index of the first segment to updateend- the index of the first segment not to updatey- the top border of the line's bounding boxfonts- the fonts instance to usecontext- the font render context to use
-
-