bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public boolean isShowing() { boolean retVal = false; if (SwingLabelPeer.this.awtComponent != null) retVal = SwingLabelPeer.this.awtComponent.isShowing(); return retVal; }
|
public boolean isShowing() { boolean retVal = false; if (SwingLabelPeer.this.awtComponent != null) retVal = SwingLabelPeer.this.awtComponent.isShowing(); return retVal; }
| 12,151
|
public SwingLabelPeer(Label label) { super(); SwingLabel swingLabel = new SwingLabel(); swingLabel.setText(label.getText()); swingLabel.setHorizontalAlignment(label.getAlignment()); swingLabel.setOpaque(true); init(label, swingLabel); }
|
public SwingLabelPeer(Label label) { super(); SwingLabel swingLabel = new SwingLabel(label); swingLabel.setText(label.getText()); swingLabel.setHorizontalAlignment(label.getAlignment()); swingLabel.setOpaque(true); init(label, swingLabel); }
| 12,152
|
public SwingLabelPeer(Label label) { super(); SwingLabel swingLabel = new SwingLabel(); swingLabel.setText(label.getText()); swingLabel.setHorizontalAlignment(label.getAlignment()); swingLabel.setOpaque(true); init(label, swingLabel); }
|
public SwingLabelPeer(Label label) { super(); SwingLabel swingLabel = new SwingLabel(); swingLabel.setText(label.getText()); swingLabel.setOpaque(true); init(label, swingLabel); }
| 12,153
|
public void setAlignment(int alignment) { ((JLabel) swingComponent.getJComponent()).setHorizontalAlignment(alignment); }
|
public void setAlignment(int alignment) { JLabel swingLabel = (JLabel) swingComponent.getJComponent(); switch (alignment) { case Label.RIGHT: swingLabel.setHorizontalAlignment(JLabel.RIGHT); break; case Label.CENTER: swingLabel.setHorizontalAlignment(JLabel.CENTER); break; case Label.LEFT: default: swingLabel.setHorizontalAlignment(JLabel.LEFT); break; } }
| 12,155
|
getName(){ return(name);}
|
getName(){ return(name);}
| 12,156
|
public void setDataVector(Vector data, Vector columnNames) { // Variables int rowIndex; int columnIndex; int numRows; int numColumns; Vector columnVector; // Set Data dataVector = data; columnIdentifiers = columnNames; // Check Data numRows = data.size(); numColumns = columnNames.size(); for (rowIndex = 0; rowIndex < numRows; rowIndex++) { columnVector = (Vector) dataVector.get(rowIndex); columnVector.setSize(numColumns); } // for } // setDataVector()
|
public void setDataVector(Vector data, Vector columnNames) { // Variables int rowIndex; int numRows; int numColumns; Vector columnVector; // Set Data dataVector = data; columnIdentifiers = columnNames; // Check Data numRows = data.size(); numColumns = columnNames.size(); for (rowIndex = 0; rowIndex < numRows; rowIndex++) { columnVector = (Vector) dataVector.get(rowIndex); columnVector.setSize(numColumns); } // for } // setDataVector()
| 12,157
|
public static Icon getMenuArrowIcon() { return new Icon() { public int getIconHeight() { return 12; } public int getIconWidth() { return 12; } public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); } }; }
|
public static Icon getMenuArrowIcon() { return new Icon() { public int getIconHeight() { return 8; } public int getIconWidth() { return 8; } public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); } }; }
| 12,158
|
public static Icon getMenuArrowIcon() { return new Icon() { public int getIconHeight() { return 12; } public int getIconWidth() { return 12; } public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); } }; }
|
public static Icon getMenuArrowIcon() { return new Icon() { public int getIconHeight() { return 4; } public int getIconWidth() { return 4; } public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); } }; }
| 12,159
|
public static Icon getMenuArrowIcon() { return new Icon() { public int getIconHeight() { return 12; } public int getIconWidth() { return 12; } public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); } }; }
|
public static Icon getMenuArrowIcon() { return new Icon() { public int getIconHeight() { return 12; } public int getIconWidth() { return 12; } public void paintIcon(Component c, Graphics g, int x, int y) { Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); } }; }
| 12,160
|
public static Icon getMenuArrowIcon() { return new Icon() { public int getIconHeight() { return 12; } public int getIconWidth() { return 12; } public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); } }; }
|
public static Icon getMenuArrowIcon() { return new Icon() { public int getIconHeight() { return 12; } public int getIconWidth() { return 12; } public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); } }; }
| 12,161
|
public static Icon getMenuArrowIcon() { return new Icon() { public int getIconHeight() { return 12; } public int getIconWidth() { return 12; } public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); } }; }
|
public static Icon getMenuArrowIcon() { return new Icon() { public int getIconHeight() { return 12; } public int getIconWidth() { return 12; } public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); } }; }
| 12,162
|
public int getIconHeight() { return 12; }
|
public int getIconHeight() { return 8; }
| 12,163
|
public int getIconWidth() { return 12; }
|
public int getIconWidth() { return 4; }
| 12,164
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); }
| 12,165
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); }
| 12,166
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); }
| 12,167
|
static BeanInfo reallyFindExplicitBeanInfo(Class beanClass) { ClassLoader beanClassLoader = beanClass.getClassLoader(); BeanInfo beanInfo; beanInfo = getBeanInfo(beanClassLoader, beanClass.getName() + "BeanInfo"); if (beanInfo == null) { String newName; newName = ClassHelper.getTruncatedClassName(beanClass) + "BeanInfo"; for(int i = 0; i < Introspector.beanInfoSearchPath.length; i++) { if (Introspector.beanInfoSearchPath[i].equals("")) beanInfo = getBeanInfo(beanClassLoader, newName); else beanInfo = getBeanInfo(beanClassLoader, Introspector.beanInfoSearchPath[i] + "." + newName); if (beanInfo != null) return beanInfo; } } return beanInfo; }
|
static BeanInfo reallyFindExplicitBeanInfo(Class beanClass) { ClassLoader beanClassLoader = beanClass.getClassLoader(); BeanInfo beanInfo; beanInfo = getBeanInfo(beanClassLoader, beanClass.getName() + "BeanInfo"); if (beanInfo == null) { String newName; newName = ClassHelper.getTruncatedClassName(beanClass) + "BeanInfo"; for(int i = 0; i < Introspector.beanInfoSearchPath.length; i++) { if (Introspector.beanInfoSearchPath[i].equals("")) beanInfo = getBeanInfo(beanClassLoader, newName); else beanInfo = getBeanInfo(beanClassLoader, Introspector.beanInfoSearchPath[i] + "." + newName); if (beanInfo != null && beanInfo.getBeanDescriptor() != null && beanInfo.getBeanDescriptor().getBeanClass() == beanClass) return beanInfo; } } return beanInfo; }
| 12,169
|
public void layoutContainer(Container c) { // The only components we care about setting up are the // one touch buttons. if (splitPane.isOneTouchExpandable()) { if (c.getComponentCount() == 2) { Component c1 = c.getComponent(0); Component c2 = c.getComponent(1); if ((c1 instanceof BasicArrowButton) && (c2 instanceof BasicArrowButton)) { lb = ((BasicArrowButton) c1); rb = ((BasicArrowButton) c2); } } if (rb != null && lb != null) { Point p = getLocation(); lb.setSize(lb.getPreferredSize()); rb.setSize(rb.getPreferredSize()); lb.setLocation(p.x, p.y); if (orientation == JSplitPane.HORIZONTAL_SPLIT) { rb.setDirection(SwingConstants.EAST); lb.setDirection(SwingConstants.WEST); rb.setLocation(p.x, p.y + lb.getHeight()); } else { rb.setDirection(SwingConstants.SOUTH); lb.setDirection(SwingConstants.NORTH); rb.setLocation(p.x + lb.getWidth(), p.y); } } } }
|
public void layoutContainer(Container c) { // The only components we care about setting up are the // one touch buttons. if (splitPane.isOneTouchExpandable()) { if (c.getComponentCount() == 2) { Component c1 = c.getComponent(0); Component c2 = c.getComponent(1); if ((c1 instanceof BasicArrowButton) && (c2 instanceof BasicArrowButton)) { lb = ((BasicArrowButton) c1); rb = ((BasicArrowButton) c2); } } if (rb != null && lb != null) { Point p = getLocation(); lb.setSize(lb.getPreferredSize()); rb.setSize(rb.getPreferredSize()); lb.setLocation(p.x, p.y); if (orientation == JSplitPane.HORIZONTAL_SPLIT) { rb.setDirection(SwingConstants.EAST); lb.setDirection(SwingConstants.WEST); rb.setLocation(p.x, p.y + lb.getHeight()); } else { rb.setDirection(SwingConstants.SOUTH); lb.setDirection(SwingConstants.NORTH); rb.setLocation(p.x + lb.getWidth(), p.y); } } } }
| 12,172
|
public abstract NamedValue create_named_value(String s, Any any, int flags);
|
public abstract NamedValue create_named_value(String name, Any any, int flags);
| 12,173
|
protected void parseURL (URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. String file = url.getFile(); if (!file.equals("")) { //has context url url_string = url_string.substring (start, end); if (url_string.startsWith("/")) { //url string is an absolute path int idx = file.lastIndexOf ("!/"); if (idx < 0) throw new URLParseError("no !/ in spec"); file = file.substring (0, idx + 1) + url_string; } else { int idx = file.lastIndexOf ("/"); if (idx == -1) //context path is weird file = "/" + url_string; else if (idx == (file.length() - 1)) //just concatenate two parts file = file + url_string; else // according to Java API Documentation, here is a little different // with URLStreamHandler.parseURL // but JDK seems doesn't handle it well file = file.substring(0, idx + 1) + url_string; } setURL (url, "jar", url.getHost(), url.getPort(), file, null); return; } // Bunches of things should be true. Make sure. if (end < start) return; if (end - start < 2) return; if (start > url_string.length()) return; // Skip remains of protocol url_string = url_string.substring (start, end); int jar_stop; if ((jar_stop = url_string.indexOf("!/")) < 0) throw new URLParseError("no !/ in spec"); try { new URL(url_string.substring (0, jar_stop)); } catch (MalformedURLException e) { throw new URLParseError("invalid inner URL: " + e.getMessage()); } if (!url.getProtocol().equals ("jar") ) throw new URLParseError("unexpected protocol " + url.getProtocol()); setURL (url, "jar", url.getHost(), url.getPort(), url_string, null); }
|
protected void parseURL (URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. String file = url.getFile(); if (!file.equals("")) { //has context url url_string = url_string.substring (start, end); if (url_string.startsWith("/")) { //url string is an absolute path int idx = file.lastIndexOf ("!/"); if (idx < 0) throw new URLParseError("no !/ in spec"); file = file.substring (0, idx + 1) + url_string; } else if (url_string.length() > 0) { int idx = file.lastIndexOf ("/"); if (idx == -1) //context path is weird file = "/" + url_string; else if (url_string.length() > 0) if (idx == (file.length() - 1)) //just concatenate two parts file = file + url_string; else if (url_string.length() > 0) // according to Java API Documentation, here is a little different // with URLStreamHandler.parseURL // but JDK seems doesn't handle it well file = file.substring(0, idx + 1) + url_string; } setURL (url, "jar", url.getHost(), url.getPort(), file, null); return; } // Bunches of things should be true. Make sure. if (end < start) return; if (end - start < 2) return; if (start > url_string.length()) return; // Skip remains of protocol url_string = url_string.substring (start, end); int jar_stop; if ((jar_stop = url_string.indexOf("!/")) < 0) throw new URLParseError("no !/ in spec"); try { new URL(url_string.substring (0, jar_stop)); } catch (MalformedURLException e) { throw new URLParseError("invalid inner URL: " + e.getMessage()); } if (!url.getProtocol().equals ("jar") ) throw new URLParseError("unexpected protocol " + url.getProtocol()); setURL (url, "jar", url.getHost(), url.getPort(), url_string, null); }
| 12,174
|
public ParameterModeHolder(ParameterMode initialValue) { value = initialValue; }
|
public ParameterModeHolder() { value = initialValue; }
| 12,176
|
public ParameterModeHolder(ParameterMode initialValue) { value = initialValue; }
|
public ParameterModeHolder(ParameterMode initialValue) { }
| 12,177
|
TemplateNode clone(Stylesheet stylesheet) { int len = sortKeys.size(); List sortKeys2 = new ArrayList(len); for (int i = 0; i < len; i++) { sortKeys2.add(((Key) sortKeys.get(i)).clone(stylesheet)); } len = withParams.size(); List withParams2 = new ArrayList(len); for (int i = 0; i < len; i++) { withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet)); } TemplateNode ret = new ApplyTemplatesNode(select.clone(stylesheet), mode, sortKeys2, withParams2, isDefault); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
|
TemplateNode clone(Stylesheet stylesheet) int len = sortKeys.size(); List sortKeys2 = new ArrayList(len); for (int i = 0; i < len; i++) sortKeys2.add(((Key) sortKeys.get(i)).clone(stylesheet)); } len = withParams.size(); List withParams2 = new ArrayList(len); for (int i = 0; i < len; i++) withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet)); } TemplateNode ret = new ApplyTemplatesNode(select.clone(stylesheet), mode, sortKeys2, withParams2, isDefault); if (children != null) ret.children = children.clone(stylesheet); } if (next != null) ret.next = next.clone(stylesheet); } return ret; }
| 12,178
|
TemplateNode clone(Stylesheet stylesheet) { int len = sortKeys.size(); List sortKeys2 = new ArrayList(len); for (int i = 0; i < len; i++) { sortKeys2.add(((Key) sortKeys.get(i)).clone(stylesheet)); } len = withParams.size(); List withParams2 = new ArrayList(len); for (int i = 0; i < len; i++) { withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet)); } TemplateNode ret = new ApplyTemplatesNode(select.clone(stylesheet), mode, sortKeys2, withParams2, isDefault); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
|
TemplateNode clone(Stylesheet stylesheet) { int len = sortKeys.size(); List sortKeys2 = new ArrayList(len); for (int i = 0; i < len; i++) { sortKeys2.add(((Key) sortKeys.get(i)).clone(stylesheet)); len = withParams.size(); List withParams2 = new ArrayList(len); for (int i = 0; i < len; i++) { withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet)); TemplateNode ret = new ApplyTemplatesNode(select.clone(stylesheet), mode, sortKeys2, withParams2, isDefault); if (children != null) { ret.children = children.clone(stylesheet); if (next != null) { ret.next = next.clone(stylesheet); return ret;
| 12,179
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { Object ret = select.evaluate(context, pos, len); if (ret != null && ret instanceof Collection) { if (withParams != null) { // compute the parameter values LinkedList values = new LinkedList(); for (Iterator i = withParams.iterator(); i.hasNext(); ) { WithParam p = (WithParam) i.next(); Object value = p.getValue(stylesheet, mode, context, pos, len); Object[] pair = new Object[2]; pair[0] = p.name; pair[1] = value; values.add(pair); } // push the parameter context stylesheet.bindings.push(Bindings.WITH_PARAM); // set the parameters for (Iterator i = values.iterator(); i.hasNext(); ) { Object[] pair = (Object[]) i.next(); QName name = (QName) pair[0]; Object value = pair[1]; stylesheet.bindings.set(name, value, Bindings.WITH_PARAM); } } Collection ns = (Collection) ret; List nodes = new ArrayList(ns); if (sortKeys != null) { for (Iterator i = sortKeys.iterator(); i.hasNext(); ) { SortKey sortKey = (SortKey) i.next(); sortKey.init(stylesheet, mode, context, pos, len, parent, nextSibling); } Collections.sort(nodes, new XSLComparator(sortKeys)); } else { Collections.sort(nodes, documentOrderComparator); } int l = nodes.size(); QName effectiveMode = isDefault ? mode : this.mode; for (int i = 0; i < l; i++) { Node node = (Node) nodes.get(i); TemplateNode t = stylesheet.getTemplate(effectiveMode, node, false); if (t != null) { stylesheet.current = node; t.apply(stylesheet, effectiveMode, node, i + 1, l, parent, nextSibling); } } if (withParams != null) { // pop the variable context stylesheet.bindings.pop(Bindings.WITH_PARAM); } } // apply-templates doesn't have processable children if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException Object ret = select.evaluate(context, pos, len); if (ret != null && ret instanceof Collection) if (withParams != null) // compute the parameter values LinkedList values = new LinkedList(); for (Iterator i = withParams.iterator(); i.hasNext(); ) WithParam p = (WithParam) i.next(); Object value = p.getValue(stylesheet, mode, context, pos, len); Object[] pair = new Object[2]; pair[0] = p.name; pair[1] = value; values.add(pair); } // push the parameter context stylesheet.bindings.push(Bindings.WITH_PARAM); // set the parameters for (Iterator i = values.iterator(); i.hasNext(); ) Object[] pair = (Object[]) i.next(); QName name = (QName) pair[0]; Object value = pair[1]; stylesheet.bindings.set(name, value, Bindings.WITH_PARAM); } } Collection ns = (Collection) ret; List nodes = new ArrayList(ns); if (sortKeys != null) for (Iterator i = sortKeys.iterator(); i.hasNext(); ) SortKey sortKey = (SortKey) i.next(); sortKey.init(stylesheet, mode, context, pos, len, parent, nextSibling); } Collections.sort(nodes, new XSLComparator(sortKeys)); } else Collections.sort(nodes, documentOrderComparator); } int l = nodes.size(); QName effectiveMode = isDefault ? mode : this.mode; for (int i = 0; i < l; i++) Node node = (Node) nodes.get(i); TemplateNode t = stylesheet.getTemplate(effectiveMode, node, false); if (t != null) stylesheet.current = node; t.apply(stylesheet, effectiveMode, node, i + 1, l, parent, nextSibling); } } if (withParams != null) // pop the variable context stylesheet.bindings.pop(Bindings.WITH_PARAM); } } // apply-templates doesn't have processable children if (next != null) next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
| 12,180
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { Object ret = select.evaluate(context, pos, len); if (ret != null && ret instanceof Collection) { if (withParams != null) { // compute the parameter values LinkedList values = new LinkedList(); for (Iterator i = withParams.iterator(); i.hasNext(); ) { WithParam p = (WithParam) i.next(); Object value = p.getValue(stylesheet, mode, context, pos, len); Object[] pair = new Object[2]; pair[0] = p.name; pair[1] = value; values.add(pair); } // push the parameter context stylesheet.bindings.push(Bindings.WITH_PARAM); // set the parameters for (Iterator i = values.iterator(); i.hasNext(); ) { Object[] pair = (Object[]) i.next(); QName name = (QName) pair[0]; Object value = pair[1]; stylesheet.bindings.set(name, value, Bindings.WITH_PARAM); } } Collection ns = (Collection) ret; List nodes = new ArrayList(ns); if (sortKeys != null) { for (Iterator i = sortKeys.iterator(); i.hasNext(); ) { SortKey sortKey = (SortKey) i.next(); sortKey.init(stylesheet, mode, context, pos, len, parent, nextSibling); } Collections.sort(nodes, new XSLComparator(sortKeys)); } else { Collections.sort(nodes, documentOrderComparator); } int l = nodes.size(); QName effectiveMode = isDefault ? mode : this.mode; for (int i = 0; i < l; i++) { Node node = (Node) nodes.get(i); TemplateNode t = stylesheet.getTemplate(effectiveMode, node, false); if (t != null) { stylesheet.current = node; t.apply(stylesheet, effectiveMode, node, i + 1, l, parent, nextSibling); } } if (withParams != null) { // pop the variable context stylesheet.bindings.pop(Bindings.WITH_PARAM); } } // apply-templates doesn't have processable children if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { Object ret = select.evaluate(context, pos, len); if (ret != null && ret instanceof Collection) { if (withParams != null) { // compute the parameter values LinkedList values = new LinkedList(); for (Iterator i = withParams.iterator(); i.hasNext(); ) { WithParam p = (WithParam) i.next(); Object value = p.getValue(stylesheet, mode, context, pos, len); Object[] pair = new Object[2]; pair[0] = p.name; pair[1] = value; values.add(pair); // push the parameter context stylesheet.bindings.push(Bindings.WITH_PARAM); // set the parameters for (Iterator i = values.iterator(); i.hasNext(); ) { Object[] pair = (Object[]) i.next(); QName name = (QName) pair[0]; Object value = pair[1]; stylesheet.bindings.set(name, value, Bindings.WITH_PARAM); Collection ns = (Collection) ret; List nodes = new ArrayList(ns); if (sortKeys != null) { for (Iterator i = sortKeys.iterator(); i.hasNext(); ) { SortKey sortKey = (SortKey) i.next(); sortKey.init(stylesheet, mode, context, pos, len, parent, nextSibling); Collections.sort(nodes, new XSLComparator(sortKeys)); else { Collections.sort(nodes, documentOrderComparator); int l = nodes.size(); QName effectiveMode = isDefault ? mode : this.mode; for (int i = 0; i < l; i++) { Node node = (Node) nodes.get(i); TemplateNode t = stylesheet.getTemplate(effectiveMode, node, false); if (t != null) { stylesheet.current = node; t.apply(stylesheet, effectiveMode, node, i + 1, l, parent, nextSibling); if (withParams != null) { // pop the variable context stylesheet.bindings.pop(Bindings.WITH_PARAM); // apply-templates doesn't have processable children if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling);
| 12,181
|
public boolean references(QName var) { if (select != null && select.references(var)) { return true; } if (withParams != null) { for (Iterator i = withParams.iterator(); i.hasNext(); ) { if (((WithParam) i.next()).references(var)) { return true; } } } if (sortKeys != null) { for (Iterator i = sortKeys.iterator(); i.hasNext(); ) { if (((SortKey) i.next()).references(var)) { return true; } } } return super.references(var); }
|
public boolean references(QName var) if (select != null && select.references(var)) return true; } if (withParams != null) for (Iterator i = withParams.iterator(); i.hasNext(); ) if (((WithParam) i.next()).references(var)) return true; } } } if (sortKeys != null) for (Iterator i = sortKeys.iterator(); i.hasNext(); ) if (((SortKey) i.next()).references(var)) return true; } } } return super.references(var); }
| 12,182
|
public boolean references(QName var) { if (select != null && select.references(var)) { return true; } if (withParams != null) { for (Iterator i = withParams.iterator(); i.hasNext(); ) { if (((WithParam) i.next()).references(var)) { return true; } } } if (sortKeys != null) { for (Iterator i = sortKeys.iterator(); i.hasNext(); ) { if (((SortKey) i.next()).references(var)) { return true; } } } return super.references(var); }
|
public boolean references(QName var) { if (select != null && select.references(var)) { return true; if (withParams != null) { for (Iterator i = withParams.iterator(); i.hasNext(); ) { if (((WithParam) i.next()).references(var)) { return true; if (sortKeys != null) { for (Iterator i = sortKeys.iterator(); i.hasNext(); ) { if (((SortKey) i.next()).references(var)) { return true; return super.references(var);
| 12,183
|
public String toString() { StringBuffer buf = new StringBuffer(getClass().getName()); buf.append('['); boolean o = false; if (select != null) { buf.append("select="); buf.append(select); o = true; } if (mode != null) { if (o) { buf.append(','); } buf.append("mode="); buf.append(mode); } buf.append(']'); return buf.toString(); }
|
public String toString() { StringBuffer buf = new StringBuffer("apply-templates"); buf.append('['); boolean o = false; if (select != null) { buf.append("select="); buf.append(select); o = true; } if (mode != null) { if (o) { buf.append(','); } buf.append("mode="); buf.append(mode); } buf.append(']'); return buf.toString(); }
| 12,184
|
public Node item(int index) { if (current == null) { current = createIterator(); lastIndex = -1; } // last node or before? go backwards if (index <= lastIndex) { while (index != lastIndex) { current.previousNode (); lastIndex--; } return current.previousNode (); } // somewhere after last node while (++lastIndex != index) current.nextNode (); return current.nextNode (); }
|
public Node item(int index) { if (current == null) { current = createIterator(); lastIndex = -1; } // last node or before? go backwards if (index <= lastIndex) { while (index != lastIndex) { current.previousNode (); lastIndex--; } Node ret = current.previousNode (); current = null; return ret; } // somewhere after last node while (++lastIndex != index) current.nextNode (); return current.nextNode (); }
| 12,186
|
public Node item(int index) { if (current == null) { current = createIterator(); lastIndex = -1; } // last node or before? go backwards if (index <= lastIndex) { while (index != lastIndex) { current.previousNode (); lastIndex--; } return current.previousNode (); } // somewhere after last node while (++lastIndex != index) current.nextNode (); return current.nextNode (); }
|
public Node item(int index) { if (current == null) { current = createIterator(); lastIndex = -1; } // last node or before? go backwards if (index <= lastIndex) { while (index != lastIndex) { current.previousNode (); lastIndex--; } return current.previousNode (); } // somewhere after last node while (++lastIndex != index) current.nextNode (); Node ret = current.nextNode (); current = null; return ret; }
| 12,187
|
public Node appendChild(Node newChild) { try { DomNode child = (DomNode) newChild; if (child.nodeType == DOCUMENT_FRAGMENT_NODE) { // Append all nodes in the fragment to this node for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { checkMisc(ctx); } for (DomNode ctx = child.first; ctx != null; ) { DomNode ctxNext = ctx.next; appendChild(ctx); ctx = ctxNext; } } else { checkMisc(child); if (child.parent != null) { child.parent.removeChild(child); } child.parent = this; child.index = length++; child.setDepth(depth + 1); child.next = null; if (last == null) { first = child; child.previous = null; } else { last.next = child; child.previous = last; } last = child; if (reportMutations) { insertionEvent(null, child); } } return child; } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, newChild, 0); } }
|
public Node appendChild(Node newChild) { try { DomNode child = (DomNode) newChild; if (child.nodeType == DOCUMENT_FRAGMENT_NODE) { // Append all nodes in the fragment to this node for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { checkMisc(ctx); } for (DomNode ctx = child.first; ctx != null; ) { DomNode ctxNext = ctx.next; appendChild(ctx); ctx = ctxNext; } } else { checkMisc(child); if (child.parent != null) { child.parent.removeChild(child); } child.parent = this; child.index = length++; child.setDepth(depth + 1); child.next = null; if (last == null) { first = child; child.previous = null; } else { last.next = child; child.previous = last; } last = child; if (reportMutations) { insertionEvent(null, child); } } return child; } catch (ClassCastException e) { throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, null, newChild, 0); } }
| 12,188
|
private void checkMisc(DomNode child) { if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode ctx = this; ctx != null; ctx = ctx.parent) { if (child == ctx) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't make ancestor into a child", this, 0); } } DomDocument owner = (nodeType == DOCUMENT_NODE) ? (DomDocument) this : this.owner; DomDocument childOwner = child.owner; short childNodeType = child.nodeType; if (childOwner != owner) { // new in DOM L2, this case -- patch it up later, in reparent() if (!(childNodeType == DOCUMENT_TYPE_NODE && childOwner == null)) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, child, 0); } } // enforce various structural constraints switch (nodeType) { case DOCUMENT_NODE: switch (childNodeType) { case ELEMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case COMMENT_NODE: case DOCUMENT_TYPE_NODE: return; } break; case ATTRIBUTE_NODE: switch (childNodeType) { case TEXT_NODE: case ENTITY_REFERENCE_NODE: return; } break; case DOCUMENT_FRAGMENT_NODE: case ENTITY_REFERENCE_NODE: case ELEMENT_NODE: case ENTITY_NODE: switch (childNodeType) { case ELEMENT_NODE: case TEXT_NODE: case COMMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case CDATA_SECTION_NODE: case ENTITY_REFERENCE_NODE: return; } break; } if (owner.checkingWellformedness) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't append " + nodeTypeToString(childNodeType) + " to node of type " + nodeTypeToString(nodeType), this, 0); } }
|
private void checkMisc(DomNode child) { if (readonly && !owner.building) { throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode ctx = this; ctx != null; ctx = ctx.parent) { if (child == ctx) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't make ancestor into a child", this, 0); } } DomDocument owner = (nodeType == DOCUMENT_NODE) ? (DomDocument) this : this.owner; DomDocument childOwner = child.owner; short childNodeType = child.nodeType; if (childOwner != owner) { // new in DOM L2, this case -- patch it up later, in reparent() if (!(childNodeType == DOCUMENT_TYPE_NODE && childOwner == null)) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, child, 0); } } // enforce various structural constraints switch (nodeType) { case DOCUMENT_NODE: switch (childNodeType) { case ELEMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case COMMENT_NODE: case DOCUMENT_TYPE_NODE: return; } break; case ATTRIBUTE_NODE: switch (childNodeType) { case TEXT_NODE: case ENTITY_REFERENCE_NODE: return; } break; case DOCUMENT_FRAGMENT_NODE: case ENTITY_REFERENCE_NODE: case ELEMENT_NODE: case ENTITY_NODE: switch (childNodeType) { case ELEMENT_NODE: case TEXT_NODE: case COMMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case CDATA_SECTION_NODE: case ENTITY_REFERENCE_NODE: return; } break; } if (owner.checkingWellformedness) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't append " + nodeTypeToString(childNodeType) + " to node of type " + nodeTypeToString(nodeType), this, 0); } }
| 12,189
|
private void checkMisc(DomNode child) { if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode ctx = this; ctx != null; ctx = ctx.parent) { if (child == ctx) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't make ancestor into a child", this, 0); } } DomDocument owner = (nodeType == DOCUMENT_NODE) ? (DomDocument) this : this.owner; DomDocument childOwner = child.owner; short childNodeType = child.nodeType; if (childOwner != owner) { // new in DOM L2, this case -- patch it up later, in reparent() if (!(childNodeType == DOCUMENT_TYPE_NODE && childOwner == null)) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, child, 0); } } // enforce various structural constraints switch (nodeType) { case DOCUMENT_NODE: switch (childNodeType) { case ELEMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case COMMENT_NODE: case DOCUMENT_TYPE_NODE: return; } break; case ATTRIBUTE_NODE: switch (childNodeType) { case TEXT_NODE: case ENTITY_REFERENCE_NODE: return; } break; case DOCUMENT_FRAGMENT_NODE: case ENTITY_REFERENCE_NODE: case ELEMENT_NODE: case ENTITY_NODE: switch (childNodeType) { case ELEMENT_NODE: case TEXT_NODE: case COMMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case CDATA_SECTION_NODE: case ENTITY_REFERENCE_NODE: return; } break; } if (owner.checkingWellformedness) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't append " + nodeTypeToString(childNodeType) + " to node of type " + nodeTypeToString(nodeType), this, 0); } }
|
private void checkMisc(DomNode child) { if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode ctx = this; ctx != null; ctx = ctx.parent) { if (child == ctx) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't make ancestor into a child", this, 0); } } DomDocument owner = (nodeType == DOCUMENT_NODE) ? (DomDocument) this : this.owner; DomDocument childOwner = child.owner; short childNodeType = child.nodeType; if (childOwner != owner) { // new in DOM L2, this case -- patch it up later, in reparent() if (!(childNodeType == DOCUMENT_TYPE_NODE && childOwner == null)) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, child, 0); } } // enforce various structural constraints switch (nodeType) { case DOCUMENT_NODE: switch (childNodeType) { case ELEMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case COMMENT_NODE: case DOCUMENT_TYPE_NODE: return; } break; case ATTRIBUTE_NODE: switch (childNodeType) { case TEXT_NODE: case ENTITY_REFERENCE_NODE: return; } break; case DOCUMENT_FRAGMENT_NODE: case ENTITY_REFERENCE_NODE: case ELEMENT_NODE: case ENTITY_NODE: switch (childNodeType) { case ELEMENT_NODE: case TEXT_NODE: case COMMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case CDATA_SECTION_NODE: case ENTITY_REFERENCE_NODE: return; } break; } if (owner.checkingWellformedness) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't append " + nodeTypeToString(childNodeType) + " to node of type " + nodeTypeToString(nodeType), this, 0); } }
| 12,190
|
private void checkMisc(DomNode child) { if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode ctx = this; ctx != null; ctx = ctx.parent) { if (child == ctx) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't make ancestor into a child", this, 0); } } DomDocument owner = (nodeType == DOCUMENT_NODE) ? (DomDocument) this : this.owner; DomDocument childOwner = child.owner; short childNodeType = child.nodeType; if (childOwner != owner) { // new in DOM L2, this case -- patch it up later, in reparent() if (!(childNodeType == DOCUMENT_TYPE_NODE && childOwner == null)) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, child, 0); } } // enforce various structural constraints switch (nodeType) { case DOCUMENT_NODE: switch (childNodeType) { case ELEMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case COMMENT_NODE: case DOCUMENT_TYPE_NODE: return; } break; case ATTRIBUTE_NODE: switch (childNodeType) { case TEXT_NODE: case ENTITY_REFERENCE_NODE: return; } break; case DOCUMENT_FRAGMENT_NODE: case ENTITY_REFERENCE_NODE: case ELEMENT_NODE: case ENTITY_NODE: switch (childNodeType) { case ELEMENT_NODE: case TEXT_NODE: case COMMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case CDATA_SECTION_NODE: case ENTITY_REFERENCE_NODE: return; } break; } if (owner.checkingWellformedness) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't append " + nodeTypeToString(childNodeType) + " to node of type " + nodeTypeToString(nodeType), this, 0); } }
|
private void checkMisc(DomNode child) { if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode ctx = this; ctx != null; ctx = ctx.parent) { if (child == ctx) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't make ancestor into a child", this, 0); } } DomDocument owner = (nodeType == DOCUMENT_NODE) ? (DomDocument) this : this.owner; DomDocument childOwner = child.owner; short childNodeType = child.nodeType; if (childOwner != owner) { // new in DOM L2, this case -- patch it up later, in reparent() if (!(childNodeType == DOCUMENT_TYPE_NODE && childOwner == null)) { throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, null, child, 0); } } // enforce various structural constraints switch (nodeType) { case DOCUMENT_NODE: switch (childNodeType) { case ELEMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case COMMENT_NODE: case DOCUMENT_TYPE_NODE: return; } break; case ATTRIBUTE_NODE: switch (childNodeType) { case TEXT_NODE: case ENTITY_REFERENCE_NODE: return; } break; case DOCUMENT_FRAGMENT_NODE: case ENTITY_REFERENCE_NODE: case ELEMENT_NODE: case ENTITY_NODE: switch (childNodeType) { case ELEMENT_NODE: case TEXT_NODE: case COMMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case CDATA_SECTION_NODE: case ENTITY_REFERENCE_NODE: return; } break; } if (owner.checkingWellformedness) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't append " + nodeTypeToString(childNodeType) + " to node of type " + nodeTypeToString(nodeType), this, 0); } }
| 12,191
|
private void checkMisc(DomNode child) { if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode ctx = this; ctx != null; ctx = ctx.parent) { if (child == ctx) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't make ancestor into a child", this, 0); } } DomDocument owner = (nodeType == DOCUMENT_NODE) ? (DomDocument) this : this.owner; DomDocument childOwner = child.owner; short childNodeType = child.nodeType; if (childOwner != owner) { // new in DOM L2, this case -- patch it up later, in reparent() if (!(childNodeType == DOCUMENT_TYPE_NODE && childOwner == null)) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, child, 0); } } // enforce various structural constraints switch (nodeType) { case DOCUMENT_NODE: switch (childNodeType) { case ELEMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case COMMENT_NODE: case DOCUMENT_TYPE_NODE: return; } break; case ATTRIBUTE_NODE: switch (childNodeType) { case TEXT_NODE: case ENTITY_REFERENCE_NODE: return; } break; case DOCUMENT_FRAGMENT_NODE: case ENTITY_REFERENCE_NODE: case ELEMENT_NODE: case ENTITY_NODE: switch (childNodeType) { case ELEMENT_NODE: case TEXT_NODE: case COMMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case CDATA_SECTION_NODE: case ENTITY_REFERENCE_NODE: return; } break; } if (owner.checkingWellformedness) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't append " + nodeTypeToString(childNodeType) + " to node of type " + nodeTypeToString(nodeType), this, 0); } }
|
private void checkMisc(DomNode child) { if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode ctx = this; ctx != null; ctx = ctx.parent) { if (child == ctx) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't make ancestor into a child", this, 0); } } DomDocument owner = (nodeType == DOCUMENT_NODE) ? (DomDocument) this : this.owner; DomDocument childOwner = child.owner; short childNodeType = child.nodeType; if (childOwner != owner) { // new in DOM L2, this case -- patch it up later, in reparent() if (!(childNodeType == DOCUMENT_TYPE_NODE && childOwner == null)) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, child, 0); } } // enforce various structural constraints switch (nodeType) { case DOCUMENT_NODE: switch (childNodeType) { case ELEMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case COMMENT_NODE: case DOCUMENT_TYPE_NODE: return; } break; case ATTRIBUTE_NODE: switch (childNodeType) { case TEXT_NODE: case ENTITY_REFERENCE_NODE: return; } break; case DOCUMENT_FRAGMENT_NODE: case ENTITY_REFERENCE_NODE: case ELEMENT_NODE: case ENTITY_NODE: switch (childNodeType) { case ELEMENT_NODE: case TEXT_NODE: case COMMENT_NODE: case PROCESSING_INSTRUCTION_NODE: case CDATA_SECTION_NODE: case ENTITY_REFERENCE_NODE: return; } break; } if (owner.checkingWellformedness) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't append " + nodeTypeToString(childNodeType) + " to node of type " + nodeTypeToString(nodeType), this, 0); } }
| 12,192
|
public Event createEvent(String eventType) { eventType = eventType.toLowerCase(); if ("mutationevents".equals(eventType)) { return new DomEvent.DomMutationEvent(null); } if ("htmlevents".equals(eventType) || "events".equals(eventType) || "user-events".equals(eventType)) { return new DomEvent(null); } if ("uievents".equals(eventType)) { return new DomEvent.DomUIEvent(null); } // mouse events throw new DomEx(DomEx.NOT_SUPPORTED_ERR, eventType, null, 0); }
|
public Event createEvent(String eventType) { eventType = eventType.toLowerCase(); if ("mutationevents".equals(eventType)) { return new DomEvent.DomMutationEvent(null); } if ("htmlevents".equals(eventType) || "events".equals(eventType) || "user-events".equals(eventType)) { return new DomEvent(null); } if ("uievents".equals(eventType)) { return new DomEvent.DomUIEvent(null); } // mouse events throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, eventType, null, 0); }
| 12,193
|
public Node insertBefore(Node newChild, Node refChild) { if (refChild == null) { return appendChild(newChild); } try { DomNode child = (DomNode) newChild; DomNode ref = (DomNode) refChild; if (child.nodeType == DOCUMENT_FRAGMENT_NODE) { // Append all nodes in the fragment to this node for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { checkMisc(ctx); } for (DomNode ctx = child.first; ctx != null; ) { DomNode ctxNext = ctx.next; insertBefore(ctx, ref); ctx = ctxNext; } } else { checkMisc(child); if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (ref == child) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't insert node before itself", ref, 0); } if (child.parent != null) { child.parent.removeChild(child); } child.parent = this; int i = ref.index; child.setDepth(depth + 1); child.next = ref; if (ref.previous != null) { ref.previous.next = child; } child.previous = ref.previous; ref.previous = child; if (first == ref) { first = child; } // index renumbering for (DomNode ctx = child; ctx != null; ctx = ctx.next) { ctx.index = i++; } if (reportMutations) { insertionEvent(null, child); } } return child; } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, newChild, 0); } }
|
public Node insertBefore(Node newChild, Node refChild) { if (refChild == null) { return appendChild(newChild); } try { DomNode child = (DomNode) newChild; DomNode ref = (DomNode) refChild; if (child.nodeType == DOCUMENT_FRAGMENT_NODE) { // Append all nodes in the fragment to this node for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { checkMisc(ctx); } for (DomNode ctx = child.first; ctx != null; ) { DomNode ctxNext = ctx.next; insertBefore(ctx, ref); ctx = ctxNext; } } else { checkMisc(child); if (ref == null || ref.parent != this) { throw new DomDOMException(DOMException.NOT_FOUND_ERR, null, ref, 0); } if (ref == child) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't insert node before itself", ref, 0); } if (child.parent != null) { child.parent.removeChild(child); } child.parent = this; int i = ref.index; child.setDepth(depth + 1); child.next = ref; if (ref.previous != null) { ref.previous.next = child; } child.previous = ref.previous; ref.previous = child; if (first == ref) { first = child; } // index renumbering for (DomNode ctx = child; ctx != null; ctx = ctx.next) { ctx.index = i++; } if (reportMutations) { insertionEvent(null, child); } } return child; } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, newChild, 0); } }
| 12,194
|
public Node insertBefore(Node newChild, Node refChild) { if (refChild == null) { return appendChild(newChild); } try { DomNode child = (DomNode) newChild; DomNode ref = (DomNode) refChild; if (child.nodeType == DOCUMENT_FRAGMENT_NODE) { // Append all nodes in the fragment to this node for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { checkMisc(ctx); } for (DomNode ctx = child.first; ctx != null; ) { DomNode ctxNext = ctx.next; insertBefore(ctx, ref); ctx = ctxNext; } } else { checkMisc(child); if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (ref == child) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't insert node before itself", ref, 0); } if (child.parent != null) { child.parent.removeChild(child); } child.parent = this; int i = ref.index; child.setDepth(depth + 1); child.next = ref; if (ref.previous != null) { ref.previous.next = child; } child.previous = ref.previous; ref.previous = child; if (first == ref) { first = child; } // index renumbering for (DomNode ctx = child; ctx != null; ctx = ctx.next) { ctx.index = i++; } if (reportMutations) { insertionEvent(null, child); } } return child; } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, newChild, 0); } }
|
public Node insertBefore(Node newChild, Node refChild) { if (refChild == null) { return appendChild(newChild); } try { DomNode child = (DomNode) newChild; DomNode ref = (DomNode) refChild; if (child.nodeType == DOCUMENT_FRAGMENT_NODE) { // Append all nodes in the fragment to this node for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { checkMisc(ctx); } for (DomNode ctx = child.first; ctx != null; ) { DomNode ctxNext = ctx.next; insertBefore(ctx, ref); ctx = ctxNext; } } else { checkMisc(child); if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (ref == child) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't insert node before itself", ref, 0); } if (child.parent != null) { child.parent.removeChild(child); } child.parent = this; int i = ref.index; child.setDepth(depth + 1); child.next = ref; if (ref.previous != null) { ref.previous.next = child; } child.previous = ref.previous; ref.previous = child; if (first == ref) { first = child; } // index renumbering for (DomNode ctx = child; ctx != null; ctx = ctx.next) { ctx.index = i++; } if (reportMutations) { insertionEvent(null, child); } } return child; } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, newChild, 0); } }
| 12,195
|
public Node insertBefore(Node newChild, Node refChild) { if (refChild == null) { return appendChild(newChild); } try { DomNode child = (DomNode) newChild; DomNode ref = (DomNode) refChild; if (child.nodeType == DOCUMENT_FRAGMENT_NODE) { // Append all nodes in the fragment to this node for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { checkMisc(ctx); } for (DomNode ctx = child.first; ctx != null; ) { DomNode ctxNext = ctx.next; insertBefore(ctx, ref); ctx = ctxNext; } } else { checkMisc(child); if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (ref == child) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't insert node before itself", ref, 0); } if (child.parent != null) { child.parent.removeChild(child); } child.parent = this; int i = ref.index; child.setDepth(depth + 1); child.next = ref; if (ref.previous != null) { ref.previous.next = child; } child.previous = ref.previous; ref.previous = child; if (first == ref) { first = child; } // index renumbering for (DomNode ctx = child; ctx != null; ctx = ctx.next) { ctx.index = i++; } if (reportMutations) { insertionEvent(null, child); } } return child; } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, newChild, 0); } }
|
public Node insertBefore(Node newChild, Node refChild) { if (refChild == null) { return appendChild(newChild); } try { DomNode child = (DomNode) newChild; DomNode ref = (DomNode) refChild; if (child.nodeType == DOCUMENT_FRAGMENT_NODE) { // Append all nodes in the fragment to this node for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { checkMisc(ctx); } for (DomNode ctx = child.first; ctx != null; ) { DomNode ctxNext = ctx.next; insertBefore(ctx, ref); ctx = ctxNext; } } else { checkMisc(child); if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (ref == child) { throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, "can't insert node before itself", ref, 0); } if (child.parent != null) { child.parent.removeChild(child); } child.parent = this; int i = ref.index; child.setDepth(depth + 1); child.next = ref; if (ref.previous != null) { ref.previous.next = child; } child.previous = ref.previous; ref.previous = child; if (first == ref) { first = child; } // index renumbering for (DomNode ctx = child; ctx != null; ctx = ctx.next) { ctx.index = i++; } if (reportMutations) { insertionEvent(null, child); } } return child; } catch (ClassCastException e) { throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, null, newChild, 0); } }
| 12,196
|
public Node removeChild(Node refChild) { try { DomNode ref = (DomNode) refChild; if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode child = first; child != null; child = child.next) { if (child == ref) { if (reportMutations) { removalEvent(null, child); } length--; if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } // renumber indices int i = 0; for (DomNode ctx = first; ctx != null; ctx = ctx.next) { ctx.index = i++; } ref.parent = null; ref.setDepth(0); ref.index = 0; ref.previous = null; ref.next = null; return ref; } } throw new DomEx(DomEx.NOT_FOUND_ERR, "that's no child of mine", refChild, 0); } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, refChild, 0); } }
|
public Node removeChild(Node refChild) { try { DomNode ref = (DomNode) refChild; if (ref == null || ref.parent != this) { throw new DomDOMException(DOMException.NOT_FOUND_ERR, null, ref, 0); } if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode child = first; child != null; child = child.next) { if (child == ref) { if (reportMutations) { removalEvent(null, child); } length--; if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } // renumber indices int i = 0; for (DomNode ctx = first; ctx != null; ctx = ctx.next) { ctx.index = i++; } ref.parent = null; ref.setDepth(0); ref.index = 0; ref.previous = null; ref.next = null; return ref; } } throw new DomEx(DomEx.NOT_FOUND_ERR, "that's no child of mine", refChild, 0); } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, refChild, 0); } }
| 12,197
|
public Node removeChild(Node refChild) { try { DomNode ref = (DomNode) refChild; if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode child = first; child != null; child = child.next) { if (child == ref) { if (reportMutations) { removalEvent(null, child); } length--; if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } // renumber indices int i = 0; for (DomNode ctx = first; ctx != null; ctx = ctx.next) { ctx.index = i++; } ref.parent = null; ref.setDepth(0); ref.index = 0; ref.previous = null; ref.next = null; return ref; } } throw new DomEx(DomEx.NOT_FOUND_ERR, "that's no child of mine", refChild, 0); } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, refChild, 0); } }
|
public Node removeChild(Node refChild) { try { DomNode ref = (DomNode) refChild; if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (readonly && !owner.building) { throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode child = first; child != null; child = child.next) { if (child == ref) { if (reportMutations) { removalEvent(null, child); } length--; if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } // renumber indices int i = 0; for (DomNode ctx = first; ctx != null; ctx = ctx.next) { ctx.index = i++; } ref.parent = null; ref.setDepth(0); ref.index = 0; ref.previous = null; ref.next = null; return ref; } } throw new DomEx(DomEx.NOT_FOUND_ERR, "that's no child of mine", refChild, 0); } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, refChild, 0); } }
| 12,198
|
public Node removeChild(Node refChild) { try { DomNode ref = (DomNode) refChild; if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode child = first; child != null; child = child.next) { if (child == ref) { if (reportMutations) { removalEvent(null, child); } length--; if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } // renumber indices int i = 0; for (DomNode ctx = first; ctx != null; ctx = ctx.next) { ctx.index = i++; } ref.parent = null; ref.setDepth(0); ref.index = 0; ref.previous = null; ref.next = null; return ref; } } throw new DomEx(DomEx.NOT_FOUND_ERR, "that's no child of mine", refChild, 0); } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, refChild, 0); } }
|
public Node removeChild(Node refChild) { try { DomNode ref = (DomNode) refChild; if (ref == null || ref.parent != this) { throw new DomDOMException(DOMException.NOT_FOUND_ERR, null, ref, 0); } if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode child = first; child != null; child = child.next) { if (child == ref) { if (reportMutations) { removalEvent(null, child); } length--; if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } // renumber indices int i = 0; for (DomNode ctx = first; ctx != null; ctx = ctx.next) { ctx.index = i++; } ref.parent = null; ref.setDepth(0); ref.index = 0; ref.previous = null; ref.next = null; return ref; } } throw new DomDOMException(DOMException.NOT_FOUND_ERR, "that's no child of mine", refChild, 0); } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, refChild, 0); } }
| 12,199
|
public Node removeChild(Node refChild) { try { DomNode ref = (DomNode) refChild; if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode child = first; child != null; child = child.next) { if (child == ref) { if (reportMutations) { removalEvent(null, child); } length--; if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } // renumber indices int i = 0; for (DomNode ctx = first; ctx != null; ctx = ctx.next) { ctx.index = i++; } ref.parent = null; ref.setDepth(0); ref.index = 0; ref.previous = null; ref.next = null; return ref; } } throw new DomEx(DomEx.NOT_FOUND_ERR, "that's no child of mine", refChild, 0); } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, refChild, 0); } }
|
public Node removeChild(Node refChild) { try { DomNode ref = (DomNode) refChild; if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode child = first; child != null; child = child.next) { if (child == ref) { if (reportMutations) { removalEvent(null, child); } length--; if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } // renumber indices int i = 0; for (DomNode ctx = first; ctx != null; ctx = ctx.next) { ctx.index = i++; } ref.parent = null; ref.setDepth(0); ref.index = 0; ref.previous = null; ref.next = null; return ref; } } throw new DomEx(DomEx.NOT_FOUND_ERR, "that's no child of mine", refChild, 0); } catch (ClassCastException e) { throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, null, refChild, 0); } }
| 12,200
|
public Node replaceChild(Node newChild, Node refChild) { try { DomNode child = (DomNode) newChild; DomNode ref = (DomNode) refChild; DomEvent.DomMutationEvent event = getMutationEvent(); boolean doFree = (event != null); if (child.nodeType == DOCUMENT_FRAGMENT_NODE) { // Append all nodes in the fragment to this node for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { checkMisc(ctx); } if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (reportMutations) { removalEvent(event, ref); } length--; length += child.length; if (child.length == 0) { // Removal if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } } else { int i = ref.index; for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { // Insertion ctx.parent = this; ctx.index = i++; ctx.setDepth(ref.depth); if (ctx == child.first) { ctx.previous = ref.previous; } if (ctx == child.last) { ctx.next = ref.next; } } if (first == ref) { first = child.first; } if (last == ref) { last = child.last; } } } else { checkMisc(child); if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (reportMutations) { removalEvent(event, ref); } if (child.parent != null) { child.parent.removeChild(child); } child.parent = this; child.index = ref.index; child.setDepth(ref.depth); if (ref.previous != null) { ref.previous.next = child; } child.previous = ref.previous; if (ref.next != null) { ref.next.previous = child; } child.next = ref.next; if (first == ref) { first = child; } if (last == ref) { last = child; } if (reportMutations) { insertionEvent(event, child); } if (doFree) { freeMutationEvent(); } } ref.parent = null; ref.index = 0; ref.setDepth(0); ref.previous = null; ref.next = null; return ref; } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, newChild, 0); } }
|
public Node replaceChild(Node newChild, Node refChild) { try { DomNode child = (DomNode) newChild; DomNode ref = (DomNode) refChild; DomEvent.DomMutationEvent event = getMutationEvent(); boolean doFree = (event != null); if (child.nodeType == DOCUMENT_FRAGMENT_NODE) { // Append all nodes in the fragment to this node for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { checkMisc(ctx); } if (ref == null || ref.parent != this) { throw new DomDOMException(DOMException.NOT_FOUND_ERR, null, ref, 0); } if (reportMutations) { removalEvent(event, ref); } length--; length += child.length; if (child.length == 0) { // Removal if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } } else { int i = ref.index; for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { // Insertion ctx.parent = this; ctx.index = i++; ctx.setDepth(ref.depth); if (ctx == child.first) { ctx.previous = ref.previous; } if (ctx == child.last) { ctx.next = ref.next; } } if (first == ref) { first = child.first; } if (last == ref) { last = child.last; } } } else { checkMisc(child); if (ref == null || ref.parent != this) { throw new DomDOMException(DOMException.NOT_FOUND_ERR, null, ref, 0); } if (reportMutations) { removalEvent(event, ref); } if (child.parent != null) { child.parent.removeChild(child); } child.parent = this; child.index = ref.index; child.setDepth(ref.depth); if (ref.previous != null) { ref.previous.next = child; } child.previous = ref.previous; if (ref.next != null) { ref.next.previous = child; } child.next = ref.next; if (first == ref) { first = child; } if (last == ref) { last = child; } if (reportMutations) { insertionEvent(event, child); } if (doFree) { freeMutationEvent(); } } ref.parent = null; ref.index = 0; ref.setDepth(0); ref.previous = null; ref.next = null; return ref; } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, newChild, 0); } }
| 12,201
|
public Node replaceChild(Node newChild, Node refChild) { try { DomNode child = (DomNode) newChild; DomNode ref = (DomNode) refChild; DomEvent.DomMutationEvent event = getMutationEvent(); boolean doFree = (event != null); if (child.nodeType == DOCUMENT_FRAGMENT_NODE) { // Append all nodes in the fragment to this node for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { checkMisc(ctx); } if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (reportMutations) { removalEvent(event, ref); } length--; length += child.length; if (child.length == 0) { // Removal if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } } else { int i = ref.index; for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { // Insertion ctx.parent = this; ctx.index = i++; ctx.setDepth(ref.depth); if (ctx == child.first) { ctx.previous = ref.previous; } if (ctx == child.last) { ctx.next = ref.next; } } if (first == ref) { first = child.first; } if (last == ref) { last = child.last; } } } else { checkMisc(child); if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (reportMutations) { removalEvent(event, ref); } if (child.parent != null) { child.parent.removeChild(child); } child.parent = this; child.index = ref.index; child.setDepth(ref.depth); if (ref.previous != null) { ref.previous.next = child; } child.previous = ref.previous; if (ref.next != null) { ref.next.previous = child; } child.next = ref.next; if (first == ref) { first = child; } if (last == ref) { last = child; } if (reportMutations) { insertionEvent(event, child); } if (doFree) { freeMutationEvent(); } } ref.parent = null; ref.index = 0; ref.setDepth(0); ref.previous = null; ref.next = null; return ref; } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, newChild, 0); } }
|
public Node replaceChild(Node newChild, Node refChild) { try { DomNode child = (DomNode) newChild; DomNode ref = (DomNode) refChild; DomEvent.DomMutationEvent event = getMutationEvent(); boolean doFree = (event != null); if (child.nodeType == DOCUMENT_FRAGMENT_NODE) { // Append all nodes in the fragment to this node for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { checkMisc(ctx); } if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (reportMutations) { removalEvent(event, ref); } length--; length += child.length; if (child.length == 0) { // Removal if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } } else { int i = ref.index; for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { // Insertion ctx.parent = this; ctx.index = i++; ctx.setDepth(ref.depth); if (ctx == child.first) { ctx.previous = ref.previous; } if (ctx == child.last) { ctx.next = ref.next; } } if (first == ref) { first = child.first; } if (last == ref) { last = child.last; } } } else { checkMisc(child); if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (reportMutations) { removalEvent(event, ref); } if (child.parent != null) { child.parent.removeChild(child); } child.parent = this; child.index = ref.index; child.setDepth(ref.depth); if (ref.previous != null) { ref.previous.next = child; } child.previous = ref.previous; if (ref.next != null) { ref.next.previous = child; } child.next = ref.next; if (first == ref) { first = child; } if (last == ref) { last = child; } if (reportMutations) { insertionEvent(event, child); } if (doFree) { freeMutationEvent(); } } ref.parent = null; ref.index = 0; ref.setDepth(0); ref.previous = null; ref.next = null; return ref; } catch (ClassCastException e) { throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, null, newChild, 0); } }
| 12,202
|
ElementNode(TemplateNode children, TemplateNode next, TemplateNode name, TemplateNode namespace, String uas, Node source) { super(children, next); this.name = name; this.namespace = namespace; this.uas = uas; this.source = source; NamedNodeMap attrs = source.getAttributes(); Node attr = attrs.getNamedItemNS(Stylesheet.XSL_NS, "exclude-result-prefixes"); if (attr != null) { elementExcludeResultPrefixes = new HashSet(); StringTokenizer st = new StringTokenizer(attr.getNodeValue()); while (st.hasMoreTokens()) { elementExcludeResultPrefixes.add(st.nextToken()); } } else { elementExcludeResultPrefixes = Collections.EMPTY_SET; } }
|
ElementNode(TemplateNode name, TemplateNode namespace, String uas, Node source) { super(children, next); this.name = name; this.namespace = namespace; this.uas = uas; this.source = source; NamedNodeMap attrs = source.getAttributes(); Node attr = attrs.getNamedItemNS(Stylesheet.XSL_NS, "exclude-result-prefixes"); if (attr != null) { elementExcludeResultPrefixes = new HashSet(); StringTokenizer st = new StringTokenizer(attr.getNodeValue()); while (st.hasMoreTokens()) { elementExcludeResultPrefixes.add(st.nextToken()); } } else { elementExcludeResultPrefixes = Collections.EMPTY_SET; } }
| 12,203
|
ElementNode(TemplateNode children, TemplateNode next, TemplateNode name, TemplateNode namespace, String uas, Node source) { super(children, next); this.name = name; this.namespace = namespace; this.uas = uas; this.source = source; NamedNodeMap attrs = source.getAttributes(); Node attr = attrs.getNamedItemNS(Stylesheet.XSL_NS, "exclude-result-prefixes"); if (attr != null) { elementExcludeResultPrefixes = new HashSet(); StringTokenizer st = new StringTokenizer(attr.getNodeValue()); while (st.hasMoreTokens()) { elementExcludeResultPrefixes.add(st.nextToken()); } } else { elementExcludeResultPrefixes = Collections.EMPTY_SET; } }
|
ElementNode(TemplateNode children, TemplateNode next, TemplateNode name, TemplateNode namespace, String uas, Node source) { this.name = name; this.namespace = namespace; this.uas = uas; this.source = source; NamedNodeMap attrs = source.getAttributes(); Node attr = attrs.getNamedItemNS(Stylesheet.XSL_NS, "exclude-result-prefixes"); if (attr != null) { elementExcludeResultPrefixes = new HashSet(); StringTokenizer st = new StringTokenizer(attr.getNodeValue()); while (st.hasMoreTokens()) { elementExcludeResultPrefixes.add(st.nextToken()); } } else { elementExcludeResultPrefixes = Collections.EMPTY_SET; } }
| 12,204
|
TemplateNode clone(Stylesheet stylesheet) { return new ElementNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), name.clone(stylesheet), (namespace == null) ? null : namespace.clone(stylesheet), uas, source); }
|
TemplateNode clone(Stylesheet stylesheet) { return new ElementNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), name.clone(stylesheet), (namespace == null) ? null : namespace.clone(stylesheet), uas, source); }
| 12,205
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); scrollbar.setForeground(defaults.getColor("ScrollBar.foreground")); scrollbar.setBackground(defaults.getColor("ScrollBar.background")); scrollbar.setBorder(defaults.getBorder("ScrollBar.border")); scrollbar.setOpaque(true); scrollbar.setLayout(this); thumbColor = defaults.getColor("ScrollBar.thumb"); thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow"); thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight"); thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow"); maximumThumbSize = defaults.getDimension("ScrollBar.maximumThumbSize"); minimumThumbSize = defaults.getDimension("ScrollBar.minimumThumbSize"); }
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); scrollbar.setForeground(defaults.getColor("ScrollBar.foreground")); scrollbar.setBackground(defaults.getColor("ScrollBar.background")); scrollbar.setBorder(defaults.getBorder("ScrollBar.border")); scrollbar.setOpaque(true); scrollbar.setLayout(this); thumbColor = defaults.getColor("ScrollBar.thumb"); thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow"); thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight"); thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow"); maximumThumbSize = defaults.getDimension("ScrollBar.maximumThumbSize"); minimumThumbSize = defaults.getDimension("ScrollBar.minimumThumbSize"); }
| 12,207
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); scrollbar.setForeground(defaults.getColor("ScrollBar.foreground")); scrollbar.setBackground(defaults.getColor("ScrollBar.background")); scrollbar.setBorder(defaults.getBorder("ScrollBar.border")); scrollbar.setOpaque(true); scrollbar.setLayout(this); thumbColor = defaults.getColor("ScrollBar.thumb"); thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow"); thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight"); thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow"); maximumThumbSize = defaults.getDimension("ScrollBar.maximumThumbSize"); minimumThumbSize = defaults.getDimension("ScrollBar.minimumThumbSize"); }
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); scrollbar.setForeground(defaults.getColor("ScrollBar.foreground")); scrollbar.setBackground(defaults.getColor("ScrollBar.background")); scrollbar.setBorder(defaults.getBorder("ScrollBar.border")); scrollbar.setOpaque(true); scrollbar.setLayout(this); thumbColor = defaults.getColor("ScrollBar.thumb"); thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow"); thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight"); thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow"); maximumThumbSize = defaults.getDimension("ScrollBar.maximumThumbSize"); minimumThumbSize = defaults.getDimension("ScrollBar.minimumThumbSize"); }
| 12,208
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); scrollbar.setForeground(defaults.getColor("ScrollBar.foreground")); scrollbar.setBackground(defaults.getColor("ScrollBar.background")); scrollbar.setBorder(defaults.getBorder("ScrollBar.border")); scrollbar.setOpaque(true); scrollbar.setLayout(this); thumbColor = defaults.getColor("ScrollBar.thumb"); thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow"); thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight"); thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow"); maximumThumbSize = defaults.getDimension("ScrollBar.maximumThumbSize"); minimumThumbSize = defaults.getDimension("ScrollBar.minimumThumbSize"); }
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); scrollbar.setForeground(defaults.getColor("ScrollBar.foreground")); scrollbar.setBackground(defaults.getColor("ScrollBar.background")); scrollbar.setBorder(defaults.getBorder("ScrollBar.border")); scrollbar.setOpaque(true); scrollbar.setLayout(this); thumbColor = defaults.getColor("ScrollBar.thumb"); thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow"); thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight"); thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow"); maximumThumbSize = defaults.getDimension("ScrollBar.maximumThumbSize"); minimumThumbSize = defaults.getDimension("ScrollBar.minimumThumbSize"); }
| 12,209
|
public void addSubjectName(Principal subjectName) throws IOException { if (subjectName instanceof X500DistinguishedName) subjectNames.add(subjectName); else if (subjectName instanceof X500Principal) subjectNames.add(new X500DistinguishedName(((X500Principal) subjectName).getEncoded())); else subjectNames.add(new X500DistinguishedName(subjectName.getName())); }
|
public void addSubjectName(byte[] subjectName) throws IOException { if (subjectName instanceof X500DistinguishedName) subjectNames.add(subjectName); else if (subjectName instanceof X500Principal) subjectNames.add(new X500DistinguishedName(((X500Principal) subjectName).getEncoded())); else subjectNames.add(new X500DistinguishedName(subjectName.getName())); }
| 12,210
|
public void addSubjectName(Principal subjectName) throws IOException { if (subjectName instanceof X500DistinguishedName) subjectNames.add(subjectName); else if (subjectName instanceof X500Principal) subjectNames.add(new X500DistinguishedName(((X500Principal) subjectName).getEncoded())); else subjectNames.add(new X500DistinguishedName(subjectName.getName())); }
|
public void addSubjectName(Principal subjectName) throws IOException { if (subjectName instanceof X500DistinguishedName) subjectNames.add(subjectName); else if (subjectName instanceof X500Principal) subjectNames.add(new X500DistinguishedName(((X500Principal) subjectName).getEncoded())); else subjectNames.add(new X500DistinguishedName(subjectName.getName())); }
| 12,211
|
public InvalidAlgorithmParameterException(String msg) { super(msg); }
|
public InvalidAlgorithmParameterException() { super(msg); }
| 12,212
|
public InvalidAlgorithmParameterException(String msg) { super(msg); }
|
public InvalidAlgorithmParameterException(String msg) { super(); }
| 12,213
|
public void select(int start_pos, int endPos) { // TODO: Must be implemented. }
|
public void select(int startPos, int endPos) { // TODO: Must be implemented. }
| 12,214
|
public AlreadyBoundHolder(AlreadyBound initialValue) { value = initialValue; }
|
public AlreadyBoundHolder() { value = initialValue; }
| 12,215
|
public AlreadyBoundHolder(AlreadyBound initialValue) { value = initialValue; }
|
public AlreadyBoundHolder(AlreadyBound initialValue) { }
| 12,216
|
public BandedSampleModel(int dataType, int w, int h, int numBands) { super(dataType, w, h, 1, w, new int[numBands]); }
|
public BandedSampleModel(int dataType, int w, int h, int numBands) { this(dataType, w, h, w, createBankArray(numBands), new int[numBands]); }
| 12,217
|
public SampleModel createSubsetSampleModel(int[] bands) { int[] newoff = new int[bands.length]; int[] newbanks = new int[bands.length]; for (int i=0; i < bands.length; i++) { int b = bands[i]; newoff[i] = bandOffsets[b]; newbanks[i] = bankIndices[b]; } if (bands.length > bankIndices.length) throw new RasterFormatException("BandedSampleModel createSubsetSampleModel too" +" many bands"); return new BandedSampleModel(dataType, width, height, scanlineStride, newbanks, newoff); }
|
public SampleModel createSubsetSampleModel(int[] bands) { int[] newoff = new int[bands.length]; int[] newbanks = new int[bands.length]; for (int i=0; i < bands.length; i++) { int b = bands[i]; newoff[i] = bandOffsets[b]; newbanks[i] = bankIndices[b]; } if (bands.length > bankIndices.length) throw new RasterFormatException("BandedSampleModel createSubsetSampleModel too" +" many bands"); return new BandedSampleModel(dataType, width, height, scanlineStride, newbanks, newoff); }
| 12,218
|
public int[] getPixel(int x, int y, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[numBands]; for (int i=0; i < numBands; i++) iArray[i] = getSample(x, y, 0, data); return iArray; }
|
public int[] getPixel(int x, int y, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[numBands]; for (int i=0; i < numBands; i++) iArray[i] = getSample(x, y, i, data); return iArray; }
| 12,219
|
public int[] getPixels(int x, int y, int w, int h, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h*numBands]; int outOffset = 0; for (y=0; y<h; y++) { for (x=0; x<w;) { for (int b=0; b < numBands; b++) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } } return iArray; }
|
public int[] getPixels(int x, int y, int w, int h, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h*numBands]; int outOffset = 0; int maxX = x + w; int maxY = y + h; for (int yy = x; yy < maxY; yy++) { for (x=0; x<w;) { for (int b=0; b < numBands; b++) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } } return iArray; }
| 12,220
|
public int[] getPixels(int x, int y, int w, int h, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h*numBands]; int outOffset = 0; for (y=0; y<h; y++) { for (x=0; x<w;) { for (int b=0; b < numBands; b++) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } } return iArray; }
|
public int[] getPixels(int x, int y, int w, int h, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h*numBands]; int outOffset = 0; for (y=0; y<h; y++) { for (int xx = x; xx < maxX; xx++) { for (int b=0; b < numBands; b++) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } } return iArray; }
| 12,221
|
public int[] getPixels(int x, int y, int w, int h, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h*numBands]; int outOffset = 0; for (y=0; y<h; y++) { for (x=0; x<w;) { for (int b=0; b < numBands; b++) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } } return iArray; }
|
public int[] getPixels(int x, int y, int w, int h, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h*numBands]; int outOffset = 0; for (y=0; y<h; y++) { for (x=0; x<w;) { for (int b=0; b < numBands; b++) { int offset = bandOffsets[b] + yy * scanlineStride + xx; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } } return iArray; }
| 12,222
|
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h]; int outOffset = 0; for (y=0; y<h; y++) { for (x=0; x<w;) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } return iArray; }
|
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h]; int outOffset = 0; int maxX = x + w; int maxY = y + h; for (int yy = y; yy < maxY; yy++) { for (x=0; x<w;) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } return iArray; }
| 12,223
|
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h]; int outOffset = 0; for (y=0; y<h; y++) { for (x=0; x<w;) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } return iArray; }
|
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h]; int outOffset = 0; for (y=0; y<h; y++) { for (int xx = x; xx < maxX; xx++) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } return iArray; }
| 12,224
|
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h]; int outOffset = 0; for (y=0; y<h; y++) { for (x=0; x<w;) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } return iArray; }
|
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h]; int outOffset = 0; for (y=0; y<h; y++) { for (x=0; x<w;) { int offset = bandOffsets[b] + yy * scanlineStride + xx; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } return iArray; }
| 12,225
|
public void setDataElements(int x, int y, Object obj, DataBuffer data) { int transferType = getTransferType(); if (getTransferType() != data.getDataType()) { throw new IllegalArgumentException("transfer type ("+ getTransferType()+"), "+ "does not match data "+ "buffer type (" + data.getDataType() + ")."); } int offset = y * scanlineStride + x; try { switch (transferType) { case DataBuffer.TYPE_BYTE: { DataBufferByte out = (DataBufferByte) data; byte[] in = (byte[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0]; return; } case DataBuffer.TYPE_SHORT: { DataBufferShort out = (DataBufferShort) data; short[] in = (short[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0]; return; } case DataBuffer.TYPE_USHORT: { DataBufferUShort out = (DataBufferUShort) data; short[] in = (short[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0]; return; } case DataBuffer.TYPE_INT: { DataBufferInt out = (DataBufferInt) data; int[] in = (int[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0]; return; } case DataBuffer.TYPE_FLOAT: { DataBufferFloat out = (DataBufferFloat) data; float[] in = (float[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0]; return; } case DataBuffer.TYPE_DOUBLE: { DataBufferDouble out = (DataBufferDouble) data; double[] in = (double[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0]; return; } default: throw new ClassCastException("Unsupported data type"); } } catch (ArrayIndexOutOfBoundsException aioobe) { String msg = "While writing data elements" + ", x="+x+", y="+y+ ", width="+width+", height="+height+ ", scanlineStride="+scanlineStride+ ", offset="+offset+ ", data.getSize()="+data.getSize()+ ", data.getOffset()="+data.getOffset()+ ": " + aioobe; throw new ArrayIndexOutOfBoundsException(msg); } }
|
public void setDataElements(int x, int y, Object obj, DataBuffer data) { int transferType = getTransferType(); if (getTransferType() != data.getDataType()) { throw new IllegalArgumentException("transfer type ("+ getTransferType()+"), "+ "does not match data "+ "buffer type (" + data.getDataType() + ")."); } int offset = y * scanlineStride + x; try { switch (transferType) { case DataBuffer.TYPE_BYTE: { DataBufferByte out = (DataBufferByte) data; byte[] in = (byte[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[i]; return; } case DataBuffer.TYPE_SHORT: { DataBufferShort out = (DataBufferShort) data; short[] in = (short[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[i]; return; } case DataBuffer.TYPE_USHORT: { DataBufferUShort out = (DataBufferUShort) data; short[] in = (short[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[i]; return; } case DataBuffer.TYPE_INT: { DataBufferInt out = (DataBufferInt) data; int[] in = (int[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[i]; return; } case DataBuffer.TYPE_FLOAT: { DataBufferFloat out = (DataBufferFloat) data; float[] in = (float[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[i]; return; } case DataBuffer.TYPE_DOUBLE: { DataBufferDouble out = (DataBufferDouble) data; double[] in = (double[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[i]; return; } default: throw new ClassCastException("Unsupported data type"); } } catch (ArrayIndexOutOfBoundsException aioobe) { String msg = "While writing data elements" + ", x="+x+", y="+y+ ", width="+width+", height="+height+ ", scanlineStride="+scanlineStride+ ", offset="+offset+ ", data.getSize()="+data.getSize()+ ", data.getOffset()="+data.getOffset()+ ": " + aioobe; throw new ArrayIndexOutOfBoundsException(msg); } }
| 12,226
|
public String getMessage() { return super.getMessage(); } // getMessage()
|
public String getMessage() { return super.getMessage(); } // getMessage()
| 12,227
|
public DateFormatSymbols (Locale locale) throws MissingResourceException { ResourceBundle res = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", locale); ampms = res.getStringArray ("ampms"); eras = res.getStringArray ("eras"); localPatternChars = res.getString ("localPatternChars"); months = res.getStringArray ("months"); shortMonths = res.getStringArray ("shortMonths"); shortWeekdays = res.getStringArray ("shortWeekdays"); weekdays = res.getStringArray ("weekdays"); zoneStrings = (String[][]) res.getObject ("zoneStrings"); dateFormats = formatsForKey(res, "DateFormat"); timeFormats = formatsForKey(res, "TimeFormat"); }
|
public DateFormatSymbols (Locale locale) throws MissingResourceException { ResourceBundle res = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", locale, ClassLoader.getSystemClassLoader()); ampms = res.getStringArray ("ampms"); eras = res.getStringArray ("eras"); localPatternChars = res.getString ("localPatternChars"); months = res.getStringArray ("months"); shortMonths = res.getStringArray ("shortMonths"); shortWeekdays = res.getStringArray ("shortWeekdays"); weekdays = res.getStringArray ("weekdays"); zoneStrings = (String[][]) res.getObject ("zoneStrings"); dateFormats = formatsForKey(res, "DateFormat"); timeFormats = formatsForKey(res, "TimeFormat"); }
| 12,228
|
public String group (int group) throws IllegalStateException { assertMatchOp(); return match.toString(group); }
|
public String group (int group) throws IllegalStateException { assertMatchOp(); return match.toString(group); }
| 12,229
|
public String group (int group) throws IllegalStateException { assertMatchOp(); return match.toString(group); }
|
public String group (int group) throws IllegalStateException { assertMatchOp(); return match.toString(); }
| 12,230
|
public boolean equals (Object obj) { if (! (obj instanceof DateFormatSymbols)) return false; DateFormatSymbols other = (DateFormatSymbols) obj; return (equals(ampms, other.ampms) && equals(eras, other.eras) && equals(localPatternChars, other.localPatternChars) && equals(months, other.months) && equals(shortMonths, other.shortMonths) && equals(shortWeekdays, other.shortWeekdays) && equals(weekdays, other.weekdays) && equals(zoneStrings, other.zoneStrings)); }
|
private static boolean equals (Object x, Object y) { if (! (obj instanceof DateFormatSymbols)) return false; DateFormatSymbols other = (DateFormatSymbols) obj; return (equals(ampms, other.ampms) && equals(eras, other.eras) && equals(localPatternChars, other.localPatternChars) && equals(months, other.months) && equals(shortMonths, other.shortMonths) && equals(shortWeekdays, other.shortWeekdays) && equals(weekdays, other.weekdays) && equals(zoneStrings, other.zoneStrings)); }
| 12,231
|
public boolean equals (Object obj) { if (! (obj instanceof DateFormatSymbols)) return false; DateFormatSymbols other = (DateFormatSymbols) obj; return (equals(ampms, other.ampms) && equals(eras, other.eras) && equals(localPatternChars, other.localPatternChars) && equals(months, other.months) && equals(shortMonths, other.shortMonths) && equals(shortWeekdays, other.shortWeekdays) && equals(weekdays, other.weekdays) && equals(zoneStrings, other.zoneStrings)); }
|
public boolean equals (Object obj) { if (x == y) return true; if (x == null || y == null) return false; DateFormatSymbols other = (DateFormatSymbols) obj; return (equals(ampms, other.ampms) && equals(eras, other.eras) && equals(localPatternChars, other.localPatternChars) && equals(months, other.months) && equals(shortMonths, other.shortMonths) && equals(shortWeekdays, other.shortWeekdays) && equals(weekdays, other.weekdays) && equals(zoneStrings, other.zoneStrings)); }
| 12,232
|
public boolean equals (Object obj) { if (! (obj instanceof DateFormatSymbols)) return false; DateFormatSymbols other = (DateFormatSymbols) obj; return (equals(ampms, other.ampms) && equals(eras, other.eras) && equals(localPatternChars, other.localPatternChars) && equals(months, other.months) && equals(shortMonths, other.shortMonths) && equals(shortWeekdays, other.shortWeekdays) && equals(weekdays, other.weekdays) && equals(zoneStrings, other.zoneStrings)); }
|
public boolean equals (Object obj) { if (! (obj instanceof DateFormatSymbols)) return false; DateFormatSymbols other = (DateFormatSymbols) obj; return (equals(ampms, other.ampms) && equals(eras, other.eras) && equals(localPatternChars, other.localPatternChars) && equals(months, other.months) && equals(shortMonths, other.shortMonths) && equals(shortWeekdays, other.shortWeekdays) && equals(weekdays, other.weekdays) && equals(zoneStrings, other.zoneStrings)); }
| 12,233
|
public int hashCode () { return (hashCode(ampms) ^ hashCode(eras) ^ hashCode(localPatternChars) ^ hashCode(months) ^ hashCode(shortMonths) ^ hashCode(shortWeekdays) ^ hashCode(weekdays) ^ hashCode(zoneStrings)); }
|
private static int hashCode (Object x) { return (hashCode(ampms) ^ hashCode(eras) ^ hashCode(localPatternChars) ^ hashCode(months) ^ hashCode(shortMonths) ^ hashCode(shortWeekdays) ^ hashCode(weekdays) ^ hashCode(zoneStrings)); }
| 12,234
|
public int hashCode () { return (hashCode(ampms) ^ hashCode(eras) ^ hashCode(localPatternChars) ^ hashCode(months) ^ hashCode(shortMonths) ^ hashCode(shortWeekdays) ^ hashCode(weekdays) ^ hashCode(zoneStrings)); }
|
public int hashCode () { return (hashCode(ampms) ^ hashCode(eras) ^ hashCode(localPatternChars) ^ hashCode(months) ^ hashCode(shortMonths) ^ hashCode(shortWeekdays) ^ hashCode(weekdays) ^ hashCode(zoneStrings)); }
| 12,235
|
public boolean isSelectionEmpty() { return ((selection == null) || (selection.length == 0)); }
|
public boolean isSelectionEmpty() { return (selection == null) || (selection.length == 0); }
| 12,236
|
public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalSplitPaneUI instance; if (o == null) { instance = new MetalSplitPaneUI(); instances.put(component, instance); } else instance = (MetalSplitPaneUI) o; return instance; }
|
public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalSplitPaneUI instance; if (o == null) { instance = new MetalSplitPaneUI(); instances.put(component, instance); } else instance = (MetalSplitPaneUI) o; return instance; }
| 12,237
|
public String getDisplayName() { return displayName; }
|
public String getDisplayName() { return (displayName == null) ? name : displayName; }
| 12,238
|
public String getShortDescription() { return shortDescription; }
|
public String getShortDescription() { return (shortDescription == null) ? getDisplayName() : shortDescription; }
| 12,239
|
public static Policy narrow(org.omg.CORBA.Object obj) { if (obj == null) return null; else if (obj instanceof Policy) return (Policy) obj; else if (!obj._is_a(id())) throw new BAD_PARAM("Not a Policy"); else { Delegate delegate = ((ObjectImpl) obj)._get_delegate(); return new _PolicyStub(delegate); } }
|
public static Policy narrow(org.omg.CORBA.Object obj) { if (obj == null) return null; else if (obj instanceof Policy) return (Policy) obj; else if (!obj._is_a(id())) throw new BAD_PARAM("Not a Policy"); else { Delegate delegate = ((ObjectImpl) obj)._get_delegate(); return new _PolicyStub(delegate); } }
| 12,240
|
public PolicyHolder(Policy initialValue) { value = initialValue; }
|
public PolicyHolder() { value = initialValue; }
| 12,241
|
public PolicyHolder(Policy initialValue) { value = initialValue; }
|
public PolicyHolder(Policy initialValue) { }
| 12,242
|
public void installUI(JComponent c) { super.installUI(c); }
|
public void installUI(JComponent c) { super.installUI(c); if (c instanceof JPanel) { JPanel p = (JPanel) c; installDefaults(p); } }
| 12,243
|
public static void main(String[] args) throws Exception { final ParsedArguments cmdLine = HELP_INFO.parse(args); final URL url = openURL(ARG_FILE.getValue(cmdLine)); final InputStream is = url.openStream(); if (is == null) { System.err.println("Not found " + ARG_FILE.getValue(cmdLine)); } else { int len; final byte[] buf = new byte[ 1024]; while ((len = is.read(buf)) > 0) { System.out.write(buf, 0, len); } System.out.flush(); is.close(); } }
|
public static void main(String[] args) throws Exception { final ParsedArguments cmdLine = HELP_INFO.parse(args); final URL url = openURL(ARG_FILE.getValue(cmdLine)); final InputStream is = url.openStream(); if (is == null) { System.err.println("Not found " + ARG_FILE.getValue(cmdLine)); } else { int len; final byte[] buf = new byte[ 1024]; while ((len = is.read(buf)) > 0) { System.out.write(buf, 0, len); } System.out.flush(); is.close(); } }
| 12,244
|
private static URL openURL(String fname) throws MalformedURLException { try { return new URL(fname); } catch (MalformedURLException ex) { return new File(fname).toURL(); } }
|
private URL openURL(String fname) throws MalformedURLException { try { return new URL(fname); } catch (MalformedURLException ex) { return new File(fname).toURL(); } }
| 12,245
|
public Preferences systemRoot() { return null; }
|
public Preferences systemRoot() { return systemPreferences; }
| 12,246
|
public Preferences userRoot() { return null; }
|
public Preferences userRoot() { return userPreferences; }
| 12,247
|
private Component findTarget(Component c) { Component target = c; while (target != null && target.getMouseListeners().length == 0) { target = target.getParent(); } return target; }
|
private Component findTarget(Container c, Point loc) { Component target = c; while (target != null && target.getMouseListeners().length == 0) { target = target.getParent(); } return target; }
| 12,248
|
private Component findTarget(Component c) { Component target = c; while (target != null && target.getMouseListeners().length == 0) { target = target.getParent(); } return target; }
|
private Component findTarget(Component c) { Component target = c; while (target != null && target.getMouseListeners().length == 0) { target = target.getParent(); } return target; }
| 12,249
|
private Component findTarget(Component c) { Component target = c; while (target != null && target.getMouseListeners().length == 0) { target = target.getParent(); } return target; }
|
private Component findTarget(Component c) { Component target = c; while (target != null && target.getMouseListeners().length == 0) { for (int i = 0; i < children.length; i++) { Component child = children[i]; if (child.isShowing()) { if (child.contains(loc.x - child.getX(), loc.y - child.getY()) && (child.getMouseListeners().length > 0 || child.getMouseMotionListeners().length > 0)) { target = child; break; } } } } return target; }
| 12,250
|
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
|
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
| 12,251
|
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
|
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
| 12,252
|
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
|
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null && (dragTarget == null || dragTarget == target)) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null && (dragTarget == null || dragTarget == target)) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
| 12,253
|
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
|
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
| 12,254
|
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
|
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: if (dragTarget == null) { lastTarget = dragTarget = target; dragButton = ev.getButton(); } else return false; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
| 12,255
|
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
|
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null && dragButton == ev.getButton()) { target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
| 12,256
|
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
|
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
| 12,258
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.