rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
try {
public void close() throws IOException { try { closeConnection(); } finally { fireConnectionEvent(ConnectionEvent.CONNECTION_CLOSED); } }
finally { fireConnectionEvent(ConnectionEvent.CONNECTION_CLOSED); } }
public void close() throws IOException { try { closeConnection(); } finally { fireConnectionEvent(ConnectionEvent.CONNECTION_CLOSED); } }
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
protected String getURI() { StringBuffer buf = new StringBuffer(); buf.append(secure ? "https://" : "http://"); buf.append(hostname); if (secure) { if (port != HTTPConnection.HTTPS_PORT) { buf.append(':'); buf.append(port); } } else { ...
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
public Request newRequest(String method, String path) { if (method == null || method.length() == 0) { throw new IllegalArgumentException("method must have non-zero length"); } if (path == null || path.length() == 0) { path = "/"; } Request ret = new Request(this, method, pa...
fireRequestEvent(RequestEvent.REQUEST_CREATED, ret);
public Request newRequest(String method, String path) { if (method == null || method.length() == 0) { throw new IllegalArgumentException("method must have non-zero length"); } if (path == null || path.length() == 0) { path = "/"; } Request ret = new Request(this, method, pa...
MetalUtils.fillMetalPattern(g, 2, 2, s.width - 4, s.height - 4,
MetalUtils.fillMetalPattern(splitPane, g, 2, 2, s.width - 4, s.height - 4,
public void paint(Graphics g) { //super.paint(g); Dimension s = getSize(); MetalUtils.fillMetalPattern(g, 2, 2, s.width - 4, s.height - 4, light, dark); }
write8(OSIZE_PREFIX);
public void writeSTOSD() { write8(OSIZE_PREFIX); write8(0xAB); }
write8(OSIZE_PREFIX);
public void writeSTOSW() { write8(0xAB); }
public BufferedImage(ColorModel colormodel, WritableRaster writableraster, boolean premultiplied, Hashtable properties)
public BufferedImage(int w, int h, int type)
public BufferedImage(ColorModel colormodel, WritableRaster writableraster, boolean premultiplied, Hashtable properties) { init(colormodel, writableraster, premultiplied, properties, TYPE_CUSTOM); // TODO: perhaps try to identify type? }
init(colormodel, writableraster, premultiplied, properties, TYPE_CUSTOM);
ColorModel cm = null; boolean alpha = false; boolean premultiplied = false; switch (type) { case TYPE_4BYTE_ABGR_PRE: case TYPE_INT_ARGB_PRE: premultiplied = true; case TYPE_INT_ARGB: case TYPE_4BYTE_ABGR: alpha = true; } ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB); switch (type) { case TYPE_INT_RGB: ...
public BufferedImage(ColorModel colormodel, WritableRaster writableraster, boolean premultiplied, Hashtable properties) { init(colormodel, writableraster, premultiplied, properties, TYPE_CUSTOM); // TODO: perhaps try to identify type? }
public static void fill(float[] a, float val)
public static void fill(boolean[] a, boolean val)
public static void fill(float[] a, float val) { fill(a, 0, a.length, val); }
transform.concatenate(renderContext.getTransform());
public GNUGlyphVector(FontDelegate fontDelegate, Font font, FontRenderContext renderContext, int[] glyphs) { this.fontDelegate = fontDelegate; this.font = font; this.renderContext = renderContext; this.glyphs = glyphs; fontSize =...
if (nameTable.getChar() != 0)
if (nameTable.getShort() != 0)
public static String getName(ByteBuffer nameTable, int name, Locale locale) { int numRecords; int macLanguage, msLanguage; int offset; int namePlatform, nameEncoding, nameLanguage, nameID, nameLen; int nameStart; String result; boolean match; if (nameTable == nul...
numRecords = nameTable.getChar(); offset = nameTable.getChar();
numRecords = nameTable.getShort(); offset = nameTable.getShort();
public static String getName(ByteBuffer nameTable, int name, Locale locale) { int numRecords; int macLanguage, msLanguage; int offset; int namePlatform, nameEncoding, nameLanguage, nameID, nameLen; int nameStart; String result; boolean match; if (nameTable == nul...
namePlatform = nameTable.getChar(); nameEncoding = nameTable.getChar(); nameLanguage = nameTable.getChar(); nameID = nameTable.getChar(); nameLen = nameTable.getChar(); nameStart = offset + nameTable.getChar();
namePlatform = nameTable.getShort(); nameEncoding = nameTable.getShort(); nameLanguage = nameTable.getShort(); nameID = nameTable.getShort(); nameLen = nameTable.getShort(); nameStart = offset + nameTable.getShort();
public static String getName(ByteBuffer nameTable, int name, Locale locale) { int numRecords; int macLanguage, msLanguage; int offset; int namePlatform, nameEncoding, nameLanguage, nameID, nameLen; int nameStart; String result; boolean match; if (nameTable == nul...
if ( name == NAME_POSTSCRIPT ) { if( nameTable.get(nameStart) == 0 ) result = decodeName("UTF-16BE", nameTable, nameStart, nameLen); else result = decodeName("ASCII", nameTable, nameStart, nameLen); return result; }
public static String getName(ByteBuffer nameTable, int name, Locale locale) { int numRecords; int macLanguage, msLanguage; int offset; int namePlatform, nameEncoding, nameLanguage, nameID, nameLen; int nameStart; String result; boolean match; if (nameTable == nul...
validCachedPreferredSize = false; tree.revalidate();
public void editingCanceled(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) tree.remove(editingComponent.getParent()); editingComponent = null; if (cellEditor != null) { if (cellEditor i...
validCachedPreferredSize = false; tree.revalidate(); tree.repaint();
public void editingStopped(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) { tree.remove(editingComponent.getParent()); editingComponent = null; } if (cellEditor != null) { ...
if (isLeaf(row)) { bounds.x -= rightChildIndent - 4; bounds.width += rightChildIndent + 4; } else if (tree.isExpanded(path) && expandedIcon != null) bounds.width += expandedIcon.getIconWidth() + 4; else if (collapsedIcon != null) bounds.width += collapsedIcon.getIconWidth() + 4;
boolean isLeaf = isLeaf(row); if (isLeaf) bounds.width += rightChildIndent + gap; else if (hasControlIcons()) bounds.width += getCurrentControlIcon(path).getIconWidth() + gap;
public void mousePressed(MouseEvent e) { Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); boolean cntlClick = isLocationInExp...
TreePath[] paths = new TreePath[tree.getRowCount()];
TreePath[] paths = new TreePath[tree.getVisibleRowCount()];
public void actionPerformed(ActionEvent e) { TreePath lead = tree.getLeadSelectionPath(); if (e.getActionCommand().equals("selectPreviousChangeLead") || e.getActionCommand().equals("selectPreviousExtendSelection") || e.getActionCommand().equals("selectPrevious") || e.getActio...
validCachedPreferredSize = false; tree.revalidate();
public void treeCollapsed(TreeExpansionEvent event) { tree.repaint(); }
validCachedPreferredSize = false; tree.revalidate();
public void treeExpanded(TreeExpansionEvent event) { tree.repaint(); }
selectPath(tree, new TreePath(getPathToRoot(prev, 0)));
selectPath(tree, newPath);
public void actionPerformed(ActionEvent e) { Object last = tree.getLeadSelectionPath().getLastPathComponent(); if (e.getActionCommand().equals("selectPreviousChangeLead")) { Object prev = getPreviousVisibleNode(last); if (prev != null) { TreePath newPath...
validCachedPreferredSize = false; tree.revalidate();
public void treeNodesChanged(TreeModelEvent e) { tree.repaint(); }
validCachedPreferredSize = false; tree.revalidate();
public void treeNodesInserted(TreeModelEvent e) { tree.repaint(); }
validCachedPreferredSize = false; tree.revalidate();
public void treeNodesRemoved(TreeModelEvent e) { tree.repaint(); }
validCachedPreferredSize = false; tree.revalidate();
public void treeStructureChanged(TreeModelEvent e) { tree.repaint(); }
if (!treeModel.isLeaf(last) && tree.isExpanded(path)) tree.collapsePath(path);
if (!treeModel.isLeaf(last)) toggleExpandState(path);
public void actionPerformed(ActionEvent e) { Object last = tree.getLeadSelectionPath().getLastPathComponent(); if (e.getActionCommand().equals("selectParent")) { TreePath path = new TreePath(getPathToRoot(last, 0)); Object p = getParent(treeModel.getRoot(), last); if (...
if (!treeModel.isLeaf(last) && tree.isCollapsed(path)) tree.expandPath(path);
if (!treeModel.isLeaf(last)) toggleExpandState(path);
public void actionPerformed(ActionEvent e) { Object last = tree.getLeadSelectionPath().getLastPathComponent(); if (e.getActionCommand().equals("selectParent")) { TreePath path = new TreePath(getPathToRoot(last, 0)); Object p = getParent(treeModel.getRoot(), last); if (...
leafIcon = UIManager.getIcon("Tree.leafIcon");
public BasicTreeUI() { drawingCache = new Hashtable(); nodeDimensions = createNodeDimensions(); configureLayoutCache(); propertyChangeListener = createPropertyChangeListener(); focusListener = createFocusListener(); treeSelectionListener = createTreeSelectionListener(); mouseInputListener = new ...
return new Rectangle(x, y, SwingUtilities.computeStringWidth(fm, s) + 4,
return new Rectangle(x, y, SwingUtilities.computeStringWidth(fm, s) + gap,
Rectangle getCellBounds(int x, int y, Object cell) { if (cell != null) { String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetrics(f); if (s != null) return new Rectangle(x, y, SwingUtilities.compu...
if (!tree.isRootVisible() && tree.isExpanded(new TreePath(mod.getRoot()))) return new Point(x + ((getLevel(node)) * rightChildIndent), y); return new Point(x + ((getLevel(node) + 1) * rightChildIndent), y);
int level = getLevel(node); if (level == 0) return new Point(x, y); if (!tree.isRootVisible() && tree.isExpanded(new TreePath(mod.getRoot()))) return new Point(x + ((level - 1) * rightChildIndent), y); return new Point(x + (level * rightChildIndent), y);
Point getCellLocation(int x, int y, JTree tree, TreeModel mod, Object node, Object startNode) { int rowHeight = getRowHeight(); if (startNode == null || startNode.equals(node)) { if (!tree.isRootVisible() && tree.isExpanded(new TreePath(mod.getRoot()))) re...
if (!mod.isLeaf(startNode) && tree.isExpanded(new TreePath(getPathToRoot(startNode, 0))) && !mod.isLeaf(startNode) && mod.getChildCount(startNode) > 0) { Object child = mod.getChild(startNode, 0); if (child != null) return getCellLocation(x, y + rowHeight, tree, mod, node, child); }
Point getCellLocation(int x, int y, JTree tree, TreeModel mod, Object node, Object startNode) { int rowHeight = getRowHeight(); if (startNode == null || startNode.equals(node)) { if (!tree.isRootVisible() && tree.isExpanded(new TreePath(mod.getRoot()))) re...
Object next = null; TreePath current = null; if (node != null) next = getNextNode(node); if (next != null)
if (currentVisiblePath != null)
Object getNextVisibleNode(Object node) { Object next = null; TreePath current = null; if (node != null) next = getNextNode(node); if (next != null) { current = new TreePath(getPathToRoot(next, 0)); if (tree.isVisible(current)) return next; while (next != null && !t...
current = new TreePath(getPathToRoot(next, 0)); if (tree.isVisible(current)) return next; while (next != null && !tree.isVisible(current)) { next = getNextNode(next); if (next != null) current = new TreePath(getPathToRoot(next, 0)); }
Object[] nodes = currentVisiblePath.getPath(); int i = 0; while (i < nodes.length && !node.equals(nodes[i])) i++; if (i+1 < nodes.length) return nodes[i+1];
Object getNextVisibleNode(Object node) { Object next = null; TreePath current = null; if (node != null) next = getNextNode(node); if (next != null) { current = new TreePath(getPathToRoot(next, 0)); if (tree.isVisible(current)) return next; while (next != null && !t...
return next;
return null;
Object getNextVisibleNode(Object node) { Object next = null; TreePath current = null; if (node != null) next = getNextNode(node); if (next != null) { current = new TreePath(getPathToRoot(next, 0)); if (tree.isVisible(current)) return next; while (next != null && !t...
if (treeModel != null)
if (treeModel != null && currentVisiblePath != null)
public TreePath getPathForRow(JTree tree, int row) { if (treeModel != null) { Object node = treeModel.getRoot(); if (!tree.isRootVisible() && tree.isExpanded(new TreePath(getPathToRoot(node, 0)))) node = getNextNode(node); for (int i = 0; i < row; i++) node =...
Object node = treeModel.getRoot(); if (!tree.isRootVisible() && tree.isExpanded(new TreePath(getPathToRoot(node, 0)))) node = getNextNode(node); for (int i = 0; i < row; i++) node = getNextVisibleNode(node); if (node == null) return null; return new TreePath(getPathToRoot(node, 0));
Object[] nodes = currentVisiblePath.getPath(); if (row < nodes.length) return new TreePath(getPathToRoot(nodes[row], 0));
public TreePath getPathForRow(JTree tree, int row) { if (treeModel != null) { Object node = treeModel.getRoot(); if (!tree.isRootVisible() && tree.isExpanded(new TreePath(getPathToRoot(node, 0)))) node = getNextNode(node); for (int i = 0; i < row; i++) node =...
return null;
return preferredMinSize;
public Dimension getPreferredMinSize() { // FIXME: not implemented return null; }
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))
if (currentVisiblePath != null)
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 != nu...
prev = getPreviousNode(prev); if (prev != null) current = new TreePath(getPathToRoot(prev, 0)); }
Object[] nodes = currentVisiblePath.getPath(); int i = 0; while (i < nodes.length && !node.equals(nodes[i])) i++; if (i-1 > 0) return nodes[i-1];
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 != nu...
return prev;
return null;
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 != nu...
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;
if (currentVisiblePath != null) return currentVisiblePath.getPathCount(); return 0;
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) { ...
Object curr = treeModel.getRoot(); while (curr != null && !curr.equals(dest))
int rowCount = getRowCount(tree); if (currentVisiblePath != null)
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; }
++row; curr = getNextVisibleNode(curr);
Object[] nodes = currentVisiblePath.getPath(); while (row < rowCount) { if (dest.equals(nodes[row])) return row; 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; }
return row;
return -1;
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; }
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); tree.setFont(defaults.getFont("Tree.font")); tree.setForeground(defaults.getColor("Tree.foreground")); tree.setBackground(defaults.getColor("Tree.background"));
LookAndFeel.installColorsAndFont(tree, "Tree.background", "Tree.foreground", "Tree.font");
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 = defa...
rightChildIndent = defaults.getInt("Tree.rightChildIndent"); leftChildIndent = defaults.getInt("Tree.leftChildIndent"); setRowHeight(defaults.getInt("Tree.rowHeight"));
rightChildIndent = UIManager.getInt("Tree.rightChildIndent"); leftChildIndent = UIManager.getInt("Tree.leftChildIndent"); setRowHeight(UIManager.getInt("Tree.rowHeight"));
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 = defa...
tree.setScrollsOnExpand(defaults.getBoolean("Tree.scrollsOnExpand")); setExpandedIcon(defaults.getIcon("Tree.expandedIcon")); setCollapsedIcon(defaults.getIcon("Tree.collapsedIcon"));
tree.setScrollsOnExpand(UIManager.getBoolean("Tree.scrollsOnExpand")); setExpandedIcon(UIManager.getIcon("Tree.openIcon")); setCollapsedIcon(UIManager.getIcon("Tree.closedIcon"));
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 = defa...
tree = (JTree) c;
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 (mo...
tree.expandPath(new TreePath(mod.getRoot()));
{ TreePath path = new TreePath(mod.getRoot()); if (!tree.isExpanded(path)) toggleExpandState(path); }
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 (mo...
if (tree.isExpanded(path) && expandedIcon != null) bounds.x -= expandedIcon.getIconWidth() - 4; else if (collapsedIcon != null) bounds.x -= collapsedIcon.getIconWidth() - 4;
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 (tr...
Icon controlIcon = getCurrentControlIcon(path); if (controlIcon != null && (mouseX < bounds.x) && (mouseX > (bounds.x - controlIcon.getIconWidth())))
if (hasControlIcons() && (mouseX < bounds.x) && (mouseX > (bounds.x - getCurrentControlIcon(path).getIconWidth())))
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 (tr...
paintRecursive(g, 0, 0, 0, 0, tree, treeModel, root);
paintRecursive(g, 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, 0, tree, treeModel, root); if (hasControlIcons()) paintControlIcons(g, 0, 0, 0, 0, tree, treeModel, root); ...
if (!node.equals(mod.getRoot()))
if (!node.equals(mod.getRoot()) && (tree.isRootVisible() || getLevel(node) != 1))
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 = getCurrent...
indent = -1;
indent = 1;
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 = getCurrent...
if (treeModel != null)
if (treeModel != null && hasControlIcons())
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean ...
int paintRecursive(Graphics g, int indentation, int descent, int childNumber,
int paintRecursive(Graphics g, int indentation, int 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()) ...
if (mod.isLeaf(curr))
if (isLeaf)
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()) ...
paintNode(g, indentation + 4, descent, tree, curr, true);
paintRow(g, clip, null, bounds, path, row, true, false, true);
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()) ...
paintNode(g, indentation + 4, descent, tree, curr, false);
paintRow(g, clip, null, bounds, path, row, isExpanded, false, false);
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()) ...
int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr); if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0))))
int max = mod.getChildCount(curr); if (isExpanded)
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()) ...
else if ((!isRootVisible && !curr.equals(mod.getRoot())) || isRootVisible)
else if (isRootVisible || (!isRootVisible && !curr.equals(root)))
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()) ...
descent = paintRecursive(g, indent, descent, i, depth + 1,
descent = paintRecursive(g, indent, descent, depth + 1,
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()) ...
if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && !mod.isLeaf(curr)
if (isExpanded) if (y0 != heightOfLine && !isLeaf
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()) ...
boolean selected = tree.isPathSelected(path); boolean hasIcons = false; Object node = path.getLastPathComponent(); if (tree.isVisible(path)) { if (editingComponent != null && editingPath != null && isEditing(tree) && node.equals(editingPath.getLastPathComponent())) { rendererPane.paintComponent(g, editingComponent.get...
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { // FIXME: not implemented. }
validCachedPreferredSize = false; tree.revalidate(); tree.repaint();
protected void pathWasCollapsed(TreePath path) { // FIXME: not implemented }
validCachedPreferredSize = false; tree.revalidate(); tree.repaint();
protected void pathWasExpanded(TreePath path) { // FIXME: not implemented }
preferredMinSize = newSize;
public void setPreferredMinSize(Dimension newSize) { // FIXME: not implemented }
Object node = path.getLastPathComponent(); if (treeModel != null && (!isLeaf && !node.equals(treeModel.getRoot())) && (tree.isRootVisible() || getLevel(node) != 1)) return true;
protected boolean shouldPaintExpandControl(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { // FIXME: not implemented. return false; }
Rectangle bounds = getPathBounds(tree, path);
bounds = getPathBounds(tree, path);
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(); Tr...
validCachedPreferredSize = false; tree.revalidate();
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(); Tr...
updateCurrentVisiblePath();
protected void toggleExpandState(TreePath path) { if (tree.isExpanded(path)) tree.collapsePath(path); else tree.expandPath(path); }
int maxWidth = 0; boolean isLeaf = false; if (currentVisiblePath != null) { Object[] path = currentVisiblePath.getPath(); for (int i = 0; i < path.length; i++) { TreePath curr = new TreePath(getPathToRoot(path[i], 0)); Rectangle bounds = getPathBounds(tree, curr); if (treeModel != null) isLeaf = treeModel.isLeaf(path[...
protected void updateCachedPreferredSize() { // FIXME: not implemented }
updateExpandedDescendants(new TreePath(getPathToRoot(treeModel. getRoot(), 0)));
updateExpandedDescendants(new TreePath(treeModel.getRoot()));
protected void updateLayoutCacheExpandedNodes() { if (treeModel != null) updateExpandedDescendants(new TreePath(getPathToRoot(treeModel. getRoot(), 0))); }
} }
protected void updateRenderer() { if (tree != null) tree.setCellRenderer(currentCellRenderer); }
String id; String kind; String next;
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. ...
public InvalidName(String why)
public InvalidName()
public InvalidName(String why) { super(why); }
super(why);
public InvalidName(String why) { super(why); }
public NameComponent(String _id, String _kind)
public NameComponent()
public NameComponent(String _id, String _kind) { id = _id; kind = _kind; }
id = _id; kind = _kind;
public NameComponent(String _id, String _kind) { id = _id; kind = _kind; }
private StyleConstants(String k)
StyleConstants(String k)
private StyleConstants(String k) { keyname = k; }
public static double getFlatnessSq(double[] coords, int offset)
public static double getFlatnessSq(double x1, double y1, double cx1, double cy1, double cx2, double cy2, double x2, double y2)
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++]); }
return getFlatnessSq(coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++], coords[offset++]);
return Math.max(Line2D.ptSegDistSq(x1, y1, x2, y2, cx1, cy1), Line2D.ptSegDistSq(x1, y1, x2, y2, cx2, cy2));
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)
public static double getFlatnessSq(double x1, double y1, double cx, double cy, double x2, double y2)
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]); }
return Line2D.ptSegDistSq(coords[offset], coords[offset + 1], coords[offset + 4], coords[offset + 5], coords[offset + 2], coords[offset + 3]);
return Line2D.ptSegDistSq(x1, y1, x2, y2, cx, cy);
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 void subdivide(double[] src, int srcOff, double[] left, int leftOff, double[] right, int rightOff)
public void subdivide(QuadCurve2D left, QuadCurve2D right)
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[srcOf...
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];
double[] d = new double[] { getX1(), getY1(), getCtrlX(), getCtrlY(), getX2(), getY2(), 0, 0, 0, 0 }; subdivide(d, 0, d, 0, d, 4);
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[srcOf...
{ left[leftOff] = x1; left[leftOff + 1] = y1; }
left.setCurve(d, 0);
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[srcOf...
{ 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) { ri...
right.setCurve(d, 4);
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[srcOf...
public float[] getSamples(int x, int y, int w, int h, int b, float[] fArray)
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray)
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); }
w, h, b, fArray, dataBuffer);
w, h, b, iArray, 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); }
public void setSample(int x, int y, int b, float s)
public void setSample(int x, int y, int b, int s)
public void setSample(int x, int y, int b, float s) { sampleModel.setSample(x-sampleModelTranslateX, y-sampleModelTranslateY, b, s, dataBuffer); }
if (input.charAt(mymatch.index+i-b) != input.charAt(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)) {
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 ...
return next(input, mymatch);
boolean result = next(input, mymatch); if (result) mymatch.empty = (mymatch.index == origin); return result;
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 ...
public Object getNextValue();
Object getNextValue();
public Object getNextValue();
public Object getPreviousValue();
Object getPreviousValue();
public Object getPreviousValue();
public Object getValue();
Object getValue();
public Object getValue();
producer.setFeature(handler.FEATURE_URI + "namespace-prefixes",
producer.setFeature(EventFilter.FEATURE_URI + "namespace-prefixes",
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; ...
handler.bind (producer, handler);
EventFilter.bind (producer, handler);
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; ...