rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, length);
final Extent size = Extent.fromIntZeroExtend(length); Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, size);
public void getBytes(int memPtr, byte[] dst, int dstOfs, int length) { if (dstOfs < 0) { throw new IndexOutOfBoundsException("dstOfs < 0"); } if (length < 0) { throw new IndexOutOfBoundsException("length < 0"); } if (dstOfs + length > dst.length) { throw new IndexOutOfBoundsException("dstOfs + length > dst.length"); } testMemPtr(memPtr, length); final Address dstPtr = VmMagic.getArrayData(dst).add(dstOfs); Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, length); }
Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, length * 2);
final Extent size = Extent.fromIntZeroExtend(length * 2); Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, size);
public void getChars(int memPtr, char[] dst, int dstOfs, int length) { if (dstOfs < 0) { throw new IndexOutOfBoundsException("dstOfs < 0"); } if (length < 0) { throw new IndexOutOfBoundsException("length < 0"); } if (dstOfs + length > dst.length) { throw new IndexOutOfBoundsException("dstOfs + length > dst.length"); } testMemPtr(memPtr, length * 2); final Address dstPtr = VmMagic.getArrayData(dst).add(dstOfs * 2); Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, length * 2); }
Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, length * 8);
final Extent size = Extent.fromIntZeroExtend(length * 8); Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, size);
public void getDoubles(int memPtr, double[] dst, int dstOfs, int length) { if (dstOfs < 0) { throw new IndexOutOfBoundsException("dstOfs < 0"); } if (length < 0) { throw new IndexOutOfBoundsException("length < 0"); } if (dstOfs + length > dst.length) { throw new IndexOutOfBoundsException("dstOfs + length > dst.length"); } testMemPtr(memPtr, length * 8); final Address dstPtr = VmMagic.getArrayData(dst).add(dstOfs * 8); Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, length * 8); }
Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, length * 4);
final Extent size = Extent.fromIntZeroExtend(length); Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, size);
public void getInts(int memPtr, int[] dst, int dstOfs, int length) { if (dstOfs < 0) { throw new IndexOutOfBoundsException("dstOfs < 0"); } if (length < 0) { throw new IndexOutOfBoundsException("length < 0"); } if (dstOfs + length > dst.length) { throw new IndexOutOfBoundsException("dstOfs + length > dst.length"); } testMemPtr(memPtr, length * 4); final Address dstPtr = VmMagic.getArrayData(dst).add(dstOfs * 4); Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, length * 4); }
Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, length * 8);
final Extent size = Extent.fromIntZeroExtend(length * 8); Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, size);
public void getLongs(int memPtr, long[] dst, int dstOfs, int length) { if (dstOfs < 0) { throw new IndexOutOfBoundsException("dstOfs < 0"); } if (length < 0) { throw new IndexOutOfBoundsException("length < 0"); } if (dstOfs + length > dst.length) { throw new IndexOutOfBoundsException("dstOfs + length > dst.length"); } testMemPtr(memPtr, length * 8); final Address dstPtr = VmMagic.getArrayData(dst).add(dstOfs * 8); Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, length * 8); }
Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, length * 2);
final Extent size = Extent.fromIntZeroExtend(length * 2); Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, size);
public void getShorts(int memPtr, short[] dst, int dstOfs, int length) { if (dstOfs < 0) { throw new IndexOutOfBoundsException("dstOfs < 0"); } if (length < 0) { throw new IndexOutOfBoundsException("length < 0"); } if (dstOfs + length > dst.length) { throw new IndexOutOfBoundsException("dstOfs + length > dst.length"); } testMemPtr(memPtr, length * 2); final Address dstPtr = VmMagic.getArrayData(dst).add(dstOfs * 2); Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, length * 2); }
Unsafe.copy(srcPtr, start.add(dstPtr), length);
final Extent size = Extent.fromIntZeroExtend(length); Unsafe.copy(srcPtr, start.add(dstPtr), size);
public void setBytes(byte[] src, int srcOfs, int dstPtr, int length) { if (srcOfs < 0) { throw new IndexOutOfBoundsException("srcOfs < 0"); } if (length < 0) { throw new IndexOutOfBoundsException("length < 0"); } if (srcOfs + length > src.length) { throw new IndexOutOfBoundsException("dstOfs + length > dst.length"); } testMemPtr(dstPtr, length); final Address srcPtr = VmMagic.getArrayData(src).add(srcOfs); Unsafe.copy(srcPtr, start.add(dstPtr), length); }
Unsafe.copy(srcPtr, start.add(dstPtr), length * 2);
final Extent size = Extent.fromIntZeroExtend(length * 2); Unsafe.copy(srcPtr, start.add(dstPtr), size);
public void setChars(char[] src, int srcOfs, int dstPtr, int length) { if (srcOfs < 0) { throw new IndexOutOfBoundsException("srcOfs < 0"); } if (length < 0) { throw new IndexOutOfBoundsException("length < 0"); } if (srcOfs + length > src.length) { throw new IndexOutOfBoundsException("dstOfs + length > dst.length"); } testMemPtr(dstPtr, length * 2); final Address srcPtr = VmMagic.getArrayData(src).add(srcOfs * 2); Unsafe.copy(srcPtr, start.add(dstPtr), length * 2); }
Unsafe.copy(srcPtr, start.add(dstPtr), length * 8);
final Extent size = Extent.fromIntZeroExtend(length * 8); Unsafe.copy(srcPtr, start.add(dstPtr), size);
public void setDoubles(double[] src, int srcOfs, int dstPtr, int length) { if (srcOfs < 0) { throw new IndexOutOfBoundsException("srcOfs < 0"); } if (length < 0) { throw new IndexOutOfBoundsException("length < 0"); } if (srcOfs + length > src.length) { throw new IndexOutOfBoundsException("dstOfs + length > dst.length"); } testMemPtr(dstPtr, length * 8); final Address srcPtr = VmMagic.getArrayData(src).add(srcOfs * 8); Unsafe.copy(srcPtr, start.add(dstPtr), length * 8); }
Unsafe.copy(srcPtr, start.add(dstPtr), length * 4);
final Extent size = Extent.fromIntZeroExtend(length * 4); Unsafe.copy(srcPtr, start.add(dstPtr), size);
public void setFloats(float[] src, int srcOfs, int dstPtr, int length) { if (srcOfs < 0) { throw new IndexOutOfBoundsException("srcOfs < 0"); } if (length < 0) { throw new IndexOutOfBoundsException("length < 0"); } if (srcOfs + length > src.length) { throw new IndexOutOfBoundsException("dstOfs + length > dst.length"); } testMemPtr(dstPtr, length * 4); final Address srcPtr = VmMagic.getArrayData(src).add(srcOfs * 4); Unsafe.copy(srcPtr, start.add(dstPtr), length * 4); }
Unsafe.copy(srcPtr, start.add(dstPtr), length * 4);
final Extent size = Extent.fromIntZeroExtend(length * 4); Unsafe.copy(srcPtr, start.add(dstPtr), size);
public void setInts(int[] src, int srcOfs, int dstPtr, int length) { if (srcOfs < 0) { throw new IndexOutOfBoundsException("srcOfs < 0"); } if (length < 0) { throw new IndexOutOfBoundsException("length < 0"); } if (srcOfs + length > src.length) { throw new IndexOutOfBoundsException("dstOfs + length > dst.length"); } testMemPtr(dstPtr, length * 4); final Address srcPtr = VmMagic.getArrayData(src).add(srcOfs * 4); Unsafe.copy(srcPtr, start.add(dstPtr), length * 4); }
Unsafe.copy(srcPtr, start.add(dstPtr), length * 8);
final Extent size = Extent.fromIntZeroExtend(length * 8); Unsafe.copy(srcPtr, start.add(dstPtr), size);
public void setLongs(long[] src, int srcOfs, int dstPtr, int length) { if (srcOfs < 0) { throw new IndexOutOfBoundsException("srcOfs < 0"); } if (length < 0) { throw new IndexOutOfBoundsException("length < 0"); } if (srcOfs + length > src.length) { throw new IndexOutOfBoundsException("dstOfs + length > dst.length"); } testMemPtr(dstPtr, length * 8); final Address srcPtr = VmMagic.getArrayData(src).add(srcOfs * 8); Unsafe.copy(srcPtr, start.add(dstPtr), length * 8); }
Unsafe.copy(srcPtr, start.add(dstPtr), length * 2);
final Extent size = Extent.fromIntZeroExtend(length * 2); Unsafe.copy(srcPtr, start.add(dstPtr), size);
public void setShorts(short[] src, int srcOfs, int dstPtr, int length) { if (srcOfs < 0) { throw new IndexOutOfBoundsException("srcOfs < 0"); } if (length < 0) { throw new IndexOutOfBoundsException("length < 0"); } if (srcOfs + length > src.length) { throw new IndexOutOfBoundsException("dstOfs + length > dst.length"); } testMemPtr(dstPtr, length * 2); final Address srcPtr = VmMagic.getArrayData(src).add(srcOfs * 2); Unsafe.copy(srcPtr, start.add(dstPtr), length * 2); }
l.pointerStateChanged(event);
try { l.pointerStateChanged(event); } catch (Throwable ex) { log.error("Exception in PointerListener", ex); }
public synchronized void fireEvent(PointerEvent event) { for (Iterator i = listeners.iterator(); i.hasNext();) { PointerListener l = (PointerListener) i.next(); l.pointerStateChanged(event); if (event.isConsumed()) { break; } } }
public static Serializable read(InputStream output)
public static Serializable read(InputStream input)
public static Serializable read(InputStream output) { // Explicitly prevent the stream from closing as we may need // to read the subsequent bytes as well. Stream may be auto-closed // in its finalizer. try { ObjectInputStream oin = new uncObjectInputStream(output); return (Serializable) oin.readObject(); } catch (Exception ex) { throw new MARSHAL(ex + ":" + ex.getMessage()); } }
try { ObjectInputStream oin = new uncObjectInputStream(output); return (Serializable) oin.readObject(); } catch (Exception ex) { throw new MARSHAL(ex + ":" + ex.getMessage()); }
return Vio.read(input);
public static Serializable read(InputStream output) { // Explicitly prevent the stream from closing as we may need // to read the subsequent bytes as well. Stream may be auto-closed // in its finalizer. try { ObjectInputStream oin = new uncObjectInputStream(output); return (Serializable) oin.readObject(); } catch (Exception ex) { throw new MARSHAL(ex + ":" + ex.getMessage()); } }
public static void write(OutputStream input, Serializable value)
public static void write(OutputStream output, Serializable value)
public static void write(OutputStream input, Serializable value) { // Explicitly prevent the stream from closing as we may need // to read the subsequent bytes as well. Stream may be auto-closed // in its finalizer. try { ObjectOutputStream oout = new uncObjectOutputStream(input); oout.writeObject(value); oout.flush(); } catch (IOException ex) { throw new MARSHAL(ex + ":" + ex.getMessage()); } }
try { ObjectOutputStream oout = new uncObjectOutputStream(input); oout.writeObject(value); oout.flush(); } catch (IOException ex) { throw new MARSHAL(ex + ":" + ex.getMessage()); }
Vio.write(output, value);
public static void write(OutputStream input, Serializable value) { // Explicitly prevent the stream from closing as we may need // to read the subsequent bytes as well. Stream may be auto-closed // in its finalizer. try { ObjectOutputStream oout = new uncObjectOutputStream(input); oout.writeObject(value); oout.flush(); } catch (IOException ex) { throw new MARSHAL(ex + ":" + ex.getMessage()); } }
return insets();
Insets retVal; if (swingComponent != null) retVal = swingComponent.getJComponent().getInsets(); else retVal = new Insets(0, 0, 0, 0); return retVal;
public Insets getInsets() { return insets(); }
if(comp == null) comp = awtComponent;
protected void handleMouseEvent(MouseEvent ev) { Component comp = awtComponent.getComponentAt(ev.getPoint()); if (comp != null) { ComponentPeer peer = comp.getPeer(); if (awtComponent != comp && !comp.isLightweight() && peer instanceof SwingComponentPeer) { ev.translatePoint(comp.getX(), comp.getY()); ev.setSource(comp); ((SwingComponentPeer) peer).handleMouseEvent(ev); } } }
disabledTextColor = UIManager.getColor("RadioButton.disabledText"); focusColor = UIManager.getColor("RadioButton.focus"); selectColor = UIManager.getColor("RadioButton.select");
String prefix = getPropertyPrefix(); disabledTextColor = UIManager.getColor(prefix + "disabledText"); focusColor = UIManager.getColor(prefix + "focus"); selectColor = UIManager.getColor(prefix + "select");
public void installDefaults(AbstractButton b) { super.installDefaults(b); disabledTextColor = UIManager.getColor("RadioButton.disabledText"); focusColor = UIManager.getColor("RadioButton.focus"); selectColor = UIManager.getColor("RadioButton.select"); }
paintFocus(g, b, vr, tr, ir);
paintFocus(g, tr, null);
public void paint(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); Icon currentIcon = null; if (b.isSelected()) currentIcon = b.getSelectedIcon(); else currentIcon = b.getIcon(); SwingUtilities.calculateInnerArea(b, vr); String text = SwingUtilities.layoutCompoundLabel (c, g.getFontMetrics(f), b.getText(), currentIcon, b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), vr, ir, tr, b.getIconTextGap() + defaultTextShiftOffset); if (currentIcon != null) { currentIcon.paintIcon(c, g, ir.x, ir.y); } if (text != null) paintText(g, b, tr, text); paintFocus(g, b, vr, tr, ir); }
if (path == null) throw new IllegalArgumentException("Null 'path' not permitted.");
public TreePath(Object[] path) { // Create Path this.path = new Object[path.length]; System.arraycopy(path, 0, this.path, 0, path.length); }
if (treepath[index] != path[index])
if (!treepath[index].equals(path[index]))
public boolean equals(Object object) { // Variables Object[] treepath; int index; // Check for TreePath if (object instanceof TreePath) { // Get Path Elements treepath = ((TreePath) object).getPath(); // Check length if (treepath.length != path.length) return false; // Check Elements for (index = 0; index < path.length; index++) { if (treepath[index] != path[index]) return false; } // Tree Path's are equals return true; } // Unequal return false; }
return path;
return (Object[]) path.clone();
public Object[] getPath() { return path; }
if (position < 0 || position >= getPathCount()) throw new IllegalArgumentException("Invalid position: " + position);
public Object getPathComponent(int position) { return path[position]; }
Object[] treepath; int index; int index2; treepath = path.getPath(); index = 0; index2 = 0; while (treepath[index] != this.path[index2]) index++; while (treepath[index] == this.path[index2])
if (path == null) return false; int count = getPathCount(); if (path.getPathCount() < count) return false; for (int i = 0; i < count; i++)
public boolean isDescendant(TreePath path) { // Variables Object[] treepath; int index; int index2; // Get Descendant path treepath = path.getPath(); // Locate Start Index index = 0; index2 = 0; while (treepath[index] != this.path[index2]) index++; // Verify Paths while (treepath[index] == this.path[index2]) { index++; index2++; } // Check for descendant if (index2 != this.path.length) return false; // Is Descendant return true; }
index++; index2++; } if (index2 != this.path.length)
if (!this.path[i].equals(path.getPathComponent(i)))
public boolean isDescendant(TreePath path) { // Variables Object[] treepath; int index; int index2; // Get Descendant path treepath = path.getPath(); // Locate Start Index index = 0; index2 = 0; while (treepath[index] != this.path[index2]) index++; // Verify Paths while (treepath[index] == this.path[index2]) { index++; index2++; } // Check for descendant if (index2 != this.path.length) return false; // Is Descendant return true; }
}
public boolean isDescendant(TreePath path) { // Variables Object[] treepath; int index; int index2; // Get Descendant path treepath = path.getPath(); // Locate Start Index index = 0; index2 = 0; while (treepath[index] != this.path[index2]) index++; // Verify Paths while (treepath[index] == this.path[index2]) { index++; index2++; } // Check for descendant if (index2 != this.path.length) return false; // Is Descendant return true; }
throw new Error ("not implemented");
if (this.getName().equals("background")) return BACKGROUND; if (this.getName().equals("bidi_embedding")) return BIDI_EMBEDDING; if (this.getName().equals("char_replacement")) return CHAR_REPLACEMENT; if (this.getName().equals("family")) return FAMILY; if (this.getName().equals("font")) return FONT; if (this.getName().equals("foreground")) return FOREGROUND; if (this.getName().equals("input method highlight")) return INPUT_METHOD_HIGHLIGHT; if (this.getName().equals("input method underline")) return INPUT_METHOD_UNDERLINE; if (this.getName().equals("justification")) return JUSTIFICATION; if (this.getName().equals("numeric_shaping")) return NUMERIC_SHAPING; if (this.getName().equals("posture")) return POSTURE; if (this.getName().equals("run_direction")) return RUN_DIRECTION; if (this.getName().equals("size")) return SIZE; if (this.getName().equals("strikethrough")) return STRIKETHROUGH; if (this.getName().equals("superscript")) return SUPERSCRIPT; if (this.getName().equals("swap_colors")) return SWAP_COLORS; if (this.getName().equals("transform")) return TRANSFORM; if (this.getName().equals("underline")) return UNDERLINE; if (this.getName().equals("weight")) return WEIGHT; if (this.getName().equals("width")) return WIDTH; throw new InvalidObjectException("Can't resolve Attribute: " + getName());
protected Object readResolve () throws InvalidObjectException { throw new Error ("not implemented"); }
Attribute(String name) {
protected Attribute (String name) {
Attribute(String name){ this.name = name;}
readResolve() throws InvalidObjectException { if (this.equals(READING)) return(READING);
protected Object readResolve() throws InvalidObjectException { if (this.equals (READING)) return READING;
readResolve() throws InvalidObjectException{ if (this.equals(READING)) return(READING); if (this.equals(LANGUAGE)) return(LANGUAGE); if (this.equals(INPUT_METHOD_SEGMENT)) return(INPUT_METHOD_SEGMENT); throw new InvalidObjectException("Can't resolve Attribute: " + getName());}
if (this.equals(LANGUAGE)) return(LANGUAGE);
if (this.equals (LANGUAGE)) return LANGUAGE;
readResolve() throws InvalidObjectException{ if (this.equals(READING)) return(READING); if (this.equals(LANGUAGE)) return(LANGUAGE); if (this.equals(INPUT_METHOD_SEGMENT)) return(INPUT_METHOD_SEGMENT); throw new InvalidObjectException("Can't resolve Attribute: " + getName());}
if (this.equals(INPUT_METHOD_SEGMENT)) return(INPUT_METHOD_SEGMENT);
if (this.equals (INPUT_METHOD_SEGMENT)) return INPUT_METHOD_SEGMENT;
readResolve() throws InvalidObjectException{ if (this.equals(READING)) return(READING); if (this.equals(LANGUAGE)) return(LANGUAGE); if (this.equals(INPUT_METHOD_SEGMENT)) return(INPUT_METHOD_SEGMENT); throw new InvalidObjectException("Can't resolve Attribute: " + getName());}
"Not existent FisleSystemType"); }
"FileSystemType " + name + " doesn't exist"); }
public FileSystemType getFileSystemTypeForNameSystemTypes(String name) throws FileSystemException { FileSystemType result = fsTypeManager.getSystemType(name); if (result == null) { throw new FileSystemException( "Not existent FisleSystemType"); } return result; }
this.cancelledKeys = new HashSet();
protected AbstractSelector (SelectorProvider provider) { this.provider = provider; }
return null;
if (! isOpen()) throw new ClosedSelectorException(); return cancelledKeys;
protected final Set cancelledKeys() { return null; }
public final void close () throws IOException
public final synchronized void close() throws IOException
public final void close () throws IOException { if (closed) return; closed = true; implCloseSelector (); }
implCloseSelector ();
public final void close () throws IOException { if (closed) return; closed = true; implCloseSelector (); }
return interestOps;
synchronized (impl.selectedKeys()) { return interestOps;
public int interestOps () { if (!isValid()) throw new CancelledKeyException(); return interestOps; }
}
public int interestOps () { if (!isValid()) throw new CancelledKeyException(); return interestOps; }
public int readyOps ()
public synchronized int readyOps ()
public int readyOps () { if (!isValid()) throw new CancelledKeyException(); return readyOps; }
WCharSeqHolder h = new WCharSeqHolder(); h._read(input); return h.value;
char[] value = new char[ input.read_long() ]; input.read_wchar_array(value, 0, value.length); return value;
public static char[] read(InputStream input) { WCharSeqHolder h = new WCharSeqHolder(); h._read(input); return h.value; }
WCharSeqHolder h = new WCharSeqHolder(value); h._write(output);
output.write_long(value.length); output.write_wchar_array(value, 0, value.length);
public static void write(OutputStream output, char[] value) { WCharSeqHolder h = new WCharSeqHolder(value); h._write(output); }
public WCharSeqHolder(char[] initial_value)
public WCharSeqHolder()
public WCharSeqHolder(char[] initial_value) { value = initial_value; typecode.setLength(value.length); }
value = initial_value; typecode.setLength(value.length);
public WCharSeqHolder(char[] initial_value) { value = initial_value; typecode.setLength(value.length); }
WhenNode(TemplateNode children, TemplateNode next, Expr test)
WhenNode(Expr test)
WhenNode(TemplateNode children, TemplateNode next, Expr test) { super(children, next); this.test = test; }
super(children, next);
WhenNode(TemplateNode children, TemplateNode next, Expr test) { super(children, next); this.test = test; }
return new WhenNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), test.clone(stylesheet));
TemplateNode ret = new WhenNode(test.clone(stylesheet)); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret;
TemplateNode clone(Stylesheet stylesheet) { return new WhenNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), test.clone(stylesheet)); }
this.extendedEventTypes = extendedEventTypes;
public XMLParser(InputStream in, String systemId, boolean validating, boolean namespaceAware, boolean coalescing, boolean replaceERefs, boolean externalEntities, boolean supportDTD, boolean baseAware, boolean stringInterning, XMLReporter reporter, XMLResolver resolver) { this.validating = validating; this.namespaceAware = namespaceAware; this.coalescing = coalescing; this.replaceERefs = replaceERefs; this.externalEntities = externalEntities; this.supportDTD = supportDTD; this.baseAware = baseAware; this.stringInterning = stringInterning; this.reporter = reporter; this.resolver = resolver; if (validating) { validationStack = new LinkedList(); ids = new HashSet(); idrefs = new HashSet(); } pushInput(new Input(in, null, null, systemId, null, null, false, true)); }
public String getAttributeName(int index)
public QName getAttributeName(int index)
public String getAttributeName(int index) { Attribute a = (Attribute) attrs.get(index); return a.localName; }
return a.localName;
String namespaceURI = getNamespaceURI(a.prefix); return new QName(namespaceURI, a.localName, a.prefix);
public String getAttributeName(int index) { Attribute a = (Attribute) attrs.get(index); return a.localName; }
System.out.println("\tattribute "+reader.getAttributeQName(i)+
System.out.println("\tattribute "+reader.getAttributeName(i)+
public static void main(String[] args) throws Exception { boolean xIncludeAware = false; if (args.length > 1 && "-x".equals(args[1])) xIncludeAware = true; XMLParser p = new XMLParser(new java.io.FileInputStream(args[0]), absolutize(null, args[0]), true, // validating true, // namespaceAware true, // coalescing, true, // replaceERefs true, // externalEntities true, // supportDTD true, // baseAware true, // stringInterning null, null); XMLStreamReader reader = p; if (xIncludeAware) reader = new XIncludeFilter(p, args[0], true, true, true); try { int event; //do while (reader.hasNext()) { event = reader.next(); Location loc = reader.getLocation(); System.out.print(loc.getLineNumber()+":"+loc.getColumnNumber()+" "); switch (event) { case XMLStreamConstants.START_DOCUMENT: System.out.println("START_DOCUMENT version="+reader.getVersion()+ " encoding="+reader.getEncoding()); break; case XMLStreamConstants.END_DOCUMENT: System.out.println("END_DOCUMENT"); break; case XMLStreamConstants.START_ELEMENT: System.out.println("START_ELEMENT "+reader.getName()); int l = reader.getNamespaceCount(); for (int i = 0; i < l; i++) System.out.println("\tnamespace "+reader.getNamespacePrefix(i)+ "='"+reader.getNamespaceURI(i)+"'"); l = reader.getAttributeCount(); for (int i = 0; i < l; i++) System.out.println("\tattribute "+reader.getAttributeQName(i)+ "='"+reader.getAttributeValue(i)+"'"); break; case XMLStreamConstants.END_ELEMENT: System.out.println("END_ELEMENT "+reader.getName()); break; case XMLStreamConstants.CHARACTERS: System.out.println("CHARACTERS '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.CDATA: System.out.println("CDATA '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.SPACE: System.out.println("SPACE '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.DTD: System.out.println("DTD "+reader.getText()); break; case XMLStreamConstants.ENTITY_REFERENCE: System.out.println("ENTITY_REFERENCE "+reader.getText()); break; case XMLStreamConstants.COMMENT: System.out.println("COMMENT '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.PROCESSING_INSTRUCTION: System.out.println("PROCESSING_INSTRUCTION "+reader.getPITarget()+ " "+reader.getPIData()); break; case XMLStreamConstants.START_ENTITY: System.out.println("START_ENTITY "+reader.getText()); break; case XMLStreamConstants.END_ENTITY: System.out.println("END_ENTITY "+reader.getText()); break; default: System.out.println("Unknown event: "+event); } } } catch (XMLStreamException e) { Location l = reader.getLocation(); System.out.println("At line "+l.getLineNumber()+ ", column "+l.getColumnNumber()+ " of "+l.getLocationURI()); throw e; } }
case XMLStreamConstants.START_ENTITY:
case START_ENTITY:
public static void main(String[] args) throws Exception { boolean xIncludeAware = false; if (args.length > 1 && "-x".equals(args[1])) xIncludeAware = true; XMLParser p = new XMLParser(new java.io.FileInputStream(args[0]), absolutize(null, args[0]), true, // validating true, // namespaceAware true, // coalescing, true, // replaceERefs true, // externalEntities true, // supportDTD true, // baseAware true, // stringInterning null, null); XMLStreamReader reader = p; if (xIncludeAware) reader = new XIncludeFilter(p, args[0], true, true, true); try { int event; //do while (reader.hasNext()) { event = reader.next(); Location loc = reader.getLocation(); System.out.print(loc.getLineNumber()+":"+loc.getColumnNumber()+" "); switch (event) { case XMLStreamConstants.START_DOCUMENT: System.out.println("START_DOCUMENT version="+reader.getVersion()+ " encoding="+reader.getEncoding()); break; case XMLStreamConstants.END_DOCUMENT: System.out.println("END_DOCUMENT"); break; case XMLStreamConstants.START_ELEMENT: System.out.println("START_ELEMENT "+reader.getName()); int l = reader.getNamespaceCount(); for (int i = 0; i < l; i++) System.out.println("\tnamespace "+reader.getNamespacePrefix(i)+ "='"+reader.getNamespaceURI(i)+"'"); l = reader.getAttributeCount(); for (int i = 0; i < l; i++) System.out.println("\tattribute "+reader.getAttributeQName(i)+ "='"+reader.getAttributeValue(i)+"'"); break; case XMLStreamConstants.END_ELEMENT: System.out.println("END_ELEMENT "+reader.getName()); break; case XMLStreamConstants.CHARACTERS: System.out.println("CHARACTERS '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.CDATA: System.out.println("CDATA '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.SPACE: System.out.println("SPACE '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.DTD: System.out.println("DTD "+reader.getText()); break; case XMLStreamConstants.ENTITY_REFERENCE: System.out.println("ENTITY_REFERENCE "+reader.getText()); break; case XMLStreamConstants.COMMENT: System.out.println("COMMENT '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.PROCESSING_INSTRUCTION: System.out.println("PROCESSING_INSTRUCTION "+reader.getPITarget()+ " "+reader.getPIData()); break; case XMLStreamConstants.START_ENTITY: System.out.println("START_ENTITY "+reader.getText()); break; case XMLStreamConstants.END_ENTITY: System.out.println("END_ENTITY "+reader.getText()); break; default: System.out.println("Unknown event: "+event); } } } catch (XMLStreamException e) { Location l = reader.getLocation(); System.out.println("At line "+l.getLineNumber()+ ", column "+l.getColumnNumber()+ " of "+l.getLocationURI()); throw e; } }
case XMLStreamConstants.END_ENTITY:
case END_ENTITY:
public static void main(String[] args) throws Exception { boolean xIncludeAware = false; if (args.length > 1 && "-x".equals(args[1])) xIncludeAware = true; XMLParser p = new XMLParser(new java.io.FileInputStream(args[0]), absolutize(null, args[0]), true, // validating true, // namespaceAware true, // coalescing, true, // replaceERefs true, // externalEntities true, // supportDTD true, // baseAware true, // stringInterning null, null); XMLStreamReader reader = p; if (xIncludeAware) reader = new XIncludeFilter(p, args[0], true, true, true); try { int event; //do while (reader.hasNext()) { event = reader.next(); Location loc = reader.getLocation(); System.out.print(loc.getLineNumber()+":"+loc.getColumnNumber()+" "); switch (event) { case XMLStreamConstants.START_DOCUMENT: System.out.println("START_DOCUMENT version="+reader.getVersion()+ " encoding="+reader.getEncoding()); break; case XMLStreamConstants.END_DOCUMENT: System.out.println("END_DOCUMENT"); break; case XMLStreamConstants.START_ELEMENT: System.out.println("START_ELEMENT "+reader.getName()); int l = reader.getNamespaceCount(); for (int i = 0; i < l; i++) System.out.println("\tnamespace "+reader.getNamespacePrefix(i)+ "='"+reader.getNamespaceURI(i)+"'"); l = reader.getAttributeCount(); for (int i = 0; i < l; i++) System.out.println("\tattribute "+reader.getAttributeQName(i)+ "='"+reader.getAttributeValue(i)+"'"); break; case XMLStreamConstants.END_ELEMENT: System.out.println("END_ELEMENT "+reader.getName()); break; case XMLStreamConstants.CHARACTERS: System.out.println("CHARACTERS '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.CDATA: System.out.println("CDATA '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.SPACE: System.out.println("SPACE '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.DTD: System.out.println("DTD "+reader.getText()); break; case XMLStreamConstants.ENTITY_REFERENCE: System.out.println("ENTITY_REFERENCE "+reader.getText()); break; case XMLStreamConstants.COMMENT: System.out.println("COMMENT '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.PROCESSING_INSTRUCTION: System.out.println("PROCESSING_INSTRUCTION "+reader.getPITarget()+ " "+reader.getPIData()); break; case XMLStreamConstants.START_ENTITY: System.out.println("START_ENTITY "+reader.getText()); break; case XMLStreamConstants.END_ENTITY: System.out.println("END_ENTITY "+reader.getText()); break; default: System.out.println("Unknown event: "+event); } } } catch (XMLStreamException e) { Location l = reader.getLocation(); System.out.println("At line "+l.getLineNumber()+ ", column "+l.getColumnNumber()+ " of "+l.getLocationURI()); throw e; } }
" of "+l.getLocationURI());
" of "+l.getSystemId());
public static void main(String[] args) throws Exception { boolean xIncludeAware = false; if (args.length > 1 && "-x".equals(args[1])) xIncludeAware = true; XMLParser p = new XMLParser(new java.io.FileInputStream(args[0]), absolutize(null, args[0]), true, // validating true, // namespaceAware true, // coalescing, true, // replaceERefs true, // externalEntities true, // supportDTD true, // baseAware true, // stringInterning null, null); XMLStreamReader reader = p; if (xIncludeAware) reader = new XIncludeFilter(p, args[0], true, true, true); try { int event; //do while (reader.hasNext()) { event = reader.next(); Location loc = reader.getLocation(); System.out.print(loc.getLineNumber()+":"+loc.getColumnNumber()+" "); switch (event) { case XMLStreamConstants.START_DOCUMENT: System.out.println("START_DOCUMENT version="+reader.getVersion()+ " encoding="+reader.getEncoding()); break; case XMLStreamConstants.END_DOCUMENT: System.out.println("END_DOCUMENT"); break; case XMLStreamConstants.START_ELEMENT: System.out.println("START_ELEMENT "+reader.getName()); int l = reader.getNamespaceCount(); for (int i = 0; i < l; i++) System.out.println("\tnamespace "+reader.getNamespacePrefix(i)+ "='"+reader.getNamespaceURI(i)+"'"); l = reader.getAttributeCount(); for (int i = 0; i < l; i++) System.out.println("\tattribute "+reader.getAttributeQName(i)+ "='"+reader.getAttributeValue(i)+"'"); break; case XMLStreamConstants.END_ELEMENT: System.out.println("END_ELEMENT "+reader.getName()); break; case XMLStreamConstants.CHARACTERS: System.out.println("CHARACTERS '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.CDATA: System.out.println("CDATA '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.SPACE: System.out.println("SPACE '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.DTD: System.out.println("DTD "+reader.getText()); break; case XMLStreamConstants.ENTITY_REFERENCE: System.out.println("ENTITY_REFERENCE "+reader.getText()); break; case XMLStreamConstants.COMMENT: System.out.println("COMMENT '"+encodeText(reader.getText())+"'"); break; case XMLStreamConstants.PROCESSING_INSTRUCTION: System.out.println("PROCESSING_INSTRUCTION "+reader.getPITarget()+ " "+reader.getPIData()); break; case XMLStreamConstants.START_ENTITY: System.out.println("START_ENTITY "+reader.getText()); break; case XMLStreamConstants.END_ENTITY: System.out.println("END_ENTITY "+reader.getText()); break; default: System.out.println("Unknown event: "+event); } } } catch (XMLStreamException e) { Location l = reader.getLocation(); System.out.println("At line "+l.getLineNumber()+ ", column "+l.getColumnNumber()+ " of "+l.getLocationURI()); throw e; } }
event = XMLStreamConstants.START_ENTITY; return event;
event = START_ENTITY; return extendedEventTypes ? event : next();
public int next() throws XMLStreamException { if (lookahead) { lookahead = false; return event; } if (event == XMLStreamConstants.END_ELEMENT) { // Pop namespace context if (namespaceAware && !namespaces.isEmpty()) namespaces.removeFirst(); // Pop base context if (baseAware && !bases.isEmpty()) bases.removeFirst(); } if (!startEntityStack.isEmpty()) { String entityName = (String) startEntityStack.removeFirst(); buf.setLength(0); buf.append(entityName); event = XMLStreamConstants.START_ENTITY; return event; } else if (!endEntityStack.isEmpty()) { String entityName = (String) endEntityStack.removeFirst(); buf.setLength(0); buf.append(entityName); event = XMLStreamConstants.END_ENTITY; return event; } try { if (!input.initialized) input.init(); switch (state) { case CONTENT: if (tryRead(TEST_END_ELEMENT)) { readEndElement(); if (stack.isEmpty()) state = MISC; event = XMLStreamConstants.END_ELEMENT; } else if (tryRead(TEST_COMMENT)) { readComment(false); event = XMLStreamConstants.COMMENT; } else if (tryRead(TEST_PI)) { readPI(false); event = XMLStreamConstants.PROCESSING_INSTRUCTION; } else if (tryRead(TEST_CDATA)) { readCDSect(); event = XMLStreamConstants.CDATA; } else if (tryRead(TEST_START_ELEMENT)) { state = readStartElement(); event = XMLStreamConstants.START_ELEMENT; } else { // Check for character reference or predefined entity mark(8); int c = readCh(); if (c == 0x26) // '&' { c = readCh(); if (c == 0x23) // '#' { reset(); event = readCharData(null); } else { // entity reference reset(); readCh(); // & readReference(); String ref = buf.toString(); String text = (String) PREDEFINED_ENTITIES.get(ref); if (text != null) { event = readCharData(text); } else if (replaceERefs && !isUnparsedEntity(ref)) { // this will report a start-entity event boolean external = false; if (doctype != null) { Object entity = doctype.getEntity(ref); if (entity instanceof ExternalIds) external = true; } expandEntity(ref, false, external); event = next(); } else { event = XMLStreamConstants.ENTITY_REFERENCE; } } } else { reset(); event = readCharData(null); if (validating && doctype != null) validatePCData(buf.toString()); } } break; case EMPTY_ELEMENT: String elementName = (String) stack.removeLast(); buf.setLength(0); buf.append(elementName); state = stack.isEmpty() ? MISC : CONTENT; event = XMLStreamConstants.END_ELEMENT; if (validating && doctype != null) endElementValidationHook(); break; case INIT: // XMLDecl? if (tryRead(TEST_XML_DECL)) readXMLDecl(); input.finalizeEncoding(); event = XMLStreamConstants.START_DOCUMENT; state = PROLOG; break; case PROLOG: // Misc* (doctypedecl Misc*)? skipWhitespace(); if (doctype == null && tryRead(TEST_DOCTYPE_DECL)) { readDoctypeDecl(); event = XMLStreamConstants.DTD; } else if (tryRead(TEST_COMMENT)) { readComment(false); event = XMLStreamConstants.COMMENT; } else if (tryRead(TEST_PI)) { readPI(false); event = XMLStreamConstants.PROCESSING_INSTRUCTION; } else if (tryRead(TEST_START_ELEMENT)) { state = readStartElement(); event = XMLStreamConstants.START_ELEMENT; } else { int c = readCh(); error("no root element: U+" + Integer.toHexString(c)); } break; case MISC: // Comment | PI | S skipWhitespace(); if (tryRead(TEST_COMMENT)) { readComment(false); event = XMLStreamConstants.COMMENT; } else if (tryRead(TEST_PI)) { readPI(false); event = XMLStreamConstants.PROCESSING_INSTRUCTION; } else { if (event == XMLStreamConstants.END_DOCUMENT) throw new NoSuchElementException(); int c = readCh(); if (c != -1) error("Only comments and PIs may appear after " + "the root element"); event = XMLStreamConstants.END_DOCUMENT; } break; default: event = -1; } return event; } catch (IOException e) { XMLStreamException e2 = new XMLStreamException(); e2.initCause(e); throw e2; } }
event = XMLStreamConstants.END_ENTITY; return event;
event = END_ENTITY; return extendedEventTypes ? event : next();
public int next() throws XMLStreamException { if (lookahead) { lookahead = false; return event; } if (event == XMLStreamConstants.END_ELEMENT) { // Pop namespace context if (namespaceAware && !namespaces.isEmpty()) namespaces.removeFirst(); // Pop base context if (baseAware && !bases.isEmpty()) bases.removeFirst(); } if (!startEntityStack.isEmpty()) { String entityName = (String) startEntityStack.removeFirst(); buf.setLength(0); buf.append(entityName); event = XMLStreamConstants.START_ENTITY; return event; } else if (!endEntityStack.isEmpty()) { String entityName = (String) endEntityStack.removeFirst(); buf.setLength(0); buf.append(entityName); event = XMLStreamConstants.END_ENTITY; return event; } try { if (!input.initialized) input.init(); switch (state) { case CONTENT: if (tryRead(TEST_END_ELEMENT)) { readEndElement(); if (stack.isEmpty()) state = MISC; event = XMLStreamConstants.END_ELEMENT; } else if (tryRead(TEST_COMMENT)) { readComment(false); event = XMLStreamConstants.COMMENT; } else if (tryRead(TEST_PI)) { readPI(false); event = XMLStreamConstants.PROCESSING_INSTRUCTION; } else if (tryRead(TEST_CDATA)) { readCDSect(); event = XMLStreamConstants.CDATA; } else if (tryRead(TEST_START_ELEMENT)) { state = readStartElement(); event = XMLStreamConstants.START_ELEMENT; } else { // Check for character reference or predefined entity mark(8); int c = readCh(); if (c == 0x26) // '&' { c = readCh(); if (c == 0x23) // '#' { reset(); event = readCharData(null); } else { // entity reference reset(); readCh(); // & readReference(); String ref = buf.toString(); String text = (String) PREDEFINED_ENTITIES.get(ref); if (text != null) { event = readCharData(text); } else if (replaceERefs && !isUnparsedEntity(ref)) { // this will report a start-entity event boolean external = false; if (doctype != null) { Object entity = doctype.getEntity(ref); if (entity instanceof ExternalIds) external = true; } expandEntity(ref, false, external); event = next(); } else { event = XMLStreamConstants.ENTITY_REFERENCE; } } } else { reset(); event = readCharData(null); if (validating && doctype != null) validatePCData(buf.toString()); } } break; case EMPTY_ELEMENT: String elementName = (String) stack.removeLast(); buf.setLength(0); buf.append(elementName); state = stack.isEmpty() ? MISC : CONTENT; event = XMLStreamConstants.END_ELEMENT; if (validating && doctype != null) endElementValidationHook(); break; case INIT: // XMLDecl? if (tryRead(TEST_XML_DECL)) readXMLDecl(); input.finalizeEncoding(); event = XMLStreamConstants.START_DOCUMENT; state = PROLOG; break; case PROLOG: // Misc* (doctypedecl Misc*)? skipWhitespace(); if (doctype == null && tryRead(TEST_DOCTYPE_DECL)) { readDoctypeDecl(); event = XMLStreamConstants.DTD; } else if (tryRead(TEST_COMMENT)) { readComment(false); event = XMLStreamConstants.COMMENT; } else if (tryRead(TEST_PI)) { readPI(false); event = XMLStreamConstants.PROCESSING_INSTRUCTION; } else if (tryRead(TEST_START_ELEMENT)) { state = readStartElement(); event = XMLStreamConstants.START_ELEMENT; } else { int c = readCh(); error("no root element: U+" + Integer.toHexString(c)); } break; case MISC: // Comment | PI | S skipWhitespace(); if (tryRead(TEST_COMMENT)) { readComment(false); event = XMLStreamConstants.COMMENT; } else if (tryRead(TEST_PI)) { readPI(false); event = XMLStreamConstants.PROCESSING_INSTRUCTION; } else { if (event == XMLStreamConstants.END_DOCUMENT) throw new NoSuchElementException(); int c = readCh(); if (c != -1) error("Only comments and PIs may appear after " + "the root element"); event = XMLStreamConstants.END_DOCUMENT; } break; default: event = -1; } return event; } catch (IOException e) { XMLStreamException e2 = new XMLStreamException(); e2.initCause(e); throw e2; } }
String getAttributeName(int index);
QName getAttributeName(int index);
String getAttributeName(int index);
String getAttributeValue(int index);
String getAttributeValue(String namespaceURI, String localName);
String getAttributeValue(int index);
public DefaultComboBoxModel(Object[] items) {
public DefaultComboBoxModel() {
public DefaultComboBoxModel(Object[] items) { // TODO } // DefaultComboBoxModel()
public Object getItem();
Object getItem();
public Object getItem();
public void addElement(Object object);
void addElement(Object object);
public void addElement(Object object);
public Object getSelectedItem();
Object getSelectedItem();
public Object getSelectedItem();
public void insertElementAt(Object object, int index);
void insertElementAt(Object object, int index);
public void insertElementAt(Object object, int index);
public void removeElementAt(int index);
void removeElementAt(int index);
public void removeElementAt(int index);
public void removeElement(Object object);
void removeElement(Object object);
public void removeElement(Object object);
public void removeActionListener(ActionListener listener);
void removeActionListener(ActionListener listener);
public void removeActionListener(ActionListener listener);
public void addActionListener(ActionListener listener);
void addActionListener(ActionListener listener);
public void addActionListener(ActionListener listener);
public void setSelectedItem(Object item);
void setSelectedItem(Object item);
public void setSelectedItem(Object item);
int numSymbols = freqs.length;
public void buildCodes() { int numSymbols = freqs.length; int[] nextCode = new int[maxLength]; int code = 0; codes = new short[freqs.length]; if (DeflaterConstants.DEBUGGING) System.err.println("buildCodes: "+freqs.length); for (int bits = 0; bits < maxLength; bits++) { nextCode[bits] = code; code += bl_counts[bits] << (15 - bits); if (DeflaterConstants.DEBUGGING) System.err.println("bits: "+(bits+1)+" count: "+bl_counts[bits] +" nextCode: "+Integer.toHexString(code)); } if (DeflaterConstants.DEBUGGING && code != 65536) throw new RuntimeException("Inconsistent bl_counts!"); for (int i=0; i < numCodes; i++) { int bits = length[i]; if (bits > 0) { if (DeflaterConstants.DEBUGGING) System.err.println("codes["+i+"] = rev(" +Integer.toHexString(nextCode[bits-1])+")," +bits); codes[i] = bitReverse(nextCode[bits-1]); nextCode[bits-1] += 1 << (16 - bits); } } }
Class c = null; try { c = Thread.currentThread().getContextClassLoader().loadClass( args[i]); } catch (ClassNotFoundException e) { System.err.println(args[i] + " class not found."); System.exit(1); }
Class c = compiler.loadClass(args[i]);
public static void main(String[] args) { // Check for the -iiop or -giop keys. If one of these keys is present, // forward all call to GRMIC. for (int i = 0; i < args.length; i++) { if (args[i].equals("-giop") || args[i].equals("-iiop")) { GRMIC.main(args); return; } } boolean noWrite = false; boolean verbose = false; String HelpPath = "rmi/RMIC.txt"; HelpPrinter.checkHelpKey(args, HelpPath); File output = new File("."); if (args.length == 0) { HelpPrinter.printHelpAndExit(HelpPath); } else { RmicCompiler compiler = new RmicCompiler(); int cl = - 1; Options: for (int i = 0; i < args.length; i++) { String c = args[i]; if (c.equals("-v")) { printVersion(); System.exit(0); } else if (c.equals("-nowrite")) noWrite = true; else if (c.equals("-nowarn")) compiler.setWarnings(false); else if (c.equals("-verbose")) { verbose = true; compiler.setVerbose(true); } else if (c.equals("-force")) { compiler.setForce(true); } else if (c.equals("-d")) { int f = i + 1; if (f < args.length) { output = new File(args[f]); i++; } else HelpPrinter.printHelpAndExit(HelpPath); } else if (c.charAt(0) != '-') // No more options - start of class list. { cl = i; break Options; } } if (cl < 0) HelpPrinter.printHelpAndExit(HelpPath); if (verbose) System.out.println("Compiling to " + output.getAbsolutePath()); // Compile classes Compile: for (int i = cl; i < args.length; i++) { if (args[i].charAt(0) != '-') { compiler.reset(); Class c = null; try { c = Thread.currentThread().getContextClassLoader().loadClass( args[i]); } catch (ClassNotFoundException e) { System.err.println(args[i] + " class not found."); System.exit(1); } compiler.compile(c); String packag = compiler.getPackageName().replace('.', '/'); File fw = new File(output, packag); // Generate stub. String stub = compiler.generateStub(); String subName = compiler.getStubName() + "_Stub.java"; if (noWrite) continue Compile; try { fw.mkdirs(); OutputStream out = new FileOutputStream(new File(fw, subName)); out.write(stub.getBytes()); out.close(); } catch (IOException ioex) { System.err.println("Output path not accessible"); ioex.printStackTrace(); System.exit(1); } } } } }
Class c = null; try { c = Thread.currentThread().getContextClassLoader().loadClass( args[i]); } catch (ClassNotFoundException e) { System.err.println(args[i] + " class not found."); System.exit(1); }
Class c = compiler.loadClass(args[i]);
public static void main(String[] args) { boolean noWrite = false; boolean verbose = false; String HelpPath = "giop/GRMIC.txt"; HelpPrinter.checkHelpKey(args, HelpPath); File output = new File("."); if (args.length == 0) { HelpPrinter.printHelpAndExit(HelpPath); } else { GiopRmicCompiler compiler = new GiopRmicCompiler(); int cl = - 1; Options: for (int i = 0; i < args.length; i++) { String c = args[i]; if (c.equals("-poa")) compiler.setPoaMode(true); else if (c.equals("-impl")) compiler.setPoaMode(false); else if (c.equals("-v")) { printVersion(); System.exit(0); } else if (c.equals("-nowrite")) noWrite = true; else if (c.equals("-nowarn")) compiler.setWarnings(false); else if (c.equals("-verbose")) { verbose = true; compiler.setVerbose(true); } else if (c.equals("-force")) { compiler.setForce(true); } else if (c.equals("-d")) { int f = i + 1; if (f < args.length) { output = new File(args[f]); i++; } else HelpPrinter.printHelpAndExit(HelpPath); } else if (c.charAt(0) != '-') // No more options - start of class list. { cl = i; break Options; } } if (cl < 0) HelpPrinter.printHelpAndExit(HelpPath); if (verbose) System.out.println("Compiling to " + output.getAbsolutePath()); // Compile classes Compile: for (int i = cl; i < args.length; i++) { if (args[i].charAt(0) != '-') { compiler.reset(); Class c = null; try { c = Thread.currentThread().getContextClassLoader().loadClass( args[i]); } catch (ClassNotFoundException e) { System.err.println(args[i] + " class not found."); System.exit(1); } compiler.compile(c); String packag = compiler.getPackageName().replace('.', '/'); File fw = new File(output, packag); // Generate stub. String stub = compiler.generateStub(); String subName = "_" + compiler.getStubName() + "_Stub.java"; compiler.reset(); compiler.compile(c); // Generate tie String tie = compiler.generateTie(); String tieName = "_" + compiler.name(c) + "_Tie.java"; if (noWrite) continue Compile; try { fw.mkdirs(); OutputStream out = new FileOutputStream(new File(fw, subName)); out.write(stub.getBytes()); out.close(); out = new FileOutputStream(new File(fw, tieName)); out.write(tie.getBytes()); out.close(); } catch (IOException ioex) { System.err.println("Output path not accessible"); ioex.printStackTrace(); System.exit(1); } } } } }
InputStream in = HelpPrinter.class.getResourceAsStream(helpResourcePath); BufferedReader r = new BufferedReader(new InputStreamReader(in)); try { String s; while ((s = r.readLine()) != null) { System.out.println(s); } r.close(); } catch (IOException e) { System.err.print("Resource loading is broken:"); e.printStackTrace(); }
printHelp(helpResourcePath);
public static void printHelpAndExit(String helpResourcePath) { InputStream in = HelpPrinter.class.getResourceAsStream(helpResourcePath); BufferedReader r = new BufferedReader(new InputStreamReader(in)); try { String s; while ((s = r.readLine()) != null) { System.out.println(s); } r.close(); } catch (IOException e) { System.err.print("Resource loading is broken:"); e.printStackTrace(); } System.exit(0); }
int xOff = 0; for (int y = thumbBounds.y + 4; y < (thumbBounds.y + thumbBounds.height - 4); y++) { if ((y % 2) == 0) g.setColor(thumbHighlightColor); else g.setColor(thumbDarkShadowColor); for (int x = thumbBounds.x + 3 + (xOff); x < (thumbBounds.x + thumbBounds.width - 3); x = x + 4) { g.drawLine(x, y, x, y); } xOff++; if (xOff > 3) xOff = 0; }
MetalUtils.fillMetalPattern(g, thumbBounds.x + 3, thumbBounds.y + 3, thumbBounds.width - 6, thumbBounds.height - 6, thumbHighlightColor, thumbDarkShadowColor);
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) { // first we fill the background g.setColor(thumbColor); g.fillRect(thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height); // draw the outer dark line g.setColor(thumbDarkShadowColor); g.drawRect(thumbBounds.x, thumbBounds.y, thumbBounds.width - 1, thumbBounds.height - 1); // draw the inner light line g.setColor(thumbHighlightColor); g.drawLine(thumbBounds.x + 1, thumbBounds.y + 1, thumbBounds.x + thumbBounds.width - 2, thumbBounds.y + 1); g.drawLine(thumbBounds.x + 1, thumbBounds.y + 1, thumbBounds.x + 1, thumbBounds.y + thumbBounds.height - 2); // draw the shadow line UIDefaults def = UIManager.getLookAndFeelDefaults(); g.setColor(def.getColor("ScrollBar.shadow")); g.drawLine(thumbBounds.x + 1, thumbBounds.y + thumbBounds.height, thumbBounds.x + thumbBounds.width, thumbBounds.y + thumbBounds.height); // draw the pattern int xOff = 0; for (int y = thumbBounds.y + 4; y < (thumbBounds.y + thumbBounds.height - 4); y++) { // set color alternating with every line if ((y % 2) == 0) g.setColor(thumbHighlightColor); else g.setColor(thumbDarkShadowColor); for (int x = thumbBounds.x + 3 + (xOff); x < (thumbBounds.x + thumbBounds.width - 3); x = x + 4) { g.drawLine(x, y, x, y); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
Color saved = g.getColor(); Point x; Point y; Point z; Polygon lines; g.setColor(thumbHighlightColor); x = new Point(thumbBounds.x + 1, thumbBounds.y + 1); y = new Point(x); y.translate(thumbBounds.width - 2, 0); z = new Point(x); z.translate(0, thumbBounds.height - 2); lines = new Polygon(new int[] { x.x, y.x, z.x }, new int[] { x.y, y.y, z.y }, 3); g.drawPolygon(lines); g.setColor(thumbLightShadowColor); x = new Point(thumbBounds.x + thumbBounds.width - 1, thumbBounds.y + thumbBounds.height - 1); y = new Point(x); y.translate(-(thumbBounds.width - 2), 0); z = new Point(x); z.translate(0, -(thumbBounds.height - 2)); lines = new Polygon(new int[] { x.x, y.x, z.x }, new int[] { x.y, y.y, z.y }, 3); g.drawPolygon(lines); g.setColor(thumbDarkShadowColor); x = new Point(thumbBounds.x + thumbBounds.width, thumbBounds.y + thumbBounds.height); y = new Point(x); y.translate(-thumbBounds.width, 0); z = new Point(x); z.translate(0, -thumbBounds.height); lines = new Polygon(new int[] { x.x, y.x, z.x }, new int[] { x.y, y.y, z.y }, 3); g.drawPolygon(lines);
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) { Color saved = g.getColor(); Point x; Point y; Point z; Polygon lines; g.setColor(thumbHighlightColor); x = new Point(thumbBounds.x + 1, thumbBounds.y + 1); y = new Point(x); y.translate(thumbBounds.width - 2, 0); z = new Point(x); z.translate(0, thumbBounds.height - 2); lines = new Polygon(new int[] { x.x, y.x, z.x }, new int[] { x.y, y.y, z.y }, 3); g.drawPolygon(lines); g.setColor(thumbLightShadowColor); x = new Point(thumbBounds.x + thumbBounds.width - 1, thumbBounds.y + thumbBounds.height - 1); y = new Point(x); y.translate(-(thumbBounds.width - 2), 0); z = new Point(x); z.translate(0, -(thumbBounds.height - 2)); lines = new Polygon(new int[] { x.x, y.x, z.x }, new int[] { x.y, y.y, z.y }, 3); g.drawPolygon(lines); g.setColor(thumbDarkShadowColor); x = new Point(thumbBounds.x + thumbBounds.width, thumbBounds.y + thumbBounds.height); y = new Point(x); y.translate(-thumbBounds.width, 0); z = new Point(x); z.translate(0, -thumbBounds.height); lines = new Polygon(new int[] { x.x, y.x, z.x }, new int[] { x.y, y.y, z.y }, 3); g.drawPolygon(lines); g.setColor(thumbColor); g.fillRect(thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height); g.setColor(saved); }
g.setColor(saved);
BasicGraphicsUtils.drawBezel(g, thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height, false, false, thumbDarkShadowColor, thumbDarkShadowColor, thumbHighlightColor, thumbHighlightColor);
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) { Color saved = g.getColor(); Point x; Point y; Point z; Polygon lines; g.setColor(thumbHighlightColor); x = new Point(thumbBounds.x + 1, thumbBounds.y + 1); y = new Point(x); y.translate(thumbBounds.width - 2, 0); z = new Point(x); z.translate(0, thumbBounds.height - 2); lines = new Polygon(new int[] { x.x, y.x, z.x }, new int[] { x.y, y.y, z.y }, 3); g.drawPolygon(lines); g.setColor(thumbLightShadowColor); x = new Point(thumbBounds.x + thumbBounds.width - 1, thumbBounds.y + thumbBounds.height - 1); y = new Point(x); y.translate(-(thumbBounds.width - 2), 0); z = new Point(x); z.translate(0, -(thumbBounds.height - 2)); lines = new Polygon(new int[] { x.x, y.x, z.x }, new int[] { x.y, y.y, z.y }, 3); g.drawPolygon(lines); g.setColor(thumbDarkShadowColor); x = new Point(thumbBounds.x + thumbBounds.width, thumbBounds.y + thumbBounds.height); y = new Point(x); y.translate(-thumbBounds.width, 0); z = new Point(x); z.translate(0, -thumbBounds.height); lines = new Polygon(new int[] { x.x, y.x, z.x }, new int[] { x.y, y.y, z.y }, 3); g.drawPolygon(lines); g.setColor(thumbColor); g.fillRect(thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height); g.setColor(saved); }
scrollPane.setVerticalScrollBarPolicy (JScrollPane.VERTICAL_SCROLLBAR_NEVER);
protected JPanel createList(JFileChooser fc) { if (fileList == null) { fileListPanel = new JPanel(new BorderLayout()); fileList = new JList(getModel()); scrollPane = new JScrollPane(fileList); scrollPane.setVerticalScrollBarPolicy (JScrollPane.VERTICAL_SCROLLBAR_NEVER); fileList.setLayoutOrientation(JList.VERTICAL_WRAP); fileList.setCellRenderer(new FileRenderer()); } else { fileList.setModel(getModel()); fileListPanel.removeAll(); scrollPane.getViewport().setView(fileList); } fileListPanel.add(scrollPane); return fileListPanel; }
protected void fireContentsChanged(Object source, int startIndex, int endIndex) {
protected void fireContentsChanged(Object source, int startIndex, int endIndex) { ListDataEvent event; ListDataListener[] listeners; ListDataListener listener; int index;
protected void fireContentsChanged(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.CONTENTS_CHANGED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.contentsChanged(event); } // for } // fireContentsChanged()
ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index;
event = new ListDataEvent(source, ListDataEvent.CONTENTS_CHANGED, startIndex, endIndex);
protected void fireContentsChanged(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.CONTENTS_CHANGED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.contentsChanged(event); } // for } // fireContentsChanged()
event = new ListDataEvent(source, ListDataEvent.CONTENTS_CHANGED, startIndex, endIndex);
listeners = getListDataListeners ();
protected void fireContentsChanged(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.CONTENTS_CHANGED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.contentsChanged(event); } // for } // fireContentsChanged()
listeners = listenerList.getListeners(ListDataListener.class); for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.contentsChanged(event); } }
for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.contentsChanged(event); } }
protected void fireContentsChanged(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.CONTENTS_CHANGED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.contentsChanged(event); } // for } // fireContentsChanged()
cancelButtonMnemonic = defaults.getInt("FileChooser.cancelButtonMnemonic");
cancelButtonMnemonic = new Integer((String) UIManager.get("FileChooser.cancelButtonMnemonic")).intValue();
protected void installStrings(JFileChooser fc) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); dirDescText = defaults.getString("FileChooser.directoryDescriptionText"); fileDescText = defaults.getString("FileChooser.fileDescriptionText"); acceptAllFileFilterText = defaults.getString("FileChooser.acceptAllFileFilterText"); cancelButtonText = "Cancel"; cancelButtonToolTipText = "Abort file chooser dialog"; cancelButtonMnemonic = defaults.getInt("FileChooser.cancelButtonMnemonic"); directoryOpenButtonText = "Open"; directoryOpenButtonToolTipText = "Open selected directory"; directoryOpenButtonMnemonic = defaults.getInt("FileChooser.directoryOpenButtonMnemonic"); helpButtonText = "Help"; helpButtonToolTipText = "FileChooser help"; helpButtonMnemonic = defaults.getInt("FileChooser.helpButtonMnemonic"); openButtonText = "Open"; openButtonToolTipText = "Open selected file"; openButtonMnemonic = defaults.getInt("FileChooser.openButtonMnemonic"); saveButtonText = "Save"; saveButtonToolTipText = "Save selected file"; saveButtonMnemonic = UIManager.getInt("FileChooser.saveButtonMnemonic"); updateButtonText = "Update"; updateButtonToolTipText = "Update directory listing"; updateButtonMnemonic = defaults.getInt("FileChooser.updateButtonMnemonic"); }
= defaults.getInt("FileChooser.directoryOpenButtonMnemonic");
= new Integer((String) UIManager.get("FileChooser.directoryOpenButtonMnemonic")).intValue();
protected void installStrings(JFileChooser fc) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); dirDescText = defaults.getString("FileChooser.directoryDescriptionText"); fileDescText = defaults.getString("FileChooser.fileDescriptionText"); acceptAllFileFilterText = defaults.getString("FileChooser.acceptAllFileFilterText"); cancelButtonText = "Cancel"; cancelButtonToolTipText = "Abort file chooser dialog"; cancelButtonMnemonic = defaults.getInt("FileChooser.cancelButtonMnemonic"); directoryOpenButtonText = "Open"; directoryOpenButtonToolTipText = "Open selected directory"; directoryOpenButtonMnemonic = defaults.getInt("FileChooser.directoryOpenButtonMnemonic"); helpButtonText = "Help"; helpButtonToolTipText = "FileChooser help"; helpButtonMnemonic = defaults.getInt("FileChooser.helpButtonMnemonic"); openButtonText = "Open"; openButtonToolTipText = "Open selected file"; openButtonMnemonic = defaults.getInt("FileChooser.openButtonMnemonic"); saveButtonText = "Save"; saveButtonToolTipText = "Save selected file"; saveButtonMnemonic = UIManager.getInt("FileChooser.saveButtonMnemonic"); updateButtonText = "Update"; updateButtonToolTipText = "Update directory listing"; updateButtonMnemonic = defaults.getInt("FileChooser.updateButtonMnemonic"); }
helpButtonMnemonic = defaults.getInt("FileChooser.helpButtonMnemonic");
helpButtonMnemonic = new Integer((String) UIManager.get("FileChooser.helpButtonMnemonic")).intValue();
protected void installStrings(JFileChooser fc) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); dirDescText = defaults.getString("FileChooser.directoryDescriptionText"); fileDescText = defaults.getString("FileChooser.fileDescriptionText"); acceptAllFileFilterText = defaults.getString("FileChooser.acceptAllFileFilterText"); cancelButtonText = "Cancel"; cancelButtonToolTipText = "Abort file chooser dialog"; cancelButtonMnemonic = defaults.getInt("FileChooser.cancelButtonMnemonic"); directoryOpenButtonText = "Open"; directoryOpenButtonToolTipText = "Open selected directory"; directoryOpenButtonMnemonic = defaults.getInt("FileChooser.directoryOpenButtonMnemonic"); helpButtonText = "Help"; helpButtonToolTipText = "FileChooser help"; helpButtonMnemonic = defaults.getInt("FileChooser.helpButtonMnemonic"); openButtonText = "Open"; openButtonToolTipText = "Open selected file"; openButtonMnemonic = defaults.getInt("FileChooser.openButtonMnemonic"); saveButtonText = "Save"; saveButtonToolTipText = "Save selected file"; saveButtonMnemonic = UIManager.getInt("FileChooser.saveButtonMnemonic"); updateButtonText = "Update"; updateButtonToolTipText = "Update directory listing"; updateButtonMnemonic = defaults.getInt("FileChooser.updateButtonMnemonic"); }
openButtonMnemonic = defaults.getInt("FileChooser.openButtonMnemonic");
openButtonMnemonic = new Integer((String) UIManager.get("FileChooser.openButtonMnemonic")).intValue();
protected void installStrings(JFileChooser fc) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); dirDescText = defaults.getString("FileChooser.directoryDescriptionText"); fileDescText = defaults.getString("FileChooser.fileDescriptionText"); acceptAllFileFilterText = defaults.getString("FileChooser.acceptAllFileFilterText"); cancelButtonText = "Cancel"; cancelButtonToolTipText = "Abort file chooser dialog"; cancelButtonMnemonic = defaults.getInt("FileChooser.cancelButtonMnemonic"); directoryOpenButtonText = "Open"; directoryOpenButtonToolTipText = "Open selected directory"; directoryOpenButtonMnemonic = defaults.getInt("FileChooser.directoryOpenButtonMnemonic"); helpButtonText = "Help"; helpButtonToolTipText = "FileChooser help"; helpButtonMnemonic = defaults.getInt("FileChooser.helpButtonMnemonic"); openButtonText = "Open"; openButtonToolTipText = "Open selected file"; openButtonMnemonic = defaults.getInt("FileChooser.openButtonMnemonic"); saveButtonText = "Save"; saveButtonToolTipText = "Save selected file"; saveButtonMnemonic = UIManager.getInt("FileChooser.saveButtonMnemonic"); updateButtonText = "Update"; updateButtonToolTipText = "Update directory listing"; updateButtonMnemonic = defaults.getInt("FileChooser.updateButtonMnemonic"); }
saveButtonMnemonic = UIManager.getInt("FileChooser.saveButtonMnemonic");
saveButtonMnemonic = new Integer((String) UIManager.get("FileChooser.saveButtonMnemonic")).intValue();
protected void installStrings(JFileChooser fc) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); dirDescText = defaults.getString("FileChooser.directoryDescriptionText"); fileDescText = defaults.getString("FileChooser.fileDescriptionText"); acceptAllFileFilterText = defaults.getString("FileChooser.acceptAllFileFilterText"); cancelButtonText = "Cancel"; cancelButtonToolTipText = "Abort file chooser dialog"; cancelButtonMnemonic = defaults.getInt("FileChooser.cancelButtonMnemonic"); directoryOpenButtonText = "Open"; directoryOpenButtonToolTipText = "Open selected directory"; directoryOpenButtonMnemonic = defaults.getInt("FileChooser.directoryOpenButtonMnemonic"); helpButtonText = "Help"; helpButtonToolTipText = "FileChooser help"; helpButtonMnemonic = defaults.getInt("FileChooser.helpButtonMnemonic"); openButtonText = "Open"; openButtonToolTipText = "Open selected file"; openButtonMnemonic = defaults.getInt("FileChooser.openButtonMnemonic"); saveButtonText = "Save"; saveButtonToolTipText = "Save selected file"; saveButtonMnemonic = UIManager.getInt("FileChooser.saveButtonMnemonic"); updateButtonText = "Update"; updateButtonToolTipText = "Update directory listing"; updateButtonMnemonic = defaults.getInt("FileChooser.updateButtonMnemonic"); }
updateButtonMnemonic = defaults.getInt("FileChooser.updateButtonMnemonic");
updateButtonMnemonic = new Integer((String) UIManager.get("FileChooser.updateButtonMnemonic")).intValue();
protected void installStrings(JFileChooser fc) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); dirDescText = defaults.getString("FileChooser.directoryDescriptionText"); fileDescText = defaults.getString("FileChooser.fileDescriptionText"); acceptAllFileFilterText = defaults.getString("FileChooser.acceptAllFileFilterText"); cancelButtonText = "Cancel"; cancelButtonToolTipText = "Abort file chooser dialog"; cancelButtonMnemonic = defaults.getInt("FileChooser.cancelButtonMnemonic"); directoryOpenButtonText = "Open"; directoryOpenButtonToolTipText = "Open selected directory"; directoryOpenButtonMnemonic = defaults.getInt("FileChooser.directoryOpenButtonMnemonic"); helpButtonText = "Help"; helpButtonToolTipText = "FileChooser help"; helpButtonMnemonic = defaults.getInt("FileChooser.helpButtonMnemonic"); openButtonText = "Open"; openButtonToolTipText = "Open selected file"; openButtonMnemonic = defaults.getInt("FileChooser.openButtonMnemonic"); saveButtonText = "Save"; saveButtonToolTipText = "Save selected file"; saveButtonMnemonic = UIManager.getInt("FileChooser.saveButtonMnemonic"); updateButtonText = "Update"; updateButtonToolTipText = "Update directory listing"; updateButtonMnemonic = defaults.getInt("FileChooser.updateButtonMnemonic"); }
public void addRow(Object[] rowData) { addRow(convertToVector(rowData));
public void addRow(Vector rowData) {
public void addRow(Object[] rowData) { addRow(convertToVector(rowData)); } // addRow()
throw new IllegalArgumentException("null attribute");
throw new NullPointerException("null attribute");
public void addAttributes(Map attributes, int begin_index, int end_index) { if (attributes == null) throw new IllegalArgumentException("null attribute"); if ((begin_index < 0) || (end_index > sci.getEndIndex()) || (end_index < begin_index)) throw new IllegalArgumentException("bad range"); AttributeRange[] new_list = new AttributeRange[attribs.length + 1]; System.arraycopy(attribs, 0, new_list, 0, attribs.length); attribs = new_list; attribs[attribs.length - 1] = new AttributeRange(attributes, begin_index, end_index); }
(end_index < begin_index))
(end_index <= begin_index))
public void addAttributes(Map attributes, int begin_index, int end_index) { if (attributes == null) throw new IllegalArgumentException("null attribute"); if ((begin_index < 0) || (end_index > sci.getEndIndex()) || (end_index < begin_index)) throw new IllegalArgumentException("bad range"); AttributeRange[] new_list = new AttributeRange[attribs.length + 1]; System.arraycopy(attribs, 0, new_list, 0, attribs.length); attribs = new_list; attribs[attribs.length - 1] = new AttributeRange(attributes, begin_index, end_index); }
public ThreadGroup(String name) { this(Thread.currentThread().getThreadGroup(), name);
private ThreadGroup() { this.parent = null; this.name = "Root Thread Group"; this.maxPriority = java.lang.Thread.MAX_PRIORITY; this.daemon = false; this.process = VmProcess.getRootProcess(this);
public ThreadGroup(String name) { this(Thread.currentThread().getThreadGroup(), name); }
ApplyTemplatesNode(TemplateNode children, TemplateNode next, Expr select, QName mode,
ApplyTemplatesNode(Expr select, QName mode,
ApplyTemplatesNode(TemplateNode children, TemplateNode next, Expr select, QName mode, List sortKeys, List withParams, boolean isDefault) { super(children, next); this.select = select; this.mode = mode; this.sortKeys = sortKeys; this.withParams = withParams; this.isDefault = isDefault; }
super(children, next);
ApplyTemplatesNode(TemplateNode children, TemplateNode next, Expr select, QName mode, List sortKeys, List withParams, boolean isDefault) { super(children, next); this.select = select; this.mode = mode; this.sortKeys = sortKeys; this.withParams = withParams; this.isDefault = isDefault; }
return new ApplyTemplatesNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), select.clone(stylesheet), mode, sortKeys2, withParams2, isDefault);
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)); } return new ApplyTemplatesNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), select.clone(stylesheet), mode, sortKeys2, withParams2, isDefault); }
if (stylesheet.debug) { System.err.println("Applying " + t); }
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) { // push the parameter context stylesheet.bindings.push(false); // set the parameters for (Iterator i = withParams.iterator(); i.hasNext(); ) { WithParam p = (WithParam) i.next(); Object value = p.getValue(stylesheet, mode, context, pos, len); stylesheet.bindings.set(p.name, value, false); } } 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) { if (stylesheet.debug) { System.err.println("Applying " + t); } stylesheet.current = node; t.apply(stylesheet, effectiveMode, node, i + 1, l, parent, nextSibling); } } if (withParams != null) { // pop the variable context stylesheet.bindings.pop(false); } } // apply-templates doesn't have processable children if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
public DirectColorModel(ColorSpace cspace, int pixelBits, int rmask, int gmask, int bmask, int amask, boolean isAlphaPremultiplied, int transferType)
public DirectColorModel(int pixelBits, int rmask, int gmask, int bmask)
public DirectColorModel(ColorSpace cspace, int pixelBits, int rmask, int gmask, int bmask, int amask, boolean isAlphaPremultiplied, int transferType) { super(cspace, pixelBits, rmask, gmask, bmask, amask, isAlphaPremultiplied, ((amask == 0) ? Transparency.OPAQUE : Transparency.TRANSLUCENT), transferType); }
super(cspace, pixelBits, rmask, gmask, bmask, amask, isAlphaPremultiplied, ((amask == 0) ? Transparency.OPAQUE : Transparency.TRANSLUCENT), transferType);
this(ColorSpace.getInstance(ColorSpace.CS_sRGB), pixelBits, rmask, gmask, bmask, 0, false, Buffers.smallestAppropriateTransferType(pixelBits) );
public DirectColorModel(ColorSpace cspace, int pixelBits, int rmask, int gmask, int bmask, int amask, boolean isAlphaPremultiplied, int transferType) { super(cspace, pixelBits, rmask, gmask, bmask, amask, isAlphaPremultiplied, ((amask == 0) ? Transparency.OPAQUE : Transparency.TRANSLUCENT), transferType); }
ColorModel model, int[] pixels, int offset, int scansize);
ColorModel model, byte[] pixels, int offset, int scansize);
void setPixels(int x, int y, int w, int h, ColorModel model, int[] pixels, int offset, int scansize);
LiteralNode(TemplateNode children, TemplateNode next, Node source)
LiteralNode(Node source)
LiteralNode(TemplateNode children, TemplateNode next, Node source) { super(children, next); this.source = source; if (source.getNodeType() == Node.ELEMENT_NODE) { NamedNodeMap attrs = source.getAttributes(); Node attr = attrs.getNamedItemNS(Stylesheet.XSL_NS, "exclude-result-prefixes"); if (attr != null) { elementExcludeResultPrefixes = new HashSet(); StringTokenizer st = new StringTokenizer(attr.getNodeValue()); while (st.hasMoreTokens()) { elementExcludeResultPrefixes.add(st.nextToken()); } } else { elementExcludeResultPrefixes = Collections.EMPTY_SET; } } else { elementExcludeResultPrefixes = null; } }