bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
Object getPreviousVisibleNode(Object node) { Object prev = null; TreePath current = null; if (node != null) prev = getPreviousNode(node); if (prev != null) { current = new TreePath(getPathToRoot(prev, 0)); if (tree.isVisible(current)) return prev; while (prev != null && !tree.isVisible(current)) { prev = getPreviousNode(prev); if (prev != null) current = new TreePath(getPathToRoot(prev, 0)); } } return prev; }
Object getPreviousVisibleNode(Object node) { Object prev = null; TreePath current = null; if (node != null) prev = getPreviousNode(node); if (prev != null) { current = new TreePath(getPathToRoot(prev, 0)); if (tree.isVisible(current)) return null; while (prev != null && !tree.isVisible(current)) { prev = getPreviousNode(prev); if (prev != null) current = new TreePath(getPathToRoot(prev, 0)); } } return null; }
11,241
public int getRowCount(JTree tree) { int count = 0; if (treeModel != null) { Object node = treeModel.getRoot(); if (!tree.isRootVisible() && tree.isExpanded(new TreePath((getPathToRoot(node, 0))))) node = getNextNode(node); while (node != null) { count++; node = getNextVisibleNode(node); } } return count; }
public int getRowCount(JTree tree) { int count = 0; if (treeModel != null) { Object node = treeModel.getRoot(); if (!tree.isRootVisible() && tree.isExpanded(new TreePath((getPathToRoot(node, 0))))) node = getNextNode(node); while (node != null) { count++; node = getNextVisibleNode(node); } } return count; }
11,242
public int getRowForPath(JTree tree, TreePath path) { int row = 0; Object dest = path.getLastPathComponent(); Object curr = treeModel.getRoot(); while (curr != null && !curr.equals(dest)) { ++row; curr = getNextVisibleNode(curr); } return row; }
public int getRowForPath(JTree tree, TreePath path) { int row = 0; Object dest = path.getLastPathComponent(); Object curr = treeModel.getRoot(); while (curr != null && !curr.equals(dest)) { ++row; curr = getNextVisibleNode(curr); } return row; }
11,243
public int getRowForPath(JTree tree, TreePath path) { int row = 0; Object dest = path.getLastPathComponent(); Object curr = treeModel.getRoot(); while (curr != null && !curr.equals(dest)) { ++row; curr = getNextVisibleNode(curr); } return row; }
public int getRowForPath(JTree tree, TreePath path) { int row = 0; Object dest = path.getLastPathComponent(); Object curr = treeModel.getRoot(); while (curr != null && !curr.equals(dest)) { ++row; curr = getNextVisibleNode(curr); } return row; }
11,244
public int getRowForPath(JTree tree, TreePath path) { int row = 0; Object dest = path.getLastPathComponent(); Object curr = treeModel.getRoot(); while (curr != null && !curr.equals(dest)) { ++row; curr = getNextVisibleNode(curr); } return row; }
public int getRowForPath(JTree tree, TreePath path) { int row = 0; Object dest = path.getLastPathComponent(); Object curr = treeModel.getRoot(); while (curr != null && !curr.equals(dest)) { ++row; curr = getNextVisibleNode(curr); } return -1; }
11,245
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); tree.setFont(defaults.getFont("Tree.font")); tree.setForeground(defaults.getColor("Tree.foreground")); tree.setBackground(defaults.getColor("Tree.background")); tree.setOpaque(true); rightChildIndent = defaults.getInt("Tree.rightChildIndent"); leftChildIndent = defaults.getInt("Tree.leftChildIndent"); setRowHeight(defaults.getInt("Tree.rowHeight")); tree.requestFocusInWindow(false); tree.setScrollsOnExpand(defaults.getBoolean("Tree.scrollsOnExpand")); setExpandedIcon(defaults.getIcon("Tree.expandedIcon")); setCollapsedIcon(defaults.getIcon("Tree.collapsedIcon")); }
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); tree.setFont(defaults.getFont("Tree.font")); tree.setForeground(defaults.getColor("Tree.foreground")); tree.setBackground(defaults.getColor("Tree.background")); tree.setOpaque(true); rightChildIndent = defaults.getInt("Tree.rightChildIndent"); leftChildIndent = defaults.getInt("Tree.leftChildIndent"); setRowHeight(defaults.getInt("Tree.rowHeight")); tree.requestFocusInWindow(false); tree.setScrollsOnExpand(defaults.getBoolean("Tree.scrollsOnExpand")); setExpandedIcon(defaults.getIcon("Tree.expandedIcon")); setCollapsedIcon(defaults.getIcon("Tree.collapsedIcon")); }
11,246
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); tree.setFont(defaults.getFont("Tree.font")); tree.setForeground(defaults.getColor("Tree.foreground")); tree.setBackground(defaults.getColor("Tree.background")); tree.setOpaque(true); rightChildIndent = defaults.getInt("Tree.rightChildIndent"); leftChildIndent = defaults.getInt("Tree.leftChildIndent"); setRowHeight(defaults.getInt("Tree.rowHeight")); tree.requestFocusInWindow(false); tree.setScrollsOnExpand(defaults.getBoolean("Tree.scrollsOnExpand")); setExpandedIcon(defaults.getIcon("Tree.expandedIcon")); setCollapsedIcon(defaults.getIcon("Tree.collapsedIcon")); }
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); tree.setFont(defaults.getFont("Tree.font")); tree.setForeground(defaults.getColor("Tree.foreground")); tree.setBackground(defaults.getColor("Tree.background")); tree.setOpaque(true); rightChildIndent = defaults.getInt("Tree.rightChildIndent"); leftChildIndent = defaults.getInt("Tree.leftChildIndent"); setRowHeight(defaults.getInt("Tree.rowHeight")); tree.requestFocusInWindow(false); tree.setScrollsOnExpand(defaults.getBoolean("Tree.scrollsOnExpand")); setExpandedIcon(defaults.getIcon("Tree.expandedIcon")); setCollapsedIcon(defaults.getIcon("Tree.collapsedIcon")); }
11,247
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); tree.setFont(defaults.getFont("Tree.font")); tree.setForeground(defaults.getColor("Tree.foreground")); tree.setBackground(defaults.getColor("Tree.background")); tree.setOpaque(true); rightChildIndent = defaults.getInt("Tree.rightChildIndent"); leftChildIndent = defaults.getInt("Tree.leftChildIndent"); setRowHeight(defaults.getInt("Tree.rowHeight")); tree.requestFocusInWindow(false); tree.setScrollsOnExpand(defaults.getBoolean("Tree.scrollsOnExpand")); setExpandedIcon(defaults.getIcon("Tree.expandedIcon")); setCollapsedIcon(defaults.getIcon("Tree.collapsedIcon")); }
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); tree.setFont(defaults.getFont("Tree.font")); tree.setForeground(defaults.getColor("Tree.foreground")); tree.setBackground(defaults.getColor("Tree.background")); tree.setOpaque(true); rightChildIndent = defaults.getInt("Tree.rightChildIndent"); leftChildIndent = defaults.getInt("Tree.leftChildIndent"); setRowHeight(defaults.getInt("Tree.rowHeight")); tree.requestFocusInWindow(false); tree.setScrollsOnExpand(defaults.getBoolean("Tree.scrollsOnExpand")); setExpandedIcon(defaults.getIcon("Tree.expandedIcon")); setCollapsedIcon(defaults.getIcon("Tree.collapsedIcon")); }
11,248
public void installUI(JComponent c) { prepareForUIInstall(); super.installUI(c); tree = (JTree) c; installDefaults(); installComponents(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; TreeModel mod = tree.getModel(); setModel(mod); if (mod != null) tree.expandPath(new TreePath(mod.getRoot())); treeSelectionModel = tree.getSelectionModel(); installKeyboardActions(); installListeners(); completeUIInstall(); }
public void installUI(JComponent c) { prepareForUIInstall(); super.installUI(c); installDefaults(); installComponents(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; TreeModel mod = tree.getModel(); setModel(mod); if (mod != null) tree.expandPath(new TreePath(mod.getRoot())); treeSelectionModel = tree.getSelectionModel(); installKeyboardActions(); installListeners(); completeUIInstall(); }
11,249
public void installUI(JComponent c) { prepareForUIInstall(); super.installUI(c); tree = (JTree) c; installDefaults(); installComponents(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; TreeModel mod = tree.getModel(); setModel(mod); if (mod != null) tree.expandPath(new TreePath(mod.getRoot())); treeSelectionModel = tree.getSelectionModel(); installKeyboardActions(); installListeners(); completeUIInstall(); }
public void installUI(JComponent c) { prepareForUIInstall(); super.installUI(c); tree = (JTree) c; installDefaults(); installComponents(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; TreeModel mod = tree.getModel(); setModel(mod); if (mod != null) { TreePath path = new TreePath(mod.getRoot()); if (!tree.isExpanded(path)) toggleExpandState(path); } treeSelectionModel = tree.getSelectionModel(); installKeyboardActions(); installListeners(); completeUIInstall(); }
11,250
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; int row = getRowForPath(tree, path); if (!isLeaf(row)) { if (bounds == null) bounds = getPathBounds(tree, path); if (tree.isExpanded(path) && expandedIcon != null) bounds.x -= expandedIcon.getIconWidth() - 4; else if (collapsedIcon != null) bounds.x -= collapsedIcon.getIconWidth() - 4; Icon controlIcon = getCurrentControlIcon(path); if (controlIcon != null && (mouseX < bounds.x) && (mouseX > (bounds.x - controlIcon.getIconWidth()))) cntlClick = true; } return cntlClick; }
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; int row = getRowForPath(tree, path); if (!isLeaf(row)) { if (bounds == null) bounds = getPathBounds(tree, path); if (tree.isExpanded(path) && expandedIcon != null) bounds.x -= expandedIcon.getIconWidth() - 4; else if (collapsedIcon != null) bounds.x -= collapsedIcon.getIconWidth() - 4; Icon controlIcon = getCurrentControlIcon(path); if (controlIcon != null && (mouseX < bounds.x) && (mouseX > (bounds.x - controlIcon.getIconWidth()))) cntlClick = true; } return cntlClick; }
11,251
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; int row = getRowForPath(tree, path); if (!isLeaf(row)) { if (bounds == null) bounds = getPathBounds(tree, path); if (tree.isExpanded(path) && expandedIcon != null) bounds.x -= expandedIcon.getIconWidth() - 4; else if (collapsedIcon != null) bounds.x -= collapsedIcon.getIconWidth() - 4; Icon controlIcon = getCurrentControlIcon(path); if (controlIcon != null && (mouseX < bounds.x) && (mouseX > (bounds.x - controlIcon.getIconWidth()))) cntlClick = true; } return cntlClick; }
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; int row = getRowForPath(tree, path); if (!isLeaf(row)) { if (bounds == null) bounds = getPathBounds(tree, path); if (tree.isExpanded(path) && expandedIcon != null) bounds.x -= expandedIcon.getIconWidth() - 4; else if (collapsedIcon != null) bounds.x -= collapsedIcon.getIconWidth() - 4; Icon controlIcon = getCurrentControlIcon(path); if (controlIcon != null && (mouseX < bounds.x) && (mouseX > (bounds.x - controlIcon.getIconWidth()))) cntlClick = true; } return cntlClick; }
11,252
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; if (treeModel != null) { Object root = treeModel.getRoot(); paintRecursive(g, 0, 0, 0, 0, tree, treeModel, root); if (hasControlIcons()) paintControlIcons(g, 0, 0, 0, 0, tree, treeModel, root); } }
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; if (treeModel != null) { Object root = treeModel.getRoot(); paintRecursive(g, 0, 0, 0, tree, treeModel, root); if (hasControlIcons()) paintControlIcons(g, 0, 0, 0, 0, tree, treeModel, root); } }
11,253
int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrentControlIcon(path); Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; if (mod.isLeaf(node)) descent += rowHeight; else { if (depth > 0 || tree.isRootVisible()) descent += rowHeight; int max = 0; if (!mod.isLeaf(node)) max = mod.getChildCount(node); if (!node.equals(mod.getRoot())) icon.paintIcon(tree, g, indentation - rightChildIndent - 3, h); if (tree.isExpanded(path)) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (depth == 0 && !tree.isRootVisible()) indent = -1; descent = paintControlIcons(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(node, i)); } } } return descent; }
int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrentControlIcon(path); Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; if (mod.isLeaf(node)) descent += rowHeight; else { if (depth > 0 || tree.isRootVisible()) descent += rowHeight; int max = 0; if (!mod.isLeaf(node)) max = mod.getChildCount(node); if (!node.equals(mod.getRoot()) && (tree.isRootVisible() || getLevel(node) != 1)) icon.paintIcon(tree, g, indentation - rightChildIndent - 3, h); if (tree.isExpanded(path)) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (depth == 0 && !tree.isRootVisible()) indent = -1; descent = paintControlIcons(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(node, i)); } } } return descent; }
11,254
int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrentControlIcon(path); Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; if (mod.isLeaf(node)) descent += rowHeight; else { if (depth > 0 || tree.isRootVisible()) descent += rowHeight; int max = 0; if (!mod.isLeaf(node)) max = mod.getChildCount(node); if (!node.equals(mod.getRoot())) icon.paintIcon(tree, g, indentation - rightChildIndent - 3, h); if (tree.isExpanded(path)) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (depth == 0 && !tree.isRootVisible()) indent = -1; descent = paintControlIcons(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(node, i)); } } } return descent; }
int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrentControlIcon(path); Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; if (mod.isLeaf(node)) descent += rowHeight; else { if (depth > 0 || tree.isRootVisible()) descent += rowHeight; int max = 0; if (!mod.isLeaf(node)) max = mod.getChildCount(node); if (!node.equals(mod.getRoot())) icon.paintIcon(tree, g, indentation - rightChildIndent - 3, h); if (tree.isExpanded(path)) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (depth == 0 && !tree.isRootVisible()) indent = 1; descent = paintControlIcons(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(node, i)); } } } return descent; }
11,255
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { if (treeModel != null) paintControlIcons(g, 0, 0, 0, 0, tree, treeModel, path.getLastPathComponent()); }
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { if (treeModel != null && hasControlIcons()) paintControlIcons(g, 0, 0, 0, 0, tree, treeModel, path.getLastPathComponent()); }
11,256
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
int paintRecursive(Graphics g, int indentation, int descent, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
11,257
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (isLeaf) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
11,258
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintRow(g, clip, null, bounds, path, row, true, false, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
11,259
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintRow(g, clip, null, bounds, path, row, isExpanded, false, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
11,260
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
11,261
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
11,262
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
11,263
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; boolean isRootVisible = tree.isRootVisible(); if (mod.isLeaf(curr)) { paintNode(g, indentation + 4, descent, tree, curr, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintNode(g, indentation + 4, descent, tree, curr, false); descent += getRowHeight(); y0 += halfHeight; } int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr) && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
11,264
protected boolean startEditing(TreePath path, MouseEvent event) { int x; int y; if (event == null) { Rectangle bounds = getPathBounds(tree, path); x = bounds.x; y = bounds.y; } else { x = event.getX(); y = event.getY(); } updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && ed.shouldSelectCell(event) && ed.isCellEditable(event)) { editingPath = path; editingRow = tree.getRowForPath(editingPath); Object val = editingPath.getLastPathComponent(); cellEditor.addCellEditorListener(cellEditorListener); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, val, true, expanded, isLeaf(editingRow), editingRow); editingComponent.getParent().setVisible(true); editingComponent.getParent().validate(); tree.add(editingComponent.getParent()); editingComponent.getParent().validate(); ((JTextField) editingComponent).requestFocusInWindow(false); editorTimer.start(); return true; } return false; }
protected boolean startEditing(TreePath path, MouseEvent event) { int x; int y; if (event == null) { bounds = getPathBounds(tree, path); x = bounds.x; y = bounds.y; } else { x = event.getX(); y = event.getY(); } updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && ed.shouldSelectCell(event) && ed.isCellEditable(event)) { editingPath = path; editingRow = tree.getRowForPath(editingPath); Object val = editingPath.getLastPathComponent(); cellEditor.addCellEditorListener(cellEditorListener); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, val, true, expanded, isLeaf(editingRow), editingRow); editingComponent.getParent().setVisible(true); editingComponent.getParent().validate(); tree.add(editingComponent.getParent()); editingComponent.getParent().validate(); ((JTextField) editingComponent).requestFocusInWindow(false); editorTimer.start(); return true; } return false; }
11,270
protected void updateLayoutCacheExpandedNodes() { if (treeModel != null) updateExpandedDescendants(new TreePath(getPathToRoot(treeModel. getRoot(), 0))); }
protected void updateLayoutCacheExpandedNodes() { if (treeModel != null) updateExpandedDescendants(new TreePath(getPathToRoot(treeModel. getRoot(), 0))); }
11,274
public NameComponent[] toName(String a_name) throws InvalidName { ArrayList components = new ArrayList(); StringTokenizer st = new StringTokenizer(a_name, "./\\", true); String id; String kind; String next; // Create the buffer array, reserving the last element for null. String[] n = new String[ st.countTokens() + 1 ]; int pp = 0; while (st.hasMoreTokens()) n [ pp++ ] = st.nextToken(); IntHolder p = new IntHolder(); NameComponent node = readNode(p, n); while (node != null) { components.add(node); node = readNode(p, n); } NameComponent[] name = new NameComponent[ components.size() ]; for (int i = 0; i < name.length; i++) { name [ i ] = (NameComponent) components.get(i); } NameValidator.check(name); return name; }
public NameComponent[] toName(String a_name) throws InvalidName { ArrayList components = new ArrayList(); StringTokenizer st = new StringTokenizer(a_name, "./\\", true); String id; String kind; String next; // Create the buffer array, reserving the last element for null. String[] n = new String[ st.countTokens() + 1 ]; int pp = 0; while (st.hasMoreTokens()) n [ pp++ ] = st.nextToken(); IntHolder p = new IntHolder(); NameComponent node = readNode(p, n); while (node != null) { components.add(node); node = readNode(p, n); } NameComponent[] name = new NameComponent[ components.size() ]; for (int i = 0; i < name.length; i++) { name [ i ] = (NameComponent) components.get(i); } NameValidator.check(name); return name; }
11,276
public InvalidName(String why) { super(why); }
public InvalidName() { super(why); }
11,277
public InvalidName(String why) { super(why); }
public InvalidName(String why) { }
11,278
public NameComponent(String _id, String _kind) { id = _id; kind = _kind; }
public NameComponent() { id = _id; kind = _kind; }
11,279
public NameComponent(String _id, String _kind) { id = _id; kind = _kind; }
public NameComponent(String _id, String _kind) { id = _id; kind = _kind; }
11,280
private StyleConstants(String k) { keyname = k; }
StyleConstants(String k) { keyname = k; }
11,281
public static double getFlatnessSq(double[] coords, int offset) { return getFlatnessSq(coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++]); }
public static double getFlatnessSq(double x1, double y1, double cx1, double cy1, double cx2, double cy2, double x2, double y2) { return getFlatnessSq(coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++]); }
11,282
public static double getFlatnessSq(double[] coords, int offset) { return getFlatnessSq(coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++]); }
public static double getFlatnessSq(double[] coords, int offset) { return getFlatnessSq(coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++]); }
11,283
public static double getFlatnessSq(double[] coords, int offset) { return Line2D.ptSegDistSq(coords[offset], coords[offset + 1], coords[offset + 4], coords[offset + 5], coords[offset + 2], coords[offset + 3]); }
public static double getFlatnessSq(double x1, double y1, double cx, double cy, double x2, double y2) { return Line2D.ptSegDistSq(coords[offset], coords[offset + 1], coords[offset + 4], coords[offset + 5], coords[offset + 2], coords[offset + 3]); }
11,284
public static double getFlatnessSq(double[] coords, int offset) { return Line2D.ptSegDistSq(coords[offset], coords[offset + 1], coords[offset + 4], coords[offset + 5], coords[offset + 2], coords[offset + 3]); }
public static double getFlatnessSq(double[] coords, int offset) { return Line2D.ptSegDistSq(coords[offset], coords[offset + 1], coords[offset + 4], coords[offset + 5], coords[offset + 2], coords[offset + 3]); }
11,285
public static void subdivide(double[] src, int srcOff, double[] left, int leftOff, double[] right, int rightOff) { double x1; double y1; double xc; double yc; double x2; double y2; x1 = src[srcOff]; y1 = src[srcOff + 1]; xc = src[srcOff + 2]; yc = src[srcOff + 3]; x2 = src[srcOff + 4]; y2 = src[srcOff + 5]; if (left != null) { left[leftOff] = x1; left[leftOff + 1] = y1; } if (right != null) { right[rightOff + 4] = x2; right[rightOff + 5] = y2; } x1 = (x1 + xc) / 2; x2 = (xc + x2) / 2; xc = (x1 + x2) / 2; y1 = (y1 + yc) / 2; y2 = (y2 + yc) / 2; yc = (y1 + y2) / 2; if (left != null) { left[leftOff + 2] = x1; left[leftOff + 3] = y1; left[leftOff + 4] = xc; left[leftOff + 5] = yc; } if (right != null) { right[rightOff] = xc; right[rightOff + 1] = yc; right[rightOff + 2] = x2; right[rightOff + 3] = y2; } }
public static void subdivide(double[] src, int srcOff, double[] left, int leftOff, double[] right, int rightOff) { double x1; double y1; double xc; double yc; double x2; double y2; x1 = src[srcOff]; y1 = src[srcOff + 1]; xc = src[srcOff + 2]; yc = src[srcOff + 3]; x2 = src[srcOff + 4]; y2 = src[srcOff + 5]; if (left != null) { left[leftOff] = x1; left[leftOff + 1] = y1; } if (right != null) { right[rightOff + 4] = x2; right[rightOff + 5] = y2; } x1 = (x1 + xc) / 2; x2 = (xc + x2) / 2; xc = (x1 + x2) / 2; y1 = (y1 + yc) / 2; y2 = (y2 + yc) / 2; yc = (y1 + y2) / 2; if (left != null) { left[leftOff + 2] = x1; left[leftOff + 3] = y1; left[leftOff + 4] = xc; left[leftOff + 5] = yc; } if (right != null) { right[rightOff] = xc; right[rightOff + 1] = yc; right[rightOff + 2] = x2; right[rightOff + 3] = y2; } }
11,286
public static void subdivide(double[] src, int srcOff, double[] left, int leftOff, double[] right, int rightOff) { double x1; double y1; double xc; double yc; double x2; double y2; x1 = src[srcOff]; y1 = src[srcOff + 1]; xc = src[srcOff + 2]; yc = src[srcOff + 3]; x2 = src[srcOff + 4]; y2 = src[srcOff + 5]; if (left != null) { left[leftOff] = x1; left[leftOff + 1] = y1; } if (right != null) { right[rightOff + 4] = x2; right[rightOff + 5] = y2; } x1 = (x1 + xc) / 2; x2 = (xc + x2) / 2; xc = (x1 + x2) / 2; y1 = (y1 + yc) / 2; y2 = (y2 + yc) / 2; yc = (y1 + y2) / 2; if (left != null) { left[leftOff + 2] = x1; left[leftOff + 3] = y1; left[leftOff + 4] = xc; left[leftOff + 5] = yc; } if (right != null) { right[rightOff] = xc; right[rightOff + 1] = yc; right[rightOff + 2] = x2; right[rightOff + 3] = y2; } }
public static void subdivide(double[] src, int srcOff, double[] left, int leftOff, double[] right, int rightOff) { double x1; double y1; double xc; double yc; double x2; double y2; x1 = src[srcOff]; y1 = src[srcOff + 1]; xc = src[srcOff + 2]; yc = src[srcOff + 3]; x2 = src[srcOff + 4]; y2 = src[srcOff + 5]; if (left != null) { left[leftOff] = x1; left[leftOff + 1] = y1; } if (right != null) { right[rightOff + 4] = x2; right[rightOff + 5] = y2; } x1 = (x1 + xc) / 2; x2 = (xc + x2) / 2; xc = (x1 + x2) / 2; y1 = (y1 + yc) / 2; y2 = (y2 + yc) / 2; yc = (y1 + y2) / 2; if (left != null) { left[leftOff + 2] = x1; left[leftOff + 3] = y1; left[leftOff + 4] = xc; left[leftOff + 5] = yc; } if (right != null) { right[rightOff] = xc; right[rightOff + 1] = yc; right[rightOff + 2] = x2; right[rightOff + 3] = y2; } }
11,287
public static void subdivide(double[] src, int srcOff, double[] left, int leftOff, double[] right, int rightOff) { double x1; double y1; double xc; double yc; double x2; double y2; x1 = src[srcOff]; y1 = src[srcOff + 1]; xc = src[srcOff + 2]; yc = src[srcOff + 3]; x2 = src[srcOff + 4]; y2 = src[srcOff + 5]; if (left != null) { left[leftOff] = x1; left[leftOff + 1] = y1; } if (right != null) { right[rightOff + 4] = x2; right[rightOff + 5] = y2; } x1 = (x1 + xc) / 2; x2 = (xc + x2) / 2; xc = (x1 + x2) / 2; y1 = (y1 + yc) / 2; y2 = (y2 + yc) / 2; yc = (y1 + y2) / 2; if (left != null) { left[leftOff + 2] = x1; left[leftOff + 3] = y1; left[leftOff + 4] = xc; left[leftOff + 5] = yc; } if (right != null) { right[rightOff] = xc; right[rightOff + 1] = yc; right[rightOff + 2] = x2; right[rightOff + 3] = y2; } }
public static void subdivide(double[] src, int srcOff, double[] left, int leftOff, double[] right, int rightOff) { double x1; double y1; double xc; double yc; double x2; double y2; x1 = src[srcOff]; y1 = src[srcOff + 1]; xc = src[srcOff + 2]; yc = src[srcOff + 3]; x2 = src[srcOff + 4]; y2 = src[srcOff + 5]; if (left != null) { left[leftOff] = x1; left[leftOff + 1] = y1; } if (right != null) { right[rightOff + 4] = x2; right[rightOff + 5] = y2; } x1 = (x1 + xc) / 2; x2 = (xc + x2) / 2; xc = (x1 + x2) / 2; y1 = (y1 + yc) / 2; y2 = (y2 + yc) / 2; yc = (y1 + y2) / 2; if (left != null) { left[leftOff + 2] = x1; left[leftOff + 3] = y1; left[leftOff + 4] = xc; left[leftOff + 5] = yc; } if (right != null) { right[rightOff] = xc; right[rightOff + 1] = yc; right[rightOff + 2] = x2; right[rightOff + 3] = y2; } }
11,288
public static void subdivide(double[] src, int srcOff, double[] left, int leftOff, double[] right, int rightOff) { double x1; double y1; double xc; double yc; double x2; double y2; x1 = src[srcOff]; y1 = src[srcOff + 1]; xc = src[srcOff + 2]; yc = src[srcOff + 3]; x2 = src[srcOff + 4]; y2 = src[srcOff + 5]; if (left != null) { left[leftOff] = x1; left[leftOff + 1] = y1; } if (right != null) { right[rightOff + 4] = x2; right[rightOff + 5] = y2; } x1 = (x1 + xc) / 2; x2 = (xc + x2) / 2; xc = (x1 + x2) / 2; y1 = (y1 + yc) / 2; y2 = (y2 + yc) / 2; yc = (y1 + y2) / 2; if (left != null) { left[leftOff + 2] = x1; left[leftOff + 3] = y1; left[leftOff + 4] = xc; left[leftOff + 5] = yc; } if (right != null) { right[rightOff] = xc; right[rightOff + 1] = yc; right[rightOff + 2] = x2; right[rightOff + 3] = y2; } }
public static void subdivide(double[] src, int srcOff, double[] left, int leftOff, double[] right, int rightOff) { double x1; double y1; double xc; double yc; double x2; double y2; x1 = src[srcOff]; y1 = src[srcOff + 1]; xc = src[srcOff + 2]; yc = src[srcOff + 3]; x2 = src[srcOff + 4]; y2 = src[srcOff + 5]; if (left != null) { left[leftOff] = x1; left[leftOff + 1] = y1; } if (right != null) { right[rightOff + 4] = x2; right[rightOff + 5] = y2; } x1 = (x1 + xc) / 2; x2 = (xc + x2) / 2; xc = (x1 + x2) / 2; y1 = (y1 + yc) / 2; y2 = (y2 + yc) / 2; yc = (y1 + y2) / 2; if (left != null) { left[leftOff + 2] = x1; left[leftOff + 3] = y1; left[leftOff + 4] = xc; left[leftOff + 5] = yc; } if (right != null) { right[rightOff] = xc; right[rightOff + 1] = yc; right[rightOff + 2] = x2; right[rightOff + 3] = y2; } }
11,289
public float[] getSamples(int x, int y, int w, int h, int b, float[] fArray) { return sampleModel.getSamples(x-sampleModelTranslateX, y-sampleModelTranslateY, w, h, b, fArray, dataBuffer); }
public float[] getSamples(int x, int y, int w, int h, int b, float[] fArray) { return sampleModel.getSamples(x-sampleModelTranslateX, y-sampleModelTranslateY, w, h, b, fArray, dataBuffer); }
11,290
public float[] getSamples(int x, int y, int w, int h, int b, float[] fArray) { return sampleModel.getSamples(x-sampleModelTranslateX, y-sampleModelTranslateY, w, h, b, fArray, dataBuffer); }
public float[] getSamples(int x, int y, int w, int h, int b, float[] fArray) { return sampleModel.getSamples(x-sampleModelTranslateX, y-sampleModelTranslateY, w, h, b, iArray, dataBuffer); }
11,291
public void setSample(int x, int y, int b, float s) { sampleModel.setSample(x-sampleModelTranslateX, y-sampleModelTranslateY, b, s, dataBuffer); }
public void setSample(int x, int y, int b, int s) { sampleModel.setSample(x-sampleModelTranslateX, y-sampleModelTranslateY, b, s, dataBuffer); }
11,292
boolean match(CharIndexed input, REMatch mymatch) { int b,e; b = mymatch.start[num]; e = mymatch.end[num]; if ((b==-1)||(e==-1)) return false; // this shouldn't happen, but... for (int i=b; i<e; i++) { if (input.charAt(mymatch.index+i-b) != input.charAt(i)) { return false; } } mymatch.index += e-b; return next(input, mymatch); }
boolean match(CharIndexed input, REMatch mymatch) { int b,e; b = mymatch.start[num]; e = mymatch.end[num]; if ((b==-1)||(e==-1)) return false; // this shouldn't happen, but... for (int i=b; i<e; i++) { char c1 = input.charAt(mymatch.index+i-b); char c2 = input.charAt(i); if (c1 != c2) { if (insens) { if (c1 != Character.toLowerCase(c2) && c1 != Character.toUpperCase(c2)) { return false; } } mymatch.index += e-b; return next(input, mymatch); }
11,293
boolean match(CharIndexed input, REMatch mymatch) { int b,e; b = mymatch.start[num]; e = mymatch.end[num]; if ((b==-1)||(e==-1)) return false; // this shouldn't happen, but... for (int i=b; i<e; i++) { if (input.charAt(mymatch.index+i-b) != input.charAt(i)) { return false; } } mymatch.index += e-b; return next(input, mymatch); }
boolean match(CharIndexed input, REMatch mymatch) { int b,e; b = mymatch.start[num]; e = mymatch.end[num]; if ((b==-1)||(e==-1)) return false; // this shouldn't happen, but... for (int i=b; i<e; i++) { if (input.charAt(mymatch.index+i-b) != input.charAt(i)) { return false; } } mymatch.index += e-b; boolean result = next(input, mymatch); if (result) mymatch.empty = (mymatch.index == origin); return result; }
11,294
public Object getNextValue();
Object getNextValue();
11,295
public Object getPreviousValue();
Object getPreviousValue();
11,296
public Object getValue();
Object getValue();
11,297
public void transform (Source in, Result out) throws TransformerException { try { XMLReader producer; InputSource input; // Input from DOM? if (in instanceof DOMSource) { DOMSource source = (DOMSource) in; if (source.getNode () == null) throw new IllegalArgumentException ("no DOM node"); producer = new DomParser (source.getNode ()); input = null; // Input from SAX? } else if (in instanceof SAXSource) { SAXSource source = (SAXSource) in; producer = source.getXMLReader (); if (producer == null) producer = XMLReaderFactory.createXMLReader (); input = source.getInputSource (); if (input == null) { if (source.getSystemId () != null) input = new InputSource (source.getSystemId ()); else throw new IllegalArgumentException ( "missing SAX input"); } // Input from a stream or something? } else { producer = XMLReaderFactory.createXMLReader (); input = SAXSource.sourceToInputSource (in); if (input == null) throw new IllegalArgumentException ("missing input"); } // preserve original namespace prefixes try { producer.setFeature(handler.FEATURE_URI + "namespace-prefixes", true); } catch (Exception e) { /* ignore */ // FIXME if we couldn't, "NsFix" stage before the output .. } // arrange the output handler.setResult (out); handler.bind (producer, handler); // then parse ... single element pipeline producer.parse (input); } catch (IOException e) { throw new TransformerException ("transform failed", e); } catch (SAXException e) { if (ex == null && ex.getCause () == e) throw ex; else throw new TransformerException ("transform failed", e); } finally { ex = null; } }
public void transform (Source in, Result out) throws TransformerException { try { XMLReader producer; InputSource input; // Input from DOM? if (in instanceof DOMSource) { DOMSource source = (DOMSource) in; if (source.getNode () == null) throw new IllegalArgumentException ("no DOM node"); producer = new DomParser (source.getNode ()); input = null; // Input from SAX? } else if (in instanceof SAXSource) { SAXSource source = (SAXSource) in; producer = source.getXMLReader (); if (producer == null) producer = XMLReaderFactory.createXMLReader (); input = source.getInputSource (); if (input == null) { if (source.getSystemId () != null) input = new InputSource (source.getSystemId ()); else throw new IllegalArgumentException ( "missing SAX input"); } // Input from a stream or something? } else { producer = XMLReaderFactory.createXMLReader (); input = SAXSource.sourceToInputSource (in); if (input == null) throw new IllegalArgumentException ("missing input"); } // preserve original namespace prefixes try { producer.setFeature(EventFilter.FEATURE_URI + "namespace-prefixes", true); } catch (Exception e) { /* ignore */ // FIXME if we couldn't, "NsFix" stage before the output .. } // arrange the output handler.setResult (out); handler.bind (producer, handler); // then parse ... single element pipeline producer.parse (input); } catch (IOException e) { throw new TransformerException ("transform failed", e); } catch (SAXException e) { if (ex == null && ex.getCause () == e) throw ex; else throw new TransformerException ("transform failed", e); } finally { ex = null; } }
11,298
public void transform (Source in, Result out) throws TransformerException { try { XMLReader producer; InputSource input; // Input from DOM? if (in instanceof DOMSource) { DOMSource source = (DOMSource) in; if (source.getNode () == null) throw new IllegalArgumentException ("no DOM node"); producer = new DomParser (source.getNode ()); input = null; // Input from SAX? } else if (in instanceof SAXSource) { SAXSource source = (SAXSource) in; producer = source.getXMLReader (); if (producer == null) producer = XMLReaderFactory.createXMLReader (); input = source.getInputSource (); if (input == null) { if (source.getSystemId () != null) input = new InputSource (source.getSystemId ()); else throw new IllegalArgumentException ( "missing SAX input"); } // Input from a stream or something? } else { producer = XMLReaderFactory.createXMLReader (); input = SAXSource.sourceToInputSource (in); if (input == null) throw new IllegalArgumentException ("missing input"); } // preserve original namespace prefixes try { producer.setFeature(handler.FEATURE_URI + "namespace-prefixes", true); } catch (Exception e) { /* ignore */ // FIXME if we couldn't, "NsFix" stage before the output .. } // arrange the output handler.setResult (out); handler.bind (producer, handler); // then parse ... single element pipeline producer.parse (input); } catch (IOException e) { throw new TransformerException ("transform failed", e); } catch (SAXException e) { if (ex == null && ex.getCause () == e) throw ex; else throw new TransformerException ("transform failed", e); } finally { ex = null; } }
public void transform (Source in, Result out) throws TransformerException { try { XMLReader producer; InputSource input; // Input from DOM? if (in instanceof DOMSource) { DOMSource source = (DOMSource) in; if (source.getNode () == null) throw new IllegalArgumentException ("no DOM node"); producer = new DomParser (source.getNode ()); input = null; // Input from SAX? } else if (in instanceof SAXSource) { SAXSource source = (SAXSource) in; producer = source.getXMLReader (); if (producer == null) producer = XMLReaderFactory.createXMLReader (); input = source.getInputSource (); if (input == null) { if (source.getSystemId () != null) input = new InputSource (source.getSystemId ()); else throw new IllegalArgumentException ( "missing SAX input"); } // Input from a stream or something? } else { producer = XMLReaderFactory.createXMLReader (); input = SAXSource.sourceToInputSource (in); if (input == null) throw new IllegalArgumentException ("missing input"); } // preserve original namespace prefixes try { producer.setFeature(handler.FEATURE_URI + "namespace-prefixes", true); } catch (Exception e) { /* ignore */ // FIXME if we couldn't, "NsFix" stage before the output .. } // arrange the output handler.setResult (out); EventFilter.bind (producer, handler); // then parse ... single element pipeline producer.parse (input); } catch (IOException e) { throw new TransformerException ("transform failed", e); } catch (SAXException e) { if (ex == null && ex.getCause () == e) throw ex; else throw new TransformerException ("transform failed", e); } finally { ex = null; } }
11,299
public ValidationConsumer (EventConsumer next) { super (next); setContentHandler (this); setDTDHandler (this); try { setProperty (DECL_HANDLER, this); } catch (Exception e) { /* "can't happen" */ } try { setProperty (LEXICAL_HANDLER, this); } catch (Exception e) { /* "can't happen" */ } }
public ValidationConsumer () { super (next); setContentHandler (this); setDTDHandler (this); try { setProperty (DECL_HANDLER, this); } catch (Exception e) { /* "can't happen" */ } try { setProperty (LEXICAL_HANDLER, this); } catch (Exception e) { /* "can't happen" */ } }
11,300
public ValidationConsumer (EventConsumer next) { super (next); setContentHandler (this); setDTDHandler (this); try { setProperty (DECL_HANDLER, this); } catch (Exception e) { /* "can't happen" */ } try { setProperty (LEXICAL_HANDLER, this); } catch (Exception e) { /* "can't happen" */ } }
public ValidationConsumer (EventConsumer next) { super (next); setContentHandler (this); setDTDHandler (this); try { setProperty (DECL_HANDLER, this); } catch (Exception e) { /* "can't happen" */ } try { setProperty (LEXICAL_HANDLER, this); } catch (Exception e) { /* "can't happen" */ } }
11,301
public DecimalFormatSymbols getDecimalFormatSymbols () { return symbols; }
public DecimalFormatSymbols getDecimalFormatSymbols () { return (DecimalFormatSymbols) symbols.clone(); }
11,302
public void setDecimalFormatSymbols (DecimalFormatSymbols newSymbols) { symbols = newSymbols; }
public void setDecimalFormatSymbols (DecimalFormatSymbols newSymbols) { symbols = (DecimalFormatSymbols) newSymbols.clone(); }
11,303
public static void main(String[] args) throws Exception { final ParsedArguments cmdLine = HELP_INFO.parse(args); final File entry = ARG_DIR.getFile(cmdLine); boolean deleteOk=false; if (!entry.exists()) { System.err.println(entry + " does not exist"); } // for this time, delete only empty directory (wait implementation of -r option) if(entry.isDirectory()){ final File[] subFile=entry.listFiles(); for(int i=0;i<subFile.length;i++){ final String name=subFile[i].getName(); if(!name.equals(".") && !name.equals("..")){ System.err.println("Directory is not empty"); return; } } } deleteOk=entry.delete(); if(!deleteOk){ System.err.println(entry + " does not deleted"); } }
public static void main(String[] args) throws Exception { final ParsedArguments cmdLine = HELP_INFO.parse(args); final File entry = ARG_DIR.getFile(cmdLine); boolean deleteOk=false; if (!entry.exists()) { System.err.println(entry + " does not exist"); } // for this time, delete only empty directory (wait implementation of -r option) if(entry.isDirectory()){ final File[] subFile=entry.listFiles(); for(int i=0;i<subFile.length;i++){ final String name=subFile[i].getName(); if(!name.equals(".") && !name.equals("..")){ System.err.println("Directory is not empty"); return; } } } deleteOk=entry.delete(); if(!deleteOk){ System.err.println(entry + " does not deleted"); } }
11,304
public void setSelectedItem(Object object) { selectedItem = object; if(object == null || list.contains(object)) fireContentsChanged(this, -1, -1); }
public void setSelectedItem(Object object) { selectedItem = object; fireContentsChanged(this, -1, -1); }
11,305
protected void fireIntervalAdded(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalAdded(event); } // for } // fireIntervalAdded()
protected void fireIntervalAdded (Object source, int startIndex, int endIndex) { ListDataEvent event; ListDataListener[] listeners; ListDataListener listener; int index; // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalAdded(event); } // for } // fireIntervalAdded()
11,306
protected void fireIntervalAdded(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalAdded(event); } // for } // fireIntervalAdded()
protected void fireIntervalAdded(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalAdded(event); } // for } // fireIntervalAdded()
11,307
protected void fireIntervalAdded(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalAdded(event); } // for } // fireIntervalAdded()
protected void fireIntervalAdded(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalAdded(event); } // for } // fireIntervalAdded()
11,308
protected void fireIntervalAdded(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalAdded(event); } // for } // fireIntervalAdded()
protected void fireIntervalAdded(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalAdded(event); } // for } // fireIntervalAdded()
11,309
protected void fireIntervalRemoved(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalRemoved(event); } // for } // fireIntervalRemoved()
protected void fireIntervalRemoved (Object source, int startIndex, int endIndex) { ListDataEvent event; ListDataListener[] listeners; ListDataListener listener; int index; // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalRemoved(event); } // for } // fireIntervalRemoved()
11,310
protected void fireIntervalRemoved(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalRemoved(event); } // for } // fireIntervalRemoved()
protected void fireIntervalRemoved(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalRemoved(event); } // for } // fireIntervalRemoved()
11,311
protected void fireIntervalRemoved(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalRemoved(event); } // for } // fireIntervalRemoved()
protected void fireIntervalRemoved(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalRemoved(event); } // for } // fireIntervalRemoved()
11,312
protected void fireIntervalRemoved(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalRemoved(event); } // for } // fireIntervalRemoved()
protected void fireIntervalRemoved(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalRemoved(event); } // for } // fireIntervalRemoved()
11,313
public Node adoptNode(Node source) { switch (source.getNodeType()) { case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: throw new DomEx(DomEx.NOT_SUPPORTED_ERR); case ENTITY_NODE: case NOTATION_NODE: throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } if (source instanceof DomNode) { DomNode src = (DomNode) source; DomNode dst = src; if (dst.parent != null) { dst = (DomNode) dst.cloneNode(true); } dst.setOwner(this); src.notifyUserDataHandlers(UserDataHandler.NODE_ADOPTED, src, dst); return dst; } return null; }
public Node adoptNode(Node source) { switch (source.getNodeType()) { case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR); case ENTITY_NODE: case NOTATION_NODE: throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } if (source instanceof DomNode) { DomNode src = (DomNode) source; DomNode dst = src; if (dst.parent != null) { dst = (DomNode) dst.cloneNode(true); } dst.setOwner(this); src.notifyUserDataHandlers(UserDataHandler.NODE_ADOPTED, src, dst); return dst; } return null; }
11,314
public Node adoptNode(Node source) { switch (source.getNodeType()) { case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: throw new DomEx(DomEx.NOT_SUPPORTED_ERR); case ENTITY_NODE: case NOTATION_NODE: throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } if (source instanceof DomNode) { DomNode src = (DomNode) source; DomNode dst = src; if (dst.parent != null) { dst = (DomNode) dst.cloneNode(true); } dst.setOwner(this); src.notifyUserDataHandlers(UserDataHandler.NODE_ADOPTED, src, dst); return dst; } return null; }
public Node adoptNode(Node source) { switch (source.getNodeType()) { case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: throw new DomEx(DomEx.NOT_SUPPORTED_ERR); case ENTITY_NODE: case NOTATION_NODE: throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } if (source instanceof DomNode) { DomNode src = (DomNode) source; DomNode dst = src; if (dst.parent != null) { dst = (DomNode) dst.cloneNode(true); } dst.setOwner(this); src.notifyUserDataHandlers(UserDataHandler.NODE_ADOPTED, src, dst); return dst; } return null; }
11,315
static void checkNCName(String name, boolean xml11) { checkName(name, xml11); int len = name.length(); int index = name.indexOf(':'); if (index != -1) { if (index == 0 || index == (len - 1) || name.lastIndexOf(':') != index) { throw new DomEx(DomEx.NAMESPACE_ERR, name, null, 0); } } }
static void checkNCName(String name, boolean xml11) { checkName(name, xml11); int len = name.length(); int index = name.indexOf(':'); if (index != -1) { if (index == 0 || index == (len - 1) || name.lastIndexOf(':') != index) { throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0); } } }
11,316
static void checkName(String name, boolean xml11) { if (name == null) { throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0); } int len = name.length(); if (len == 0) { throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0); } // dog: rewritten to use the rules for XML 1.0 and 1.1 // Name start character char c = name.charAt(0); if (xml11) { // XML 1.1 if ((c < 0x0041 || c > 0x005a) && (c < 0x0061 || c > 0x007a) && c != ':' && c != '_' && (c < 0x00c0 || c > 0x00d6) && (c < 0x00d8 || c > 0x00f6) && (c < 0x00f8 || c > 0x02ff) && (c < 0x0370 || c > 0x037d) && (c < 0x037f || c > 0x1fff) && (c < 0x200c || c > 0x200d) && (c < 0x2070 || c > 0x218f) && (c < 0x2c00 || c > 0x2fef) && (c < 0x3001 || c > 0xd7ff) && (c < 0xf900 || c > 0xfdcf) && (c < 0xfdf0 || c > 0xfffd) && (c < 0x10000 || c > 0xeffff)) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } else { // XML 1.0 int type = Character.getType(c); switch (type) { case Character.LOWERCASE_LETTER: // Ll case Character.UPPERCASE_LETTER: // Lu case Character.OTHER_LETTER: // Lo case Character.TITLECASE_LETTER: // Lt case Character.LETTER_NUMBER: // Nl if ((c > 0xf900 && c < 0xfffe) || (c >= 0x20dd && c <= 0x20e0)) { // Compatibility area and Unicode 2.0 exclusions throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } break; default: if (c != ':' && c != '_' && (c < 0x02bb || c > 0x02c1) && c != 0x0559 && c != 0x06e5 && c != 0x06e6) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } } // Subsequent characters for (int i = 1; i < len; i++) { c = name.charAt(i); if (xml11) { // XML 1.1 if ((c < 0x0041 || c > 0x005a) && (c < 0x0061 || c > 0x007a) && (c < 0x0030 || c > 0x0039) && c != ':' && c != '_' && c != '-' && c != '.' && (c < 0x00c0 || c > 0x00d6) && (c < 0x00d8 || c > 0x00f6) && (c < 0x00f8 || c > 0x02ff) && (c < 0x0370 || c > 0x037d) && (c < 0x037f || c > 0x1fff) && (c < 0x200c || c > 0x200d) && (c < 0x2070 || c > 0x218f) && (c < 0x2c00 || c > 0x2fef) && (c < 0x3001 || c > 0xd7ff) && (c < 0xf900 || c > 0xfdcf) && (c < 0xfdf0 || c > 0xfffd) && (c < 0x10000 || c > 0xeffff) && c != 0x00b7 && (c < 0x0300 || c > 0x036f) && (c < 0x203f || c > 0x2040)) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } else { // XML 1.0 int type = Character.getType(c); switch (type) { case Character.LOWERCASE_LETTER: // Ll case Character.UPPERCASE_LETTER: // Lu case Character.DECIMAL_DIGIT_NUMBER: // Nd case Character.OTHER_LETTER: // Lo case Character.TITLECASE_LETTER: // Lt case Character.LETTER_NUMBER: // Nl case Character.COMBINING_SPACING_MARK: // Mc case Character.ENCLOSING_MARK: // Me case Character.NON_SPACING_MARK: // Mn case Character.MODIFIER_LETTER: // Lm if ((c > 0xf900 && c < 0xfffe) || (c >= 0x20dd && c <= 0x20e0)) { // Compatibility area and Unicode 2.0 exclusions throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } break; default: if (c != '-' && c != '.' && c != ':' && c != '_' && c != 0x0387 && (c < 0x02bb || c > 0x02c1) && c != 0x0559 && c != 0x06e5 && c != 0x06e6 && c != 0x00b7) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } } } // FIXME characters with a font or compatibility decomposition (i.e. // those with a "compatibility formatting tag" in field 5 of the // database -- marked by field 5 beginning with a "<") are not allowed. }
static void checkName(String name, boolean xml11) { if (name == null) { throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0); } int len = name.length(); if (len == 0) { throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0); } // dog: rewritten to use the rules for XML 1.0 and 1.1 // Name start character char c = name.charAt(0); if (xml11) { // XML 1.1 if ((c < 0x0041 || c > 0x005a) && (c < 0x0061 || c > 0x007a) && c != ':' && c != '_' && (c < 0x00c0 || c > 0x00d6) && (c < 0x00d8 || c > 0x00f6) && (c < 0x00f8 || c > 0x02ff) && (c < 0x0370 || c > 0x037d) && (c < 0x037f || c > 0x1fff) && (c < 0x200c || c > 0x200d) && (c < 0x2070 || c > 0x218f) && (c < 0x2c00 || c > 0x2fef) && (c < 0x3001 || c > 0xd7ff) && (c < 0xf900 || c > 0xfdcf) && (c < 0xfdf0 || c > 0xfffd) && (c < 0x10000 || c > 0xeffff)) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } else { // XML 1.0 int type = Character.getType(c); switch (type) { case Character.LOWERCASE_LETTER: // Ll case Character.UPPERCASE_LETTER: // Lu case Character.OTHER_LETTER: // Lo case Character.TITLECASE_LETTER: // Lt case Character.LETTER_NUMBER: // Nl if ((c > 0xf900 && c < 0xfffe) || (c >= 0x20dd && c <= 0x20e0)) { // Compatibility area and Unicode 2.0 exclusions throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } break; default: if (c != ':' && c != '_' && (c < 0x02bb || c > 0x02c1) && c != 0x0559 && c != 0x06e5 && c != 0x06e6) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } } // Subsequent characters for (int i = 1; i < len; i++) { c = name.charAt(i); if (xml11) { // XML 1.1 if ((c < 0x0041 || c > 0x005a) && (c < 0x0061 || c > 0x007a) && (c < 0x0030 || c > 0x0039) && c != ':' && c != '_' && c != '-' && c != '.' && (c < 0x00c0 || c > 0x00d6) && (c < 0x00d8 || c > 0x00f6) && (c < 0x00f8 || c > 0x02ff) && (c < 0x0370 || c > 0x037d) && (c < 0x037f || c > 0x1fff) && (c < 0x200c || c > 0x200d) && (c < 0x2070 || c > 0x218f) && (c < 0x2c00 || c > 0x2fef) && (c < 0x3001 || c > 0xd7ff) && (c < 0xf900 || c > 0xfdcf) && (c < 0xfdf0 || c > 0xfffd) && (c < 0x10000 || c > 0xeffff) && c != 0x00b7 && (c < 0x0300 || c > 0x036f) && (c < 0x203f || c > 0x2040)) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } else { // XML 1.0 int type = Character.getType(c); switch (type) { case Character.LOWERCASE_LETTER: // Ll case Character.UPPERCASE_LETTER: // Lu case Character.DECIMAL_DIGIT_NUMBER: // Nd case Character.OTHER_LETTER: // Lo case Character.TITLECASE_LETTER: // Lt case Character.LETTER_NUMBER: // Nl case Character.COMBINING_SPACING_MARK: // Mc case Character.ENCLOSING_MARK: // Me case Character.NON_SPACING_MARK: // Mn case Character.MODIFIER_LETTER: // Lm if ((c > 0xf900 && c < 0xfffe) || (c >= 0x20dd && c <= 0x20e0)) { // Compatibility area and Unicode 2.0 exclusions throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } break; default: if (c != '-' && c != '.' && c != ':' && c != '_' && c != 0x0387 && (c < 0x02bb || c > 0x02c1) && c != 0x0559 && c != 0x06e5 && c != 0x06e6 && c != 0x00b7) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } } } // FIXME characters with a font or compatibility decomposition (i.e. // those with a "compatibility formatting tag" in field 5 of the // database -- marked by field 5 beginning with a "<") are not allowed. }
11,317
static void checkName(String name, boolean xml11) { if (name == null) { throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0); } int len = name.length(); if (len == 0) { throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0); } // dog: rewritten to use the rules for XML 1.0 and 1.1 // Name start character char c = name.charAt(0); if (xml11) { // XML 1.1 if ((c < 0x0041 || c > 0x005a) && (c < 0x0061 || c > 0x007a) && c != ':' && c != '_' && (c < 0x00c0 || c > 0x00d6) && (c < 0x00d8 || c > 0x00f6) && (c < 0x00f8 || c > 0x02ff) && (c < 0x0370 || c > 0x037d) && (c < 0x037f || c > 0x1fff) && (c < 0x200c || c > 0x200d) && (c < 0x2070 || c > 0x218f) && (c < 0x2c00 || c > 0x2fef) && (c < 0x3001 || c > 0xd7ff) && (c < 0xf900 || c > 0xfdcf) && (c < 0xfdf0 || c > 0xfffd) && (c < 0x10000 || c > 0xeffff)) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } else { // XML 1.0 int type = Character.getType(c); switch (type) { case Character.LOWERCASE_LETTER: // Ll case Character.UPPERCASE_LETTER: // Lu case Character.OTHER_LETTER: // Lo case Character.TITLECASE_LETTER: // Lt case Character.LETTER_NUMBER: // Nl if ((c > 0xf900 && c < 0xfffe) || (c >= 0x20dd && c <= 0x20e0)) { // Compatibility area and Unicode 2.0 exclusions throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } break; default: if (c != ':' && c != '_' && (c < 0x02bb || c > 0x02c1) && c != 0x0559 && c != 0x06e5 && c != 0x06e6) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } } // Subsequent characters for (int i = 1; i < len; i++) { c = name.charAt(i); if (xml11) { // XML 1.1 if ((c < 0x0041 || c > 0x005a) && (c < 0x0061 || c > 0x007a) && (c < 0x0030 || c > 0x0039) && c != ':' && c != '_' && c != '-' && c != '.' && (c < 0x00c0 || c > 0x00d6) && (c < 0x00d8 || c > 0x00f6) && (c < 0x00f8 || c > 0x02ff) && (c < 0x0370 || c > 0x037d) && (c < 0x037f || c > 0x1fff) && (c < 0x200c || c > 0x200d) && (c < 0x2070 || c > 0x218f) && (c < 0x2c00 || c > 0x2fef) && (c < 0x3001 || c > 0xd7ff) && (c < 0xf900 || c > 0xfdcf) && (c < 0xfdf0 || c > 0xfffd) && (c < 0x10000 || c > 0xeffff) && c != 0x00b7 && (c < 0x0300 || c > 0x036f) && (c < 0x203f || c > 0x2040)) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } else { // XML 1.0 int type = Character.getType(c); switch (type) { case Character.LOWERCASE_LETTER: // Ll case Character.UPPERCASE_LETTER: // Lu case Character.DECIMAL_DIGIT_NUMBER: // Nd case Character.OTHER_LETTER: // Lo case Character.TITLECASE_LETTER: // Lt case Character.LETTER_NUMBER: // Nl case Character.COMBINING_SPACING_MARK: // Mc case Character.ENCLOSING_MARK: // Me case Character.NON_SPACING_MARK: // Mn case Character.MODIFIER_LETTER: // Lm if ((c > 0xf900 && c < 0xfffe) || (c >= 0x20dd && c <= 0x20e0)) { // Compatibility area and Unicode 2.0 exclusions throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } break; default: if (c != '-' && c != '.' && c != ':' && c != '_' && c != 0x0387 && (c < 0x02bb || c > 0x02c1) && c != 0x0559 && c != 0x06e5 && c != 0x06e6 && c != 0x00b7) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } } } // FIXME characters with a font or compatibility decomposition (i.e. // those with a "compatibility formatting tag" in field 5 of the // database -- marked by field 5 beginning with a "<") are not allowed. }
static void checkName(String name, boolean xml11) { if (name == null) { throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0); } int len = name.length(); if (len == 0) { throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0); } // dog: rewritten to use the rules for XML 1.0 and 1.1 // Name start character char c = name.charAt(0); if (xml11) { // XML 1.1 if ((c < 0x0041 || c > 0x005a) && (c < 0x0061 || c > 0x007a) && c != ':' && c != '_' && (c < 0x00c0 || c > 0x00d6) && (c < 0x00d8 || c > 0x00f6) && (c < 0x00f8 || c > 0x02ff) && (c < 0x0370 || c > 0x037d) && (c < 0x037f || c > 0x1fff) && (c < 0x200c || c > 0x200d) && (c < 0x2070 || c > 0x218f) && (c < 0x2c00 || c > 0x2fef) && (c < 0x3001 || c > 0xd7ff) && (c < 0xf900 || c > 0xfdcf) && (c < 0xfdf0 || c > 0xfffd) && (c < 0x10000 || c > 0xeffff)) { throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, name, null, c); } } else { // XML 1.0 int type = Character.getType(c); switch (type) { case Character.LOWERCASE_LETTER: // Ll case Character.UPPERCASE_LETTER: // Lu case Character.OTHER_LETTER: // Lo case Character.TITLECASE_LETTER: // Lt case Character.LETTER_NUMBER: // Nl if ((c > 0xf900 && c < 0xfffe) || (c >= 0x20dd && c <= 0x20e0)) { // Compatibility area and Unicode 2.0 exclusions throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, name, null, c); } break; default: if (c != ':' && c != '_' && (c < 0x02bb || c > 0x02c1) && c != 0x0559 && c != 0x06e5 && c != 0x06e6) { throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, name, null, c); } } } // Subsequent characters for (int i = 1; i < len; i++) { c = name.charAt(i); if (xml11) { // XML 1.1 if ((c < 0x0041 || c > 0x005a) && (c < 0x0061 || c > 0x007a) && (c < 0x0030 || c > 0x0039) && c != ':' && c != '_' && c != '-' && c != '.' && (c < 0x00c0 || c > 0x00d6) && (c < 0x00d8 || c > 0x00f6) && (c < 0x00f8 || c > 0x02ff) && (c < 0x0370 || c > 0x037d) && (c < 0x037f || c > 0x1fff) && (c < 0x200c || c > 0x200d) && (c < 0x2070 || c > 0x218f) && (c < 0x2c00 || c > 0x2fef) && (c < 0x3001 || c > 0xd7ff) && (c < 0xf900 || c > 0xfdcf) && (c < 0xfdf0 || c > 0xfffd) && (c < 0x10000 || c > 0xeffff) && c != 0x00b7 && (c < 0x0300 || c > 0x036f) && (c < 0x203f || c > 0x2040)) { throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, name, null, c); } } else { // XML 1.0 int type = Character.getType(c); switch (type) { case Character.LOWERCASE_LETTER: // Ll case Character.UPPERCASE_LETTER: // Lu case Character.DECIMAL_DIGIT_NUMBER: // Nd case Character.OTHER_LETTER: // Lo case Character.TITLECASE_LETTER: // Lt case Character.LETTER_NUMBER: // Nl case Character.COMBINING_SPACING_MARK: // Mc case Character.ENCLOSING_MARK: // Me case Character.NON_SPACING_MARK: // Mn case Character.MODIFIER_LETTER: // Lm if ((c > 0xf900 && c < 0xfffe) || (c >= 0x20dd && c <= 0x20e0)) { // Compatibility area and Unicode 2.0 exclusions throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, name, null, c); } break; default: if (c != '-' && c != '.' && c != ':' && c != '_' && c != 0x0387 && (c < 0x02bb || c > 0x02c1) && c != 0x0559 && c != 0x06e5 && c != 0x06e6 && c != 0x00b7) { throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, name, null, c); } } } } // FIXME characters with a font or compatibility decomposition (i.e. // those with a "compatibility formatting tag" in field 5 of the // database -- marked by field 5 beginning with a "<") are not allowed. }
11,318
private void checkNewChild(Node newChild) { if (newChild.getNodeType() == ELEMENT_NODE && getDocumentElement() != null) { throw new DomEx (DomEx.HIERARCHY_REQUEST_ERR, "document element already present: " + getDocumentElement(), newChild, 0); } if (newChild.getNodeType() == DOCUMENT_TYPE_NODE && getDoctype() != null) { throw new DomEx (DomEx.HIERARCHY_REQUEST_ERR, "document type already present: " + getDoctype(), newChild, 0); } }
private void checkNewChild(Node newChild) { if (newChild.getNodeType() == ELEMENT_NODE && getDocumentElement() != null) { throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR, "document element already present: " + getDocumentElement(), newChild, 0); } if (newChild.getNodeType() == DOCUMENT_TYPE_NODE && getDoctype() != null) { throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR, "document type already present: " + getDoctype(), newChild, 0); } }
11,319
public Attr createAttributeNS(String namespaceURI, String name) { if (checkingCharacters) { checkNCName(name, "1.1".equals(version)); } if ("".equals(namespaceURI)) { namespaceURI = null; } if (name.startsWith ("xml:")) { if (namespaceURI == null) { namespaceURI = XMLConstants.XML_NS_URI; } else if (!XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace is always " + XMLConstants.XML_NS_URI, this, 0); } } else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) || name.startsWith("xmlns:")) { if (namespaceURI == null) { namespaceURI = XMLConstants.XMLNS_ATTRIBUTE_NS_URI; } else if (!XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, this, 0); } } else if (namespaceURI == null && name.indexOf(':') != -1) { throw new DomEx(DomEx.NAMESPACE_ERR, "prefixed name needs a URI: " + name, this, 0); } return new DomAttr(this, namespaceURI, name); }
public Attr createAttributeNS(String namespaceURI, String name) { if (checkingCharacters) { checkNCName(name, "1.1".equals(version)); } if ("".equals(namespaceURI)) { namespaceURI = null; } if (name.startsWith ("xml:")) { if (namespaceURI == null) { namespaceURI = XMLConstants.XML_NS_URI; } else if (!XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomDOMException(DOMException.NAMESPACE_ERR, "xml namespace is always " + XMLConstants.XML_NS_URI, this, 0); } } else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) || name.startsWith("xmlns:")) { if (namespaceURI == null) { namespaceURI = XMLConstants.XMLNS_ATTRIBUTE_NS_URI; } else if (!XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomDOMException(DOMException.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, this, 0); } } else if (namespaceURI == null && name.indexOf(':') != -1) { throw new DomDOMException(DOMException.NAMESPACE_ERR, "prefixed name needs a URI: " + name, this, 0); } return new DomAttr(this, namespaceURI, name); }
11,320
public CDATASection createCDATASection(String value) { if (checkingCharacters) { checkChar(value, "1.1".equals(version)); } return new DomCDATA(this, value); }
public CDATASection createCDATASection(String value) { if (checkingCharacters) { checkChar(value, "1.1".equals(version)); } return new DomCDATASection(this, value); }
11,321
public DocumentFragment createDocumentFragment() { return new DomFragment(this); }
public DocumentFragment createDocumentFragment() { return new DomDocumentFragment(this); }
11,322
public Element createElementNS(String namespaceURI, String name) { if (checkingCharacters) { checkNCName(name, "1.1".equals(version)); } if ("".equals(namespaceURI)) { namespaceURI = null; } if (name.startsWith("xml:")) { if (namespaceURI != null && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace is always " + XMLConstants.XML_NS_URI, this, 0); } namespaceURI = XMLConstants.XML_NS_URI; } else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) || name.startsWith("xmlns:")) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns is reserved", this, 0); } else if (namespaceURI == null && name.indexOf(':') != -1) { throw new DomEx(DomEx.NAMESPACE_ERR, "prefixed name '" + name + "' needs a URI", this, 0); } Element element = new DomElement(this, namespaceURI, name); defaultAttributes(element, name); return element; }
public Element createElementNS(String namespaceURI, String name) { if (checkingCharacters) { checkNCName(name, "1.1".equals(version)); } if ("".equals(namespaceURI)) { namespaceURI = null; } if (name.startsWith("xml:")) { if (namespaceURI != null && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomDOMException(DOMException.NAMESPACE_ERR, "xml namespace is always " + XMLConstants.XML_NS_URI, this, 0); } namespaceURI = XMLConstants.XML_NS_URI; } else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) || name.startsWith("xmlns:")) { throw new DomDOMException(DOMException.NAMESPACE_ERR, "xmlns is reserved", this, 0); } else if (namespaceURI == null && name.indexOf(':') != -1) { throw new DomDOMException(DOMException.NAMESPACE_ERR, "prefixed name '" + name + "' needs a URI", this, 0); } Element element = new DomElement(this, namespaceURI, name); defaultAttributes(element, name); return element; }
11,323
public Element createElementNS(String namespaceURI, String name) { if (checkingCharacters) { checkNCName(name, "1.1".equals(version)); } if ("".equals(namespaceURI)) { namespaceURI = null; } if (name.startsWith("xml:")) { if (namespaceURI != null && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace is always " + XMLConstants.XML_NS_URI, this, 0); } namespaceURI = XMLConstants.XML_NS_URI; } else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) || name.startsWith("xmlns:")) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns is reserved", this, 0); } else if (namespaceURI == null && name.indexOf(':') != -1) { throw new DomEx(DomEx.NAMESPACE_ERR, "prefixed name '" + name + "' needs a URI", this, 0); } Element element = new DomElement(this, namespaceURI, name); defaultAttributes(element, name); return element; }
public Element createElementNS(String namespaceURI, String name) { if (checkingCharacters) { checkNCName(name, "1.1".equals(version)); } if ("".equals(namespaceURI)) { namespaceURI = null; } if (name.startsWith("xml:")) { if (namespaceURI != null && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace is always " + XMLConstants.XML_NS_URI, this, 0); } namespaceURI = XMLConstants.XML_NS_URI; } else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) || name.startsWith("xmlns:")) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns is reserved", this, 0); } else if (namespaceURI == null && name.indexOf(':') != -1) { throw new DomEx(DomEx.NAMESPACE_ERR, "prefixed name '" + name + "' needs a URI", this, 0); } Element element = new DomElement(this, namespaceURI, name); defaultAttributes(element, name); return element; }
11,324
public ProcessingInstruction createProcessingInstruction(String target, String data) { if (checkingCharacters) { boolean xml11 = "1.1".equals(version); checkName(target, xml11); if ("xml".equalsIgnoreCase(target)) { throw new DomEx(DomEx.SYNTAX_ERR, "illegal PI target name", this, 0); } checkChar(data, xml11); } return new DomPI(this, target, data); }
public ProcessingInstruction createProcessingInstruction(String target, String data) { if (checkingCharacters) { boolean xml11 = "1.1".equals(version); checkName(target, xml11); if ("xml".equalsIgnoreCase(target)) { throw new DomEx(DomEx.SYNTAX_ERR, "illegal PI target name", this, 0); } checkChar(data, xml11); } return new DomPI(this, target, data); }
11,325
public ProcessingInstruction createProcessingInstruction(String target, String data) { if (checkingCharacters) { boolean xml11 = "1.1".equals(version); checkName(target, xml11); if ("xml".equalsIgnoreCase(target)) { throw new DomEx(DomEx.SYNTAX_ERR, "illegal PI target name", this, 0); } checkChar(data, xml11); } return new DomPI(this, target, data); }
public ProcessingInstruction createProcessingInstruction(String target, String data) { if (checkingCharacters) { boolean xml11 = "1.1".equals(version); checkName(target, xml11); if ("xml".equalsIgnoreCase(target)) { throw new DomEx(DomEx.SYNTAX_ERR, "illegal PI target name", this, 0); } checkChar(data, xml11); } return new DomProcessingInstruction(this, target, data); }
11,326
public Node importNode(Node src, boolean deep) { Node dst = null; switch (src.getNodeType()) { case TEXT_NODE: dst = createTextNode(src.getNodeValue()); break; case CDATA_SECTION_NODE: dst = createCDATASection(src.getNodeValue()); break; case COMMENT_NODE: dst = createComment(src.getNodeValue()); break; case PROCESSING_INSTRUCTION_NODE: dst = createProcessingInstruction(src.getNodeName(), src.getNodeValue()); break; case NOTATION_NODE: // NOTE: There's no standard way to create // these, or add them to a doctype. Useless. Notation notation = (Notation) src; dst = new DomNotation(this, notation.getNodeName(), notation.getPublicId(), notation.getSystemId()); break; case ENTITY_NODE: // NOTE: There's no standard way to create // these, or add them to a doctype. Useless. Entity entity = (Entity) src; dst = new DomEntity(this, entity.getNodeName(), entity.getPublicId(), entity.getSystemId(), entity.getNotationName()); if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, deep)); } } break; case ENTITY_REFERENCE_NODE: dst = createEntityReference(src.getNodeName()); break; case DOCUMENT_FRAGMENT_NODE: dst = new DomFragment(this); if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, deep)); } } break; case ATTRIBUTE_NODE: String attr_nsuri = src.getNamespaceURI(); if (attr_nsuri != null) { dst = createAttributeNS(attr_nsuri, src.getNodeName()); } else { dst = createAttribute(src.getNodeName()); } // this is _always_ done regardless of "deep" setting for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, false)); } break; case ELEMENT_NODE: String elem_nsuri = src.getNamespaceURI(); if (elem_nsuri != null) { dst = createElementNS(elem_nsuri, src.getNodeName()); } else { dst = createElement(src.getNodeName()); } NamedNodeMap srcAttrs = src.getAttributes(); NamedNodeMap dstAttrs = dst.getAttributes(); int len = srcAttrs.getLength(); for (int i = 0; i < len; i++) { Attr a = (Attr) srcAttrs.item(i); Attr dflt; // maybe update defaulted attributes dflt = (Attr) dstAttrs.getNamedItem(a.getNodeName()); if (dflt != null) { String newval = a.getNodeValue(); if (!dflt.getNodeValue().equals(newval) || a.getSpecified () == true) { dflt.setNodeValue (newval); } continue; } dstAttrs.setNamedItem((Attr) importNode(a, false)); } if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, true)); } } break; // can't import document or doctype nodes case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: // FALLTHROUGH // can't import unrecognized or nonstandard nodes default: throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, src, 0); } // FIXME cleanup a bit -- for deep copies, copy those // children in one place, here (code sharing is healthy) if (src instanceof DomNode) { ((DomNode) src).notifyUserDataHandlers(UserDataHandler.NODE_IMPORTED, src, dst); } return dst; }
public Node importNode(Node src, boolean deep) { Node dst = null; switch (src.getNodeType()) { case TEXT_NODE: dst = createTextNode(src.getNodeValue()); break; case CDATA_SECTION_NODE: dst = createCDATASection(src.getNodeValue()); break; case COMMENT_NODE: dst = createComment(src.getNodeValue()); break; case PROCESSING_INSTRUCTION_NODE: dst = createProcessingInstruction(src.getNodeName(), src.getNodeValue()); break; case NOTATION_NODE: // NOTE: There's no standard way to create // these, or add them to a doctype. Useless. Notation notation = (Notation) src; dst = new DomNotation(this, notation.getNodeName(), notation.getPublicId(), notation.getSystemId()); break; case ENTITY_NODE: // NOTE: There's no standard way to create // these, or add them to a doctype. Useless. Entity entity = (Entity) src; dst = new DomEntity(this, entity.getNodeName(), entity.getPublicId(), entity.getSystemId(), entity.getNotationName()); if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, deep)); } } break; case ENTITY_REFERENCE_NODE: dst = createEntityReference(src.getNodeName()); break; case DOCUMENT_FRAGMENT_NODE: dst = new DomDocumentFragment(this); if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, deep)); } } break; case ATTRIBUTE_NODE: String attr_nsuri = src.getNamespaceURI(); if (attr_nsuri != null) { dst = createAttributeNS(attr_nsuri, src.getNodeName()); } else { dst = createAttribute(src.getNodeName()); } // this is _always_ done regardless of "deep" setting for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, false)); } break; case ELEMENT_NODE: String elem_nsuri = src.getNamespaceURI(); if (elem_nsuri != null) { dst = createElementNS(elem_nsuri, src.getNodeName()); } else { dst = createElement(src.getNodeName()); } NamedNodeMap srcAttrs = src.getAttributes(); NamedNodeMap dstAttrs = dst.getAttributes(); int len = srcAttrs.getLength(); for (int i = 0; i < len; i++) { Attr a = (Attr) srcAttrs.item(i); Attr dflt; // maybe update defaulted attributes dflt = (Attr) dstAttrs.getNamedItem(a.getNodeName()); if (dflt != null) { String newval = a.getNodeValue(); if (!dflt.getNodeValue().equals(newval) || a.getSpecified () == true) { dflt.setNodeValue (newval); } continue; } dstAttrs.setNamedItem((Attr) importNode(a, false)); } if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, true)); } } break; // can't import document or doctype nodes case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: // FALLTHROUGH // can't import unrecognized or nonstandard nodes default: throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, src, 0); } // FIXME cleanup a bit -- for deep copies, copy those // children in one place, here (code sharing is healthy) if (src instanceof DomNode) { ((DomNode) src).notifyUserDataHandlers(UserDataHandler.NODE_IMPORTED, src, dst); } return dst; }
11,327
public Node importNode(Node src, boolean deep) { Node dst = null; switch (src.getNodeType()) { case TEXT_NODE: dst = createTextNode(src.getNodeValue()); break; case CDATA_SECTION_NODE: dst = createCDATASection(src.getNodeValue()); break; case COMMENT_NODE: dst = createComment(src.getNodeValue()); break; case PROCESSING_INSTRUCTION_NODE: dst = createProcessingInstruction(src.getNodeName(), src.getNodeValue()); break; case NOTATION_NODE: // NOTE: There's no standard way to create // these, or add them to a doctype. Useless. Notation notation = (Notation) src; dst = new DomNotation(this, notation.getNodeName(), notation.getPublicId(), notation.getSystemId()); break; case ENTITY_NODE: // NOTE: There's no standard way to create // these, or add them to a doctype. Useless. Entity entity = (Entity) src; dst = new DomEntity(this, entity.getNodeName(), entity.getPublicId(), entity.getSystemId(), entity.getNotationName()); if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, deep)); } } break; case ENTITY_REFERENCE_NODE: dst = createEntityReference(src.getNodeName()); break; case DOCUMENT_FRAGMENT_NODE: dst = new DomFragment(this); if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, deep)); } } break; case ATTRIBUTE_NODE: String attr_nsuri = src.getNamespaceURI(); if (attr_nsuri != null) { dst = createAttributeNS(attr_nsuri, src.getNodeName()); } else { dst = createAttribute(src.getNodeName()); } // this is _always_ done regardless of "deep" setting for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, false)); } break; case ELEMENT_NODE: String elem_nsuri = src.getNamespaceURI(); if (elem_nsuri != null) { dst = createElementNS(elem_nsuri, src.getNodeName()); } else { dst = createElement(src.getNodeName()); } NamedNodeMap srcAttrs = src.getAttributes(); NamedNodeMap dstAttrs = dst.getAttributes(); int len = srcAttrs.getLength(); for (int i = 0; i < len; i++) { Attr a = (Attr) srcAttrs.item(i); Attr dflt; // maybe update defaulted attributes dflt = (Attr) dstAttrs.getNamedItem(a.getNodeName()); if (dflt != null) { String newval = a.getNodeValue(); if (!dflt.getNodeValue().equals(newval) || a.getSpecified () == true) { dflt.setNodeValue (newval); } continue; } dstAttrs.setNamedItem((Attr) importNode(a, false)); } if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, true)); } } break; // can't import document or doctype nodes case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: // FALLTHROUGH // can't import unrecognized or nonstandard nodes default: throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, src, 0); } // FIXME cleanup a bit -- for deep copies, copy those // children in one place, here (code sharing is healthy) if (src instanceof DomNode) { ((DomNode) src).notifyUserDataHandlers(UserDataHandler.NODE_IMPORTED, src, dst); } return dst; }
public Node importNode(Node src, boolean deep) { Node dst = null; switch (src.getNodeType()) { case TEXT_NODE: dst = createTextNode(src.getNodeValue()); break; case CDATA_SECTION_NODE: dst = createCDATASection(src.getNodeValue()); break; case COMMENT_NODE: dst = createComment(src.getNodeValue()); break; case PROCESSING_INSTRUCTION_NODE: dst = createProcessingInstruction(src.getNodeName(), src.getNodeValue()); break; case NOTATION_NODE: // NOTE: There's no standard way to create // these, or add them to a doctype. Useless. Notation notation = (Notation) src; dst = new DomNotation(this, notation.getNodeName(), notation.getPublicId(), notation.getSystemId()); break; case ENTITY_NODE: // NOTE: There's no standard way to create // these, or add them to a doctype. Useless. Entity entity = (Entity) src; dst = new DomEntity(this, entity.getNodeName(), entity.getPublicId(), entity.getSystemId(), entity.getNotationName()); if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, deep)); } } break; case ENTITY_REFERENCE_NODE: dst = createEntityReference(src.getNodeName()); break; case DOCUMENT_FRAGMENT_NODE: dst = new DomFragment(this); if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, deep)); } } break; case ATTRIBUTE_NODE: String attr_nsuri = src.getNamespaceURI(); if (attr_nsuri != null) { dst = createAttributeNS(attr_nsuri, src.getNodeName()); } else { dst = createAttribute(src.getNodeName()); } // this is _always_ done regardless of "deep" setting for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, false)); } break; case ELEMENT_NODE: String elem_nsuri = src.getNamespaceURI(); if (elem_nsuri != null) { dst = createElementNS(elem_nsuri, src.getNodeName()); } else { dst = createElement(src.getNodeName()); } NamedNodeMap srcAttrs = src.getAttributes(); NamedNodeMap dstAttrs = dst.getAttributes(); int len = srcAttrs.getLength(); for (int i = 0; i < len; i++) { Attr a = (Attr) srcAttrs.item(i); Attr dflt; // maybe update defaulted attributes dflt = (Attr) dstAttrs.getNamedItem(a.getNodeName()); if (dflt != null) { String newval = a.getNodeValue(); if (!dflt.getNodeValue().equals(newval) || a.getSpecified () == true) { dflt.setNodeValue (newval); } continue; } dstAttrs.setNamedItem((Attr) importNode(a, false)); } if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, true)); } } break; // can't import document or doctype nodes case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: // FALLTHROUGH // can't import unrecognized or nonstandard nodes default: throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, null, src, 0); } // FIXME cleanup a bit -- for deep copies, copy those // children in one place, here (code sharing is healthy) if (src instanceof DomNode) { ((DomNode) src).notifyUserDataHandlers(UserDataHandler.NODE_IMPORTED, src, dst); } return dst; }
11,328
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { if (n instanceof DomNsNode) { DomNsNode src = (DomNsNode) n; if (src == null) { throw new DomEx(DomEx.NOT_FOUND_ERR); } if (src.owner != this) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0); } boolean xml11 = "1.1".equals(version); checkName(qualifiedName, xml11); int ci = qualifiedName.indexOf(':'); if ("".equals(namespaceURI)) { namespaceURI = null; } if (namespaceURI != null) { checkNCName(qualifiedName, xml11); String prefix = (ci == -1) ? "" : qualifiedName.substring(0, ci); if (XMLConstants.XML_NS_PREFIX.equals(prefix) && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } if (XMLConstants.XML_NS_URI.equals(namespaceURI) && !XMLConstants.XML_NS_PREFIX.equals(prefix)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI) && !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName))) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } } src.setNodeName(qualifiedName); src.setNamespaceURI(namespaceURI); src.notifyUserDataHandlers(UserDataHandler.NODE_RENAMED, src, src); // TODO MutationNameEvents // DOMElementNameChanged or DOMAttributeNameChanged return src; } throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0); }
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { if (n instanceof DomNsNode) { DomNsNode src = (DomNsNode) n; if (src == null) { throw new DomDOMException(DOMException.NOT_FOUND_ERR); } if (src.owner != this) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0); } boolean xml11 = "1.1".equals(version); checkName(qualifiedName, xml11); int ci = qualifiedName.indexOf(':'); if ("".equals(namespaceURI)) { namespaceURI = null; } if (namespaceURI != null) { checkNCName(qualifiedName, xml11); String prefix = (ci == -1) ? "" : qualifiedName.substring(0, ci); if (XMLConstants.XML_NS_PREFIX.equals(prefix) && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } if (XMLConstants.XML_NS_URI.equals(namespaceURI) && !XMLConstants.XML_NS_PREFIX.equals(prefix)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI) && !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName))) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } } src.setNodeName(qualifiedName); src.setNamespaceURI(namespaceURI); src.notifyUserDataHandlers(UserDataHandler.NODE_RENAMED, src, src); // TODO MutationNameEvents // DOMElementNameChanged or DOMAttributeNameChanged return src; } throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0); }
11,329
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { if (n instanceof DomNsNode) { DomNsNode src = (DomNsNode) n; if (src == null) { throw new DomEx(DomEx.NOT_FOUND_ERR); } if (src.owner != this) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0); } boolean xml11 = "1.1".equals(version); checkName(qualifiedName, xml11); int ci = qualifiedName.indexOf(':'); if ("".equals(namespaceURI)) { namespaceURI = null; } if (namespaceURI != null) { checkNCName(qualifiedName, xml11); String prefix = (ci == -1) ? "" : qualifiedName.substring(0, ci); if (XMLConstants.XML_NS_PREFIX.equals(prefix) && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } if (XMLConstants.XML_NS_URI.equals(namespaceURI) && !XMLConstants.XML_NS_PREFIX.equals(prefix)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI) && !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName))) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } } src.setNodeName(qualifiedName); src.setNamespaceURI(namespaceURI); src.notifyUserDataHandlers(UserDataHandler.NODE_RENAMED, src, src); // TODO MutationNameEvents // DOMElementNameChanged or DOMAttributeNameChanged return src; } throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0); }
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { if (n instanceof DomNsNode) { DomNsNode src = (DomNsNode) n; if (src == null) { throw new DomEx(DomEx.NOT_FOUND_ERR); } if (src.owner != this) { throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, null, src, 0); } boolean xml11 = "1.1".equals(version); checkName(qualifiedName, xml11); int ci = qualifiedName.indexOf(':'); if ("".equals(namespaceURI)) { namespaceURI = null; } if (namespaceURI != null) { checkNCName(qualifiedName, xml11); String prefix = (ci == -1) ? "" : qualifiedName.substring(0, ci); if (XMLConstants.XML_NS_PREFIX.equals(prefix) && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } if (XMLConstants.XML_NS_URI.equals(namespaceURI) && !XMLConstants.XML_NS_PREFIX.equals(prefix)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI) && !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName))) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } } src.setNodeName(qualifiedName); src.setNamespaceURI(namespaceURI); src.notifyUserDataHandlers(UserDataHandler.NODE_RENAMED, src, src); // TODO MutationNameEvents // DOMElementNameChanged or DOMAttributeNameChanged return src; } throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0); }
11,330
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { if (n instanceof DomNsNode) { DomNsNode src = (DomNsNode) n; if (src == null) { throw new DomEx(DomEx.NOT_FOUND_ERR); } if (src.owner != this) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0); } boolean xml11 = "1.1".equals(version); checkName(qualifiedName, xml11); int ci = qualifiedName.indexOf(':'); if ("".equals(namespaceURI)) { namespaceURI = null; } if (namespaceURI != null) { checkNCName(qualifiedName, xml11); String prefix = (ci == -1) ? "" : qualifiedName.substring(0, ci); if (XMLConstants.XML_NS_PREFIX.equals(prefix) && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } if (XMLConstants.XML_NS_URI.equals(namespaceURI) && !XMLConstants.XML_NS_PREFIX.equals(prefix)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI) && !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName))) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } } src.setNodeName(qualifiedName); src.setNamespaceURI(namespaceURI); src.notifyUserDataHandlers(UserDataHandler.NODE_RENAMED, src, src); // TODO MutationNameEvents // DOMElementNameChanged or DOMAttributeNameChanged return src; } throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0); }
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { if (n instanceof DomNsNode) { DomNsNode src = (DomNsNode) n; if (src == null) { throw new DomEx(DomEx.NOT_FOUND_ERR); } if (src.owner != this) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0); } boolean xml11 = "1.1".equals(version); checkName(qualifiedName, xml11); int ci = qualifiedName.indexOf(':'); if ("".equals(namespaceURI)) { namespaceURI = null; } if (namespaceURI != null) { checkNCName(qualifiedName, xml11); String prefix = (ci == -1) ? "" : qualifiedName.substring(0, ci); if (XMLConstants.XML_NS_PREFIX.equals(prefix) && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomDOMException(DOMException.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomDOMException(DOMException.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } if (XMLConstants.XML_NS_URI.equals(namespaceURI) && !XMLConstants.XML_NS_PREFIX.equals(prefix)) { throw new DomDOMException(DOMException.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI) && !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName))) { throw new DomDOMException(DOMException.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } } src.setNodeName(qualifiedName); src.setNamespaceURI(namespaceURI); src.notifyUserDataHandlers(UserDataHandler.NODE_RENAMED, src, src); // TODO MutationNameEvents // DOMElementNameChanged or DOMAttributeNameChanged return src; } throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0); }
11,331
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { if (n instanceof DomNsNode) { DomNsNode src = (DomNsNode) n; if (src == null) { throw new DomEx(DomEx.NOT_FOUND_ERR); } if (src.owner != this) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0); } boolean xml11 = "1.1".equals(version); checkName(qualifiedName, xml11); int ci = qualifiedName.indexOf(':'); if ("".equals(namespaceURI)) { namespaceURI = null; } if (namespaceURI != null) { checkNCName(qualifiedName, xml11); String prefix = (ci == -1) ? "" : qualifiedName.substring(0, ci); if (XMLConstants.XML_NS_PREFIX.equals(prefix) && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } if (XMLConstants.XML_NS_URI.equals(namespaceURI) && !XMLConstants.XML_NS_PREFIX.equals(prefix)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI) && !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName))) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } } src.setNodeName(qualifiedName); src.setNamespaceURI(namespaceURI); src.notifyUserDataHandlers(UserDataHandler.NODE_RENAMED, src, src); // TODO MutationNameEvents // DOMElementNameChanged or DOMAttributeNameChanged return src; } throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0); }
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { if (n instanceof DomNsNode) { DomNsNode src = (DomNsNode) n; if (src == null) { throw new DomEx(DomEx.NOT_FOUND_ERR); } if (src.owner != this) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0); } boolean xml11 = "1.1".equals(version); checkName(qualifiedName, xml11); int ci = qualifiedName.indexOf(':'); if ("".equals(namespaceURI)) { namespaceURI = null; } if (namespaceURI != null) { checkNCName(qualifiedName, xml11); String prefix = (ci == -1) ? "" : qualifiedName.substring(0, ci); if (XMLConstants.XML_NS_PREFIX.equals(prefix) && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } if (XMLConstants.XML_NS_URI.equals(namespaceURI) && !XMLConstants.XML_NS_PREFIX.equals(prefix)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI) && !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName))) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } } src.setNodeName(qualifiedName); src.setNamespaceURI(namespaceURI); src.notifyUserDataHandlers(UserDataHandler.NODE_RENAMED, src, src); // TODO MutationNameEvents // DOMElementNameChanged or DOMAttributeNameChanged return src; } throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, null, n, 0); }
11,332
public void setXmlVersion(String xmlVersion) { if (xmlVersion == null) { xmlVersion = "1.0"; } if ("1.0".equals(xmlVersion) || "1.1".equals(xmlVersion)) { version = xmlVersion; } else { throw new DomEx(DomEx.NOT_SUPPORTED_ERR); } }
public void setXmlVersion(String xmlVersion) { if (xmlVersion == null) { xmlVersion = "1.0"; } if ("1.0".equals(xmlVersion) || "1.1".equals(xmlVersion)) { version = xmlVersion; } else { throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR); } }
11,333
Request _create_request(Context context, String operation, NVList parameters, NamedValue returns, ExceptionList exceptions, ContextList ctx_list );
Request _create_request(Context context, String operation, NVList parameters, NamedValue returns, ExceptionList exceptions, ContextList ctx_list );
11,334
public abstract Request create_request(org.omg.CORBA.Object target, Context context, String operation, NVList parameters, NamedValue returns, ExceptionList exceptions, ContextList ctx_list );
public abstract Request create_request(org.omg.CORBA.Object target, Context context, String operation, NVList parameters, NamedValue returns, ExceptionList exceptions, ContextList ctx_list );
11,335
ParameterNode(TemplateNode children, TemplateNode next, String name, Expr select, boolean global) { super(children, next); this.name = name; this.select = select; this.global = global; }
ParameterNode(TemplateNode children, TemplateNode next, String name, Expr select, boolean global) { super(children, next); this.name = name; this.select = select; this.global = global; }
11,336
ParameterNode(TemplateNode children, TemplateNode next, String name, Expr select, boolean global) { super(children, next); this.name = name; this.select = select; this.global = global; }
ParameterNode(TemplateNode children, TemplateNode next, String name, Expr select, boolean global) { this.name = name; this.select = select; this.global = global; }
11,337
TemplateNode clone(Stylesheet stylesheet) { return new ParameterNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), name, select.clone(stylesheet), global); }
TemplateNode clone(Stylesheet stylesheet) { return new ParameterNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), name, select.clone(stylesheet), global); }
11,338
public void setLength(long length) throws IOException { throw new IOException("EXT2 implementation is currently readonly"); }
public void setLength(long length) throws IOException { long blockSize = iNode.getExt2FileSystem().getBlockSize(); if(length<getLength()) { long blockNr = length / blockSize; long blockOffset = length % blockSize; long nextBlock; if(blockOffset==0) nextBlock=blockNr; else nextBlock=blockNr+1; for(long i=iNode.getAllocatedBlockCount()-1; i>=nextBlock; i--) { log.debug("setLength(): freeing up block "+i+" of inode"); try{ iNode.freeDataBlock(i); }catch(FileSystemException fse) { throw new IOException(fse); } } iNode.setSize(length); try{ iNode.update(); }catch(FileSystemException fse) { throw new IOException(fse); } iNode.getExt2FileSystem().updateFS(); return; } if(length>getLength()) { long len = length - getLength(); long blocksAllocated = getLengthInBlocks(); long bytesAllocated = getLength(); long bytesCovered=0; while( bytesCovered < len ) { long blockIndex = (bytesAllocated+bytesCovered) / blockSize; long blockOffset = (bytesAllocated+bytesCovered) % blockSize; long newSection = Math.min(len-bytesCovered, blockSize - blockOffset); if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } bytesCovered += newSection; } iNode.setSize(length); return; } }
11,341
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { throw new IOException("EXT2 implementation is currently readonly"); }
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); try{ iNode.update(); }catch(FileSystemException fse) { throw new IOException(fse); } iNode.getExt2FileSystem().updateFS(); }
11,342
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); if (serialVersionOnStream < 1) { monetarySeparator = decimalSeparator; exponential = 'E'; serialVersionOnStream = 1; } }
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); if (serialVersionOnStream < 1) { monetarySeparator = decimalSeparator; exponential = 'E'; } }
11,343
public static Currency getInstance (String currencyCode) { Locale[] all_locales = Locale.getAvailableLocales (); for (int i=0;i<all_locales.length;i++) { Currency test_currency = getInstance (all_locales[i]); if (test_currency.getCurrencyCode() != null && test_currency.getCurrencyCode().equals(currencyCode)) return test_currency; } return null; }
public static Currency getInstance (Locale locale) { Locale[] all_locales = Locale.getAvailableLocales (); for (int i=0;i<all_locales.length;i++) { Currency test_currency = getInstance (all_locales[i]); if (test_currency.getCurrencyCode() != null && test_currency.getCurrencyCode().equals(currencyCode)) return test_currency; } return null; }
11,345
public static Currency getInstance (String currencyCode) { Locale[] all_locales = Locale.getAvailableLocales (); for (int i=0;i<all_locales.length;i++) { Currency test_currency = getInstance (all_locales[i]); if (test_currency.getCurrencyCode() != null && test_currency.getCurrencyCode().equals(currencyCode)) return test_currency; } return null; }
public static Currency getInstance (String currencyCode) { Locale[] all_locales = Locale.getAvailableLocales (); for (int i=0;i<all_locales.length;i++) { Currency test_currency = getInstance (all_locales[i]); if (test_currency.getCurrencyCode() != null && test_currency.getCurrencyCode().equals(currencyCode)) return test_currency; } return null; }
11,346
public static Currency getInstance (String currencyCode) { Locale[] all_locales = Locale.getAvailableLocales (); for (int i=0;i<all_locales.length;i++) { Currency test_currency = getInstance (all_locales[i]); if (test_currency.getCurrencyCode() != null && test_currency.getCurrencyCode().equals(currencyCode)) return test_currency; } return null; }
public static Currency getInstance (String currencyCode) { Locale[] all_locales = Locale.getAvailableLocales (); for (int i=0;i<all_locales.length;i++) { Currency test_currency = getInstance (all_locales[i]); if (test_currency.getCurrencyCode() != null && test_currency.getCurrencyCode().equals(currencyCode)) return test_currency; } return null; }
11,347
public static Currency getInstance (String currencyCode) { Locale[] all_locales = Locale.getAvailableLocales (); for (int i=0;i<all_locales.length;i++) { Currency test_currency = getInstance (all_locales[i]); if (test_currency.getCurrencyCode() != null && test_currency.getCurrencyCode().equals(currencyCode)) return test_currency; } return null; }
public static Currency getInstance (String currencyCode) { Locale[] all_locales = Locale.getAvailableLocales (); for (int i=0;i<all_locales.length;i++) { Currency test_currency = getInstance (all_locales[i]); if (test_currency.getCurrencyCode() != null && test_currency.getCurrencyCode().equals(currencyCode)) return test_currency; } return newCurrency; }
11,348
public synchronized void compile(Class remote) { reset(); String s; // Get the package. s = remote.getName(); int p = s.lastIndexOf('.'); if (p < 0) { // Root package. packag = ""; implName = name = s; } else { packag = s.substring(0, p); implName = name = s.substring(p + 1); } name = convertStubName(name); stubName = name; vars.put("#name", name); vars.put("#package", packag); vars.put("#implName", implName); if (verbose) System.out.println("Package " + packag + ", name " + name + " impl " + implName); // Get the implemented remotes. Class[] interfaces = remote.getInterfaces(); for (int i = 0; i < interfaces.length; i++) { if (Remote.class.isAssignableFrom(interfaces[i])) { if (! interfaces[i].equals(Remote.class)) { implementedRemotes.add(interfaces[i]); } } } vars.put("#idList", getIdList(implementedRemotes)); // Collect and process methods. Iterator iter = implementedRemotes.iterator(); while (iter.hasNext()) { Class c = (Class) iter.next(); Method[] m = c.getMethods(); // Check if throws RemoteException. for (int i = 0; i < m.length; i++) { Class[] exc = m[i].getExceptionTypes(); boolean remEx = false; for (int j = 0; j < exc.length; j++) { if (RemoteException.class.isAssignableFrom(exc[j])) { remEx = true; break; } if (! remEx && !force) throw new CompilationError(m[i].getName() + ", defined in " + c.getName() + ", does not throw " + RemoteException.class.getName()); } AbstractMethodGenerator mm = createMethodGenerator(m[i]); methods.add(mm); } } }
public synchronized void compile(Class remote) { reset(); String s; // Get the package. s = remote.getName(); int p = s.lastIndexOf('.'); if (p < 0) { // Root package. packag = ""; implName = name = s; } else { packag = s.substring(0, p); implName = name = s.substring(p + 1); } name = convertStubName(name); stubName = name; vars.put("#name", name); vars.put("#package", packag); vars.put("#implName", implName); if (verbose) System.out.println("Package " + packag + ", name " + name + " impl " + implName); // Get the implemented remotes. Class[] interfaces = remote.getInterfaces(); for (int i = 0; i < interfaces.length; i++) { if (Remote.class.isAssignableFrom(interfaces[i])) { if (! interfaces[i].equals(Remote.class)) { implementedRemotes.add(interfaces[i]); } } } vars.put("#idList", getIdList(implementedRemotes)); // Collect and process methods. Iterator iter = implementedRemotes.iterator(); while (iter.hasNext()) { Class c = (Class) iter.next(); Method[] m = c.getMethods(); // Check if throws RemoteException. for (int i = 0; i < m.length; i++) { Class[] exc = m[i].getExceptionTypes(); boolean remEx = false; for (int j = 0; j < exc.length; j++) { if (RemoteException.class.isAssignableFrom(exc[j])) { remEx = true; break; } if (! remEx && !force) throw new CompilationError(m[i].getName() + ", defined in " + c.getName() + ", does not throw " + RemoteException.class.getName()); } AbstractMethodGenerator mm = createMethodGenerator(m[i]); methods.add(mm); } } }
11,349
public void addChangeListener(ChangeListener listener);
void addChangeListener(ChangeListener listener);
11,350
public int getSelectedIndex();
int getSelectedIndex();
11,351
public void removeChangeListener(ChangeListener listener);
void removeChangeListener(ChangeListener listener);
11,352