< prev index next >

src/java.desktop/share/classes/javax/swing/text/FlowView.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -68,10 +68,12 @@
      * flowed.  By default, this will be the axis
      * orthogonal to the axis along which the flow
      * rows are tiled (the axis of the default flow
      * rows themselves).  This is typically used
      * by the <code>FlowStrategy</code>.
+     * @return the axis along which views should be
+     * flowed
      */
     public int getFlowAxis() {
         if (getAxis() == Y_AXIS) {
             return X_AXIS;
         }

@@ -87,10 +89,12 @@
      * span inside of the insets along the flow axis
      * is returned.
      *
      * @param index the index of the row being updated.
      *   This should be a value &gt;= 0 and &lt; getViewCount().
+     * @return the constraining span to flow against for
+     * the given child index
      * @see #getFlowStart
      */
     public int getFlowSpan(int index) {
         return layoutSpan;
     }

@@ -102,10 +106,12 @@
      * A flow can be shaped by providing different values
      * for the row constraints.
 
      * @param index the index of the row being updated.
      *   This should be a value &gt;= 0 and &lt; getViewCount().
+     * @return the location along the flow axis that the
+     * flow span will start at
      * @see #getFlowSpan
      */
     public int getFlowStart(int index) {
         return 0;
     }

@@ -114,10 +120,12 @@
      * Create a View that should be used to hold a
      * a rows worth of children in a flow.  This is
      * called by the FlowStrategy when new children
      * are added or removed (i.e. rows are added or
      * removed) in the process of updating the flow.
+     * @return a View that should be used to hold a
+     * a rows worth of children in a flow
      */
     protected abstract View createRow();
 
     // ---- BoxView methods -------------------------------------
 

@@ -357,10 +365,11 @@
          * Gives notification that something was inserted into the document
          * in a location that the given flow view is responsible for.  The
          * strategy should update the appropriate changed region (which
          * depends upon the strategy used for repair).
          *
+         * @param fv the flow view
          * @param e the change information from the associated document
          * @param alloc the current allocation of the view inside of the insets.
          *   This value will be null if the view has not yet been displayed.
          * @see View#insertUpdate
          */

@@ -383,10 +392,11 @@
 
         /**
          * Gives notification that something was removed from the document
          * in a location that the given flow view is responsible for.
          *
+         * @param fv the flow view
          * @param e the change information from the associated document
          * @param alloc the current allocation of the view inside of the insets.
          * @see View#removeUpdate
          */
         public void removeUpdate(FlowView fv, DocumentEvent e, Rectangle alloc) {

@@ -424,10 +434,12 @@
         }
 
         /**
          * This method gives flow strategies access to the logical
          * view of the FlowView.
+         * @param fv the FlowView
+         * @return the logical view of the FlowView
          */
         protected View getLogicalView(FlowView fv) {
             return fv.layoutPool;
         }
 

@@ -493,10 +505,11 @@
          * exhausted, a forced break was encountered, or the createView
          * method returned null.  If the remaining span was exhausted,
          * the adjustRow method will be called to perform adjustments
          * to the row to try and make it fit into the given span.
          *
+         * @param fv the flow view
          * @param rowIndex the index of the row to fill in with views.  The
          *   row is assumed to be empty on entry.
          * @param pos  The current position in the children of
          *   this views element from which to start.
          * @return the position to start the next row

@@ -576,10 +589,11 @@
          * layout span.  By default this will try to find the
          * highest break weight possible nearest the end of
          * the row.  If a forced break is encountered, the
          * break will be positioned there.
          *
+         * @param fv the flow view
          * @param rowIndex the row to adjust to the current layout
          *  span.
          * @param desiredSpan the current layout span &gt;= 0
          * @param x the location r starts at.
          */

@@ -652,10 +666,12 @@
          *
          * @param fv the view holding the flow
          * @param startOffset the start location for the view being created
          * @param spanLeft the about of span left to fill in the row
          * @param rowIndex the row the view will be placed into
+         * @return a view that can be used to represent the current piece
+         * of the flow
          */
         protected View createView(FlowView fv, int startOffset, int spanLeft, int rowIndex) {
             // Get the child view that contains the given starting position
             View lv = getLogicalView(fv);
             int childIndex = lv.getViewIndex(startOffset, Position.Bias.Forward);
< prev index next >