Lines 25-44
Link Here
|
25 |
* @author hudsonr |
25 |
* @author hudsonr |
26 |
* @since 2.1 |
26 |
* @since 2.1 |
27 |
*/ |
27 |
*/ |
28 |
class FlowUtilities |
28 |
public class FlowUtilities |
29 |
extends FigureUtilities |
29 |
extends FigureUtilities |
30 |
{ |
30 |
{ |
31 |
|
31 |
|
32 |
interface LookAhead { |
32 |
public interface LookAhead { |
33 |
int getWidth(); |
33 |
int getWidth(); |
34 |
} |
34 |
} |
35 |
private static int ELLIPSIS_SIZE; |
35 |
private static int ELLIPSIS_SIZE; |
36 |
private static final BreakIterator INTERNAL_LINE_BREAK = BreakIterator.getLineInstance(); |
36 |
private static final BreakIterator INTERNAL_LINE_BREAK = BreakIterator.getLineInstance(); |
37 |
private static TextLayout layout; |
37 |
private static TextLayout layout; |
38 |
|
38 |
|
39 |
static final BreakIterator LINE_BREAK = BreakIterator.getLineInstance(); |
39 |
public static final BreakIterator LINE_BREAK = BreakIterator.getLineInstance(); |
40 |
|
40 |
|
41 |
static boolean canBreakAfter(char c) { |
41 |
public static boolean canBreakAfter(char c) { |
42 |
boolean result = Character.isWhitespace(c) || c == '-'; |
42 |
boolean result = Character.isWhitespace(c) || c == '-'; |
43 |
if (!result && (c < 'a' || c > 'z')) { |
43 |
if (!result && (c < 'a' || c > 'z')) { |
44 |
// chinese characters and such would be caught in here |
44 |
// chinese characters and such would be caught in here |
Lines 49-55
Link Here
|
49 |
return result; |
49 |
return result; |
50 |
} |
50 |
} |
51 |
|
51 |
|
52 |
private static int findFirstDelimeter(String string) { |
52 |
protected static int findFirstDelimeter(String string) { |
53 |
int macNL = string.indexOf('\r'); |
53 |
int macNL = string.indexOf('\r'); |
54 |
int unixNL = string.indexOf('\n'); |
54 |
int unixNL = string.indexOf('\n'); |
55 |
|
55 |
|
Lines 107-113
Link Here
|
107 |
* @return an SWT TextLayout that can be used for Bidi |
107 |
* @return an SWT TextLayout that can be used for Bidi |
108 |
* @since 3.1 |
108 |
* @since 3.1 |
109 |
*/ |
109 |
*/ |
110 |
static TextLayout getTextLayout() { |
110 |
public static TextLayout getTextLayout() { |
111 |
if (layout == null) |
111 |
if (layout == null) |
112 |
layout = new TextLayout(Display.getDefault()); |
112 |
layout = new TextLayout(Display.getDefault()); |
113 |
layout.setOrientation(SWT.LEFT_TO_RIGHT); |
113 |
layout.setOrientation(SWT.LEFT_TO_RIGHT); |
Lines 120-126
Link Here
|
120 |
* @param font |
120 |
* @param font |
121 |
* @since 3.1 |
121 |
* @since 3.1 |
122 |
*/ |
122 |
*/ |
123 |
private static void initBidi(TextFragmentBox frag, String string, Font font) { |
123 |
protected static void initBidi(TextFragmentBox frag, String string, Font font) { |
124 |
if (frag.requiresBidi()) { |
124 |
if (frag.requiresBidi()) { |
125 |
TextLayout textLayout = getTextLayout(); |
125 |
TextLayout textLayout = getTextLayout(); |
126 |
textLayout.setFont(font); |
126 |
textLayout.setFont(font); |