/** * Returns the document model underlying the view. * * @return the model */ @Override public Document getDocument() { return view.getDocument(); }
/** * Returns the document model underlying the view. * * @return the model */ @Override public Document getDocument() { return view == null ? null : view.getDocument(); }
@Override public Document getDocument() { return view.getDocument(); }
/** * Returns the document model underlying the view. * * @return the model */ @Override public Document getDocument() { return view.getDocument(); }
/** * Returns the document model underlying the view. * * @return the model */ @Override public Document getDocument() { return view == null ? null : view.getDocument(); }
/** * Returns the document model underlying the view. * * @return the model */ @Override public Document getDocument() { return view == null ? null : view.getDocument(); }
/** * Returns the document model underlying the view. * * @return the model */ @Override public Document getDocument() { return view.getDocument(); }
/** * Returns the document model underlying the view. * * @return the model */ @Override public Document getDocument() { return view == null ? null : view.getDocument(); }
/** * Returns the document model underlying the view. * * @return the model */ @Override public Document getDocument() { return view.getDocument(); }
/** * Returns the document model underlying the view. * * @return the model */ @Override public Document getDocument() { return view.getDocument(); }
/** * Returns the document model underlying the view. * * @return the model */ public Document getDocument() { return view == null ? null : view.getDocument(); }
pos = Math.min(pos + 1, view.getDocument().getLength()); if (target.isCodeFoldingEnabled()) { int last = pos==0 ? 0 : target.getLineOfOffset(pos-1);
public Document getDocument() { View parent = getParent(); return (parent == null) ? null : parent.getDocument(); }
@Override public Document getDocument() { View parent = getParent(); return (parent != null) ? parent.getDocument() : null; }
/** * Gets the element that this view is mapped to. * * @return the view */ public Element getElement() { if (view != null) { return view.getElement(); } return view.getDocument().getDefaultRootElement(); }
public static View drawHtmlText(Graphics _g, JComponent _parent, String _text, Rectangle _bounds) { if (_text == null || _text.equals("")) { return null; } View v = BasicHTML.createHTMLView(_parent, _text); HTMLDocument doc=(HTMLDocument)v.getDocument(); doc.getStyleSheet().addRule("body { color: #000000,padding:2px}"); v.paint(_g, _bounds); return v; }
public String getLink(Point p){ View view = (View)getClientProperty(BasicHTML.propertyKey); if(view == null) return null; Rectangle textR = ((ZoomableLabelUI)getUI()).getTextR(this); if(textR == null) return null; if(!textR.contains(p)) return null; int x = (int) (p.x / getZoom()); int y = (int) (p.y / getZoom()); final int pos = view.viewToModel(x, y, textR); final HTMLDocument document = (HTMLDocument) view.getDocument(); final String linkURL = HtmlUtils.getURLOfExistingLink(document, pos); return linkURL; }
private void cacheLinkElements() { this.linkCache = new ArrayList<>(); final View view = (View) this.getClientProperty("html"); //NOI18N if (view != null) { final HTMLDocument doc = (HTMLDocument) view.getDocument(); final HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.A); while (it.isValid()) { final SimpleAttributeSet s = (SimpleAttributeSet) it.getAttributes(); final String link = (String) s.getAttribute(HTML.Attribute.HREF); if (link != null) { this.linkCache.add(new HtmlLinkAddress(link, it.getStartOffset(), it.getEndOffset())); } it.next(); } } }
public void setViewData(View v) { doc = (HTMLDocument) v.getDocument(); textAttribs = new SimpleAttributeSet(); textAttribs.removeAttribute(FontSize); textAttribs.removeAttribute(Bold); textAttribs.removeAttribute(Italic); Font font = getFont(); textAttribs.addAttribute(FontFamily, font.getName()); textAttribs.addAttribute(FontSize, font.getSize()); textAttribs.addAttribute(Bold, font.isBold()); textAttribs.addAttribute(Italic, font.isItalic()); }
private void initView() { String text = getText(); if (getGrid() == null) return; if (CtuluLibString.isEmpty(text)) { text = "<html><body><p></p></body></html>"; setW(10); setH(10); } view_ = BasicHTML.createHTMLView(getGrid(), text); HTMLDocument doc = (HTMLDocument) view_.getDocument(); doc.getStyleSheet().addRule("body { color: #000000;padding: 4px}"); }