Author: desruisseaux
Date: Sat Mar 9 21:45:39 2013
New Revision: 1454764
URL: http://svn.apache.org/r1454764
Log:
Formatting change: when drawing a tree, put the vertical line after two spaces
instead than on the left border.
People specialized in human design of interfaces seem to prefer this layout.
We are better to change the layout before more tests depend on it.
Modified:
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/converter/FallbackConverter.java
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java
sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/internal/converter/FallbackConverterTest.java
sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java
Modified:
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/converter/FallbackConverter.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/converter/FallbackConverter.java?rev=1454764&r1=1454763&r2=1454764&view=diff
==============================================================================
---
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/converter/FallbackConverter.java
[UTF-8] (original)
+++
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/converter/FallbackConverter.java
[UTF-8] Sat Mar 9 21:45:39 2013
@@ -269,10 +269,10 @@ final class FallbackConverter<S,T> exten
*
* Adding: String ⇨ Number
* to: String ⇨ Number : FallbackConverter
- * ├───String ⇨ Short
- * └───String ⇨ Number : FallbackConverter
- * ├───String ⇨ Integer
- * └───String ⇨ Long
+ * ├─String ⇨ Short
+ * └─String ⇨ Number : FallbackConverter
+ * ├─String ⇨ Integer
+ * └─String ⇨ Long
*
* We don't want to insert the generic Number converter
between specialized
* ones (Integer and Long). So rather than going down the tree
in this case,
Modified:
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java?rev=1454764&r1=1454763&r2=1454764&view=diff
==============================================================================
---
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java
[UTF-8] (original)
+++
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java
[UTF-8] Sat Mar 9 21:45:39 2013
@@ -30,17 +30,17 @@ import java.util.List;
*
* {@preformat text
* Citation
- * ├───Title…………………………………………………………… Open Geospatial Consortium
- * ├───Presentation Forms………………………… document digital
- * ├───Cited Responsible Parties
- * │ ├───Organisation Name………………… Open Geospatial Consortium
- * │ ├───Role…………………………………………………… resource provider
- * │ └───Contact Info
- * │ └───Online Resource
- * │ ├───Linkage……………………… http://www.opengeospatial.org/
- * │ └───Function…………………… information
- * └───Identifiers
- * └───Code…………………………………………………… OGC
+ * ├─Title…………………………………………………………… Open Geospatial Consortium
+ * ├─Presentation Forms………………………… document digital
+ * ├─Cited Responsible Parties
+ * │ ├─Organisation Name………………… Open Geospatial Consortium
+ * │ ├─Role…………………………………………………… resource provider
+ * │ └─Contact Info
+ * │ └─Online Resource
+ * │ ├─Linkage……………………… http://www.opengeospatial.org/
+ * │ └─Function…………………… information
+ * └─Identifiers
+ * └─Code…………………………………………………… OGC
* }
*
* <p>In many cases, the columns are known in advance as hard-coded static
constants.
Modified:
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java?rev=1454764&r1=1454763&r2=1454764&view=diff
==============================================================================
---
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
[UTF-8] (original)
+++
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
[UTF-8] Sat Mar 9 21:45:39 2013
@@ -49,9 +49,9 @@ import static org.apache.sis.util.Charac
*
* {@preformat text
* Node #1
- * ├───Node #2
- * │ └───Node #4
- * └───Node #3
+ * ├─Node #2
+ * │ └─Node #4
+ * └─Node #3
* }
*
* If the same {@code TreeTable} is formatted with two columns,
@@ -59,9 +59,9 @@ import static org.apache.sis.util.Charac
*
* {@preformat text
* Node #1……………………… More #1
- * ├───Node #2…………… More #2
- * │ └───Node #4… More #4
- * └───Node #3…………… More #3
+ * ├─Node #2…………… More #2
+ * │ └─Node #4… More #4
+ * └─Node #3…………… More #3
* }
*
* This representation can be printed to the {@linkplain
java.io.Console#writer() console output}
@@ -115,7 +115,7 @@ public class TreeTableFormat extends Tab
/**
* The position of the vertical line, relative to the position of the
label of the parent node.
- * The default value is 0, which means that the vertical line is drawn
below the first letter
+ * The default value is 2, which means that the vertical line is drawn
below the third letter
* of the node label.
*
* @see #getVerticalLinePosition()
@@ -129,9 +129,9 @@ public class TreeTableFormat extends Tab
*
* <ul>
* <li>{@code treeBlank} = {@code " "}</li>
- * <li>{@code treeLine} = {@code "│ "}</li>
- * <li>{@code treeCross} = {@code "├───"}</li>
- * <li>{@code treeEnd} = {@code "└───"}</li>
+ * <li>{@code treeLine} = {@code " │ "}</li>
+ * <li>{@code treeCross} = {@code " ├─"}</li>
+ * <li>{@code treeEnd} = {@code " └─"}</li>
* </ul>
*
* @see #clearTreeSymbols()
@@ -148,10 +148,11 @@ public class TreeTableFormat extends Tab
*/
public TreeTableFormat(final Locale locale, final TimeZone timezone) {
super(locale, timezone);
- indentation = 4;
- beforeFill = "……";
- fillCharacter = '…';
- omitTrailingNulls = true;
+ indentation = 4;
+ verticalLinePosition = 2;
+ beforeFill = "……";
+ fillCharacter = '…';
+ omitTrailingNulls = true;
}
/**
@@ -238,7 +239,7 @@ public class TreeTableFormat extends Tab
/**
* Returns the position of the vertical line, relative to the position of
the root label.
- * The default value is 0, which means that the vertical line is drawn
below the first
+ * The default value is 2, which means that the vertical line is drawn
below the third
* letter of the root label.
*
* @return The current vertical line position.
Modified:
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java?rev=1454764&r1=1454763&r2=1454764&view=diff
==============================================================================
---
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java
[UTF-8] (original)
+++
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java
[UTF-8] Sat Mar 9 21:45:39 2013
@@ -50,20 +50,20 @@ import org.apache.sis.util.ArgumentCheck
* <table class="compact"><tr><td>
* {@preformat text
* root
- * ├───users
- * │ └───alice
- * │ ├───data
- * │ │ └───mercator
- * │ └───document
- * └───lib
+ * ├─users
+ * │ └─alice
+ * │ ├─data
+ * │ │ └─mercator
+ * │ └─document
+ * └─lib
* }
* </td><td>
* {@preformat text
* root
- * ├───users/alice
- * │ ├───data/mercator
- * │ └───document
- * └───lib
+ * ├─users/alice
+ * │ ├─data/mercator
+ * │ └─document
+ * └─lib
* }
* </td></tr></table>
* {@preformat java
@@ -120,9 +120,9 @@ public final class TreeTables extends St
*
* {@preformat text
* from
- * └───users
- * └───alice
- * └───data
+ * └─users
+ * └─alice
+ * └─data
* }
*
* @param from The root node from which to start the search.
Modified:
sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/internal/converter/FallbackConverterTest.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/internal/converter/FallbackConverterTest.java?rev=1454764&r1=1454763&r2=1454764&view=diff
==============================================================================
---
sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/internal/converter/FallbackConverterTest.java
[UTF-8] (original)
+++
sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/internal/converter/FallbackConverterTest.java
[UTF-8] Sat Mar 9 21:45:39 2013
@@ -133,14 +133,14 @@ public final strictfp class FallbackConv
if (false) // TODO: FallbackConverter.toString() not yet implemented.
assertMultilinesEquals(
"String ⇨ Object\n" +
- "├───String ⇨ Number\n" +
- "│ ├───String ⇨ Number\n" +
- "│ ├───String ⇨ Short\n" +
- "│ ├───String ⇨ Long\n" +
- "│ ├───String ⇨ Float\n" +
- "│ ├───String ⇨ Integer\n" +
- "│ └───String ⇨ Double\n" +
- "└───String ⇨ Boolean\n", c.toString());
+ " ├─String ⇨ Number\n" +
+ " │ ├─String ⇨ Number\n" +
+ " │ ├─String ⇨ Short\n" +
+ " │ ├─String ⇨ Long\n" +
+ " │ ├─String ⇨ Float\n" +
+ " │ ├─String ⇨ Integer\n" +
+ " │ └─String ⇨ Double\n" +
+ " └─String ⇨ Boolean\n", c.toString());
}
/**
Modified:
sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java?rev=1454764&r1=1454763&r2=1454764&view=diff
==============================================================================
---
sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java
[UTF-8] (original)
+++
sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java
[UTF-8] Sat Mar 9 21:45:39 2013
@@ -75,19 +75,19 @@ public final strictfp class TreeTablesTe
public void testConcatenateSingletons() throws ParseException {
final TreeTable table = TreeTables.parse(
"root\n" +
- "├───users\n" +
- "│ └───alice\n" +
- "│ ├───data\n" +
- "│ │ └───mercator\n" +
- "│ └───document\n" +
- "└───lib\n", NAME);
+ " ├─users\n" +
+ " │ └─alice\n" +
+ " │ ├─data\n" +
+ " │ │ └─mercator\n" +
+ " │ └─document\n" +
+ " └─lib\n", NAME);
((DefaultTreeTable)
table).setRoot(concatenateSingletons(table.getRoot()));
assertMultilinesEquals(
"root\n" +
- "├───users/alice\n" +
- "│ ├───data/mercator\n" +
- "│ └───document\n" +
- "└───lib\n".replace("/", File.separator), table.toString());
+ " ├─users/alice\n" +
+ " │ ├─data/mercator\n" +
+ " │ └─document\n" +
+ " └─lib\n".replace("/", File.separator), table.toString());
}
/**
@@ -107,14 +107,14 @@ public final strictfp class TreeTablesTe
nodeForPath(files, NAME,
fs.getPath("users","Alice","data","mercator")).setValue(VALUE_AS_NUMBER, 60);
assertMultilinesEquals(
"Root\n" +
- "├───users\n" +
- "│ ├───Alice\n" +
- "│ │ ├───data………………………… 10\n" +
- "│ │ │ └───mercator…… 60\n" +
- "│ │ └───document……………… 50\n" +
- "│ └───Bob……………………………………… 30\n" +
- "│ └───data………………………… 20\n" +
- "└───lib………………………………………………… 40\n", table.toString());
+ " ├─users\n" +
+ " │ ├─Alice\n" +
+ " │ │ ├─data………………………… 10\n" +
+ " │ │ │ └─mercator…… 60\n" +
+ " │ │ └─document……………… 50\n" +
+ " │ └─Bob……………………………………… 30\n" +
+ " │ └─data………………………… 20\n" +
+ " └─lib………………………………………………… 40\n", table.toString());
}
/**
@@ -133,14 +133,14 @@ public final strictfp class TreeTablesTe
nodeForPath(files, NAME, new
File("users/Alice/data/mercator")).setValue(VALUE_AS_NUMBER, 60);
assertMultilinesEquals(
"Root\n" +
- "├───users\n" +
- "│ ├───Alice\n" +
- "│ │ ├───data………………………… 10\n" +
- "│ │ │ └───mercator…… 60\n" +
- "│ │ └───document……………… 50\n" +
- "│ └───Bob……………………………………… 30\n" +
- "│ └───data………………………… 20\n" +
- "└───lib………………………………………………… 40\n", table.toString());
+ " ├─users\n" +
+ " │ ├─Alice\n" +
+ " │ │ ├─data………………………… 10\n" +
+ " │ │ │ └─mercator…… 60\n" +
+ " │ │ └─document……………… 50\n" +
+ " │ └─Bob……………………………………… 30\n" +
+ " │ └─data………………………… 20\n" +
+ " └─lib………………………………………………… 40\n", table.toString());
}
/**