1 11 package org.eclipse.ui.internal.forms.widgets; 12 13 import java.util.Hashtable ; 14 15 import org.eclipse.swt.graphics.FontMetrics; 16 import org.eclipse.swt.graphics.GC; 17 import org.eclipse.swt.graphics.Rectangle; 18 19 23 24 public class BreakSegment extends ParagraphSegment { 25 28 public boolean advanceLocator(GC gc, int wHint, Locator locator, 29 Hashtable objectTable, boolean computeHeightOnly) { 30 if (locator.rowHeight==0) { 31 FontMetrics fm = gc.getFontMetrics(); 32 locator.rowHeight = fm.getHeight(); 33 } 34 if (computeHeightOnly) locator.collectHeights(); 35 locator.x = locator.indent; 36 locator.y += locator.rowHeight; 37 locator.rowHeight = 0; 38 locator.leading = 0; 39 return true; 40 } 41 42 public void paint(GC gc, boolean hover, Hashtable resourceTable, boolean selected, SelectionData selData, Rectangle repaintRegion) { 43 } 45 public boolean contains(int x, int y) { 46 return false; 47 } 48 public boolean intersects(Rectangle rect) { 49 return false; 50 } 51 54 public void layout(GC gc, int width, Locator locator, Hashtable ResourceTable, 55 boolean selected) { 56 locator.resetCaret(); 57 if (locator.rowHeight==0) { 58 FontMetrics fm = gc.getFontMetrics(); 59 locator.rowHeight = fm.getHeight(); 60 } 61 locator.y += locator.rowHeight; 62 locator.rowHeight = 0; 63 locator.rowCounter++; 64 } 65 66 69 public void computeSelection(GC gc, Hashtable resourceTable, SelectionData selData) { 70 selData.markNewLine(); 71 } 72 } 73 | Popular Tags |