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

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

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

org.netbeans.editor
Class DrawEngineFakeDocView

java.lang.Object
  extended by javax.swing.text.View
      extended by org.netbeans.lib.editor.view.GapBoxView
          extended by org.netbeans.lib.editor.view.GapDocumentView
              extended by org.netbeans.editor.DrawEngineFakeDocView
All Implemented Interfaces:
PropertyChangeListener, EventListener, SwingConstants, FoldHierarchyListener, EstimatedSpanView, ViewLayoutState, ViewLayoutState.Parent

public class DrawEngineFakeDocView
extends GapDocumentView

Fake view of the whole document supporting the code folding, operating from given startOffset to endOffset


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.netbeans.editor.view.spi.ViewLayoutState
ViewLayoutState.Parent
 
Field Summary
 
Fields inherited from class org.netbeans.lib.editor.view.GapBoxView
GAP_BOX_VIEW_LAST_USED_STATUS_BIT
 
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
 
Method Summary
protected  void attachListeners()
           
protected  View createCustomView(ViewFactory f, int startOffset, int maxEndOffset, int elementIndex)
          Create custom child view starting at startOffset.
protected  void customReloadChildren(int index, int removeLength, int startOffset, int endOffset)
          Loads child views in a custom way.
protected  void finishCustomReloadChildren(FoldHierarchy hierarchy)
          Free any resources required for custom reload of children.
 void foldHierarchyChanged(FoldHierarchyEvent evt)
           
 int getEndOffset()
           
 int getStartOffset()
           
 int getYFromPos(int offset, Shape a)
           
protected  void initCustomReloadChildren(FoldHierarchy hierarchy, int startOffset, int endOffset)
          Extra initialization for custom reload of children.
protected  boolean isChildrenResizeDisabled()
          Return true if the children should not be attempted to resize once setSize() is called on this view.
protected  Fold nextCollapsedFold()
          Find next collapsed fold in the given offset range.
 void paint(Graphics g, Shape allocation)
          Render the view using the given allocation and rendering surface.
 void propertyChange(PropertyChangeEvent evt)
           
 void setParent(View parent)
          Sets the parent of the view.
 void setSize(float width, float height)
          Sets the size of the view.
protected  boolean useCustomReloadChildren()
           
 
Methods inherited from class org.netbeans.lib.editor.view.GapDocumentView
changedUpdate, createChildren, directUpdateLayout, getLastAllocationHeight, getLastAllocationWidth, getLastAllocationX, getLastAllocationY, getLayoutQueue, insertUpdate, layoutLock, layoutUnlock, markRepaint, markSizeInvalid, processRepaint, reallocate, removeUpdate, renderWithUpdateLayout, repaint, resetEstimatedSpan
 
Methods inherited from class org.netbeans.lib.editor.view.GapBoxView
appendChildToStringBuffer, childrenToString, childrenToString, childToString, clearStatusBits, createChild, createDefaultChild, customInsertUpdate, customRemoveUpdate, elementReloadChildren, getAlignment, getChild, getChildAllocation, getChildIndex, getChildIndexNoCheck, getChildren, getChildrenNull, getEndOffset, getInsertUpdateRebuildOffsetRange, getInsets, getInsetSpan, getLayoutMajorAxisPreferredSpan, getLayoutMajorAxisRawOffset, getLayoutMinorAxisAlignment, getLayoutMinorAxisMaximumSpan, getLayoutMinorAxisMinimumSpan, getLayoutMinorAxisPreferredSpan, getLayoutStateMajorAxis, getLayoutStateMinorAxis, getLayoutStateParent, getMajorAxis, getMajorAxisInsetSpan, getMaximumSpan, getMinimumSpan, getMinorAxis, getMinorAxisInsetSpan, getMinorAxisSpan, getNextVisualPositionFrom, getPreferredSpan, getRemoveUpdateRebuildOffsetRange, getReplaceEstimatedThreshold, getStartOffset, getStatusBits, getView, getView, getViewCount, getViewIndex, getViewIndex, getViewIndexAtPoint, getViewRawIndex, isActiveLayoutState, isChildrenLayoutNecessary, isEstimatedSpan, isFlyweight, isLayoutMinorAxisPreferenceChanged, isLayoutValid, isMajorAxisPreferenceChanged, isMinorAxisPreferenceChanged, isRepaintPending, isRepaintTillEnd, isStatusBitsNonZero, isXLayoutStateMajorAxis, layoutInvalid, majorAxisPreferenceChanged, markChildrenLayoutNecessary, markLayoutInvalid, markMajorAxisPreferenceChanged, markMinorAxisPreferenceChanged, markRepaintPending, markViewSizeInvalid, minorAxisPreferenceChanged, modelToView, offsetRebuild, preferenceChanged, rebuild, releaseChildren, reloadChildren, replace, resetAxesPreferenceChanged, resetRepaintPending, selectLayoutMajorAxis, setEstimatedSpan, setLayoutMajorAxisRawOffset, setSpanOnMajorAxis, setSpanOnMinorAxis, setStatusBits, setViewRawIndex, toString, unloadChildren, updateLayout, updateLayout, viewPreferenceChanged, viewToModel
 
