'STRAP:multiple sequence alignments '

charite.christo
Class ChTextComponents

java.lang.Object
  extended by charite.christo.ChTextComponents
All Implemented Interfaces:
ChRunnable, HasModiCount, PaintHook, ProcessEv, java.util.EventListener, javax.swing.event.DocumentListener, javax.swing.event.UndoableEditListener

public final class ChTextComponents
extends java.lang.Object
implements javax.swing.event.DocumentListener, ChRunnable, PaintHook, javax.swing.event.UndoableEditListener, ProcessEv, HasModiCount

Utilities for TextComponents


Field Summary
static java.lang.String ACTION_INSERTED_TEXT_LONGER_ONE
           
static int COMPL_ALLOW_SPC_IN_FILE
           
static java.lang.String COMPL_HYPERREFS
           
static int COMPL_IC
           
static int COMPL_INFER_CASE
           
static int COMPL_TAB
           
static java.lang.String DIR_SAVED_TEXT
           
static java.lang.String[] FILE_RANGE_SUFX
           
static long FRAME_OPTS
           
 java.util.List<TextMatches>[] HIGHLIGHTS
           
static long INSERT_IF_NOT_CONTAINS
           
static java.lang.String KOPT_CLASS_AT_CURSOR
           
static java.lang.String KOPT_F1_HELP
           
static java.lang.String RANGE_SUFX_XML
           
static java.lang.String TT
           
static byte[] WRONG_CHARS_IN_FILEN
           
 
Fields inherited from interface charite.christo.ChRunnable
APPEND, COLUMN_TITLE, DOWNLOAD_FINISHED, GET_PANEL, ICON, INTERPRET_LINE, IS_DRAG4XY, ITEM_TEXT, MODIFY_RENDERER_COMPONENT, PROGRESS, REPAINT_CURSOR, SAY_DOWNLOADING, SET_ICON_IMAGE, SET_TREE_VALUE, SHOW_IN_FRAME, TAB_TEXT, TIP_TEXT
 
Constructor Summary
ChTextComponents(javax.swing.JComponent jc)
           
 
Method Summary
 void addHighlight(TextMatches h)
           
static void addLiDb(java.awt.event.ActionListener li)
           
 int boundsToPos(boolean first, java.awt.Rectangle clip)
           
 ChButton butSave(java.io.File f)
           
 BA byteArray()
           
 void changedUpdate(javax.swing.event.DocumentEvent ev)
           
 ChTextComponents cp(java.lang.Object key, java.lang.Object value)
           
 void enableTextChangeEv(boolean b)
           
 ChTextComponents enableUndo(boolean soft)
           
 ChTextComponents enableWordCompletion(long options, java.lang.Object collection, boolean[] lDelim, boolean[] rDelim)
           
 ChTextComponents enableWordCompletion(java.lang.Object collection)
           
 java.awt.Cursor getCursor()
           
static int getFixedRowHeight(java.lang.Object o)
           
static int getLength(java.lang.Object o)
           
 boolean getSelection(java.lang.Object range)
           
 java.lang.String getText()
           
 javax.swing.text.Segment getTextAsSegment()
           
static java.lang.String getWordAt(int iCaret, BA ba, boolean[] lDelimiters, boolean[] rDelimiters)
           
static Range getWordAt(int iCaret, BA ba, boolean[] lDelimiters, boolean[] rDelimiters, Range range)
           
static java.lang.String getWordAt(java.awt.Point p, javax.swing.JComponent tc, boolean[] lDelimiters, boolean[] rDelimiters)
           
 java.lang.String getWordUnderMouse(Range r)
           
 void highlightBlanks()
           
 TextMatches highlightOccurrence(java.lang.Object needle, boolean[] delimiterL, boolean[] delimiterR, long mode, java.awt.Color color)
           
static void insertAtCaret(long options, java.lang.String s, javax.swing.JComponent jc)
           
 void insertUpdate(javax.swing.event.DocumentEvent ev)
           
 boolean isAlreadyPainted()
           
 boolean isEmpty()
           
 javax.swing.JComponent jc()
           
 void loadSavedText()
           
 void marchingAnts(int id, int from, int to)
           
static void modelToView(int m, java.lang.Object o, java.awt.Rectangle r)
           
 int modificationCount()
           
 ChButton newClearButton()
           
static int nxtEC(byte[] T, int from, int end)
           
 boolean paintHook(javax.swing.JComponent component, java.awt.Graphics g, boolean after)
           
 void processEv(java.awt.AWTEvent ev)
           
 boolean removeHighlight(TextMatches h)
           
 void removeUpdate(javax.swing.event.DocumentEvent ev)
           
 void repaintLater(int delay)
           
 void rmAllHighlights()
           
 ChDelay run(char type)
           
 java.lang.Object run(java.lang.String id, java.lang.Object arg)
           
 void saveInFile(boolean always)
           
 void saveInFile(java.io.File file)
           
 ChTextComponents saveInFile(java.lang.String fileName)
           
