From ac1ed908de999523efc36f38e69bca1aadfe0808 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 14 Aug 2006 23:12:35 +0000 Subject: Imported GNU Classpath 0.92 2006-08-14 Mark Wielaard Imported GNU Classpath 0.92 * HACKING: Add more importing hints. Update automake version requirement. * configure.ac (gconf-peer): New enable AC argument. Add --disable-gconf-peer and --enable-default-preferences-peer to classpath configure when gconf is disabled. * scripts/makemake.tcl: Set gnu/java/util/prefs/gconf and gnu/java/awt/dnd/peer/gtk to bc. Classify gnu/java/security/Configuration.java as generated source file. * gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.java, gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java, gnu/java/lang/management/VMClassLoadingMXBeanImpl.java, gnu/java/lang/management/VMRuntimeMXBeanImpl.java, gnu/java/lang/management/VMMemoryManagerMXBeanImpl.java, gnu/java/lang/management/VMThreadMXBeanImpl.java, gnu/java/lang/management/VMMemoryMXBeanImpl.java, gnu/java/lang/management/VMCompilationMXBeanImpl.java: New VM stub classes. * java/lang/management/VMManagementFactory.java: Likewise. * java/net/VMURLConnection.java: Likewise. * gnu/java/nio/VMChannel.java: Likewise. * java/lang/Thread.java (getState): Add stub implementation. * java/lang/Class.java (isEnum): Likewise. * java/lang/Class.h (isEnum): Likewise. * gnu/awt/xlib/XToolkit.java (getClasspathTextLayoutPeer): Removed. * javax/naming/spi/NamingManager.java: New override for StackWalker functionality. * configure, sources.am, Makefile.in, gcj/Makefile.in, include/Makefile.in, testsuite/Makefile.in: Regenerated. From-SVN: r116139 --- libjava/classpath/javax/swing/text/TabStop.java | 68 ++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 7 deletions(-) (limited to 'libjava/classpath/javax/swing/text/TabStop.java') diff --git a/libjava/classpath/javax/swing/text/TabStop.java b/libjava/classpath/javax/swing/text/TabStop.java index 56f862f..f4c3f85 100644 --- a/libjava/classpath/javax/swing/text/TabStop.java +++ b/libjava/classpath/javax/swing/text/TabStop.java @@ -1,5 +1,5 @@ -/* TabSet.java -- - Copyright (C) 2004 Free Software Foundation, Inc. +/* TabStop.java -- + Copyright (C) 2004, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,6 +39,9 @@ package javax.swing.text; import java.io.Serializable; +/** + * Represents a tab position in some text. + */ public class TabStop implements Serializable { /** The serialization UID (compatible with JDK1.5). */ @@ -61,18 +64,42 @@ public class TabStop implements Serializable int align; int leader; + /** + * Creates a new TabStop for the specified tab position. + * + * @param pos the tab position. + */ public TabStop(float pos) { this(pos, ALIGN_LEFT, LEAD_NONE); } + /** + * Creates a new TabStop with the specified attributes. + * + * @param pos the tab position. + * @param align the alignment (one of {@link #ALIGN_LEFT}, + * {@link #ALIGN_CENTER}, {@link #ALIGN_RIGHT}, {@link #ALIGN_DECIMAL} + * or {@link #ALIGN_BAR}). + * @param leader the leader (one of {@link #LEAD_NONE}, {@link #LEAD_DOTS}, + * {@link #LEAD_EQUALS}, {@link #LEAD_HYPHENS}, {@link #LEAD_THICKLINE} + * or {@link #LEAD_UNDERLINE}). + */ public TabStop(float pos, int align, int leader) { this.pos = pos; this.align = align; this.leader = leader; } - + + /** + * Tests this TabStop for equality with an arbitrary object. + * + * @param other the other object (null permitted). + * + * @return true if this TabStop is equal to + * the specified object, and false otherwise. + */ public boolean equals(Object other) { return (other != null) @@ -82,34 +109,60 @@ public class TabStop implements Serializable && (((TabStop)other).getAlignment() == this.getAlignment()); } + /** + * Returns the tab alignment. This should be one of {@link #ALIGN_LEFT}, + * {@link #ALIGN_CENTER}, {@link #ALIGN_RIGHT}, {@link #ALIGN_DECIMAL} or + * {@link #ALIGN_BAR}. + * + * @return The tab alignment. + */ public int getAlignment() { return align; } + /** + * Returns the leader type. This should be one of {@link #LEAD_NONE}, + * {@link #LEAD_DOTS}, {@link #LEAD_EQUALS}, {@link #LEAD_HYPHENS}, + * {@link #LEAD_THICKLINE} or {@link #LEAD_UNDERLINE}. + * + * @return The leader type. + */ public int getLeader() { return leader; } + /** + * Returns the tab position. + * + * @return The tab position. + */ public float getPosition() { return pos; } + /** + * Returns a hash code for this TabStop. + * + * @return A hash code. + */ public int hashCode() { return (int) pos + (int) leader + (int) align; } + /** + * Returns a string describing this TabStop. + * + * @return A string describing this TabStop. + */ public String toString() { String prefix = ""; switch (align) { - case ALIGN_LEFT: - prefix = "left "; - break; case ALIGN_RIGHT: prefix = "right "; break; @@ -130,7 +183,8 @@ public class TabStop implements Serializable break; } - return (prefix + "tab @" + pos + ((leader == LEAD_NONE) ? "" : "(w/leaders)")); + return prefix + "tab @" + pos + + ((leader == LEAD_NONE) ? "" : " (w/leaders)"); } } -- cgit v1.1