站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

BaseTextUI (Editor Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib/1 1.14.0 3

org.netbeans.editor
Class BaseTextUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.TextUI
          extended by javax.swing.plaf.basic.BasicTextUI
              extended by org.netbeans.editor.BaseTextUI
All Implemented Interfaces:
PropertyChangeListener, EventListener, DocumentListener, ViewFactory, SettingsChangeListener

public class BaseTextUI
extends BasicTextUI
implements PropertyChangeListener, DocumentListener, SettingsChangeListener

Text UI implementation


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTextUI
BasicTextUI.BasicCaret, BasicTextUI.BasicHighlighter
 
Constructor Summary
BaseTextUI()
           
 
Method Summary
 void changedUpdate(DocumentEvent evt)
          The change in document notification.
 View create(Element elem)
          Creates a view for an element.
 View create(Element elem, int p0, int p1)
          Creates a view for an element.
 int getBaseX(int y)
           
 EditorKit getEditorKit(JTextComponent c)
          Fetches the EditorKit for the UI.
 EditorUI getEditorUI()
          Get extended UI.
static JTextComponent getFocusedComponent()
           
 int getNextVisualPositionFrom(JTextComponent t, int pos, Position.Bias b, int direction, Position.Bias[] biasRet)
          Next visually represented model location where caret can be placed.
 int getPosFromY(int y)
           
protected  String getPropertyPrefix()
           
 int getYFromPos(int pos)
           
 void insertUpdate(DocumentEvent evt)
          Insert to document notification.
protected  void installKeyboardActions()
           
 void installUI(JComponent c)
          Installs the UI for a component.
 void invalidateStartY()
           
protected  boolean isRootViewReplaceNecessary()
           
protected  void modelChanged()
          Called when the model of component is changed
 void preferenceChanged(boolean width, boolean height)
          Specifies that some preference has changed.
 void propertyChange(PropertyChangeEvent evt)
          This method gets called when a bound property is changed.
protected  void refresh()
           
 void removeUpdate(DocumentEvent evt)
          Remove from document notification.
protected  void rootViewReplaceNotify()
           
 void settingsChange(SettingsChangeEvent evt)
           
 void uninstallUI(JComponent c)
          Deinstalls the UI for a component
 int viewToModel(JTextComponent c, int x, int y)
           
 
Methods inherited from class javax.swing.plaf.basic.BasicTextUI
createCaret, createHighlighter, createKeymap, damageRange, damageRange, getComponent, getKeymapName, getMaximumSize, getMinimumSize, getPreferredSize, getRootView, getToolTipText, getVisibleEditorRect, installDefaults, installListeners, modelToView, modelToView, paint, paintBackground, paintSafely, setView, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, update, viewToModel, viewToModel
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseTextUI

public BaseTextUI()
Method Detail

getPropertyPrefix

protected String getPropertyPrefix()
Specified by:
getPropertyPrefix in class BasicTextUI

getFocusedComponent

public static JTextComponent getFocusedComponent()

isRootViewReplaceNecessary

protected boolean isRootViewReplaceNecessary()

rootViewReplaceNotify

protected void rootViewReplaceNotify()

modelChanged

protected void modelChanged()
Called when the model of component is changed

Overrides:
modelChanged in class BasicTextUI

installKeyboardActions

protected void installKeyboardActions()
Overrides:
installKeyboardActions in class BasicTextUI

installUI

public void installUI(JComponent c)
Installs the UI for a component.

Overrides:
installUI in class BasicTextUI

uninstallUI

public void uninstallUI(JComponent c)
Deinstalls the UI for a component

Overrides:
uninstallUI in class BasicTextUI

getYFromPos

public int getYFromPos(int pos)
                throws BadLocationException
Throws:
BadLocationException

getPosFromY

public int getPosFromY(int y)
                throws BadLocationException
Throws:
BadLocationException

getBaseX

public int getBaseX(int y)

viewToModel

public int viewToModel(JTextComponent c,
                       int x,
                       int y)

getNextVisualPositionFrom

public int getNextVisualPositionFrom(JTextComponent t,
                                     int pos,
                                     Position.Bias b,
                                     int direction,
                                     Position.Bias[] biasRet)
                              throws BadLocationException
Next visually represented model location where caret can be placed. This version works without placing read lock on the document.

Overrides:
getNextVisualPositionFrom in class BasicTextUI
Throws:
BadLocationException

getEditorKit

public EditorKit getEditorKit(JTextComponent c)
Fetches the EditorKit for the UI.

Overrides:
getEditorKit in class BasicTextUI
Returns:
the component capabilities

getEditorUI

public EditorUI getEditorUI()
Get extended UI. This is called from views to get correct extended UI.


propertyChange

public void propertyChange(PropertyChangeEvent evt)
This method gets called when a bound property is changed. We are looking for document changes on the component.

Specified by:
propertyChange in interface PropertyChangeListener
Overrides:
propertyChange in class BasicTextUI

insertUpdate

public void insertUpdate(DocumentEvent evt)
Insert to document notification.

Specified by:
insertUpdate in interface DocumentListener

removeUpdate

public void removeUpdate(DocumentEvent evt)
Remove from document notification.

Specified by:
removeUpdate in interface DocumentListener

changedUpdate

public void changedUpdate(DocumentEvent evt)
The change in document notification.

Specified by:
changedUpdate in interface DocumentListener
Parameters:
evt - The change notification from the currently associated document.

create

public View create(Element elem)
Creates a view for an element.

Specified by:
create in interface ViewFactory
Overrides:
create in class BasicTextUI
Parameters:
elem - the element
Returns:
the newly created view or null

create

public View create(Element elem,
                   int p0,
                   int p1)
Creates a view for an element.

Overrides:
create in class BasicTextUI
Parameters:
elem - the element
p0 - the starting offset >= 0
p1 - the ending offset >= p0
Returns:
the view

preferenceChanged

public void preferenceChanged(boolean width,
                              boolean height)
Specifies that some preference has changed.


invalidateStartY

public void invalidateStartY()

settingsChange

public void settingsChange(SettingsChangeEvent evt)
Specified by:
settingsChange in interface SettingsChangeListener

refresh

protected void refresh()

org.netbeans.modules.editor.lib/1 1.14.0 3

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.