org.crsh.text
Class RenderAppendable

java.lang.Object
  extended by org.crsh.text.RenderAppendable
All Implemented Interfaces:
Appendable, Screenable, ScreenContext

public class RenderAppendable
extends Object
implements ScreenContext


Field Summary
private  ScreenContext context
          .
private  LinkedList<Style.Composite> stack
          .
 
Constructor Summary
RenderAppendable(ScreenContext context)
           
 
Method Summary
 Screenable append(char c)
           
 RenderAppendable append(CharSequence s)
           
 Screenable append(CharSequence csq, int start, int end)
           
 Screenable append(Style style)
           
 Screenable cls()
           
 void enterStyle(Style.Composite style)
           
 void flush()
          Flush the stream.
private  Boolean foo(Boolean last, Boolean merged)
           
private  Color foo(Color last, Color merged, Color def)
           
 int getHeight()
          Returns the screen height in chars.
private  Style.Composite getMerged()
          Compute the current merged style.
 int getWidth()
          Returns the screen width in chars.
 Style.Composite leaveStyle()
           
 void styleOff()
           
 void styleOn()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

private final ScreenContext context
.


stack

private LinkedList<Style.Composite> stack
.

Constructor Detail

RenderAppendable

public RenderAppendable(ScreenContext context)
Method Detail

append

public RenderAppendable append(CharSequence s)
Specified by:
append in interface Appendable

append

public Screenable append(char c)
Specified by:
append in interface Appendable

append

public Screenable append(CharSequence csq,
                         int start,
                         int end)
Specified by:
append in interface Appendable

append

public Screenable append(Style style)
Specified by:
append in interface Screenable

cls

public Screenable cls()
Specified by:
cls in interface Screenable

getWidth

public int getWidth()
Description copied from interface: ScreenContext
Returns the screen width in chars. When the value is not positive it means the value could not be determined.

Specified by:
getWidth in interface ScreenContext
Returns:
the term width

getHeight

public int getHeight()
Description copied from interface: ScreenContext
Returns the screen height in chars. When the value is not positive it means the value could not be determined.

Specified by:
getHeight in interface ScreenContext
Returns:
the term height

flush

public void flush()
           throws IOException
Description copied from interface: ScreenContext
Flush the stream.

Specified by:
flush in interface ScreenContext
Throws:
IOException - any io exception

enterStyle

public void enterStyle(Style.Composite style)

leaveStyle

public Style.Composite leaveStyle()

getMerged

private Style.Composite getMerged()
Compute the current merged style.

Returns:
the merged style

foo

private Boolean foo(Boolean last,
                    Boolean merged)

foo

private Color foo(Color last,
                  Color merged,
                  Color def)

styleOff

public void styleOff()

styleOn

public void styleOn()


Copyright © 2015 eXo Platform SAS. All Rights Reserved.