blob: e9e5f663ceac03ddcd9165beb56cc343a2179f9b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
/*******************************************************************************
* Copyright (c) 2004, 2008 John Krasnay and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* John Krasnay - initial API and implementation
*******************************************************************************/
package org.eclipse.vex.core.internal.layout;
import java.net.URL;
import org.eclipse.vex.core.internal.css.StyleSheet;
import org.eclipse.vex.core.internal.css.StyleSheetReader;
import org.eclipse.vex.core.internal.layout.CssBoxFactory;
import org.eclipse.vex.core.internal.layout.LayoutContext;
import junit.framework.TestCase;
public class TestParagraphBox extends TestCase {
FakeGraphics g;
LayoutContext context;
public TestParagraphBox() throws Exception {
URL url = this.getClass().getResource("test.css");
StyleSheetReader reader = new StyleSheetReader();
StyleSheet ss = reader.read(url);
this.g = new FakeGraphics();
this.context = new LayoutContext();
this.context.setBoxFactory(new CssBoxFactory());
this.context.setGraphics(this.g);
this.context.setStyleSheet(ss);
}
/*
* public void testWordWrap() throws Exception { RootElement root = new
* RootElement("root"); Document doc = new Document(root);
*
* Styles styles = this.context.getStyleSheet().getStyles(root);
*
* FontMetrics fm = this.g.getFontMetrics();
*
* // Test Case 1: check the offsets // // UPPER CASE indicates static text
* // lower case indicates document text // [ ] represent element start and
* end // // BLACK WHITE GRAY // RED [orange] YELLOW (line is 1:8,
* last=false) // BLACK WHITE GRAY // [blue] GREEN [pink] (line is 9:20
* last=true) // BLACK WHITE GRAY // // Document looks like this (# chars
* are element sentinels // 2 8 16 20 // / / / / // ##orange##blue##pink##
* // \ \ // 10 14 //
*
* }
*/
}
|