Home » openjdk-7 » javax » swing » text » [javadoc | source]
class: ZoneView.Zone [javadoc | source]

All Implemented Interfaces:

Internally created view that has the purpose of holding the views that represent the children of the ZoneView that have been arranged in a zone.
Fields inherited from javax.swing.text.AsyncBoxView:
axis,  stats,  majorSpan,  estimatedMajorSpan,  minorSpan,  locator,  topInset,  bottomInset,  leftInset,  rightInset,  minRequest,  prefRequest,  majorChanged,  minorChanged,  flushTask,  changing
Fields inherited from javax.swing.text.View:
BadBreakWeight,  GoodBreakWeight,  ExcellentBreakWeight,  ForcedBreakWeight,  X_AXIS,  Y_AXIS,  sharedBiasReturn
 public Zone(Element elem,
    Position start,
    Position end) 
Method from javax.swing.text.ZoneView$Zone Summary:
changedUpdate,   flushRequirementChanges,   getAttributes,   getEndOffset,   getStartOffset,   getViewIndex,   insertUpdate,   isLoaded,   load,   loadChildren,   modelToView,   paint,   removeUpdate,   unload,   updateChildren,   viewToModel
Methods from javax.swing.text.AsyncBoxView:
createChildState,   flushRequirementChanges,   getBottomInset,   getChildAllocation,   getChildState,   getEstimatedMajorSpan,   getInsetSpan,   getLayoutQueue,   getLeftInset,   getMajorAxis,   getMaximumSpan,   getMinimumSpan,   getMinorAxis,   getNextVisualPositionFrom,   getPreferredSpan,   getRightInset,   getSpanOnAxis,   getTopInset,   getView,   getViewCount,   getViewIndex,   getViewIndexAtPosition,   loadChildren,   majorRequirementChange,   minorRequirementChange,   modelToView,   paint,   preferenceChanged,   replace,   setBottomInset,   setEstimatedMajorSpan,   setLeftInset,   setParent,   setRightInset,   setSize,   setSpanOnAxis,   setTopInset,   updateLayout,   viewToModel
Methods from javax.swing.text.View:
append,   breakView,   changedUpdate,   createFragment,   forwardUpdate,   forwardUpdateToView,   getAlignment,   getAttributes,   getBreakWeight,   getChildAllocation,   getContainer,   getDocument,   getElement,   getEndOffset,   getGraphics,   getMaximumSpan,   getMinimumSpan,   getNextVisualPositionFrom,   getParent,   getPreferredSpan,   getResizeWeight,   getStartOffset,   getToolTipText,   getView,   getViewCount,   getViewFactory,   getViewIndex,   getViewIndex,   insert,   insertUpdate,   isVisible,   modelToView,   modelToView,   modelToView,   paint,   preferenceChanged,   remove,   removeAll,   removeUpdate,   replace,   setParent,   setSize,   updateChildren,   updateLayout,   viewToModel,   viewToModel
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.ZoneView$Zone Detail:
 public  void changedUpdate(DocumentEvent e,
    Shape a,
    ViewFactory f) 
    Gives notification from the document that attributes were changed in a location that this view is responsible for. If the zone has been loaded, the superclass behavior is invoked, otherwise this does nothing.
 protected  void flushRequirementChanges() 
    Publish the changes in preferences upward to the parent view.

    This is reimplemented to stop the superclass behavior if the zone has not yet been loaded. If the zone is unloaded for example, the last seen major span is the best estimate and a calculated span for no children is undesirable.

 public AttributeSet getAttributes() 
    Fetches the attributes to use when rendering. This view isn't directly responsible for an element so it returns the outer classes attributes.
 public int getEndOffset() 
    End of the zones range.
 public int getStartOffset() 
    Start of the zones range.
 public int getViewIndex(int pos,
    Bias b) 
    Returns the child view index representing the given position in the model. Since the zone contains a cluster of the overall set of child elements, we can determine the index fairly quickly from the model by subtracting the index of the start offset from the index of the position given.
 public  void insertUpdate(DocumentEvent e,
    Shape a,
    ViewFactory f) 
    Gives notification that something was inserted into the document in a location that this view is responsible for. If the zone has been loaded, the superclass behavior is invoked, otherwise this does nothing.
 public boolean isLoaded() 
    Determines if the zone is in the loaded state or not.
 public  void load() 
    Creates the child views and populates the zone with them. This is done by translating the positions to child element index locations and building views to those elements. If the zone is already loaded, this does nothing.
 protected  void loadChildren(ViewFactory f) 
    This method is reimplemented to not build the children since the children are created when the zone is loaded rather then when it is placed in the view hierarchy. The major span is estimated at this point by building the first child (but not storing it), and calling setEstimatedMajorSpan(true) followed by setSpan for the major axis with the estimated span.
 public Shape modelToView(int pos,
    Shape a,
    Bias b) throws BadLocationException 
    Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it. This is implemented to provide the superclass behavior after first making sure the zone is loaded (The zone must be loaded to make this calculation).
 public  void paint(Graphics g,
    Shape a) 
    Renders using the given rendering surface and area on that surface. This is implemented to load the zone if its not already loaded, and then perform the superclass behavior.
 public  void removeUpdate(DocumentEvent e,
    Shape a,
    ViewFactory f) 
    Gives notification that something was removed from the document in a location that this view is responsible for. If the zone has been loaded, the superclass behavior is invoked, otherwise this does nothing.
 public  void unload() 
    Removes the child views and returns to a state of unloaded.
 protected boolean updateChildren(ElementChange ec,
    DocumentEvent e,
    ViewFactory f) 
 public int viewToModel(float x,
    float y,
    Shape a,
    Bias[] bias) 
    Provides a mapping from the view coordinate space to the logical coordinate space of the model. This is implemented to first make sure the zone is loaded before providing the superclass behavior.