本文整理汇总了Java中org.netbeans.modules.editor.errorstripe.privatespi.Mark类的典型用法代码示例。如果您正苦于以下问题:Java Mark类的具体用法?Java Mark怎么用?Java Mark使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Mark类属于org.netbeans.modules.editor.errorstripe.privatespi包,在下文中一共展示了Mark类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMainMarkForBlock
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
public Mark getMainMarkForBlock(int startLine, int endLine) {
Mark m1;
synchronized(this) {
m1 = getMainMarkForBlockImpl(startLine, endLine, getMarkMap());
}
Mark m2 = getMainMarkForBlockAnnotations(startLine, endLine);
if (m1 == null)
return m2;
if (m2 == null)
return m1;
if (isMoreImportant(m1, m2))
return m1;
else
return m2;
}
示例2: registerMark
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
private void registerMark(Mark mark) {
int[] span = mark.getAssignedLines();
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("AnnotationView.registerMark mark: " + mark + "; from-to: " + span[0] + "-" + span[1]); //NOI18N
}
for (int line = span[0]; line <= span[1]; line++) {
List<Mark> inside = marksMap.get(line);
if (inside == null) {
inside = new ArrayList<Mark>();
marksMap.put(line, inside);
}
inside.add(mark);
}
}
示例3: unregisterMark
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
private void unregisterMark(Mark mark) {
int[] span = mark.getAssignedLines();
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("AnnotationView.unregisterMark mark: " + mark + "; from-to: " + span[0] + "-" + span[1]); //NOI18N
}
for (int line = span[0]; line <= span[1]; line++) {
List<Mark> inside = marksMap.get(line);
if (inside != null) {
inside.remove(mark);
if (inside.size() == 0) {
marksMap.remove(line);
}
}
}
}
示例4: caretUpdate
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
@Override
public void caretUpdate(CaretEvent e) {
final List<Mark> old = getMarks();
marks = createMarks();
final List<Mark> nue = getMarks();
//Do not fire this event under the document's write lock
//may deadlock with other providers:
RP.post(new Runnable() {
@Override
public void run() {
firePropertyChange(PROP_MARKS, old, nue);
}
});
}
示例5: testMarkSensitiveStripe1
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
public void testMarkSensitiveStripe1() throws Exception {
performTest(new Action() {
public void test(AnnotationView aView, BaseDocument document) throws Exception {
double position = aView.modelToView(6);
double start = position - AnnotationView.UPPER_HANDLE;
double end = position + AnnotationView.PIXELS_FOR_LINE + AnnotationView.LOWER_HANDLE - 1;
for (double pos = start; pos <= end; pos++) {
Mark m = aView.getMarkForPoint(pos);
assertNotNull("pos=" + pos + ", start=" + start + ", end=" + end + ", position=" + position, m);
}
Mark m1 = aView.getMarkForPoint(start - 1);
assertNull("There is a mark at position: " + (start - 1), m1);
Mark m2 = aView.getMarkForPoint(end + 1);
assertNull("There is a mark at position: " + (end + 1), m2);
}
});
}
示例6: setSematic
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
public void setSematic(Collection<Mark> s) {
List<Mark> old;
List<Mark> nue;
synchronized (this) {
semantic = new ArrayList<Mark>(s);
old = joint;
nue = joint = new ArrayList<Mark>();
joint.addAll(semantic);
joint.addAll(occurrences);
}
//#85919: fire outside the lock:
firePropertyChange(PROP_MARKS, old, nue);
}
示例7: setOccurrences
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
public void setOccurrences(Collection<Mark> s) {
List<Mark> old;
List<Mark> nue;
synchronized (this) {
occurrences = new ArrayList<Mark>(s);
old = joint;
nue = joint = new ArrayList<Mark>();
joint.addAll(semantic);
joint.addAll(occurrences);
}
//#85919: fire outside the lock:
firePropertyChange(PROP_MARKS, old, nue);
}
示例8: createMarks
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
public static Collection<Mark> createMarks(final Document doc, final List<OffsetRange> bag, final Color color, final String tooltip) {
final List<Mark> result = new LinkedList<Mark>();
doc.render(new Runnable() {
public void run() {
//for (int[] span : bag) {
for (OffsetRange span : bag) {
try {
//if (span[0] < doc.getLength()) {
if (span.getStart() < doc.getLength()) {
//result.add(new MarkImpl(doc, doc.createPosition(span[0]), color, tooltip));
result.add(new MarkImpl(doc, doc.createPosition(span.getStart()), color, tooltip));
}
} catch (BadLocationException ex) {
Exceptions.printStackTrace(ex);
}
}
}
});
return result;
}
示例9: createMarks
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
public static Collection<Mark> createMarks(final Document doc, final List<int[]> bag, final Color color, final String tooltip) {
final List<Mark> result = new LinkedList<Mark>();
doc.render(new Runnable() {
public void run() {
int docLen = doc.getLength();
for (int[] span : bag) {
try {
int offset = span[0];
if (offset >= 0 && offset <= docLen) {
result.add(new MarkImpl(doc, doc.createPosition(offset), color, tooltip));
}
} catch (BadLocationException ex) {
Exceptions.printStackTrace(ex);
}
}
}
});
return result;
}
示例10: createMergedMarks
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
static Collection<Mark> createMergedMarks(List<MarkProvider> providers) {
Collection<Mark> result = new LinkedHashSet<Mark>();
for(MarkProvider provider : providers) {
result.addAll(provider.getMarks());
}
return result;
}
示例11: getMergedMarks
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
synchronized Collection<Mark> getMergedMarks() {
if (currentMarks == null) {
currentMarks = createMergedMarks(markProviders);
}
return new ArrayList<Mark>(currentMarks);
}
示例12: getMainMarkForBlockImpl
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
static Mark getMainMarkForBlockImpl(int startLine, int endLine, SortedMap<Integer, List<Mark>> marks) {
int current = startLine - 1;
Mark found = null;
while ((current = findNextUsedLine(current, marks)) != Integer.MAX_VALUE && current <= endLine) {
for (Mark newMark : getStatusesForLineImpl(/*doc, */current, marks)) {
if (found == null || isMoreImportant(newMark, found)) {
found = newMark;
}
}
}
return found;
}
示例13: isMoreImportant
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
private static boolean isMoreImportant(Mark m1, Mark m2) {
int compared = m1.getStatus().compareTo(m2.getStatus());
if (compared == 0)
return m1.getPriority() < m2.getPriority();
return compared > 0;
}
示例14: getMainMarkForBlockAnnotations
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
private Mark getMainMarkForBlockAnnotations(int startLine, int endLine) {
AnnotationDesc foundDesc = null;
for (AnnotationDesc desc : NbCollections.iterable(listAnnotations(startLine, endLine))) {
if ((foundDesc == null || isMoreImportant(desc, foundDesc)) && isValidForErrorStripe(desc))
foundDesc = desc;
}
if (foundDesc != null)
return new AnnotationMark(foundDesc);
else
return null;
}
示例15: findNextUsedLine
import org.netbeans.modules.editor.errorstripe.privatespi.Mark; //导入依赖的package包/类
static int findNextUsedLine(int from, SortedMap<Integer, List<Mark>> marks) {
SortedMap<Integer, List<Mark>> next = marks.tailMap(from + 1);
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("AnnotationView.findNextUsedLine from: " + from + "; marks: " + marks + "; next: " + next); //NOI18N
}
if (next.isEmpty()) {
return Integer.MAX_VALUE;
}
return next.firstKey().intValue();
}