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

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

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

org.netbeans.editor.view.spi
Class LockView

java.lang.Object
  extended by javax.swing.text.View
      extended by org.netbeans.editor.view.spi.LockView
All Implemented Interfaces:
SwingConstants

public class LockView
extends View

View that allow to lock the view hierarchy. It's a filter view that is being installed under the root view.


Field Summary
 
Fields inherited from class javax.swing.text.View
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
LockView(View view)
           
 
Method Summary
 View breakView(int axis, float len, Shape a)
           
 void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
           
static LockView get(View view)
          Find the LockView instance in a view hierarchy by traversing it up to the root view.
 float getAlignment(int axis)
           
 AttributeSet getAttributes()
          Fetches the attributes to use when rendering.
 Shape getChildAllocation(int index, Shape a)
           
 Document getDocument()
           
 Element getElement()
           
 int getEndOffset()
           
 Thread getLockThread()
          Return the thread that holds a lock on the view hierarchy.
 float getMaximumSpan(int axis)
           
 float getMinimumSpan(int axis)
           
 int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)
           
 float getPreferredSpan(int axis)
           
 int getResizeWeight(int axis)
           
 int getStartOffset()
           
 String getToolTipText(float x, float y, Shape allocation)
           
 View getView(int n)
          Gets the n-th view in this container.
 int getViewCount()
           
static PriorityMutex getViewHierarchyMutex(JTextComponent component)
          Get mutex used to lock the view hierarchy.
 int getViewIndex(int pos, Position.Bias b)
           
 void insertUpdate(DocumentEvent e, Shape a, ViewFactory f)
           
 boolean isPriorityThreadWaiting()
           
 void lock()
           
 Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a)
           
 Shape modelToView(int pos, Shape a, Position.Bias b)
           
 void paint(Graphics g, Shape allocation)
           
 void preferenceChanged(View child, boolean width, boolean height)
           
 void removeUpdate(DocumentEvent e, Shape a, ViewFactory f)
           
 void render(Runnable r)
           
 void setParent(View parent)
           
protected  void setParentLocked(View parent)
           
 void setSize(float width, float height)
           
 void setView(View v)
          Set a new single child of this view.
 void unlock()
           
 int viewToModel(float x, float y, Shape a, Position.Bias[] bias)
           
 
Methods inherited from class javax.swing.text.View
append, breakView, createFragment, forwardUpdate, forwardUpdateToView, getBreakWeight, getContainer, getGraphics, getParent, getViewFactory, getViewIndex, insert, isVisible, modelToView, remove, removeAll, replace, updateChildren, updateLayout, viewToModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockView

public LockView(View view)
Method Detail

getViewHierarchyMutex

public static PriorityMutex getViewHierarchyMutex(JTextComponent component)
Get mutex used to lock the view hierarchy. All the services manipulating the view hierarchy or providing data for the view hierarchy may choose to lock on this mutex rather having its own locking mechanism to simplify their locking model and eliminate possibility of deadlocks because of counter-locking.
The LockView itself uses this mutex as well as the code folding hierarchy.


get

public static LockView get(View view)
Find the LockView instance in a view hierarchy by traversing it up to the root view.

Parameters:
view - view in the view hierarchy. null is accepted too.
Returns:
valid instance of LockView or null if there is no LockView instance present in the view hierarchy of the view is no longer part of the view hierarchy.

setParent

public void setParent(View parent)
Overrides:
setParent in class View

setParentLocked

protected void setParentLocked(View parent)

setView

public void setView(View v)
Set a new single child of this view.


lock

public void lock()

unlock

public void unlock()

isPriorityThreadWaiting

public boolean isPriorityThreadWaiting()

getLockThread

public Thread getLockThread()
Return the thread that holds a lock on the view hierarchy.
This method is intended for diagnostic purposes only to determine an intruder thread that entered the view hierarchy without obtaining the lock first.

Returns:
thread that currently holds a lock on the hierarchy or null if there is currently no thread holding a lock on the hierarchy.

render

public void render(Runnable r)

getAttributes

public AttributeSet getAttributes()
Fetches the attributes to use when rendering. At this level there are no attributes. If an attribute is resolved up the view hierarchy this is the end of the line.

Overrides:
getAttributes in class View

getPreferredSpan

public float getPreferredSpan(int axis)
Specified by:
getPreferredSpan in class View

getMinimumSpan

public float getMinimumSpan(int axis)
Overrides:
getMinimumSpan in class View

getMaximumSpan

public float getMaximumSpan(int axis)
Overrides:
getMaximumSpan in class View

preferenceChanged

public void preferenceChanged(View child,
                              boolean width,
                              boolean height)
Overrides:
preferenceChanged in class View

getAlignment

public float getAlignment(int axis)
Overrides:
getAlignment in class View

paint

public void paint(Graphics g,
                  Shape allocation)
Specified by:
paint in class View

getViewCount

public int getViewCount()
Overrides:
getViewCount in class View

getView

public View getView(int n)
Gets the n-th view in this container.

Overrides:
getView in class View
Parameters:
n - the number of the view to get
Returns:
the view

getViewIndex

public int getViewIndex(int pos,
                        Position.Bias b)
Overrides:
getViewIndex in class View

getChildAllocation

public Shape getChildAllocation(int index,
                                Shape a)
Overrides:
getChildAllocation in class View

modelToView

public Shape modelToView(int pos,
                         Shape a,
                         Position.Bias b)
                  throws BadLocationException
Specified by:
modelToView in class View
Throws:
BadLocationException

modelToView

public Shape modelToView(int p0,
                         Position.Bias b0,
                         int p1,
                         Position.Bias b1,
                         Shape a)
                  throws BadLocationException
Overrides:
modelToView in class View
Throws:
BadLocationException

viewToModel

public int viewToModel(float x,
                       float y,
                       Shape a,
                       Position.Bias[] bias)
Specified by:
viewToModel in class View

getNextVisualPositionFrom

public int getNextVisualPositionFrom(int pos,
                                     Position.Bias b,
                                     Shape a,
                                     int direction,
                                     Position.Bias[] biasRet)
                              throws BadLocationException
Overrides:
getNextVisualPositionFrom in class View
Throws:
BadLocationException

insertUpdate

public void insertUpdate(DocumentEvent e,
                         Shape a,
                         ViewFactory f)
Overrides:
insertUpdate in class View

removeUpdate

public void removeUpdate(DocumentEvent e,
                         Shape a,
                         ViewFactory f)
Overrides:
removeUpdate in class View

changedUpdate

public void changedUpdate(DocumentEvent e,
                          Shape a,
                          ViewFactory f)
Overrides:
changedUpdate in class View

getToolTipText

public String getToolTipText(float x,
                             float y,
                             Shape allocation)
Overrides:
getToolTipText in class View

getDocument

public Document getDocument()
Overrides:
getDocument in class View

getStartOffset

public int getStartOffset()
Overrides:
getStartOffset in class View

getEndOffset

public int getEndOffset()
Overrides:
getEndOffset in class View

getElement

public Element getElement()
Overrides:
getElement in class View

breakView

public View breakView(int axis,
                      float len,
                      Shape a)

getResizeWeight

public int getResizeWeight(int axis)
Overrides:
getResizeWeight in class View

setSize

public void setSize(float width,
                    float height)
Overrides:
setSize in class View

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.