public void install(JTextComponent c){
  component=c;
  Document doc=c.getDocument();
  dot=mark=0;
  dotLTR=markLTR=true;
  dotBias=markBias=Position.Bias.Forward;
  if (doc != null) {
    doc.addDocumentListener(handler);
  }
  c.addPropertyChangeListener(handler);
  c.addFocusListener(this);
  c.addMouseListener(this);
  c.addMouseMotionListener(this);
  if (component.hasFocus()) {
    focusGained(null);
  }
  Number ratio=(Number)c.getClientProperty("caretAspectRatio");
  if (ratio != null) {
    aspectRatio=ratio.floatValue();
  }
 else {
    aspectRatio=-1;
  }
  Integer width=(Integer)c.getClientProperty("caretWidth");
  if (width != null) {
    caretWidth=width.intValue();
  }
 else {
    caretWidth=-1;
  }
}

public void install ( JTextComponent c ) { component = c ; Document doc = c . getDocument ( ) ; dot = mark = 0 ; dotLTR = markLTR = true ; dotBias = markBias = Position . Bias . Forward ; if ( doc != null ) { doc . addDocumentListener ( handler ) ; } c . addPropertyChangeListener ( handler ) ; c . addFocusListener ( this ) ; c . addMouseListener ( this ) ; c . addMouseMotionListener ( this ) ; if ( component . hasFocus ( ) ) { focusGained ( null ) ; } Number ratio = ( Number ) c . getClientProperty ( "caretAspectRatio" ) ; if ( ratio != null ) { aspectRatio = ratio . floatValue ( ) ; } else { aspectRatio = - 1 ; } Integer width = ( Integer ) c . getClientProperty ( "caretWidth" ) ; if ( width != null ) { caretWidth = width . intValue ( ) ; } else { caretWidth = - 1 ; } }
called when the ui is being installed into the interface of a jtextcomponent . this can be used to gain access to the model that is being navigated by the implementation of this interface . sets the dot and mark to 0 , and establishes document , property change , focus , mouse , and mouse motion listeners .