Methods inherited from class javax.swing.text.View
append, breakView, createFragment, forwardUpdate, forwardUpdateToView, getAttributes, getBreakWeight, getContainer, getDocument, getElement, getGraphics, getParent, getResizeWeight, getToolTipText, getViewFactory, getViewIndex, insert, isVisible, modelToView, modelToView, remove, removeAll, updateChildren, viewToModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getStartOffset

public int getStartOffset()
Overrides:
getStartOffset in class View

getEndOffset

public int getEndOffset()
Overrides:
getEndOffset in class View

nextCollapsedFold

protected Fold nextCollapsedFold()
Find next collapsed fold in the given offset range.


attachListeners

protected void attachListeners()

setParent

public void setParent(View parent)
Description copied from class: GapBoxView
Sets the parent of the view. The children are only initialized if someone has previously asked for information related to children (e.g. getViewCount()) or for preferred, minimum or maximum span of this view.

Overrides:
setParent in class GapDocumentView
Parameters:
parent - the parent of the view, null if none

useCustomReloadChildren

protected boolean useCustomReloadChildren()
Overrides:
useCustomReloadChildren in class GapBoxView

initCustomReloadChildren

protected void initCustomReloadChildren(FoldHierarchy hierarchy,
                                        int startOffset,
                                        int endOffset)
Extra initialization for custom reload of children.


finishCustomReloadChildren

protected void finishCustomReloadChildren(FoldHierarchy hierarchy)
Free any resources required for custom reload of children.


customReloadChildren

protected void customReloadChildren(int index,
                                    int removeLength,
                                    int startOffset,
                                    int endOffset)
Description copied from class: GapBoxView
Loads child views in a custom way.

Overrides:
customReloadChildren in class GapBoxView
Parameters:
index - index at which the views should be added/replaced.
removeLength - number of removed children views. It is useful when rebuilding children for a portion of the view.
startOffset - starting offset from which the loading starts.
endOffset - ending offset where the loading ends.

createCustomView

protected View createCustomView(ViewFactory f,
                                int startOffset,
                                int maxEndOffset,
                                int elementIndex)
Description copied from class: GapBoxView
Create custom child view starting at startOffset.

Overrides:
createCustomView in class GapBoxView
Parameters:
f - view factory to be used.
startOffset - offset at which the created view must start.
maxEndOffset - maximum ending offset to which the created view may span.
elementIndex - index of the child element that best represents the startOffset. The element is child of the element that this view is responsible for. If this view is not based by element then this parameter will be -1.

foldHierarchyChanged

public void foldHierarchyChanged(FoldHierarchyEvent evt)
Specified by:
foldHierarchyChanged in interface FoldHierarchyListener

paint

public void paint(Graphics g,
                  Shape allocation)
Description copied from class: GapBoxView
Render the view using the given allocation and rendering surface.

Overrides:
paint in class GapDocumentView
Parameters:
g - the rendering surface to use
allocation - the allocated region to render into
See Also:
View.paint(java.awt.Graphics, java.awt.Shape)

setSize

public void setSize(float width,
                    float height)
Description copied from class: GapBoxView
Sets the size of the view. This should cause layout of the view if the view caches any layout information.

The propagation of this operation to child views can be done asynchronously if appropriate.

Overrides:
setSize in class GapDocumentView
Parameters:
width - the width >= 0
height - the height >= 0

isChildrenResizeDisabled

protected boolean isChildrenResizeDisabled()
Description copied from class: GapBoxView
Return true if the children should not be attempted to resize once setSize() is called on this view.
Turning this on may save considerable time but it should be only used if the views truly do not react on setSize() e.g. this should *not* be used if line-wrapping is turned on.

Overrides:
isChildrenResizeDisabled in class GapBoxView

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

getYFromPos

public int getYFromPos(int offset,
                       Shape a)

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.