Imported GNU Classpath 0.19 + gcj-import-20051115.
* sources.am: Regenerated. * Makefile.in: Likewise. * scripts/makemake.tcl: Use glob -nocomplain. From-SVN: r107049
This commit is contained in:
parent
02e549bfaa
commit
8f523f3a10
1241 changed files with 97711 additions and 25284 deletions
|
@ -42,8 +42,10 @@ import java.awt.Container;
|
|||
import java.awt.Graphics;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
|
||||
/**
|
||||
|
@ -71,6 +73,7 @@ public abstract class FlowView extends BoxView
|
|||
*/
|
||||
public FlowStrategy()
|
||||
{
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -137,7 +140,7 @@ public abstract class FlowView extends BoxView
|
|||
* Performs the layout for the whole view. By default this rebuilds
|
||||
* all the physical views from the logical views of the managed FlowView.
|
||||
*
|
||||
* This is called by {@link FlowLayout#layout} to update the layout of
|
||||
* This is called by {@link FlowView#layout} to update the layout of
|
||||
* the view.
|
||||
*
|
||||
* @param fv the flow view for which we perform the layout
|
||||
|
@ -183,11 +186,17 @@ public abstract class FlowView extends BoxView
|
|||
{
|
||||
View child = createView(fv, offset, spanLeft, rowIndex);
|
||||
if (child == null)
|
||||
break;
|
||||
{
|
||||
offset = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
int span = (int) child.getPreferredSpan(flowAxis);
|
||||
if (span > spanLeft)
|
||||
break;
|
||||
{
|
||||
offset = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
row.append(child);
|
||||
spanLeft -= span;
|
||||
|
@ -204,7 +213,7 @@ public abstract class FlowView extends BoxView
|
|||
* not fit in the available span and also cannot be broken down).
|
||||
*
|
||||
* @param fv the flow view
|
||||
* @param startOffset the start offset for the view to be created
|
||||
* @param offset the start offset for the view to be created
|
||||
* @param spanLeft the available span
|
||||
* @param rowIndex the index of the row
|
||||
*
|
||||
|
@ -218,13 +227,15 @@ public abstract class FlowView extends BoxView
|
|||
View logicalView = getLogicalView(fv);
|
||||
|
||||
int viewIndex = logicalView.getViewIndex(offset, Position.Bias.Forward);
|
||||
if (viewIndex == -1)
|
||||
return null;
|
||||
|
||||
View child = logicalView.getView(viewIndex);
|
||||
int flowAxis = fv.getFlowAxis();
|
||||
int span = (int) child.getPreferredSpan(flowAxis);
|
||||
|
||||
if (span <= spanLeft)
|
||||
return child;
|
||||
|
||||
else if (child.getBreakWeight(flowAxis, offset, spanLeft)
|
||||
> BadBreakWeight)
|
||||
// FIXME: What to do with the pos parameter here?
|
||||
|
@ -326,7 +337,19 @@ public abstract class FlowView extends BoxView
|
|||
*/
|
||||
public int getViewIndex(int pos, Position.Bias b)
|
||||
{
|
||||
return getElement().getElementIndex(pos);
|
||||
int index = -1;
|
||||
int i = 0;
|
||||
for (Iterator it = children.iterator(); it.hasNext(); i++)
|
||||
{
|
||||
View child = (View) it.next();
|
||||
if (child.getStartOffset() >= pos
|
||||
&& child.getEndOffset() < pos)
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -373,6 +396,37 @@ public abstract class FlowView extends BoxView
|
|||
throw new AssertionError("This method must not be called in "
|
||||
+ "LogicalView.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the document position that is (visually) nearest to the given
|
||||
* document position <code>pos</code> in the given direction <code>d</code>.
|
||||
*
|
||||
* @param c the text component
|
||||
* @param pos the document position
|
||||
* @param b the bias for <code>pos</code>
|
||||
* @param d the direction, must be either {@link SwingConstants#NORTH},
|
||||
* {@link SwingConstants#SOUTH}, {@link SwingConstants#WEST} or
|
||||
* {@link SwingConstants#EAST}
|
||||
* @param biasRet an array of {@link Position.Bias} that can hold at least
|
||||
* one element, which is filled with the bias of the return position
|
||||
* on method exit
|
||||
*
|
||||
* @return the document position that is (visually) nearest to the given
|
||||
* document position <code>pos</code> in the given direction
|
||||
* <code>d</code>
|
||||
*
|
||||
* @throws BadLocationException if <code>pos</code> is not a valid offset in
|
||||
* the document model
|
||||
*/
|
||||
public int getNextVisualPositionFrom(JTextComponent c, int pos,
|
||||
Position.Bias b, int d,
|
||||
Position.Bias[] biasRet)
|
||||
throws BadLocationException
|
||||
{
|
||||
assert false : "getNextVisualPositionFrom() must not be called in "
|
||||
+ "LogicalView";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -478,7 +532,7 @@ public abstract class FlowView extends BoxView
|
|||
* The real children are created at layout time and each represent one
|
||||
* row.
|
||||
*
|
||||
* This method is called by {@link #setParent} in order to initialize
|
||||
* This method is called by {@link View#setParent} in order to initialize
|
||||
* the view.
|
||||
*
|
||||
* @param vf the view factory to use for creating the child views
|
||||
|
@ -502,7 +556,7 @@ public abstract class FlowView extends BoxView
|
|||
|
||||
/**
|
||||
* Performs the layout of this view. If the span along the flow axis changed,
|
||||
* this first calls {@link FlowStrategy.layout} in order to rebuild the
|
||||
* this first calls {@link FlowStrategy#layout} in order to rebuild the
|
||||
* rows of this view. Then the superclass's behaviour is called to arrange
|
||||
* the rows within the box.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue