rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
super(children, next);
|
LiteralNode(TemplateNode children, TemplateNode next, Node source) { super(children, next); this.source = source; if (source.getNodeType() == Node.ELEMENT_NODE) { NamedNodeMap attrs = source.getAttributes(); Node attr = attrs.getNamedItemNS(Stylesheet.XSL_NS, "exclude-result-prefixes"); if (attr != null) { elementExcludeResultPrefixes = new HashSet(); StringTokenizer st = new StringTokenizer(attr.getNodeValue()); while (st.hasMoreTokens()) { elementExcludeResultPrefixes.add(st.nextToken()); } } else { elementExcludeResultPrefixes = Collections.EMPTY_SET; } } else { elementExcludeResultPrefixes = null; } }
|
|
return new LiteralNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), source);
|
TemplateNode ret = new LiteralNode(source); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret;
|
TemplateNode clone(Stylesheet stylesheet) { return new LiteralNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), source); }
|
result = doc.adoptNode(result); if (result == null)
|
Node result2 = doc.adoptNode(result); if (result2 == null)
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { Node result = null; Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); short nodeType = source.getNodeType(); if (nodeType == Node.ATTRIBUTE_NODE && parent.getFirstChild() != null) { // Ignore attributes added after child elements } else { // Namespace aliasing if (nodeType == Node.ELEMENT_NODE) { String prefix = source.getPrefix(); if (prefix == null) { prefix = "#default"; } String resultPrefix = (String) stylesheet.namespaceAliases.get(prefix); if (resultPrefix != null) { if ("#default".equals(resultPrefix)) { resultPrefix = null; } String uri = source.lookupNamespaceURI(resultPrefix); String name = source.getNodeName(); // Create a new element node in the result document result = doc.createElementNS(uri, name); // copy attributes NamedNodeMap srcAttrs = source.getAttributes(); NamedNodeMap dstAttrs = result.getAttributes(); int l = srcAttrs.getLength(); for (int i = 0; i < l; i++) { Node attr = srcAttrs.item(i); if (!Stylesheet.XSL_NS.equals(attr.getNamespaceURI())) { attr = attr.cloneNode(true); attr = doc.adoptNode(attr); dstAttrs.setNamedItemNS(attr); } } } } if (result == null) { // Create result node result = source.cloneNode(false); // Remove any XSL attributes NamedNodeMap attrs = result.getAttributes(); if (attrs != null) { int l = attrs.getLength(); for (int i = 0; i < l; i++) { Node attr = attrs.item(i); if (Stylesheet.XSL_NS.equals(attr.getNamespaceURI())) { attrs.removeNamedItem(attr.getNodeName()); i--; l--; } } } result = doc.adoptNode(result); if (result == null) { String msg = "Error adopting node to result tree"; DOMSourceLocator l = new DOMSourceLocator(context); throw new TransformerException(msg, l); } } if (nextSibling != null) { parent.insertBefore(result, nextSibling); } else { parent.appendChild(result); } if (nodeType == Node.ELEMENT_NODE) { stylesheet.addNamespaceNodes(source, result, doc, elementExcludeResultPrefixes); } // children if (children != null) { children.apply(stylesheet, mode, context, pos, len, result, null); } } // next sibling if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
|
String msg = "Error adopting node to result tree";
|
String msg = "Error adopting node to result tree: " + result + " (" + result.getClass().getName() + ")";
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { Node result = null; Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); short nodeType = source.getNodeType(); if (nodeType == Node.ATTRIBUTE_NODE && parent.getFirstChild() != null) { // Ignore attributes added after child elements } else { // Namespace aliasing if (nodeType == Node.ELEMENT_NODE) { String prefix = source.getPrefix(); if (prefix == null) { prefix = "#default"; } String resultPrefix = (String) stylesheet.namespaceAliases.get(prefix); if (resultPrefix != null) { if ("#default".equals(resultPrefix)) { resultPrefix = null; } String uri = source.lookupNamespaceURI(resultPrefix); String name = source.getNodeName(); // Create a new element node in the result document result = doc.createElementNS(uri, name); // copy attributes NamedNodeMap srcAttrs = source.getAttributes(); NamedNodeMap dstAttrs = result.getAttributes(); int l = srcAttrs.getLength(); for (int i = 0; i < l; i++) { Node attr = srcAttrs.item(i); if (!Stylesheet.XSL_NS.equals(attr.getNamespaceURI())) { attr = attr.cloneNode(true); attr = doc.adoptNode(attr); dstAttrs.setNamedItemNS(attr); } } } } if (result == null) { // Create result node result = source.cloneNode(false); // Remove any XSL attributes NamedNodeMap attrs = result.getAttributes(); if (attrs != null) { int l = attrs.getLength(); for (int i = 0; i < l; i++) { Node attr = attrs.item(i); if (Stylesheet.XSL_NS.equals(attr.getNamespaceURI())) { attrs.removeNamedItem(attr.getNodeName()); i--; l--; } } } result = doc.adoptNode(result); if (result == null) { String msg = "Error adopting node to result tree"; DOMSourceLocator l = new DOMSourceLocator(context); throw new TransformerException(msg, l); } } if (nextSibling != null) { parent.insertBefore(result, nextSibling); } else { parent.appendChild(result); } if (nodeType == Node.ELEMENT_NODE) { stylesheet.addNamespaceNodes(source, result, doc, elementExcludeResultPrefixes); } // children if (children != null) { children.apply(stylesheet, mode, context, pos, len, result, null); } } // next sibling if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
|
result = result2;
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { Node result = null; Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); short nodeType = source.getNodeType(); if (nodeType == Node.ATTRIBUTE_NODE && parent.getFirstChild() != null) { // Ignore attributes added after child elements } else { // Namespace aliasing if (nodeType == Node.ELEMENT_NODE) { String prefix = source.getPrefix(); if (prefix == null) { prefix = "#default"; } String resultPrefix = (String) stylesheet.namespaceAliases.get(prefix); if (resultPrefix != null) { if ("#default".equals(resultPrefix)) { resultPrefix = null; } String uri = source.lookupNamespaceURI(resultPrefix); String name = source.getNodeName(); // Create a new element node in the result document result = doc.createElementNS(uri, name); // copy attributes NamedNodeMap srcAttrs = source.getAttributes(); NamedNodeMap dstAttrs = result.getAttributes(); int l = srcAttrs.getLength(); for (int i = 0; i < l; i++) { Node attr = srcAttrs.item(i); if (!Stylesheet.XSL_NS.equals(attr.getNamespaceURI())) { attr = attr.cloneNode(true); attr = doc.adoptNode(attr); dstAttrs.setNamedItemNS(attr); } } } } if (result == null) { // Create result node result = source.cloneNode(false); // Remove any XSL attributes NamedNodeMap attrs = result.getAttributes(); if (attrs != null) { int l = attrs.getLength(); for (int i = 0; i < l; i++) { Node attr = attrs.item(i); if (Stylesheet.XSL_NS.equals(attr.getNamespaceURI())) { attrs.removeNamedItem(attr.getNodeName()); i--; l--; } } } result = doc.adoptNode(result); if (result == null) { String msg = "Error adopting node to result tree"; DOMSourceLocator l = new DOMSourceLocator(context); throw new TransformerException(msg, l); } } if (nextSibling != null) { parent.insertBefore(result, nextSibling); } else { parent.appendChild(result); } if (nodeType == Node.ELEMENT_NODE) { stylesheet.addNamespaceNodes(source, result, doc, elementExcludeResultPrefixes); } // children if (children != null) { children.apply(stylesheet, mode, context, pos, len, result, null); } } // next sibling if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
|
|
public String getSystemId() { return baseID; }
|
public String getSystemId() { return systemId; }
|
public String getSystemId() { return baseID; } // getSystemId()
|
public void setSystemId(String systemID) { baseID = systemID; }
|
public void setSystemId(String systemId) { this.systemId = systemId; }
|
public void setSystemId(String systemID) { baseID = systemID; } // setSystemId()
|
return null;
|
return new BreadthFirstEnumeration(this);
|
public Enumeration breadthFirstEnumeration() { return null; // TODO: Implement me. }
|
return null;
|
return new PostorderEnumeration(this);
|
public Enumeration postorderEnumeration() { return null; // TODO: Implement me. }
|
return null;
|
return new PreorderEnumeration(this);
|
public Enumeration preorderEnumeration() { return null; // TODO: Implement me. }
|
parent.remove(this);
|
public void removeFromParent() { // FIXME: IS this implementation really correct ? parent = null; }
|
|
if (content == null) { caret.setDot(dot); return; }
|
int p0 = Math.min (dot, mark); int p1 = Math.max (dot, mark);
|
public void replaceSelection(String content) { Caret caret = getCaret(); StyledDocument doc = getStyledDocument(); int dot = caret.getDot(); int mark = caret.getMark(); // If content is empty delete selection. if (content == null) { caret.setDot(dot); return; } try { int start = getSelectionStart(); int end = getSelectionEnd(); int contentLength = content.length(); // Remove selected text. if (dot != mark) doc.remove(start, end - start); // Insert new text. doc.insertString(start, content, null); // Set attributes for inserted text doc.setCharacterAttributes(start, contentLength, getInputAttributes(), true); } catch (BadLocationException e) { throw new AssertionError ("No BadLocationException should be thrown here"); } }
|
int start = getSelectionStart(); int end = getSelectionEnd(); int contentLength = content.length();
|
if (doc instanceof AbstractDocument) ((AbstractDocument)doc).replace(p0, p1 - p0, content, a); else {
|
public void replaceSelection(String content) { Caret caret = getCaret(); StyledDocument doc = getStyledDocument(); int dot = caret.getDot(); int mark = caret.getMark(); // If content is empty delete selection. if (content == null) { caret.setDot(dot); return; } try { int start = getSelectionStart(); int end = getSelectionEnd(); int contentLength = content.length(); // Remove selected text. if (dot != mark) doc.remove(start, end - start); // Insert new text. doc.insertString(start, content, null); // Set attributes for inserted text doc.setCharacterAttributes(start, contentLength, getInputAttributes(), true); } catch (BadLocationException e) { throw new AssertionError ("No BadLocationException should be thrown here"); } }
|
doc.remove(start, end - start);
|
doc.remove(p0, p1 - p0);
|
public void replaceSelection(String content) { Caret caret = getCaret(); StyledDocument doc = getStyledDocument(); int dot = caret.getDot(); int mark = caret.getMark(); // If content is empty delete selection. if (content == null) { caret.setDot(dot); return; } try { int start = getSelectionStart(); int end = getSelectionEnd(); int contentLength = content.length(); // Remove selected text. if (dot != mark) doc.remove(start, end - start); // Insert new text. doc.insertString(start, content, null); // Set attributes for inserted text doc.setCharacterAttributes(start, contentLength, getInputAttributes(), true); } catch (BadLocationException e) { throw new AssertionError ("No BadLocationException should be thrown here"); } }
|
doc.insertString(start, content, null); doc.setCharacterAttributes(start, contentLength, getInputAttributes(), true);
|
if (content != null && content.length() > 0) doc.insertString(p0, content, a); }
|
public void replaceSelection(String content) { Caret caret = getCaret(); StyledDocument doc = getStyledDocument(); int dot = caret.getDot(); int mark = caret.getMark(); // If content is empty delete selection. if (content == null) { caret.setDot(dot); return; } try { int start = getSelectionStart(); int end = getSelectionEnd(); int contentLength = content.length(); // Remove selected text. if (dot != mark) doc.remove(start, end - start); // Insert new text. doc.insertString(start, content, null); // Set attributes for inserted text doc.setCharacterAttributes(start, contentLength, getInputAttributes(), true); } catch (BadLocationException e) { throw new AssertionError ("No BadLocationException should be thrown here"); } }
|
public Style addStyle(String nm, Style parent);
|
Style addStyle(String nm, Style parent);
|
public Style addStyle(String nm, Style parent);
|
public Element getCharacterElement(int position);
|
Element getCharacterElement(int position);
|
public Element getCharacterElement(int position);
|
public Style getLogicalStyle(int position);
|
Style getLogicalStyle(int position);
|
public Style getLogicalStyle(int position);
|
public abstract Element getParagraphElement(int position);
|
Element getParagraphElement(int position);
|
public abstract Element getParagraphElement(int position);
|
public Style getStyle(String nm);
|
Style getStyle(String nm);
|
public Style getStyle(String nm);
|
public void removeStyle(String nm);
|
void removeStyle(String nm);
|
public void removeStyle(String nm);
|
public void setCharacterAttributes(int offset, int length,
|
void setCharacterAttributes(int offset, int length,
|
public void setCharacterAttributes(int offset, int length, AttributeSet set, boolean replace);
|
public void setLogicalStyle(int position, Style style);
|
void setLogicalStyle(int position, Style style);
|
public void setLogicalStyle(int position, Style style);
|
sizes[1] = available - sizes[0] - sizes[1];
|
sizes[1] = available - sizes[0] - sizes[2];
|
public void layoutContainer(Container container) { if (container instanceof JSplitPane) { JSplitPane split = (JSplitPane) container; distributeExtraSpace(); Insets insets = split.getInsets(); Dimension dims = split.getSize(); int loc = getInitialLocation(insets); int available = getAvailableSize(dims, insets); sizes[0] = getDividerLocation(split) - loc; sizes[1] = available - sizes[0] - sizes[1]; // The size of the divider won't change. // Layout component#1. setComponentToSize(components[0], sizes[0], loc, insets, dims); // Layout divider. loc += sizes[0]; setComponentToSize(components[2], sizes[2], loc, insets, dims); // Layout component#2. loc += sizes[2]; setComponentToSize(components[1], sizes[1], loc, insets, dims); } }
|
setDividerLocation(splitPane, getInitialLocation(splitPane.getInsets()) + sizes[0]);
|
public void resetToPreferredSizes() { for (int i = 0; i < components.length; i++) resetSizeAt(i); }
|
|
layoutManager.layoutContainer(splitPane); splitPane.repaint();
|
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JSplitPane.DIVIDER_SIZE_PROPERTY)) { int newSize = splitPane.getDividerSize(); int[] tmpSizes = layoutManager.getSizes(); dividerSize = tmpSizes[2]; int newSpace = newSize - tmpSizes[2]; tmpSizes[2] = newSize; tmpSizes[0] += newSpace / 2; tmpSizes[1] += newSpace / 2; layoutManager.setSizes(tmpSizes); } else if (e.getPropertyName().equals(JSplitPane.ORIENTATION_PROPERTY)) { int max = layoutManager.getAvailableSize(splitPane.getSize(), splitPane.getInsets()); int dividerLoc = getDividerLocation(splitPane); double prop = ((double) dividerLoc) / max; resetLayoutManager(); if (prop <= 1 && prop >= 0) splitPane.setDividerLocation(prop); } layoutManager.layoutContainer(splitPane); splitPane.repaint(); // Don't have to deal with continuous_layout - only // necessary in dragging modes (and it's checked // every time you drag there) // Don't have to deal with resize_weight (as there // will be no extra space associated with this // event - the changes to the weighting will // be taken into account the next time the // sizes change.) // Don't have to deal with divider_location // The method in JSplitPane calls our setDividerLocation // so we'll know about those anyway. // Don't have to deal with last_divider_location // Although I'm not sure why, it doesn't seem to // have any effect on Sun's JSplitPane. // one_touch_expandable changes are dealt with // by our divider. }
|
|
nonContinuousLayoutDivider.setBackground(Color.DARK_GRAY);
|
Color c = UIManager.getColor("SplitPaneDivider.draggingColor"); nonContinuousLayoutDivider.setBackground(c);
|
protected Component createDefaultNonContinuousLayoutDivider() { if (nonContinuousLayoutDivider == null) { nonContinuousLayoutDivider = new Canvas(); nonContinuousLayoutDivider.setBackground(Color.DARK_GRAY); } return nonContinuousLayoutDivider; }
|
dragDividerTo(location);
|
protected void finishDraggingTo(int location) { if (nonContinuousLayoutDivider != null) nonContinuousLayoutDivider.setVisible(false); draggingHW = false; location = validLocation(location); dragDividerTo(location); splitPane.setDividerLocation(location); splitPane.setLastDividerLocation(beginDragDividerLocation); beginDragDividerLocation = -1; splitPane.repaint(); }
|
|
splitPane.repaint();
|
protected void finishDraggingTo(int location) { if (nonContinuousLayoutDivider != null) nonContinuousLayoutDivider.setVisible(false); draggingHW = false; location = validLocation(location); dragDividerTo(location); splitPane.setDividerLocation(location); splitPane.setLastDividerLocation(beginDragDividerLocation); beginDragDividerLocation = -1; splitPane.repaint(); }
|
|
dividerLocation = validLocation(location);
|
dividerLocation = location;
|
public void setDividerLocation(JSplitPane jc, int location) { dividerLocation = validLocation(location); splitPane.revalidate(); splitPane.repaint(); }
|
splitPane.revalidate(); splitPane.repaint();
|
protected void startDragging() { Component left = splitPane.getLeftComponent(); Component right = splitPane.getRightComponent(); dividerSize = divider.getDividerSize(); setLastDragLocation(-1); if ((left != null && !left.isLightweight()) || (right != null && !right.isLightweight())) draggingHW = true; if (splitPane.isContinuousLayout()) nonContinuousLayoutDivider.setVisible(false); else { nonContinuousLayoutDivider.setVisible(true); nonContinuousLayoutDivider.setBounds(divider.getBounds()); } splitPane.revalidate(); splitPane.repaint(); }
|
|
this(prefs, new OutputStreamWriter(os));
|
this.prefs = prefs; Writer w; try { w = new OutputStreamWriter(os, "UTF-8"); } catch (UnsupportedEncodingException uee) { InternalError ie = new InternalError("UTF-8 encoding missing"); ie.initCause(uee); throw ie; } this.bw = new BufferedWriter(w);
|
public NodeWriter(Preferences prefs, OutputStream os) { this(prefs, new OutputStreamWriter(os)); }
|
bw.newLine(); bw.write("<!DOCTYPE preferences SYSTEM " + "\"http:
|
private void writeHeader() throws BackingStoreException, IOException { bw.write("<?xml version=\"1.0\"?>"); bw.newLine(); bw.newLine(); bw.write("<!-- GNU Classpath java.util.prefs Preferences "); if (prefs.isUserNode()) { bw.write("user"); } else { bw.write("system"); } // root node? if (prefs.parent() == null) { bw.write(" root"); } if (subtree) { bw.write(" tree"); } else { bw.write(" node"); } // no root? if (prefs.parent() != null) { bw.newLine(); bw.write(" '"); bw.write(prefs.absolutePath()); bw.write('\''); bw.newLine(); } bw.write(" -->"); bw.newLine(); bw.newLine(); }
|
|
if (menu.parent != null) menu.parent.remove(menu);
|
MenuBarPeer myPeer = (MenuBarPeer) getPeer ();
|
public synchronized Menu add(Menu menu) { if (menu.parent != null) menu.parent.remove(menu); menu.parent = this; menus.addElement(menu); if (peer != null) menu.addNotify(); return menu; }
|
menu.parent = this;
|
MenuContainer parent = menu.getParent(); if (parent != null) parent.remove(menu);
|
public synchronized Menu add(Menu menu) { if (menu.parent != null) menu.parent.remove(menu); menu.parent = this; menus.addElement(menu); if (peer != null) menu.addNotify(); return menu; }
|
if (peer != null)
|
if (myPeer != null) {
|
public synchronized Menu add(Menu menu) { if (menu.parent != null) menu.parent.remove(menu); menu.parent = this; menus.addElement(menu); if (peer != null) menu.addNotify(); return menu; }
|
myPeer.addMenu(menu); }
|
public synchronized Menu add(Menu menu) { if (menu.parent != null) menu.parent.remove(menu); menu.parent = this; menus.addElement(menu); if (peer != null) menu.addNotify(); return menu; }
|
|
if (getPeer() == null) setPeer(getToolkit().createMenuBar(this));
|
MenuBarPeer peer = (MenuBarPeer) getPeer(); if (peer == null) { peer = getToolkit().createMenuBar(this); setPeer(peer); }
|
public void addNotify() { if (getPeer() == null) setPeer(getToolkit().createMenuBar(this)); Enumeration e = menus.elements(); while (e.hasMoreElements()) { Menu mi = (Menu)e.nextElement(); mi.addNotify(); } if (helpMenu != null) { helpMenu.addNotify(); ((MenuBarPeer) peer).addHelpMenu(helpMenu); } }
|
((MenuBarPeer) peer).addHelpMenu(helpMenu);
|
peer.addHelpMenu(helpMenu);
|
public void addNotify() { if (getPeer() == null) setPeer(getToolkit().createMenuBar(this)); Enumeration e = menus.elements(); while (e.hasMoreElements()) { Menu mi = (Menu)e.nextElement(); mi.addNotify(); } if (helpMenu != null) { helpMenu.addNotify(); ((MenuBarPeer) peer).addHelpMenu(helpMenu); } }
|
Menu m = (Menu) menus.get(index); menus.remove(index);
|
Menu m = (Menu) menus.remove(index); MenuBarPeer mp = (MenuBarPeer) getPeer(); if (mp != null)
|
public synchronized void remove(int index) { Menu m = (Menu) menus.get(index); menus.remove(index); m.removeNotify(); m.parent = null; if (peer != null) { MenuBarPeer mp = (MenuBarPeer) peer; mp.delMenu(index); } }
|
m.parent = null;
|
public synchronized void remove(int index) { Menu m = (Menu) menus.get(index); menus.remove(index); m.removeNotify(); m.parent = null; if (peer != null) { MenuBarPeer mp = (MenuBarPeer) peer; mp.delMenu(index); } }
|
|
if (peer != null) { MenuBarPeer mp = (MenuBarPeer) peer;
|
m.setParent(null); if (mp != null)
|
public synchronized void remove(int index) { Menu m = (Menu) menus.get(index); menus.remove(index); m.removeNotify(); m.parent = null; if (peer != null) { MenuBarPeer mp = (MenuBarPeer) peer; mp.delMenu(index); } }
|
}
|
public synchronized void remove(int index) { Menu m = (Menu) menus.get(index); menus.remove(index); m.removeNotify(); m.parent = null; if (peer != null) { MenuBarPeer mp = (MenuBarPeer) peer; mp.delMenu(index); } }
|
|
frame = null;
|
public void removeNotify() { Enumeration e = menus.elements(); while (e.hasMoreElements()) { Menu mi = (Menu) e.nextElement(); mi.removeNotify(); } frame = null; super.removeNotify(); }
|
|
helpMenu.parent = null;
|
helpMenu.setParent(null);
|
public synchronized void setHelpMenu(Menu menu) { if (helpMenu != null) { helpMenu.removeNotify(); helpMenu.parent = null; } helpMenu = menu; if (menu.parent != null) menu.parent.remove(menu); menu.parent = this; MenuBarPeer myPeer = (MenuBarPeer) getPeer (); if (myPeer != null) { menu.addNotify(); myPeer.addHelpMenu(menu); } }
|
if (menu.parent != null) menu.parent.remove(menu); menu.parent = this;
|
MenuContainer parent = menu.getParent(); if (parent != null) parent.remove(menu); menu.setParent(this);
|
public synchronized void setHelpMenu(Menu menu) { if (helpMenu != null) { helpMenu.removeNotify(); helpMenu.parent = null; } helpMenu = menu; if (menu.parent != null) menu.parent.remove(menu); menu.parent = this; MenuBarPeer myPeer = (MenuBarPeer) getPeer (); if (myPeer != null) { menu.addNotify(); myPeer.addHelpMenu(menu); } }
|
MenuBarPeer myPeer = (MenuBarPeer) getPeer ();
|
public synchronized void setHelpMenu(Menu menu) { if (helpMenu != null) { helpMenu.removeNotify(); helpMenu.parent = null; } helpMenu = menu; if (menu.parent != null) menu.parent.remove(menu); menu.parent = this; MenuBarPeer myPeer = (MenuBarPeer) getPeer (); if (myPeer != null) { menu.addNotify(); myPeer.addHelpMenu(menu); } }
|
|
private void setOffset(int offset)
|
void setOffset(int offset)
|
private void setOffset(int offset) { this.offset = this.offset >= 0 ? offset : -1; }
|
private void checkLocation(int where, int len) throws BadLocationException
|
void checkLocation(int where, int len) throws BadLocationException
|
private void checkLocation(int where, int len) throws BadLocationException { if (where < 0) throw new BadLocationException("Invalid location", 1); else if (where > this.count) throw new BadLocationException("Invalid location", this.count); else if ((where + len)>this.count) throw new BadLocationException("Invalid range", this.count); }
|
public DataBufferByte(int size, int numBanks)
|
public DataBufferByte(int size)
|
public DataBufferByte(int size, int numBanks) { super(TYPE_BYTE, size, numBanks); bankData = new byte[numBanks][size]; data = bankData[0]; }
|
super(TYPE_BYTE, size, numBanks); bankData = new byte[numBanks][size]; data = bankData[0];
|
super(TYPE_BYTE, size, 1, 0); bankData = new byte[1][]; data = new byte[size]; bankData[0] = data;
|
public DataBufferByte(int size, int numBanks) { super(TYPE_BYTE, size, numBanks); bankData = new byte[numBanks][size]; data = bankData[0]; }
|
protected DataBuffer(int dataType, int size, int numBanks, int offset) { this(dataType, size, numBanks); java.util.Arrays.fill(offsets, offset); this.offset = offset;
|
protected DataBuffer(int dataType, int size) { this.dataType = dataType; this.size = size;
|
protected DataBuffer(int dataType, int size, int numBanks, int offset) { this(dataType, size, numBanks); java.util.Arrays.fill(offsets, offset); this.offset = offset; }
|
throw new Error("not implemented");
|
Point2D xp1 = xform.transform(getPoint1(), null); Point2D xp2 = xform.transform(getPoint2(), null); return new GradientPaintContext((float) xp1.getX(), (float) xp1.getY(), c1, (float) xp2.getX(), (float) xp2.getY(), c2, cyclic);
|
public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints) { throw new Error("not implemented"); }
|
throw new Error("not implemented");
|
if (c1.getAlpha() == 255 && c2.getAlpha() == 255) return Transparency.OPAQUE; else return Transparency.TRANSLUCENT;
|
public int getTransparency() { throw new Error("not implemented"); }
|
public abstract int getVisibleChildCount(TreePath value0);
|
public abstract int getVisibleChildCount(TreePath path);
|
public abstract int getVisibleChildCount(TreePath value0);
|
addEdit(par, index, removed, added);
|
edits.add(new Edit(par, index, removed, added));
|
protected void changeUpdate() { // Split up the element at the start offset if necessary. Element el = getCharacterElement(offset); Element[] res = split(el, offset, 0); BranchElement par = (BranchElement) el.getParentElement(); if (res[1] != null) { int index = par.getElementIndex(offset); Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; added = new Element[]{ res[1] }; index++; } else { removed = new Element[]{ el }; added = new Element[]{ res[0], res[1] }; } par.replace(index, removed.length, added); addEdit(par, index, removed, added); } int endOffset = offset + length; el = getCharacterElement(endOffset); res = split(el, endOffset, 0); par = (BranchElement) el.getParentElement(); if (res[1] != null) { int index = par.getElementIndex(offset); Element[] removed; Element[] added; if (res[1] == null) { removed = new Element[0]; added = new Element[]{ res[1] }; } else { removed = new Element[]{ el }; added = new Element[]{ res[0], res[1] }; } par.replace(index, removed.length, added); addEdit(par, index, removed, added); } }
|
numEndTags = 0; numStartTags = 0;
|
public void insert(int offset, int length, ElementSpec[] data, DefaultDocumentEvent ev) { if (length == 0) return; this.offset = offset; this.length = length; this.endOffset = offset + length; documentEvent = ev; // Push the root and the paragraph at offset onto the element stack. elementStack.clear(); elementStack.push(root); elementStack.push(root.getElement(root.getElementIndex(offset))); numEndTags = 0; numStartTags = 0; insertUpdate(data); }
|
|
int size = edits.size(); for (int i = 0; i < size; i++) { Edit curr = (Edit) edits.get(i); addEdit(curr.e, curr.index, curr.removed, curr.added); }
|
public void insert(int offset, int length, ElementSpec[] data, DefaultDocumentEvent ev) { if (length == 0) return; this.offset = offset; this.length = length; this.endOffset = offset + length; documentEvent = ev; // Push the root and the paragraph at offset onto the element stack. elementStack.clear(); elementStack.push(root); elementStack.push(root.getElement(root.getElementIndex(offset))); numEndTags = 0; numStartTags = 0; insertUpdate(data); }
|
|
prepareContentInsertion();
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); if (next == null) return; Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] { newEl1, newEl2 }; Element[] remove = new Element[] { current, next }; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed = new Element[] {current}; Element[] splitRes = split(current, offset, length); if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { // This is if the new insertion happens immediately before // the <code>current</code> Element. In this case there are 2 // resulting Elements. added = new Element[2]; added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[1] = splitRes[1]; } else if (current.getEndOffset() == endOffset) { // This is if the new insertion happens right at the end of // the <code>current</code> Element. In this case there are // 2 resulting Elements. added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); } else { // This is if the new insertion is in the middle of the // <code>current</code> Element. In this case // there will be 3 resulting Elements. added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[2] = splitRes[1]; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
|
int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); if (next == null) return;
|
int index = paragraph.getElementIndex(offset); Element target = paragraph.getElement(index); if (target.isLeaf() && paragraph.getElementCount() > (index + 1)) { Element next = paragraph.getElement(index + 1);
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); if (next == null) return; Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] { newEl1, newEl2 }; Element[] remove = new Element[] { current, next }; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed = new Element[] {current}; Element[] splitRes = split(current, offset, length); if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { // This is if the new insertion happens immediately before // the <code>current</code> Element. In this case there are 2 // resulting Elements. added = new Element[2]; added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[1] = splitRes[1]; } else if (current.getEndOffset() == endOffset) { // This is if the new insertion happens right at the end of // the <code>current</code> Element. In this case there are // 2 resulting Elements. added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); } else { // This is if the new insertion is in the middle of the // <code>current</code> Element. In this case // there will be 3 resulting Elements. added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[2] = splitRes[1]; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
current.getAttributes(), current.getStartOffset(),
|
target.getAttributes(), target.getStartOffset(),
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); if (next == null) return; Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] { newEl1, newEl2 }; Element[] remove = new Element[] { current, next }; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed = new Element[] {current}; Element[] splitRes = split(current, offset, length); if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { // This is if the new insertion happens immediately before // the <code>current</code> Element. In this case there are 2 // resulting Elements. added = new Element[2]; added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[1] = splitRes[1]; } else if (current.getEndOffset() == endOffset) { // This is if the new insertion happens right at the end of // the <code>current</code> Element. In this case there are // 2 resulting Elements. added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); } else { // This is if the new insertion is in the middle of the // <code>current</code> Element. In this case // there will be 3 resulting Elements. added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[2] = splitRes[1]; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
current.getAttributes(), offset,
|
next.getAttributes(), offset,
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); if (next == null) return; Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] { newEl1, newEl2 }; Element[] remove = new Element[] { current, next }; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed = new Element[] {current}; Element[] splitRes = split(current, offset, length); if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { // This is if the new insertion happens immediately before // the <code>current</code> Element. In this case there are 2 // resulting Elements. added = new Element[2]; added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[1] = splitRes[1]; } else if (current.getEndOffset() == endOffset) { // This is if the new insertion happens right at the end of // the <code>current</code> Element. In this case there are // 2 resulting Elements. added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); } else { // This is if the new insertion is in the middle of the // <code>current</code> Element. In this case // there will be 3 resulting Elements. added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[2] = splitRes[1]; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
Element[] remove = new Element[] { current, next }; paragraph.replace(currentIndex, 2, add); addEdit(paragraph, currentIndex, remove, add);
|
paragraph.replace (index, 2, add); edits.add(new Edit(paragraph, index, new Element[] { target, next }, add));
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); if (next == null) return; Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] { newEl1, newEl2 }; Element[] remove = new Element[] { current, next }; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed = new Element[] {current}; Element[] splitRes = split(current, offset, length); if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { // This is if the new insertion happens immediately before // the <code>current</code> Element. In this case there are 2 // resulting Elements. added = new Element[2]; added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[1] = splitRes[1]; } else if (current.getEndOffset() == endOffset) { // This is if the new insertion happens right at the end of // the <code>current</code> Element. In this case there are // 2 resulting Elements. added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); } else { // This is if the new insertion is in the middle of the // <code>current</code> Element. In this case // there will be 3 resulting Elements. added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[2] = splitRes[1]; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
else
|
} else if (dir == ElementSpec.OriginateDirection)
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); if (next == null) return; Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] { newEl1, newEl2 }; Element[] remove = new Element[] { current, next }; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed = new Element[] {current}; Element[] splitRes = split(current, offset, length); if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { // This is if the new insertion happens immediately before // the <code>current</code> Element. In this case there are 2 // resulting Elements. added = new Element[2]; added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[1] = splitRes[1]; } else if (current.getEndOffset() == endOffset) { // This is if the new insertion happens right at the end of // the <code>current</code> Element. In this case there are // 2 resulting Elements. added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); } else { // This is if the new insertion is in the middle of the // <code>current</code> Element. In this case // there will be 3 resulting Elements. added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[2] = splitRes[1]; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
addEdit(paragraph, index, removed, added);
|
edits.add(new Edit(paragraph, index, removed, added));
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); if (next == null) return; Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] { newEl1, newEl2 }; Element[] remove = new Element[] { current, next }; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed = new Element[] {current}; Element[] splitRes = split(current, offset, length); if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { // This is if the new insertion happens immediately before // the <code>current</code> Element. In this case there are 2 // resulting Elements. added = new Element[2]; added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[1] = splitRes[1]; } else if (current.getEndOffset() == endOffset) { // This is if the new insertion happens right at the end of // the <code>current</code> Element. In this case there are // 2 resulting Elements. added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); } else { // This is if the new insertion is in the middle of the // <code>current</code> Element. In this case // there will be 3 resulting Elements. added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); added[2] = splitRes[1]; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
addEdit(par, index, removed, added);
|
edits.add(new Edit(par, index, removed, added));
|
private Element insertParagraph(BranchElement par, int offset) { Element current = par.getElement(par.getElementIndex(offset)); Element[] res = split(current, offset, 0); int index = par.getElementIndex(offset); Element ret; if (res[1] != null) { Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; if (res[1] instanceof BranchElement) { added = new Element[]{ res[1] }; ret = res[1]; } else { ret = createBranchElement(par, null); added = new Element[]{ ret, res[1] }; } index++; } else { removed = new Element[]{ current }; if (res[1] instanceof BranchElement) { ret = res[1]; added = new Element[]{ res[0], res[1] }; } else { ret = createBranchElement(par, null); added = new Element[]{ res[0], ret, res[1] }; } } par.replace(index, removed.length, added); addEdit(par, index, removed, added); } else { ret = createBranchElement(par, null); Element[] added = new Element[]{ ret }; par.replace(index, 0, added); addEdit(par, index, new Element[0], added); } return ret; }
|
addEdit(par, index, new Element[0], added);
|
edits.add(new Edit(par, index, new Element[0], added));
|
private Element insertParagraph(BranchElement par, int offset) { Element current = par.getElement(par.getElementIndex(offset)); Element[] res = split(current, offset, 0); int index = par.getElementIndex(offset); Element ret; if (res[1] != null) { Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; if (res[1] instanceof BranchElement) { added = new Element[]{ res[1] }; ret = res[1]; } else { ret = createBranchElement(par, null); added = new Element[]{ ret, res[1] }; } index++; } else { removed = new Element[]{ current }; if (res[1] instanceof BranchElement) { ret = res[1]; added = new Element[]{ res[0], res[1] }; } else { ret = createBranchElement(par, null); added = new Element[]{ res[0], ret, res[1] }; } } par.replace(index, removed.length, added); addEdit(par, index, removed, added); } else { ret = createBranchElement(par, null); Element[] added = new Element[]{ ret }; par.replace(index, 0, added); addEdit(par, index, new Element[0], added); } return ret; }
|
numStartTags++;
|
switch (data[i].getDirection()) { case ElementSpec.JoinFractureDirection: insertFracture(data[i]); break; case ElementSpec.JoinNextDirection: int index = paragraph.getElementIndex(offset); elementStack.push(paragraph.getElement(index)); break; case ElementSpec.OriginateDirection: Element current = (Element) elementStack.peek(); Element newParagraph = insertParagraph((BranchElement) current, offset); elementStack.push(newParagraph); break; default: break; }
|
protected void insertUpdate(ElementSpec[] data) { for (int i = 0; i < data.length; i++) { switch (data[i].getType()) { case ElementSpec.StartTagType: numStartTags++; break; case ElementSpec.EndTagType: numEndTags++; break; default: insertContentTag(data[i]); break; } } endEdit(); }
|
numEndTags++;
|
elementStack.pop();
|
protected void insertUpdate(ElementSpec[] data) { for (int i = 0; i < data.length; i++) { switch (data[i].getType()) { case ElementSpec.StartTagType: numStartTags++; break; case ElementSpec.EndTagType: numEndTags++; break; default: insertContentTag(data[i]); break; } } endEdit(); }
|
default:
|
case ElementSpec.ContentType:
|
protected void insertUpdate(ElementSpec[] data) { for (int i = 0; i < data.length; i++) { switch (data[i].getType()) { case ElementSpec.StartTagType: numStartTags++; break; case ElementSpec.EndTagType: numEndTags++; break; default: insertContentTag(data[i]); break; } } endEdit(); }
|
endEdit();
|
protected void insertUpdate(ElementSpec[] data) { for (int i = 0; i < data.length; i++) { switch (data[i].getType()) { case ElementSpec.StartTagType: numStartTags++; break; case ElementSpec.EndTagType: numEndTags++; break; default: insertContentTag(data[i]); break; } } endEdit(); }
|
|
addEdit(el, index, removed, added);
|
edits.add(new Edit(el, index, removed, added));
|
private Element[] split(Element el, int offset, int space) { // If we are at an element boundary, then return an empty array. if ((offset == el.getStartOffset() || offset == el.getEndOffset()) && space == 0 && el.isLeaf()) return new Element[2]; // If the element is an instance of BranchElement, then we recursivly // call this method to perform the split. Element[] res = new Element[2]; if (el instanceof BranchElement) { int index = el.getElementIndex(offset); Element child = el.getElement(index); Element[] result = split(child, offset, space); Element[] removed; Element[] added; Element[] newAdded; int count = el.getElementCount(); if (!(result[1] == null)) { // This is the case when we can keep the first element. if (result[0] == null) { removed = new Element[count - index - 1]; newAdded = new Element[count - index - 1]; added = new Element[]{}; } // This is the case when we may not keep the first element. else { removed = new Element[count - index]; newAdded = new Element[count - index]; added = new Element[]{result[0]}; } newAdded[0] = result[1]; for (int i = index; i < count; i++) { Element el2 = el.getElement(i); int ind = i - count + removed.length; removed[ind] = el2; if (ind != 0) newAdded[ind] = el2; } ((BranchElement) el).replace(index, removed.length, added); addEdit(el, index, removed, added); BranchElement newPar = (BranchElement) createBranchElement(el.getParentElement(), el.getAttributes()); newPar.replace(0, 0, newAdded); res = new Element[]{ null, newPar }; } else { removed = new Element[count - index]; for (int i = index; i < count; ++i) removed[i - index] = el.getElement(i); added = new Element[0]; ((BranchElement) el).replace(index, removed.length, added); addEdit(el, index, removed, added); BranchElement newPar = (BranchElement) createBranchElement(el.getParentElement(), el.getAttributes()); newPar.replace(0, 0, removed); res = new Element[]{ null, newPar }; } } else if (el instanceof LeafElement) { BranchElement par = (BranchElement) el.getParentElement(); Element el1 = createLeafElement(par, el.getAttributes(), el.getStartOffset(), offset); Element el2 = createLeafElement(par, el.getAttributes(), offset + space, el.getEndOffset()); res = new Element[]{ el1, el2 }; } return res; }
|
b.append('<');
|
public String toString() { StringBuilder b = new StringBuilder(); b.append('<'); switch (type) { case StartTagType: b.append("StartTag"); break; case EndTagType: b.append("EndTag"); break; case ContentType: b.append("Content"); break; default: b.append("??"); break; } b.append(':'); switch (direction) { case JoinPreviousDirection: b.append("JoinPrevious"); break; case JoinNextDirection: b.append("JoinNext"); break; case OriginateDirection: b.append("Originate"); break; case JoinFractureDirection: b.append("Fracture"); break; default: b.append("??"); break; } b.append(':'); b.append(length); return b.toString(); }
|
|
paragraph.setResolveParent(getStyle(StyleContext.DEFAULT_STYLE));
|
protected AbstractDocument.AbstractElement createDefaultRoot() { Element[] tmp; // FIXME: Create a SecionElement here instead of a BranchElement. // Use createBranchElement() and createLeafElement instead. SectionElement section = new SectionElement(); BranchElement paragraph = new BranchElement(section, null); paragraph.setResolveParent(getStyle(StyleContext.DEFAULT_STYLE)); tmp = new Element[1]; tmp[0] = paragraph; section.replace(0, 0, tmp); LeafElement leaf = new LeafElement(paragraph, null, 0, 1); tmp = new Element[1]; tmp[0] = leaf; paragraph.replace(0, 0, tmp); return section; }
|
|
for (int i = 0; i < data.length; i++) { ElementSpec spec = data[i]; AttributeSet atts = spec.getAttributes(); if (atts != null) insertUpdate(ev, atts); }
|
protected void insert(int offset, ElementSpec[] data) throws BadLocationException { try { // writeLock() and writeUnlock() should always be in a try/finally // block so that locking balance is guaranteed even if some // exception is thrown. writeLock(); // First we collect the content to be inserted. StringBuffer contentBuffer = new StringBuffer(); for (int i = 0; i < data.length; i++) { // Collect all inserts into one so we can get the correct // ElementEdit ElementSpec spec = data[i]; if (spec.getArray() != null && spec.getLength() > 0) contentBuffer.append(spec.getArray(), spec.getOffset(), spec.getLength()); } int length = contentBuffer.length(); // If there was no content inserted then exit early. if (length == 0) return; UndoableEdit edit = content.insertString(offset, contentBuffer.toString()); // Create the DocumentEvent with the ElementEdit added DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.INSERT); ev.addEdit(edit); for (int i = 0; i < data.length; i++) { ElementSpec spec = data[i]; AttributeSet atts = spec.getAttributes(); if (atts != null) insertUpdate(ev, atts); } // Finally we must update the document structure and fire the insert // update event. buffer.insert(offset, length, data, ev); fireInsertUpdate(ev); } finally { writeUnlock(); } }
|
|
fireUndoableEditUpdate(new UndoableEditEvent(this, ev));
|
protected void insert(int offset, ElementSpec[] data) throws BadLocationException { try { // writeLock() and writeUnlock() should always be in a try/finally // block so that locking balance is guaranteed even if some // exception is thrown. writeLock(); // First we collect the content to be inserted. StringBuffer contentBuffer = new StringBuffer(); for (int i = 0; i < data.length; i++) { // Collect all inserts into one so we can get the correct // ElementEdit ElementSpec spec = data[i]; if (spec.getArray() != null && spec.getLength() > 0) contentBuffer.append(spec.getArray(), spec.getOffset(), spec.getLength()); } int length = contentBuffer.length(); // If there was no content inserted then exit early. if (length == 0) return; UndoableEdit edit = content.insertString(offset, contentBuffer.toString()); // Create the DocumentEvent with the ElementEdit added DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.INSERT); ev.addEdit(edit); for (int i = 0; i < data.length; i++) { ElementSpec spec = data[i]; AttributeSet atts = spec.getAttributes(); if (atts != null) insertUpdate(ev, atts); } // Finally we must update the document structure and fire the insert // update event. buffer.insert(offset, length, data, ev); fireInsertUpdate(ev); } finally { writeUnlock(); } }
|
|
ElementSpec finalStartTag = null; short finalStartDirection = ElementSpec.OriginateDirection; boolean prevCharWasNewline = false;
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); // If the attribute set is null, use an empty attribute set. if (attr == null) attr = SimpleAttributeSet.EMPTY; int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; AttributeSet paragraphAttributes = getParagraphElement(endOffset).getAttributes(); Segment txt = new Segment(); try { getText(offset, length, txt); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } int len = 0; Vector specs = new Vector(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); int segmentEnd = txt.offset + txt.count; for (int i = txt.offset; i < segmentEnd; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(paragraphAttributes, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; } } // Create last element if last character hasn't been a newline. if (len > 0) specs.add(new ElementSpec(attr, ElementSpec.ContentType, len)); // If we are at the last index, then check if we could probably be // joined with the next element. ElementSpec last = (ElementSpec) specs.lastElement(); if (next.getAttributes().isEqual(attr)) last.setDirection(ElementSpec.JoinNextDirection); // If we are at the first new element, then check if it could be // joined with the previous element. ElementSpec first = (ElementSpec) specs.firstElement(); if (prev.getAttributes().isEqual(attr)) first.setDirection(ElementSpec.JoinPreviousDirection); ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
|
|
ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); specs.add(spec);
|
specs.add(new ElementSpec(attr, ElementSpec.ContentType, len));
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); // If the attribute set is null, use an empty attribute set. if (attr == null) attr = SimpleAttributeSet.EMPTY; int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; AttributeSet paragraphAttributes = getParagraphElement(endOffset).getAttributes(); Segment txt = new Segment(); try { getText(offset, length, txt); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } int len = 0; Vector specs = new Vector(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); int segmentEnd = txt.offset + txt.count; for (int i = txt.offset; i < segmentEnd; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(paragraphAttributes, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; } } // Create last element if last character hasn't been a newline. if (len > 0) specs.add(new ElementSpec(attr, ElementSpec.ContentType, len)); // If we are at the last index, then check if we could probably be // joined with the next element. ElementSpec last = (ElementSpec) specs.lastElement(); if (next.getAttributes().isEqual(attr)) last.setDirection(ElementSpec.JoinNextDirection); // If we are at the first new element, then check if it could be // joined with the previous element. ElementSpec first = (ElementSpec) specs.firstElement(); if (prev.getAttributes().isEqual(attr)) first.setDirection(ElementSpec.JoinPreviousDirection); ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
|
ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(paragraphAttributes,
|
specs.add(new ElementSpec(null, ElementSpec.EndTagType)); finalStartTag = new ElementSpec(paragraphAttributes,
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); // If the attribute set is null, use an empty attribute set. if (attr == null) attr = SimpleAttributeSet.EMPTY; int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; AttributeSet paragraphAttributes = getParagraphElement(endOffset).getAttributes(); Segment txt = new Segment(); try { getText(offset, length, txt); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } int len = 0; Vector specs = new Vector(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); int segmentEnd = txt.offset + txt.count; for (int i = txt.offset; i < segmentEnd; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(paragraphAttributes, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; } } // Create last element if last character hasn't been a newline. if (len > 0) specs.add(new ElementSpec(attr, ElementSpec.ContentType, len)); // If we are at the last index, then check if we could probably be // joined with the next element. ElementSpec last = (ElementSpec) specs.lastElement(); if (next.getAttributes().isEqual(attr)) last.setDirection(ElementSpec.JoinNextDirection); // If we are at the first new element, then check if it could be // joined with the previous element. ElementSpec first = (ElementSpec) specs.firstElement(); if (prev.getAttributes().isEqual(attr)) first.setDirection(ElementSpec.JoinPreviousDirection); ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
|
startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag);
|
specs.add(finalStartTag);
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); // If the attribute set is null, use an empty attribute set. if (attr == null) attr = SimpleAttributeSet.EMPTY; int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; AttributeSet paragraphAttributes = getParagraphElement(endOffset).getAttributes(); Segment txt = new Segment(); try { getText(offset, length, txt); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } int len = 0; Vector specs = new Vector(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); int segmentEnd = txt.offset + txt.count; for (int i = txt.offset; i < segmentEnd; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(paragraphAttributes, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; } } // Create last element if last character hasn't been a newline. if (len > 0) specs.add(new ElementSpec(attr, ElementSpec.ContentType, len)); // If we are at the last index, then check if we could probably be // joined with the next element. ElementSpec last = (ElementSpec) specs.lastElement(); if (next.getAttributes().isEqual(attr)) last.setDirection(ElementSpec.JoinNextDirection); // If we are at the first new element, then check if it could be // joined with the previous element. ElementSpec first = (ElementSpec) specs.firstElement(); if (prev.getAttributes().isEqual(attr)) first.setDirection(ElementSpec.JoinPreviousDirection); ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
|
if (next.getAttributes().isEqual(attr))
|
if (last.getType() == ElementSpec.ContentType) { Element currentRun = prevParagraph.getElement(prevParagraph.getElementIndex(offset)); if (currentRun.getEndOffset() == endOffset) { if (endOffset < getLength() && next.getAttributes().isEqual(attr) && last.getType() == ElementSpec.ContentType)
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); // If the attribute set is null, use an empty attribute set. if (attr == null) attr = SimpleAttributeSet.EMPTY; int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; AttributeSet paragraphAttributes = getParagraphElement(endOffset).getAttributes(); Segment txt = new Segment(); try { getText(offset, length, txt); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } int len = 0; Vector specs = new Vector(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); int segmentEnd = txt.offset + txt.count; for (int i = txt.offset; i < segmentEnd; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(paragraphAttributes, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; } } // Create last element if last character hasn't been a newline. if (len > 0) specs.add(new ElementSpec(attr, ElementSpec.ContentType, len)); // If we are at the last index, then check if we could probably be // joined with the next element. ElementSpec last = (ElementSpec) specs.lastElement(); if (next.getAttributes().isEqual(attr)) last.setDirection(ElementSpec.JoinNextDirection); // If we are at the first new element, then check if it could be // joined with the previous element. ElementSpec first = (ElementSpec) specs.firstElement(); if (prev.getAttributes().isEqual(attr)) first.setDirection(ElementSpec.JoinPreviousDirection); ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
|
if (prev.getAttributes().isEqual(attr))
|
if (prev.getAttributes().isEqual(attr) && first.getType() == ElementSpec.ContentType)
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); // If the attribute set is null, use an empty attribute set. if (attr == null) attr = SimpleAttributeSet.EMPTY; int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; AttributeSet paragraphAttributes = getParagraphElement(endOffset).getAttributes(); Segment txt = new Segment(); try { getText(offset, length, txt); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } int len = 0; Vector specs = new Vector(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); int segmentEnd = txt.offset + txt.count; for (int i = txt.offset; i < segmentEnd; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(paragraphAttributes, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; } } // Create last element if last character hasn't been a newline. if (len > 0) specs.add(new ElementSpec(attr, ElementSpec.ContentType, len)); // If we are at the last index, then check if we could probably be // joined with the next element. ElementSpec last = (ElementSpec) specs.lastElement(); if (next.getAttributes().isEqual(attr)) last.setDirection(ElementSpec.JoinNextDirection); // If we are at the first new element, then check if it could be // joined with the previous element. ElementSpec first = (ElementSpec) specs.firstElement(); if (prev.getAttributes().isEqual(attr)) first.setDirection(ElementSpec.JoinPreviousDirection); ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
|
fireUndoableEditUpdate(new UndoableEditEvent(this, ev));
|
public void setLogicalStyle(int position, Style style) { Element el = getParagraphElement(position); // getParagraphElement doesn't return null but subclasses might so // we check for null here. if (el == null) return; try { writeLock(); if (el instanceof AbstractElement) { AbstractElement ael = (AbstractElement) el; ael.setResolveParent(style); int start = el.getStartOffset(); int end = el.getEndOffset(); DefaultDocumentEvent ev = new DefaultDocumentEvent ( start, end - start, DocumentEvent.EventType.CHANGE); // FIXME: Add an UndoableEdit to this event and fire it. fireChangedUpdate(ev); } else throw new AssertionError("paragraph elements are expected to be" + "instances of AbstractDocument.AbstractElement"); } finally { writeUnlock(); } }
|
|
public GapContent(int size)
|
public GapContent()
|
public GapContent(int size) { buf.append("\n"); }
|
buf.append("\n");
|
this(10);
|
public GapContent(int size) { buf.append("\n"); }
|
protected AbstractDocument(Content doc, AttributeContext ctx)
|
protected AbstractDocument(Content doc)
|
protected AbstractDocument(Content doc, AttributeContext ctx) { content = doc; context = ctx; }
|
content = doc; context = ctx;
|
this(doc, StyleContext.getDefaultStyleContext());
|
protected AbstractDocument(Content doc, AttributeContext ctx) { content = doc; context = ctx; }
|
public Color getBackground(AttributeSet set);
|
Color getBackground(AttributeSet set);
|
public Color getBackground(AttributeSet set);
|
public Font getFont(AttributeSet set);
|
Font getFont(AttributeSet set);
|
public Font getFont(AttributeSet set);
|
public Color getForeground(AttributeSet set);
|
Color getForeground(AttributeSet set);
|
public Color getForeground(AttributeSet set);
|
public void getText(int offset, int length, Segment segment) throws BadLocationException { content.getChars(offset, length, segment); }
|
public String getText(int offset, int length) throws BadLocationException { return content.getString(offset, length); }
|
public void getText(int offset, int length, Segment segment) throws BadLocationException { content.getChars(offset, length, segment); }
|
public void setParagraphAttributes(int offset, int length,
|
void setParagraphAttributes(int offset, int length,
|
public void setParagraphAttributes(int offset, int length, AttributeSet set, boolean replace);
|
invalidate(); layout();
|
protected void addImpl(Component comp, Object constraints, int index) { int left = 0; int right = 1; int div = 2; int place; if (constraints == null) { if (leftComponent == null) constraints = LEFT; else if (rightComponent == null) constraints = RIGHT; } if (constraints instanceof String) { String placement = (String) constraints; if (placement.equals(BOTTOM) || placement.equals(RIGHT)) { if (rightComponent != null) remove(rightComponent); rightComponent = comp; } else if (placement.equals(LEFT) || placement.equals(TOP)) { if (leftComponent != null) remove(leftComponent); leftComponent = comp; } else if (placement.equals(DIVIDER)) constraints = null; else throw new IllegalArgumentException("Constraints is not a known identifier."); super.addImpl(comp, constraints, index); } invalidate(); layout(); }
|
|
private void resetSelectedValue()
|
void resetSelectedValue()
|
private void resetSelectedValue() { if (inputComponent != null) { Object init = optionPane.getInitialSelectionValue(); if (init == null) return; if (inputComponent instanceof JTextField) ((JTextField) inputComponent).setText((String) init); else if (inputComponent instanceof JComboBox) ((JComboBox) inputComponent).setSelectedItem(init); else if (inputComponent instanceof JList) { // ((JList) inputComponent).setSelectedValue(init, true); } } }
|
Object invoke (Remote obj, Method method, Object[] params, long opnum) throws Exception;
|
void invoke (RemoteCall call) throws Exception;
|
Object invoke (Remote obj, Method method, Object[] params, long opnum) throws Exception;
|
public void update (int bval);
|
void update (int bval);
|
public void update (int bval);
|
public DataFormatException(String msg)
|
public DataFormatException()
|
public DataFormatException(String msg) { super(msg); }
|
super(msg);
|
public DataFormatException(String msg) { super(msg); }
|
|
{
|
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new ParameterNode(name, select.clone(stylesheet), type); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
|
|
}
|
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new ParameterNode(name, select.clone(stylesheet), type); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.