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

ViewLayoutState.Parent (Editor Library) - NetBeans API Javadoc (Current Development Version)

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

org.netbeans.editor.view.spi
Interface ViewLayoutState.Parent

All Known Implementing Classes:
DrawEngineFakeDocView, GapBoxView, GapDocumentView, GapLineView, GapMultiLineView
Enclosing interface:
ViewLayoutState

public static interface ViewLayoutState.Parent

Interface that the parent view of the view wrapped by ViewLayoutState is expected to implement.


Method Summary
 float getMinorAxisSpan(ViewLayoutState child)
          Get span of the given child along the minor axis.
 void layoutInvalid(ViewLayoutState child)
          Notify this view that layout of the particular child has become invalid and needs to be updated.
 void majorAxisPreferenceChanged(ViewLayoutState child, double majorAxisSpanDelta)
          By using this method a child layout state notifies its parent that its requirement for span along the major axis has changed against the previous value.
 void minorAxisPreferenceChanged(ViewLayoutState child)
          By using this method a child layout state notifies its parent that either preferred, minimum or maximum spans or aligment along the minor axis has changed against their previous values.
 void repaint(ViewLayoutState child, double majorAxisOffset, double majorAxisSpan, float minorAxisOffset, float minorAxisSpan)
          Inform the parent that the child layout state needs a repaint.
 

Method Detail

majorAxisPreferenceChanged

void majorAxisPreferenceChanged(ViewLayoutState child,
                                double majorAxisSpanDelta)
By using this method a child layout state notifies its parent that its requirement for span along the major axis has changed against the previous value.
It can be done anytime but typically during ViewLayoutState.updateLayout() execution.
The child will be automatically scheduled for repaint (together with all children that follow it in the parent view) after this method gets called.

Parameters:
child - child layout state which preference has changed.
majorAxisSpanDelta - delta between the new span and the original span.

minorAxisPreferenceChanged

void minorAxisPreferenceChanged(ViewLayoutState child)
By using this method a child layout state notifies its parent that either preferred, minimum or maximum spans or aligment along the minor axis has changed against their previous values.
It can be done anytime but typically during ViewLayoutState.updateLayout() execution.

Parameters:
child - child layout state which preference has changed.

layoutInvalid

void layoutInvalid(ViewLayoutState child)
Notify this view that layout of the particular child has become invalid and needs to be updated.
The parent can update the child's layout either immediately or later.


getMinorAxisSpan

float getMinorAxisSpan(ViewLayoutState child)
Get span of the given child along the minor axis.
Parent computes the span according to its own layout policy for the children.
This method is typically called from the layout state's methods and is thus useful for non-flyweight layout states only as flyweights do not maintain the parent.

Parameters:
child - child layout state for which the span is being determined.

repaint

void repaint(ViewLayoutState child,
             double majorAxisOffset,
             double majorAxisSpan,
             float minorAxisOffset,
             float minorAxisSpan)
Inform the parent that the child layout state needs a repaint.
This method can be called anytime although usually it's called during the layout state's updateLayout().
This method can be called repetively. The lowest offsets should finally be used by the parent.

Parameters:
child - child that needs its area to be repainted.
majorAxisOffset - offset along the major axis defining the begining of the repaint region. If the allocation has changed along the major axis the view is fully repainted (see majorAxisPreferenceChanged()).
This parameter is typically zero but can be used e.g. for line-wrapping views when typing on the last line.
minorAxisOffset - offset along the minor axis defining the begining of the repaint region.
majorAxisSpan - span along the major axis that should be repainted. If it is set to zero then it means that the end of the repaint region along the major axis span is determined by the span allocated for the child in this parent.
minorAxisSpan - span along the minor axis that should be repainted. If it is set to zero then it means that the end of the repaint region along the minor axis span is determined by the span of this parent.

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.