8076624: Fix missing doclint warnings in javax.swing.text

Reviewed-by: serb
This commit is contained in:
Joe Darcy 2015-04-14 15:43:14 -07:00
parent 0b622e20f7
commit d617368a75
29 changed files with 319 additions and 64 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -308,9 +308,8 @@ public abstract class AbstractDocument implements Document, Serializable {
*
* If no such listeners exist, this method returns an empty array.
*
* @param listenerType the type of listeners requested; this parameter
* should specify an interface that descends from
* <code>java.util.EventListener</code>
* @param <T> the listener type
* @param listenerType the type of listeners requested
* @return an array of all objects registered as
* <code><em>Foo</em>Listener</code>s on this component,
* or an empty array if no such
@ -905,6 +904,8 @@ public abstract class AbstractDocument implements Document, Serializable {
* Returns the root element of the bidirectional structure for this
* document. Its children represent character runs with a given
* Unicode bidi level.
* @return the root element of the bidirectional structure for this
* document
*/
public Element getBidiRootElement() {
return bidiRoot;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@ -186,7 +186,7 @@ public abstract class AbstractWriter {
/**
* Returns the first offset to be output.
*
* @return the first offset to be output
* @since 1.3
*/
public int getStartOffset() {
@ -195,7 +195,7 @@ public abstract class AbstractWriter {
/**
* Returns the last offset to be output.
*
* @return the last offset to be output
* @since 1.3
*/
public int getEndOffset() {
@ -213,7 +213,7 @@ public abstract class AbstractWriter {
/**
* Returns the Writer that is used to output the content.
*
* @return the Writer that is used to output the content
* @since 1.3
*/
protected Writer getWriter() {
@ -257,6 +257,9 @@ public abstract class AbstractWriter {
* by subclasses. Its responsibility is to
* iterate over the elements and use the write()
* methods to generate output in the desired format.
* @throws IOException if an I/O problem has occurred
* @throws BadLocationException for an invalid location within
* the document
*/
abstract protected void write() throws IOException, BadLocationException;
@ -314,7 +317,7 @@ public abstract class AbstractWriter {
/**
* Returns the maximum line length.
*
* @return the maximum line length
* @since 1.3
*/
protected int getLineLength() {
@ -323,7 +326,7 @@ public abstract class AbstractWriter {
/**
* Sets the current line length.
*
* @param length the new line length
* @since 1.3
*/
protected void setCurrentLineLength(int length) {
@ -333,7 +336,7 @@ public abstract class AbstractWriter {
/**
* Returns the current line length.
*
* @return the current line length
* @since 1.3
*/
protected int getCurrentLineLength() {
@ -344,7 +347,7 @@ public abstract class AbstractWriter {
* Returns true if the current line should be considered empty. This
* is true when <code>getCurrentLineLength</code> == 0 ||
* <code>indent</code> has been invoked on an empty line.
*
* @return true if the current line should be considered empty
* @since 1.3
*/
protected boolean isLineEmpty() {
@ -355,7 +358,7 @@ public abstract class AbstractWriter {
* Sets whether or not lines can be wrapped. This can be toggled
* during the writing of lines. For example, outputting HTML might
* set this to false when outputting a quoted string.
*
* @param newValue new value for line wrapping
* @since 1.3
*/
protected void setCanWrapLines(boolean newValue) {
@ -365,7 +368,7 @@ public abstract class AbstractWriter {
/**
* Returns whether or not the lines can be wrapped. If this is false
* no lineSeparator's will be output.
*
* @return whether or not the lines can be wrapped
* @since 1.3
*/
protected boolean getCanWrapLines() {
@ -385,7 +388,7 @@ public abstract class AbstractWriter {
/**
* Returns the amount of space to indent.
*
* @return the amount of space to indent
* @since 1.3
*/
protected int getIndentSpace() {
@ -396,7 +399,7 @@ public abstract class AbstractWriter {
* Sets the String used to represent newlines. This is initialized
* in the constructor from either the Document, or the System property
* line.separator.
*
* @param value the new line separator
* @since 1.3
*/
public void setLineSeparator(String value) {
@ -405,7 +408,7 @@ public abstract class AbstractWriter {
/**
* Returns the string used to represent newlines.
*
* @return the string used to represent newlines
* @since 1.3
*/
public String getLineSeparator() {
@ -446,7 +449,7 @@ public abstract class AbstractWriter {
* Returns the current indentation level. That is, the number of times
* <code>incrIndent</code> has been invoked minus the number of times
* <code>decrIndent</code> has been invoked.
*
* @return the current indentation level
* @since 1.3
*/
protected int getIndentLevel() {
@ -514,7 +517,7 @@ public abstract class AbstractWriter {
/**
* Writes the line separator. This invokes <code>output</code> directly
* as well as setting the <code>lineLength</code> to 0.
*
* @throws IOException on any I/O error
* @since 1.3
*/
protected void writeLineSeparator() throws IOException {
@ -539,6 +542,10 @@ public abstract class AbstractWriter {
* and won't fit in which case the line length will exceed
* <code>getLineLength</code>.
*
* @param chars characters to output
* @param startIndex starting index
* @param length length of output
* @throws IOException on any I/O error
* @since 1.3
*/
protected void write(char[] chars, int startIndex, int length)
@ -686,6 +693,10 @@ public abstract class AbstractWriter {
* <code>writeLineSeparator</code> to write out a newline, which will
* property update the current line length.
*
* @param content characters to output
* @param start starting index
* @param length length of output
* @throws IOException on any I/O error
* @since 1.3
*/
protected void output(char[] content, int start, int length)

View File

@ -1,5 +1,5 @@
/*
* 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
@ -71,6 +71,7 @@ public class AsyncBoxView extends View {
* Fetch the major axis (the axis the children
* are tiled along). This will have a value of
* either X_AXIS or Y_AXIS.
* @return the major axis
*/
public int getMajorAxis() {
return axis;
@ -80,6 +81,7 @@ public class AsyncBoxView extends View {
* Fetch the minor axis (the axis orthogonal
* to the tiled axis). This will have a value of
* either X_AXIS or Y_AXIS.
* @return the minor axis
*/
public int getMinorAxis() {
return (axis == X_AXIS) ? Y_AXIS : X_AXIS;
@ -87,6 +89,7 @@ public class AsyncBoxView extends View {
/**
* Get the top part of the margin around the view.
* @return the top part of the margin around the view
*/
public float getTopInset() {
return topInset;
@ -103,6 +106,7 @@ public class AsyncBoxView extends View {
/**
* Get the bottom part of the margin around the view.
* @return the bottom part of the margin around the view
*/
public float getBottomInset() {
return bottomInset;
@ -119,6 +123,7 @@ public class AsyncBoxView extends View {
/**
* Get the left part of the margin around the view.
* @return the left part of the margin around the view
*/
public float getLeftInset() {
return leftInset;
@ -135,6 +140,7 @@ public class AsyncBoxView extends View {
/**
* Get the right part of the margin around the view.
* @return the right part of the margin around the view
*/
public float getRightInset() {
return rightInset;
@ -154,6 +160,7 @@ public class AsyncBoxView extends View {
*
* @param axis the axis to determine the total insets along,
* either X_AXIS or Y_AXIS.
* @return the span along an axis that is taken up by the insets
* @since 1.4
*/
protected float getInsetSpan(int axis) {
@ -173,6 +180,7 @@ public class AsyncBoxView extends View {
* considered to be accurate and incremental changes will be
* added into the total as they are calculated.
*
* @param isEstimated new value for the estimatedMajorSpan property
* @since 1.4
*/
protected void setEstimatedMajorSpan(boolean isEstimated) {
@ -181,6 +189,7 @@ public class AsyncBoxView extends View {
/**
* Is the major span currently estimated?
* @return whether or not the major span currently estimated
*
* @since 1.4
*/
@ -194,6 +203,8 @@ public class AsyncBoxView extends View {
*
* @param index the child index. This should be a
* value &gt;= 0 and &lt; getViewCount().
* @return the object representing the layout state of
* of the child at the given index
*/
protected ChildState getChildState(int index) {
synchronized(stats) {
@ -206,6 +217,7 @@ public class AsyncBoxView extends View {
/**
* Fetch the queue to use for layout.
* @return the queue to use for layout
*/
protected LayoutQueue getLayoutQueue() {
return LayoutQueue.getDefaultQueue();
@ -214,7 +226,9 @@ public class AsyncBoxView extends View {
/**
* New ChildState records are created through
* this method to allow subclasses the extend
* the ChildState records to do/hold more
* the ChildState records to do/hold more.
* @param v the view
* @return new child state
*/
protected ChildState createChildState(View v) {
return new ChildState(v);
@ -237,6 +251,8 @@ public class AsyncBoxView extends View {
* not estimated, it is updated by the given delta to reflect
* the incremental change. The delta is ignored if the
* major span is estimated.
* @param cs the child state
* @param delta the delta
*/
protected synchronized void majorRequirementChange(ChildState cs, float delta) {
if (estimatedMajorSpan == false) {
@ -254,6 +270,7 @@ public class AsyncBoxView extends View {
* might be the GUI thread if it is trying to update
* something immediately (such as to perform a
* model/view translation).
* @param cs the child state
*/
protected synchronized void minorRequirementChange(ChildState cs) {
minorChanged = true;
@ -418,6 +435,7 @@ public class AsyncBoxView extends View {
* where there is a child view for each child element.
*
* @param pos the position &gt;= 0
* @param b the position bias
* @return index of the view representing the given position, or
* -1 if no view represents that position
*/
@ -946,6 +964,7 @@ public class AsyncBoxView extends View {
* This is called by a ChildState object that has
* changed it's major span. This can therefore be
* called by multiple threads.
* @param cs the child state
*/
public synchronized void childChanged(ChildState cs) {
if (lastValidOffset == null) {
@ -958,6 +977,7 @@ public class AsyncBoxView extends View {
/**
* Paint the children that intersect the clip area.
* @param g the rendering surface to use
*/
public synchronized void paintChildren(Graphics g) {
Rectangle clip = g.getClipBounds();
@ -987,6 +1007,9 @@ public class AsyncBoxView extends View {
* Fetch the allocation to use for a child view.
* This will update the offsets for all children
* not yet updated before the given index.
* @param index the child index
* @param a the allocation
* @return the allocation to use for a child view
*/
public synchronized Shape getChildAllocation(int index, Shape a) {
if (a == null) {
@ -1031,6 +1054,8 @@ public class AsyncBoxView extends View {
* Fetch the allocation to use for a child view.
* <em>This does not update the offsets in the ChildState
* records.</em>
* @param index the index
* @return the allocation to use for a child view
*/
protected Shape getChildAllocation(int index) {
ChildState cs = getChildState(index);
@ -1057,6 +1082,7 @@ public class AsyncBoxView extends View {
* Copy the currently allocated shape into the Rectangle
* used to store the current allocation. This would be
* a floating point rectangle in a Java2D-specific implementation.
* @param a the allocation
*/
protected void setAllocation(Shape a) {
if (a instanceof Rectangle) {
@ -1072,6 +1098,7 @@ public class AsyncBoxView extends View {
* along the major axis. Make sure that offsets are set
* on the ChildState objects up to the given target span
* past the desired offset.
* @param targetOffset the target offset
*
* @return index of the view representing the given visual
* location (targetOffset), or -1 if no view represents
@ -1201,6 +1228,7 @@ public class AsyncBoxView extends View {
* Construct a child status. This needs to start
* out as fairly large so we don't falsely begin with
* the idea that all of the children are visible.
* @param v the view
* @since 1.4
*/
public ChildState(View v) {
@ -1212,7 +1240,8 @@ public class AsyncBoxView extends View {
}
/**
* Fetch the child view this record represents
* Fetch the child view this record represents.
* @return the child view this record represents
*/
public View getChildView() {
return child;
@ -1322,6 +1351,7 @@ public class AsyncBoxView extends View {
/**
* What is the span along the minor axis.
* @return the span along the minor axis
*/
public float getMinorSpan() {
if (max < minorSpan) {
@ -1333,6 +1363,7 @@ public class AsyncBoxView extends View {
/**
* What is the offset along the minor axis
* @return the offset along the minor axis
*/
public float getMinorOffset() {
if (max < minorSpan) {
@ -1345,13 +1376,15 @@ public class AsyncBoxView extends View {
/**
* What is the span along the major axis.
* @return the span along the major axis
*/
public float getMajorSpan() {
return span;
}
/**
* Get the offset along the major axis
* Get the offset along the major axis.
* @return the offset along the major axis
*/
public float getMajorOffset() {
return offset;
@ -1361,6 +1394,7 @@ public class AsyncBoxView extends View {
* This method should only be called by the ChildLocator,
* it is simply a convenient place to hold the cached
* location.
* @param offs offsets
*/
public void setMajorOffset(float offs) {
offset = offs;
@ -1394,6 +1428,7 @@ public class AsyncBoxView extends View {
/**
* Has the child view been laid out.
* @return whether or not the child view been laid out.
*/
public boolean isLayoutValid() {
return (minorValid && majorValid && childSizeValid);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -134,6 +134,7 @@ public class BoxView extends CompositeView {
/**
* Determines if the layout is valid along the given axis.
* @return if the layout is valid along the given axis
*
* @param axis either <code>View.X_AXIS</code> or <code>View.Y_AXIS</code>
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@ -38,15 +38,28 @@ public class ChangedCharSetException extends IOException {
String charSetSpec;
boolean charSetKey;
/**
* Constructs a {@code ChangedCharSetException}.
* @param charSetSpec name of the char set specification
* @param charSetKey char set key
*/
public ChangedCharSetException(String charSetSpec, boolean charSetKey) {
this.charSetSpec = charSetSpec;
this.charSetKey = charSetKey;
}
/**
* Returns the char set specification.
* @return the char set specification
*/
public String getCharSetSpec() {
return charSetSpec;
}
/**
* Returns the char set key.
* @return the char set key
*/
public boolean keyEqualsCharSet() {
return charSetKey;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -85,6 +85,8 @@ public class ComponentView extends View {
* This would result from a call to setParent or
* as a result of being notified that attributes
* have changed.
* @return the component that is associated with
* this view
*/
protected Component createComponent() {
AttributeSet attr = getElement().getAttributes();
@ -94,6 +96,7 @@ public class ComponentView extends View {
/**
* Fetch the component associated with the view.
* @return the component associated with the view
*/
public final Component getComponent() {
return createdC;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -825,10 +825,8 @@ public class DefaultCaret extends Rectangle implements Caret, FocusListener, Mou
* <pre>ChangeListener[] cls = (ChangeListener[])(c.getListeners(ChangeListener.class));</pre>
*
* If no such listeners exist, this method returns an empty array.
*
* @param listenerType the type of listeners requested; this parameter
* should specify an interface that descends from
* <code>java.util.EventListener</code>
* @param <T> the listener type
* @param listenerType the type of listeners requested
* @return an array of all objects registered as
* <code><em>Foo</em>Listener</code>s on this component,
* or an empty array if no such

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 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
@ -97,6 +97,9 @@ public class DefaultFormatterFactory extends JFormattedTextField.AbstractFormatt
private JFormattedTextField.AbstractFormatter nullFormat;
/**
* Constructs a {@code DefaultFormatterFactory}.
*/
public DefaultFormatterFactory() {
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -336,11 +336,16 @@ public class DefaultHighlighter extends LayeredHighlighter {
* (if the offsets are in a highlighted region that is). For this to
* work the painter supplied must be an instance of
* LayeredHighlightPainter.
* @param newValue the new value
*/
public void setDrawsLayeredHighlights(boolean newValue) {
drawsLayeredHighlights = newValue;
}
/**
* Return the draw layered highlights.
* @return the draw layered highlights
*/
public boolean getDrawsLayeredHighlights() {
return drawsLayeredHighlights;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -122,6 +122,7 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc
* structure (i.e. the structure reported by the
* <code>getDefaultRootElement</code> method. If the
* document contained any data it will first be removed.
* @param data the element data
*/
protected void create(ElementSpec[] data) {
try {
@ -1104,6 +1105,9 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc
*/
public static final int BUFFER_SIZE_DEFAULT = 4096;
/**
* The element buffer.
*/
protected ElementBuffer buffer;
/** Styles listening to. */
@ -2524,6 +2528,12 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc
* Element.
*/
public static class AttributeUndoableEdit extends AbstractUndoableEdit {
/**
* Constructs an {@code AttributeUndoableEdit}.
* @param element the element
* @param newAttributes the new attributes
* @param isReplacing true if all the attributes in the element were removed first.
*/
public AttributeUndoableEdit(Element element, AttributeSet newAttributes,
boolean isReplacing) {
super();
@ -2561,13 +2571,21 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc
as.addAttributes(copy);
}
// AttributeSet containing additional entries, must be non-mutable!
/**
* AttributeSet containing additional entries, must be non-mutable!
*/
protected AttributeSet newAttributes;
// Copy of the AttributeSet the Element contained.
/**
* Copy of the AttributeSet the Element contained.
*/
protected AttributeSet copy;
// true if all the attributes in the element were removed first.
/**
* true if all the attributes in the element were removed first.
*/
protected boolean isReplacing;
// Efected Element.
/**
* Affected Element.
*/
protected Element element;
}

View File

@ -1,5 +1,5 @@
/*
* 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
@ -70,6 +70,8 @@ public abstract class FlowView extends BoxView {
* 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) {
@ -89,6 +91,8 @@ public abstract class FlowView extends BoxView {
*
* @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) {
@ -104,6 +108,8 @@ public abstract class FlowView extends BoxView {
* @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) {
@ -116,6 +122,8 @@ public abstract class FlowView extends BoxView {
* 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();
@ -359,6 +367,7 @@ public abstract class FlowView extends BoxView {
* 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.
@ -385,6 +394,7 @@ public abstract class FlowView extends BoxView {
* 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
@ -426,6 +436,8 @@ public abstract class FlowView extends BoxView {
/**
* 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;
@ -495,6 +507,7 @@ public abstract class FlowView extends BoxView {
* 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
@ -578,6 +591,7 @@ public abstract class FlowView extends BoxView {
* 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
@ -654,6 +668,8 @@ public abstract class FlowView extends BoxView {
* @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 File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@ -758,6 +758,8 @@ public class GapContent extends GapVector implements AbstractDocument.Content, S
* to subclasses.
*
* @param positions the UndoPosRef instances to reset
* @param offset where the string was inserted
* @param length length of inserted string
*/
@SuppressWarnings("rawtypes") // UndoPosRef type cannot be exposed
protected void updateUndoPositions(Vector positions, int offset,

View File

@ -1,5 +1,5 @@
/*
* 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
@ -102,6 +102,7 @@ public class GlyphView extends View implements TabableView, Cloneable {
* Fetch the currently installed glyph painter.
* If a painter has not yet been installed, and
* a default was not yet needed, null is returned.
* @return the currently installed glyph painter
*/
public GlyphPainter getGlyphPainter() {
return painter;
@ -109,6 +110,7 @@ public class GlyphView extends View implements TabableView, Cloneable {
/**
* Sets the painter to use for rendering glyphs.
* @param p the painter to use for rendering glyphs
*/
public void setGlyphPainter(GlyphPainter p) {
painter = p;
@ -144,6 +146,7 @@ public class GlyphView extends View implements TabableView, Cloneable {
* be returned. This is implemented to call
* <code>StyledDocument.getBackground</code> if the associated
* document is a styled document, otherwise it returns null.
* @return the background color to use to render the glyphs
*/
public Color getBackground() {
Document doc = getDocument();
@ -165,6 +168,7 @@ public class GlyphView extends View implements TabableView, Cloneable {
* is not a StyledDocument, the associated components foreground
* color is used. If there is no associated component, null
* is returned.
* @return the foreground color to use to render the glyphs
*/
public Color getForeground() {
Document doc = getDocument();
@ -187,6 +191,7 @@ public class GlyphView extends View implements TabableView, Cloneable {
* is not a StyledDocument, the associated components font
* is used. If there is no associated component, null
* is returned.
* @return the font that the glyphs should be based upon
*/
public Font getFont() {
Document doc = getDocument();
@ -204,6 +209,7 @@ public class GlyphView extends View implements TabableView, Cloneable {
/**
* Determine if the glyphs should be underlined. If true,
* an underline should be drawn through the baseline.
* @return if the glyphs should be underlined
*/
public boolean isUnderline() {
AttributeSet attr = getAttributes();
@ -214,6 +220,7 @@ public class GlyphView extends View implements TabableView, Cloneable {
* Determine if the glyphs should have a strikethrough
* line. If true, a line should be drawn through the center
* of the glyphs.
* @return if the glyphs should have a strikethrough line
*/
public boolean isStrikeThrough() {
AttributeSet attr = getAttributes();
@ -222,6 +229,7 @@ public class GlyphView extends View implements TabableView, Cloneable {
/**
* Determine if the glyphs should be rendered as superscript.
* @return if the glyphs should be rendered as superscript
*/
public boolean isSubscript() {
AttributeSet attr = getAttributes();
@ -230,6 +238,7 @@ public class GlyphView extends View implements TabableView, Cloneable {
/**
* Determine if the glyphs should be rendered as subscript.
* @return if the glyphs should be rendered as subscript
*/
public boolean isSuperscript() {
AttributeSet attr = getAttributes();
@ -238,6 +247,7 @@ public class GlyphView extends View implements TabableView, Cloneable {
/**
* Fetch the TabExpander to use if tabs are present in this view.
* @return the TabExpander to use if tabs are present in this view
*/
public TabExpander getTabExpander() {
return expander;
@ -1148,17 +1158,43 @@ public class GlyphView extends View implements TabableView, Cloneable {
/**
* Determine the span the glyphs given a start location
* (for tab expansion).
* @param v the {@code GlyphView}
* @param p0 the beginning position
* @param p1 the ending position
* @param e how to expand the tabs when encountered
* @param x the X coordinate
* @return the span the glyphs given a start location
*/
public abstract float getSpan(GlyphView v, int p0, int p1, TabExpander e, float x);
/**
* Returns of the height.
* @param v the {@code GlyphView}
* @return of the height
*/
public abstract float getHeight(GlyphView v);
/**
* Returns of the ascent.
* @param v the {@code GlyphView}
* @return of the ascent
*/
public abstract float getAscent(GlyphView v);
/**
* Returns of the descent.
* @param v the {@code GlyphView}
* @return of the descent
*/
public abstract float getDescent(GlyphView v);
/**
* Paint the glyphs representing the given range.
* @param v the {@code GlyphView}
* @param g the graphics context
* @param a the current allocation of the view
* @param p0 the beginning position
* @param p1 the ending position
*/
public abstract void paint(GlyphView v, Graphics g, Shape a, int p0, int p1);
@ -1231,6 +1267,7 @@ public class GlyphView extends View implements TabableView, Cloneable {
* @param v the <code>GlyphView</code> to provide a painter for
* @param p0 the starting document offset &gt;= 0
* @param p1 the ending document offset &gt;= p0
* @return a painter to use for the given GlyphView
*/
public GlyphPainter getPainter(GlyphView v, int p0, int p1) {
return this;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -124,6 +124,9 @@ public interface Highlighter {
}
/**
* A highlight.
*/
public interface Highlight {
/**
@ -148,5 +151,4 @@ public interface Highlighter {
public HighlightPainter getPainter();
}
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -535,6 +535,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A
* Sets the <code>NavigationFilter</code>. <code>NavigationFilter</code>
* is used by <code>DefaultCaret</code> and the default cursor movement
* actions as a way to restrict the cursor movement.
* @param filter the filter
*
* @since 1.4
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -161,6 +161,7 @@ public class LabelView extends GlyphView implements TabableView {
/**
* Fetches the <code>FontMetrics</code> used for this view.
* @return the <code>FontMetrics</code> used for this view
* @deprecated FontMetrics are not used for glyph rendering
* when running in the JDK.
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@ -56,6 +56,15 @@ public abstract class LayeredHighlighter implements Highlighter {
* Layered highlight renderer.
*/
static public abstract class LayerPainter implements Highlighter.HighlightPainter {
/**
* @return a shape
* @param g Graphics used to draw
* @param p0 starting offset of view
* @param p1 ending offset of view
* @param viewBounds Bounds of View
* @param editor JTextComponent
* @param view View instance being rendered
*/
public abstract Shape paintLayer(Graphics g, int p0, int p1,
Shape viewBounds,JTextComponent editor,
View view);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2008, 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
@ -50,6 +50,7 @@ public class LayoutQueue {
/**
* Fetch the default layout queue.
* @return the default layout queue
*/
public static LayoutQueue getDefaultQueue() {
AppContext ac = AppContext.getAppContext();
@ -77,6 +78,7 @@ public class LayoutQueue {
/**
* Add a task that is not needed immediately because
* the results are not believed to be visible.
* @param task the task to add to the queue
*/
public synchronized void addTask(Runnable task) {
if (worker == null) {
@ -88,7 +90,8 @@ public class LayoutQueue {
}
/**
* Used by the worker thread to get a new task to execute
* Used by the worker thread to get a new task to execute.
* @return a task from the queue
*/
protected synchronized Runnable waitForWork() {
while (tasks.size() == 0) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 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
@ -199,7 +199,7 @@ public class MaskFormatter extends DefaultFormatter {
* Creates a <code>MaskFormatter</code> with the specified mask.
* A <code>ParseException</code>
* will be thrown if <code>mask</code> is an invalid mask.
*
* @param mask the mask
* @throws ParseException if mask does not contain valid mask characters
*/
public MaskFormatter(String mask) throws ParseException {
@ -211,6 +211,7 @@ public class MaskFormatter extends DefaultFormatter {
* Sets the mask dictating the legal characters.
* This will throw a <code>ParseException</code> if <code>mask</code> is
* not valid.
* @param mask the mask
*
* @throws ParseException if mask does not contain valid mask characters
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -246,6 +246,7 @@ public class ParagraphView extends FlowView implements TabExpander {
* <code>rowIndex</code> gives the index of the view that corresponds
* that should be looked in.
* @param pos position into the model
* @param b the bias
* @param a the allocated region to render into
* @param direction one of the following values:
* <ul>
@ -256,6 +257,7 @@ public class ParagraphView extends FlowView implements TabExpander {
* in this method
* @param rowIndex the index of the view
* @param x the x coordinate of interest
* @throws BadLocationException if a bad location is encountered
* @return the closest model position to <code>x</code>
*/
// NOTE: This will not properly work if ParagraphView contains

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -520,6 +520,9 @@ public class PlainView extends View implements TabExpander {
* view. The longest line is checked to see if it has
* changed.
*
* @param changes the change information from the associated document
* @param a the current allocation of the view
* @param f the factory to use to rebuild if the view has children
* @since 1.4
*/
protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) {
@ -608,6 +611,7 @@ public class PlainView extends View implements TabExpander {
* @param a the region allocated for the view to render into
* @param line the line number to find the region of. This must
* be a valid line number in the model.
* @return the rectangle that represents the given line
* @since 1.4
*/
protected Rectangle lineToRect(Shape a, int line) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -479,9 +479,9 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon
* behavior of SmallAttributeSet. This can be reimplemented
* to return an AttributeSet that provides some sort of
* attribute conversion.
*
* @param a The set of attributes to be represented in the
* the compact form.
* @return a compact set of attributes that might be shared
*/
protected SmallAttributeSet createSmallAttributeSet(AttributeSet a) {
return new SmallAttributeSet(a);
@ -498,6 +498,8 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon
*
* @param a The set of attributes to be represented in the
* the larger form.
* @return a large set of attributes that should trade off
* space for time
*/
protected MutableAttributeSet createLargeAttributeSet(AttributeSet a) {
return new SimpleAttributeSet(a);
@ -558,6 +560,9 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon
/**
* Context-specific handling of writing out attributes
* @param out the output stream
* @param a the attribute set
* @exception IOException on any I/O error
*/
public void writeAttributes(ObjectOutputStream out,
AttributeSet a) throws IOException {
@ -566,6 +571,13 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon
/**
* Context-specific handling of reading in attributes
* @param in the object stream to read the attribute data from.
* @param a the attribute set to place the attribute
* definitions in.
* @exception ClassNotFoundException passed upward if encountered
* when reading the object stream.
* @exception IOException passed upward if encountered when
* reading the object stream.
*/
public void readAttributes(ObjectInputStream in,
MutableAttributeSet a) throws ClassNotFoundException, IOException {
@ -685,6 +697,9 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon
/**
* Returns the object previously registered with
* <code>registerStaticAttributeKey</code>.
* @param key the object key
* @return Returns the object previously registered with
* {@code registerStaticAttributeKey}
*/
public static Object getStaticAttribute(Object key) {
if (thawKeyMap == null || key == null) {
@ -694,9 +709,11 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon
}
/**
* Returns the String that <code>key</code> will be registered with
* Returns the String that <code>key</code> will be registered with.
* @see #getStaticAttribute
* @see #registerStaticAttributeKey
* @param key the object key
* @return the String that {@code key} will be registered with
*/
public static Object getStaticAttributeKey(Object key) {
return key.getClass().getName() + "." + key.toString();
@ -772,11 +789,19 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon
*/
public class SmallAttributeSet implements AttributeSet {
/**
* Constructs a SmallAttributeSet.
* @param attributes the attributes
*/
public SmallAttributeSet(Object[] attributes) {
this.attributes = attributes;
updateResolveParent();
}
/**
* Constructs a SmallAttributeSet.
* @param attrs the attributes
*/
public SmallAttributeSet(AttributeSet attrs) {
int n = attrs.getAttributeCount();
Object[] tbl = new Object[2 * n];
@ -818,7 +843,8 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon
// --- Object methods -------------------------
/**
* Returns a string showing the key/value pairs
* Returns a string showing the key/value pairs.
* @return a string showing the key/value pairs
*/
public String toString() {
String s = "{";
@ -1382,7 +1408,8 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon
/**
* Return an array of all the listeners of the given type that
* were added to this model.
*
* @param <T> the listener type
* @param listenerType the type of listeners requested
* @return all of the objects receiving <em>listenerType</em> notifications
* from this model
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -288,6 +288,8 @@ public class StyledEditorKit extends DefaultEditorKit {
* are in <code>set</code>.<p>
* This is called anytime the caret moves over a different location.
*
* @param element the element
* @param set the attributes
*/
protected void createInputAttributes(Element element,
MutableAttributeSet set) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@ -58,6 +58,7 @@ public class TabSet implements Serializable
/**
* Creates and returns an instance of TabSet. The array of Tabs
* passed in must be sorted in ascending order.
* @param tabs the TabStops to initialize the TabSet
*/
public TabSet(TabStop[] tabs) {
// PENDING(sky): If this becomes a problem, make it sort.
@ -73,6 +74,7 @@ public class TabSet implements Serializable
/**
* Returns the number of Tab instances the receiver contains.
* @return the number of Tab instances the receiver contains
*/
public int getTabCount() {
return (tabs == null) ? 0 : tabs.length;
@ -82,6 +84,8 @@ public class TabSet implements Serializable
* Returns the TabStop at index <code>index</code>. This will throw an
* IllegalArgumentException if <code>index</code> is outside the range
* of tabs.
* @param index which TapStop to return
* @return the TabStop at index {@code index}
*/
public TabStop getTab(int index) {
int numTabs = getTabCount();
@ -95,6 +99,8 @@ public class TabSet implements Serializable
/**
* Returns the Tab instance after <code>location</code>. This will
* return null if there are no tabs after <code>location</code>.
* @param location location to find a Tab after
* @return the Tab instance after {@code location}
*/
public TabStop getTabAfter(float location) {
int index = getTabIndexAfter(location);
@ -103,6 +109,9 @@ public class TabSet implements Serializable
}
/**
* Returns the index of the TabStop <code>tab</code>, or -1 if
* <code>tab</code> is not contained in the receiver.
* @param tab the TabStop to find
* @return the index of the TabStop <code>tab</code>, or -1 if
* <code>tab</code> is not contained in the receiver.
*/
@ -117,6 +126,8 @@ public class TabSet implements Serializable
/**
* Returns the index of the Tab to be used after <code>location</code>.
* This will return -1 if there are no tabs after <code>location</code>.
* @param location location to find a Tab after
* @return the index of the Tab to be used after <code>location</code>
*/
public int getTabIndexAfter(float location) {
int current, min, max;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -59,6 +59,7 @@ public class TabStop implements Serializable {
* RIGHT_TAB, just includes decimal as additional character to look for.
*/
public static final int ALIGN_DECIMAL = 4;
/** Align bar */
public static final int ALIGN_BAR = 5;
/* Bar tabs (whatever they are) are actually a separate kind of tab
@ -66,11 +67,17 @@ public class TabStop implements Serializable {
properties are mutually exclusive, so the reader treats barness
as being a kind of alignment. */
/** Lead none */
public static final int LEAD_NONE = 0;
/** Lead dots */
public static final int LEAD_DOTS = 1;
/** Lead hyphens */
public static final int LEAD_HYPHENS = 2;
/** Lead underline */
public static final int LEAD_UNDERLINE = 3;
/** Lead thickline */
public static final int LEAD_THICKLINE = 4;
/** Lead equals */
public static final int LEAD_EQUALS = 5;
/** Tab type. */
@ -82,6 +89,7 @@ public class TabStop implements Serializable {
/**
* Creates a tab at position <code>pos</code> with a default alignment
* and default leader.
* @param pos position of the tab
*/
public TabStop(float pos) {
this(pos, ALIGN_LEFT, LEAD_NONE);
@ -90,6 +98,9 @@ public class TabStop implements Serializable {
/**
* Creates a tab with the specified position <code>pos</code>,
* alignment <code>align</code> and leader <code>leader</code>.
* @param pos position of the tab
* @param align alignment of the tab
* @param leader leader of the tab
*/
public TabStop(float pos, int align, int leader) {
alignment = align;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -311,6 +311,23 @@ public class Utilities {
justificationData);
}
/**
* Determines the relative offset into the given text that
* best represents the given span in the view coordinate
* system.
*
* @param s the source of the text
* @param metrics the font metrics to use for the calculation
* @param x0 the starting view location representing the start
* of the given text &gt;= 0.
* @param x the target view location to translate to an
* offset into the text &gt;= 0.
* @param e how to expand the tabs. If this value is null,
* tabs will be expanded as a space character.
* @param startOffset starting offset of the text in the document &gt;= 0
* @param round whether or not to round
* @return the offset into the text &gt;= 0
*/
public static final int getTabbedTextOffset(Segment s,
FontMetrics metrics,
int x0, int x, TabExpander e,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -381,6 +381,7 @@ public abstract class View implements SwingConstants {
/**
* Removes one of the children at the given position.
* This is a convenience call to <code>replace</code>.
* @param i the position
* @since 1.3
*/
public void remove(int i) {
@ -444,6 +445,7 @@ public abstract class View implements SwingConstants {
* position.
*
* @param pos the position &gt;= 0
* @param b the bias
* @return index of the view representing the given position, or
* -1 if no view represents that position
* @since 1.3
@ -480,6 +482,7 @@ public abstract class View implements SwingConstants {
* the {@code BadLocationException} will be thrown.
*
* @param pos the position to convert
* @param b the bias
* @param a the allocated region in which to render
* @param direction the direction from the current position that can
* be thought of as the arrow keys typically found on a keyboard.
@ -490,6 +493,7 @@ public abstract class View implements SwingConstants {
* <li>SwingConstants.NORTH
* <li>SwingConstants.SOUTH
* </ul>
* @param biasRet the returned bias
* @return the location within the model that best represents the next
* location visual position
* @exception BadLocationException the given position is not a valid
@ -662,6 +666,7 @@ public abstract class View implements SwingConstants {
* @param x the X coordinate &gt;= 0
* @param y the Y coordinate &gt;= 0
* @param a the allocated region in which to render
* @param biasReturn the returned bias
* @return the location within the model that best represents the
* given point in the view &gt;= 0. The <code>biasReturn</code>
* argument will be
@ -864,6 +869,7 @@ public abstract class View implements SwingConstants {
* for the purpose of rendering or layout, and should always
* access them through the <code>AttributeSet</code> returned
* by this method.
* @return the attributes to use when rendering
*/
public AttributeSet getAttributes() {
return elem.getAttributes();
@ -1026,6 +1032,10 @@ public abstract class View implements SwingConstants {
* Returns the tooltip text at the specified location. The default
* implementation returns the value from the child View identified by
* the passed in location.
* @param x the x coordinate
* @param y the y coordinate
* @param allocation current allocation of the View.
* @return the tooltip text at the specified location
*
* @since 1.4
* @see JTextComponent#getToolTipText

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@ -228,6 +228,9 @@ public class WrappedPlainView extends BoxView implements TabExpander {
* It will either break at word or character boundaries
* depending upon the break argument given at
* construction.
* @param p0 the starting document location
* @param p1 the ending document location to use
* @return the break position
*/
protected int calculateBreakPosition(int p0, int p1) {
int p;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@ -94,6 +94,7 @@ public class ZoneView extends BoxView {
/**
* Get the current maximum zone size.
* @return the current maximum zone size
*/
public int getMaximumZoneSize() {
return maxZoneSize;
@ -117,6 +118,8 @@ public class ZoneView extends BoxView {
/**
* Get the current setting of the number of zones
* allowed to be loaded at the same time.
* @return current setting of the number of zones
* allowed to be loaded at the same time
*/
public int getMaxZonesLoaded() {
return maxZonesLoaded;
@ -184,6 +187,9 @@ public class ZoneView extends BoxView {
* child elements of the element this view is responsible for.
* Therefore, the default implementation is to return
* true if the view has children.
* param zone the child view
* @param zone the zone
* @return whether or not the zone is in the loaded state.
*/
protected boolean isZoneLoaded(View zone) {
return (zone.getViewCount() > 0);
@ -203,6 +209,8 @@ public class ZoneView extends BoxView {
* @param p1 the end of the desired zone. This should
* be &gt; getStartOffset() and &lt;= getEndOffset(). This
* value should also be &gt; p0.
* @return a view to represent a zone for the given range within
* the model
*/
protected View createZone(int p0, int p1) {
Document doc = getDocument();