static void setAssociateFind(boolean focus, DialogFindInText d)
           
 void setChanged()
           
static void setContextMenuProvider(ChRunnable r)
           
 void setReplaceWhenTextChanges(ChTextReplacement... replacements)
           
static void setScrollPositionV(int pos, javax.swing.JComponent jc)
           
 void setSelection(int f, int t)
           
static void setTextAreaForAbstract(ChTextComponents t)
           
 void setTextTS(java.lang.CharSequence txt)
           
 void setTextTS(java.lang.CharSequence txt, boolean keepCaretPosition)
           
 ChTextComponents setWordCompletionSetFirst(java.lang.Object collection)
           
static void showFrameWeblinks(int type, java.lang.CharSequence txt, java.lang.Object pSouth)
           
 ChTextComponents showInFrame(long options, java.lang.String title)
           
 ChTextComponents showInFrame(java.lang.String t)
           
 javax.swing.text.JTextComponent tc()
           
static java.lang.Thread thread_setScrollPositionV(int pos, javax.swing.JComponent jc)
           
static ChTextComponents tools(java.lang.Object o0)
           
 ChTextComponents underlineRefs(long mode)
           
 void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
           
static int viewToModel(java.awt.Point p, java.lang.Object o)
           
static java.lang.String[] webLinks(java.lang.String id, java.lang.String[] customSettings)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WRONG_CHARS_IN_FILEN

public static final byte[] WRONG_CHARS_IN_FILEN

COMPL_HYPERREFS

public static final java.lang.String COMPL_HYPERREFS
See Also:
Constant Field Values

KOPT_F1_HELP

public static final java.lang.String KOPT_F1_HELP
See Also:
Constant Field Values

KOPT_CLASS_AT_CURSOR

public static final java.lang.String KOPT_CLASS_AT_CURSOR
See Also:
Constant Field Values

ACTION_INSERTED_TEXT_LONGER_ONE

public static final java.lang.String ACTION_INSERTED_TEXT_LONGER_ONE
See Also:
Constant Field Values

RANGE_SUFX_XML

public static final java.lang.String RANGE_SUFX_XML
See Also:
Constant Field Values

FILE_RANGE_SUFX

public static final java.lang.String[] FILE_RANGE_SUFX

TT

public static final java.lang.String TT
See Also:
Constant Field Values

COMPL_TAB

public static final int COMPL_TAB
See Also:
Constant Field Values

COMPL_IC

public static final int COMPL_IC
See Also:
Constant Field Values

COMPL_INFER_CASE

public static final int COMPL_INFER_CASE
See Also:
Constant Field Values

COMPL_ALLOW_SPC_IN_FILE

public static final int COMPL_ALLOW_SPC_IN_FILE
See Also:
Constant Field Values

FRAME_OPTS

public static final long FRAME_OPTS
See Also:
Constant Field Values

HIGHLIGHTS

public java.util.List<TextMatches>[] HIGHLIGHTS

DIR_SAVED_TEXT

public static final java.lang.String DIR_SAVED_TEXT
See Also:
Constant Field Values

INSERT_IF_NOT_CONTAINS

public static final long INSERT_IF_NOT_CONTAINS
See Also:
Constant Field Values
Constructor Detail

ChTextComponents

public ChTextComponents(javax.swing.JComponent jc)
Method Detail

jc

public javax.swing.JComponent jc()

tc

public javax.swing.text.JTextComponent tc()

setContextMenuProvider

public static void setContextMenuProvider(ChRunnable r)

setTextAreaForAbstract

public static void setTextAreaForAbstract(ChTextComponents t)

addLiDb

public static void addLiDb(java.awt.event.ActionListener li)

setAssociateFind

public static void setAssociateFind(boolean focus,
                                    DialogFindInText d)

undoableEditHappened

public void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
Specified by:
undoableEditHappened in interface javax.swing.event.UndoableEditListener

enableUndo

public ChTextComponents enableUndo(boolean soft)

setWordCompletionSetFirst

public ChTextComponents setWordCompletionSetFirst(java.lang.Object collection)

enableWordCompletion

public ChTextComponents enableWordCompletion(java.lang.Object collection)

enableWordCompletion

public ChTextComponents enableWordCompletion(long options,
                                             java.lang.Object collection,
                                             boolean[] lDelim,
                                             boolean[] rDelim)

getWordUnderMouse

public java.lang.String getWordUnderMouse(Range r)

getWordAt

public static java.lang.String getWordAt(java.awt.Point p,
                                         javax.swing.JComponent tc,
                                         boolean[] lDelimiters,
                                         boolean[] rDelimiters)

getWordAt

public static java.lang.String getWordAt(int iCaret,
                                         BA ba,
                                         boolean[] lDelimiters,
                                         boolean[] rDelimiters)

getWordAt

public static Range getWordAt(int iCaret,
                              BA ba,
                              boolean[] lDelimiters,
                              boolean[] rDelimiters,
                              Range range)

getCursor

public java.awt.Cursor getCursor()

webLinks

public static java.lang.String[] webLinks(java.lang.String id,
                                          java.lang.String[] customSettings)

showFrameWeblinks

public static void showFrameWeblinks(int type,
                                     java.lang.CharSequence txt,
                                     java.lang.Object pSouth)

showInFrame

public ChTextComponents showInFrame(java.lang.String t)

showInFrame

public ChTextComponents showInFrame(long options,
                                    java.lang.String title)

processEv

public void processEv(java.awt.AWTEvent ev)
Specified by:
processEv in interface ProcessEv
See Also:
EvAdapter

run

public ChDelay run(char type)

run

public java.lang.Object run(java.lang.String id,
                            java.lang.Object arg)
Specified by:
run in interface ChRunnable

newClearButton

public ChButton newClearButton()

butSave

public ChButton butSave(java.io.File f)

underlineRefs

public ChTextComponents underlineRefs(long mode)

thread_setScrollPositionV

public static java.lang.Thread thread_setScrollPositionV(int pos,
                                                         javax.swing.JComponent jc)

setScrollPositionV

public static void setScrollPositionV(int pos,
                                      javax.swing.JComponent jc)

repaintLater

public void repaintLater(int delay)

isEmpty

public boolean isEmpty()

isAlreadyPainted

public boolean isAlreadyPainted()

paintHook

public boolean paintHook(javax.swing.JComponent component,
                         java.awt.Graphics g,
                         boolean after)
Specified by:
paintHook in interface PaintHook
after - This method is called once before and once after super.paintComponent.
Returns:
means do not call super.paintComponent

getFixedRowHeight

public static int getFixedRowHeight(java.lang.Object o)

getLength

public static int getLength(java.lang.Object o)

addHighlight

public void addHighlight(TextMatches h)

rmAllHighlights

public void rmAllHighlights()

removeHighlight

public boolean removeHighlight(TextMatches h)

highlightOccurrence

public TextMatches highlightOccurrence(java.lang.Object needle,
                                       boolean[] delimiterL,
                                       boolean[] delimiterR,
                                       long mode,
                                       java.awt.Color color)

highlightBlanks

public void highlightBlanks()

modelToView

public static void modelToView(int m,
                               java.lang.Object o,
                               java.awt.Rectangle r)

tools

public static ChTextComponents tools(java.lang.Object o0)

saveInFile

public ChTextComponents saveInFile(java.lang.String fileName)

saveInFile

public void saveInFile(java.io.File file)

viewToModel

public static int viewToModel(java.awt.Point p,
                              java.lang.Object o)

loadSavedText

public void loadSavedText()

saveInFile

public void saveInFile(boolean always)

nxtEC

public static int nxtEC(byte[] T,
                        int from,
                        int end)

getText

public java.lang.String getText()

setTextTS

public void setTextTS(java.lang.CharSequence txt)

setTextTS

public void setTextTS(java.lang.CharSequence txt,
                      boolean keepCaretPosition)

byteArray

public BA byteArray()

getTextAsSegment

public javax.swing.text.Segment getTextAsSegment()

setReplaceWhenTextChanges

public void setReplaceWhenTextChanges(ChTextReplacement... replacements)

modificationCount

public int modificationCount()
Specified by:
modificationCount in interface HasModiCount

enableTextChangeEv

public void enableTextChangeEv(boolean b)

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent ev)
Specified by:
insertUpdate in interface javax.swing.event.DocumentListener

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent ev)
Specified by:
removeUpdate in interface javax.swing.event.DocumentListener

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent ev)
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener

setChanged

public void setChanged()

marchingAnts

public void marchingAnts(int id,
                         int from,
                         int to)

getSelection

public boolean getSelection(java.lang.Object range)

setSelection

public void setSelection(int f,
                         int t)

insertAtCaret

public static void insertAtCaret(long options,
                                 java.lang.String s,
                                 javax.swing.JComponent jc)

boundsToPos

public int boundsToPos(boolean first,
                       java.awt.Rectangle clip)

cp

public ChTextComponents cp(java.lang.Object key,
                           java.lang.Object value)

'STRAP:multiple sequence alignments '

'The most important classes are StrapAlign, Protein and StrapEvent.'