1 19 20 package org.netbeans.editor; 21 22 40 41 42 public interface DrawLayer { 43 44 47 public static final String TEXT_FRAME_START_POSITION_COMPONENT_PROPERTY 48 = "text-frame-start-position"; 50 53 public static final String TEXT_FRAME_END_POSITION_COMPONENT_PROPERTY 54 = "text-frame-end-position"; 56 59 public String getName(); 60 61 64 public boolean extendsEOL(); 65 66 69 public boolean extendsEmptyLine(); 70 71 76 public int getNextActivityChangeOffset(DrawContext ctx); 77 78 85 public void init(DrawContext ctx); 86 87 103 public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark); 104 105 110 public void updateContext(DrawContext ctx); 111 112 129 public int updateLineNumberContext(int lineNumber, DrawContext ctx); 130 131 137 public static abstract class AbstractLayer implements DrawLayer { 138 139 142 private String name; 143 144 147 int nextActivityChangeOffset = Integer.MAX_VALUE; 148 149 150 public AbstractLayer(String name) { 151 this.name = name; 152 } 153 154 public String getName() { 155 return name; 156 } 157 158 public boolean extendsEOL() { 159 return false; 160 } 161 162 public boolean extendsEmptyLine() { 163 return false; 164 } 165 166 public int getNextActivityChangeOffset(DrawContext ctx) { 167 return nextActivityChangeOffset; 168 } 169 170 public void setNextActivityChangeOffset(int nextActivityChangeOffset) { 171 this.nextActivityChangeOffset = nextActivityChangeOffset; 172 } 173 174 public void init(DrawContext ctx) { 175 } 176 177 public int updateLineNumberContext(int lineNumber, DrawContext ctx) { 178 return lineNumber; 179 } 180 181 public String toString() { 182 return "Layer " + getClass() + ", name='" + name; } 184 185 } 186 187 } 188 | Popular Tags |