< prev index next >
src/java.desktop/share/classes/javax/swing/text/TabSet.java
Print this page
*** 36,46 ****
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
! * has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
* @author Scott Violet
*/
@SuppressWarnings("serial") // Same-version serialization only
--- 36,46 ----
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
! * has been added to the {@code java.beans} package.
* Please see {@link java.beans.XMLEncoder}.
*
* @author Scott Violet
*/
@SuppressWarnings("serial") // Same-version serialization only
*** 79,90 ****
public int getTabCount() {
return (tabs == null) ? 0 : tabs.length;
}
/**
! * 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) {
--- 79,90 ----
public int getTabCount() {
return (tabs == null) ? 0 : tabs.length;
}
/**
! * Returns the TabStop at index {@code index}. This will throw an
! * IllegalArgumentException if {@code index} is outside the range
* of tabs.
* @param index which TapStop to return
* @return the TabStop at index {@code index}
*/
public TabStop getTab(int index) {
*** 95,135 ****
" is outside the range of tabs");
return tabs[index];
}
/**
! * 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);
return (index == -1) ? null : tabs[index];
}
/**
! * 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.
*/
public int getTabIndex(TabStop tab) {
for(int counter = getTabCount() - 1; counter >= 0; counter--)
// should this use .equals?
if(getTab(counter) == tab)
return counter;
return -1;
}
/**
! * 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;
min = 0;
--- 95,135 ----
" is outside the range of tabs");
return tabs[index];
}
/**
! * Returns the Tab instance after {@code location}. This will
! * return null if there are no tabs after {@code location}.
* @param location location to find a Tab after
* @return the Tab instance after {@code location}
*/
public TabStop getTabAfter(float location) {
int index = getTabIndexAfter(location);
return (index == -1) ? null : tabs[index];
}
/**
! * Returns the index of the TabStop {@code tab}, or -1 if
! * {@code tab} is not contained in the receiver.
* @param tab the TabStop to find
! * @return the index of the TabStop {@code tab}, or -1 if
! * {@code tab} is not contained in the receiver.
*/
public int getTabIndex(TabStop tab) {
for(int counter = getTabCount() - 1; counter >= 0; counter--)
// should this use .equals?
if(getTab(counter) == tab)
return counter;
return -1;
}
/**
! * Returns the index of the Tab to be used after {@code location}.
! * This will return -1 if there are no tabs after {@code location}.
* @param location location to find a Tab after
! * @return the index of the Tab to be used after {@code location}
*/
public int getTabIndexAfter(float location) {
int current, min, max;
min = 0;
*** 151,166 ****
// no tabs after the passed in location.
return -1;
}
/**
! * Indicates whether this <code>TabSet</code> is equal to another one.
! * @param o the <code>TabSet</code> instance which this instance
* should be compared to.
! * @return <code>true</code> if <code>o</code> is the instance of
! * <code>TabSet</code>, has the same number of <code>TabStop</code>s
! * and they are all equal, <code>false</code> otherwise.
*
* @since 1.5
*/
public boolean equals(Object o) {
if (o == this) {
--- 151,166 ----
// no tabs after the passed in location.
return -1;
}
/**
! * Indicates whether this {@code TabSet} is equal to another one.
! * @param o the {@code TabSet} instance which this instance
* should be compared to.
! * @return {@code true} if {@code o} is the instance of
! * {@code TabSet}, has the same number of {@code TabStop}s
! * and they are all equal, {@code false} otherwise.
*
* @since 1.5
*/
public boolean equals(Object o) {
if (o == this) {
< prev index next >