|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.ranides.assira.text.format.AnsiStringWrapper
public abstract class AnsiStringWrapper
Klasa abstrakcyjna ułatwiająca pisanie wrapperów, które opakowują standardową
sekwencję znaków nadając wszystkim elementom atrybuty zwrócone przez metodę getAttr.
Metoda musi zwracać numery kolorów i czcionek kompatybilne ze schematami
zwracanymi przez metody getScheme oraz getFonts.
Implementacja metody subAnsiSequence najczęściej będzie miała w klasie
pochodnej TWrapper bardzo prostą implementację, jeśli tylko zostanie
dostarczony odpowiedni konstruktor:
return new TWrapper(subSequence(begin, end));
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface net.ranides.assira.text.format.AnsiAttr |
|---|
AnsiAttr.IndirectAt |
| Field Summary |
|---|
| Fields inherited from interface net.ranides.assira.text.format.AnsiAttr |
|---|
bold, BOLD, changed, CHANGED, fresh, FRESH, invert, INVERT, MASK_INTERNAL, MASK_PUBLIC, narrow, NARROW, normal, NORMAL, SPLIT_ALL, SPLIT_BACK, SPLIT_FLAGS, SPLIT_FLAGS_ALL, SPLIT_FONT, SPLIT_FORE, strike, STRIKE, symbol, SYMBOL, underline, UNDERLINE |
| Constructor Summary | |
|---|---|
AnsiStringWrapper(CharSequence value)
Opakowuje podaną sekwencję znaków. |
|
| Method Summary | |
|---|---|
char |
charAt(int index)
|
AnsiAttr |
getAttrAt(int index)
Zwraca wszystkie właściwości przypisane do znaku o podanym indeksie (kolor, tło, czcionka, styl). |
int |
getBack()
Zwraca przypisany numer koloru tła. |
int |
getBackAt(int index)
Zwraca numer koloru tła przypisany do znaku o podanym indeksie. |
char |
getCharAt(int index)
Odczytuje z sekwencji znak o podanym indeksie. |
Color |
getComputedBack()
Metoda opcjonalna: zwraca przypisany kolor tła. |
Color |
getComputedBackAt(int index)
Metoda opcjonalna: zwraca kolor tła przypisany do znaku o podanym indeksie. |
Font |
getComputedFont()
Metoda opcjonalna: zwraca przypisaną czcionkę. |
Font |
getComputedFontAt(int index)
Metoda opcjonalna: zwraca numer czcionki przypisany do znaku o podanym indeksie. |
Color |
getComputedFore()
Metoda opcjonalna: zwraca przypisany kolor tekstu. |
Color |
getComputedForeAt(int index)
Metoda opcjonalna: zwraca kolor tekstu przypisany do znaku o podanym indeksie. |
int |
getFlags()
Zwraca przypisane atrybuty tekstu. |
int |
getFlagsAt(int index)
Zwraca atrybuty przypisane do znaku o podanym indeksie. |
int |
getFont()
Zwraca przypisany numer czcionki. |
int |
getFontAt(int index)
Zwraca numer czcionki przypisany do znaku o podanym indeksie. |
int |
getFore()
Zwraca przypisany numer koloru tekstu. |
int |
getForeAt(int index)
Zwraca numer koloru tekstu przypisany do znaku o podanym indeksie. |
int |
length()
|
Iterable<? extends AnsiCharSequence> |
split(int options)
Rozbija tekst na fragmenty zawierające znaki zgrupowane według kryteriów podanych w opcjach. |
CharSequence |
subSequence(int start,
int end)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.ranides.assira.text.format.AnsiCharSequence |
|---|
getAttr, getFonts, getScheme, subAnsiSequence |
| Methods inherited from interface java.lang.CharSequence |
|---|
toString |
| Constructor Detail |
|---|
public AnsiStringWrapper(CharSequence value)
value - | Method Detail |
|---|
public int getFore()
AnsiAttrAnsiColorScheme.
getFore in interface AnsiAttrAnsiAttr.getComputedFore()public int getBack()
AnsiAttrAnsiColorScheme.
getBack in interface AnsiAttrAnsiAttr.getComputedBack()public int getFlags()
AnsiAttr
getFlags in interface AnsiAttrpublic int getFont()
AnsiAttrAnsiFontScheme.
getFont in interface AnsiAttrAnsiAttr.getComputedFont()public Color getComputedFore()
AnsiAttrAnsiColorScheme.
getComputedFore in interface AnsiAttrpublic Color getComputedBack()
AnsiAttrAnsiColorScheme.
getComputedBack in interface AnsiAttrpublic Font getComputedFont()
AnsiAttrAnsiFontScheme.
getComputedFont in interface AnsiAttrpublic char getCharAt(int index)
AnsiCharSequenceCharSequence.charAt(int). Metoda istniejąca w celu uzyskania pełnej kompatybilności
sekwencji znaków z konwencją JavaBeans.
getCharAt in interface AnsiCharSequencepublic int getForeAt(int index)
AnsiCharSequenceAnsiColorScheme.
getForeAt in interface AnsiCharSequenceAnsiCharSequence.getComputedForeAt(int)public int getBackAt(int index)
AnsiCharSequenceAnsiColorScheme.
getBackAt in interface AnsiCharSequenceAnsiCharSequence.getComputedBackAt(int)public int getFlagsAt(int index)
AnsiCharSequence
getFlagsAt in interface AnsiCharSequencepublic int getFontAt(int index)
AnsiCharSequenceAnsiFontScheme.
getFontAt in interface AnsiCharSequenceAnsiCharSequence.getComputedFontAt(int)public AnsiAttr getAttrAt(int index)
AnsiCharSequence
getAttrAt in interface AnsiCharSequencepublic Color getComputedForeAt(int index)
AnsiCharSequenceAnsiColorScheme.
getComputedForeAt in interface AnsiCharSequencepublic Color getComputedBackAt(int index)
AnsiCharSequenceAnsiColorScheme.
getComputedBackAt in interface AnsiCharSequencepublic Font getComputedFontAt(int index)
AnsiCharSequenceAnsiFontScheme.
getComputedFontAt in interface AnsiCharSequencepublic Iterable<? extends AnsiCharSequence> split(int options)
AnsiCharSequence
Rozbija tekst na fragmenty zawierające znaki zgrupowane według kryteriów
podanych w opcjach. Opcje są zbiorem flag z klasy AnsiAttr.
Rozdziela tekst na fragmenty o jednym kolorze tekstu i tła:
text.split(AnsiAttr.SPLIT_FORE | AnsiAttr.SPLIT_BACK)
Rozdziela tekst na fragmenty o tym samym stylu pogrubienia:
text.split(AnsiAttr.SPLIT_FLAGS | AnsiAttr.BOLD)
split in interface AnsiCharSequencepublic int length()
length in interface CharSequencepublic char charAt(int index)
charAt in interface CharSequence
public CharSequence subSequence(int start,
int end)
subSequence in interface CharSequence
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||