bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { //throw new IOException("EXT2 implementation is currently readonly"); if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the block //and update its contents with the data in src. If the whole block //is overwritten, then skip reading it. byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); //allocate a new block if needed if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } //write the block iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); iNode.setMtime(System.currentTimeMillis()/1000); }
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { //throw new IOException("EXT2 implementation is currently readonly"); if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the block //and update its contents with the data in src. If the whole block //is overwritten, then skip reading it. byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); //allocate a new block if needed if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } //write the block iNode.setSize( fileOffset+len ); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); iNode.setMtime(System.currentTimeMillis()/1000); }
11,469
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { //throw new IOException("EXT2 implementation is currently readonly"); if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the block //and update its contents with the data in src. If the whole block //is overwritten, then skip reading it. byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); //allocate a new block if needed if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } //write the block iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); iNode.setMtime(System.currentTimeMillis()/1000); }
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { //throw new IOException("EXT2 implementation is currently readonly"); if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the block //and update its contents with the data in src. If the whole block //is overwritten, then skip reading it. byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); //allocate a new block if needed if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } //write the block iNode.writeDataBlock(blockIndex, dest); iNode.setMtime(System.currentTimeMillis()/1000); } iNode.setSize( fileOffset+len ); iNode.setMtime(System.currentTimeMillis()/1000); }
11,470
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { //throw new IOException("EXT2 implementation is currently readonly"); if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the block //and update its contents with the data in src. If the whole block //is overwritten, then skip reading it. byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); //allocate a new block if needed if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } //write the block iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); iNode.setMtime(System.currentTimeMillis()/1000); }
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { //throw new IOException("EXT2 implementation is currently readonly"); if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the block //and update its contents with the data in src. If the whole block //is overwritten, then skip reading it. byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); //allocate a new block if needed if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } //write the block iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); iNode.setMtime(System.currentTimeMillis()/1000); }
11,471
private final int getu4() { int v1 = bytecode.get() & 0xFF; int v2 = bytecode.get() & 0xFF; int v3 = bytecode.get() & 0xFF; int v4 = bytecode.get() & 0xFF; return (v1 << 16) | (v2 << 16) | (v3 << 8) | v4; }
private final int getu4() { int v1 = bytecode.get() & 0xFF; int v2 = bytecode.get() & 0xFF; int v3 = bytecode.get() & 0xFF; int v4 = bytecode.get() & 0xFF; return (v1 << 24) | (v2 << 16) | (v3 << 8) | v4; }
11,472
public DefaultMutableTreeNode(Object userObject) { this.userObject = userObject; } // DefaultMutableTreeNode()
public DefaultMutableTreeNode(Object userObject) { this.userObject = userObject; } // DefaultMutableTreeNode()
11,474
public TreePath getParentPath() { return new TreePath(this.getPath(), path.length - 1); } // getParentPath()
public TreePath getParentPath() { return new TreePath(this.getPath(), path.length - 1); } // getParentPath()
11,475
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++; } // while // Verify Paths while (treepath[index] == this.path[index2]) { index++; index2++; } // while // Check for descendant if (index2 != this.path.length) { return false; } // if // Is Descendant return true; } // isDescendant()
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++; } // while // Verify Paths while (treepath[index] == this.path[index2]) { index++; index2++; } // while // Check for descendant if (index2 != this.path.length) { return false; } // if // Is Descendant return true; } // isDescendant()
11,476
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++; } // while // Verify Paths while (treepath[index] == this.path[index2]) { index++; index2++; } // while // Check for descendant if (index2 != this.path.length) { return false; } // if // Is Descendant return true; } // isDescendant()
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++; // while // Verify Paths while (treepath[index] == this.path[index2]) { index++; index2++; // while // Check for descendant if (index2 != this.path.length) { return false; // if // Is Descendant return true; // isDescendant()
11,477
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++; } // while // Verify Paths while (treepath[index] == this.path[index2]) { index++; index2++; } // while // Check for descendant if (index2 != this.path.length) { return false; } // if // Is Descendant return true; } // isDescendant()
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++; } // while // Verify Paths while (treepath[index] == this.path[index2]) { index++; index2++; } // while // Check for descendant if (index2 != this.path.length) return false; } // if // Is Descendant return true; } // isDescendant()
11,478
public void resizeFrame(JComponent frame, int x, int y, int width, int height);
void resizeFrame(JComponent frame, int x, int y, int width, int height);
11,481
public void beginResizingFrame(JComponent frame, int direction);
void beginResizingFrame(JComponent frame, int direction);
11,482
public void endResizingFrame(JComponent frame);
void endResizingFrame(JComponent frame);
11,483
public void activateFrame(JInternalFrame vframe);
void activateFrame(JInternalFrame vframe);
11,484
public void closeFrame(JInternalFrame frame);
void closeFrame(JInternalFrame frame);
11,485
public void deactivateFrame(JInternalFrame frame);
void deactivateFrame(JInternalFrame frame);
11,486
public void deiconifyFrame(JInternalFrame frame);
void deiconifyFrame(JInternalFrame frame);
11,487
public void iconifyFrame(JInternalFrame frame);
void iconifyFrame(JInternalFrame frame);
11,488
public void maximizeFrame(JInternalFrame frame);
void maximizeFrame(JInternalFrame frame);
11,489
public void minimizeFrame(JInternalFrame frame);
void minimizeFrame(JInternalFrame frame);
11,490
public long getValue ();
long getValue();
11,491
public void reset ();
void reset();
11,492
public static <S extends Enum<S>> Enum valueOf(Class<S> etype, String s) { if (etype == null || s == null) throw new NullPointerException(); try { return (S) etype.getDeclaredField(s).get(null); } catch (NoSuchFieldException exception) { throw new IllegalArgumentException(s); } catch (IllegalAccessException exception) { throw new Error("Unable to access Enum class"); } }
public static <S extends Enum<S>> S valueOf(Class<S> etype, String s) { if (etype == null || s == null) throw new NullPointerException(); try { return (S) etype.getDeclaredField(s).get(null); } catch (NoSuchFieldException exception) { throw new IllegalArgumentException(s); } catch (IllegalAccessException exception) { throw new Error("Unable to access Enum class"); } }
11,493
String [] processName (String qName, boolean isAttribute) { String name[]; Hashtable table; // detect errors in call sequence declsOK = false; // Select the appropriate table. if (isAttribute) { table = attributeNameTable; } else { table = elementNameTable; } // Start by looking in the cache, and // return immediately if the name // is already known in this content name = (String[])table.get(qName); if (name != null) { return name; } // We haven't seen this name in this // context before. Maybe in the parent // context, but we can't assume prefix // bindings are the same. name = new String[3]; name[2] = qName.intern(); int index = qName.indexOf(':'); // No prefix. if (index == -1) { if (isAttribute || defaultNS == null) { name[0] = ""; } else { name[0] = defaultNS; } name[1] = name[2]; } // Prefix else { String prefix = qName.substring(0, index); String local = qName.substring(index+1); String uri; if ("".equals(prefix)) { uri = defaultNS; } else { uri = (String)prefixTable.get(prefix); } if (uri == null) { return null; } name[0] = uri; name[1] = local.intern(); } // Save in the cache for future use. // (Could be shared with parent context...) table.put(name[2], name); return name; }
String [] processName (String qName, boolean isAttribute) { String name[]; Hashtable table; // detect errors in call sequence declsOK = false; // Select the appropriate table. if (isAttribute) { table = attributeNameTable; } else { table = elementNameTable; } // Start by looking in the cache, and // return immediately if the name // is already known in this content name = (String[])table.get(qName); if (name != null) { return name; } // We haven't seen this name in this // context before. Maybe in the parent // context, but we can't assume prefix // bindings are the same. name = new String[3]; name[2] = qName.intern(); int index = qName.indexOf(':'); // No prefix. if (index == -1) { if (isAttribute) { if (qName == "xmlns" && namespaceDeclUris) name[0] = NSDECL; else name[0] = ""; } else if (defaultNS == null) { name[0] = ""; } else { name[0] = defaultNS; } name[1] = name[2]; } // Prefix else { String prefix = qName.substring(0, index); String local = qName.substring(index+1); String uri; if ("".equals(prefix)) { uri = defaultNS; } else { uri = (String)prefixTable.get(prefix); } if (uri == null) { return null; } name[0] = uri; name[1] = local.intern(); } // Save in the cache for future use. // (Could be shared with parent context...) table.put(name[2], name); return name; }
11,494
String [] processName (String qName, boolean isAttribute) { String name[]; Hashtable table; // detect errors in call sequence declsOK = false; // Select the appropriate table. if (isAttribute) { table = attributeNameTable; } else { table = elementNameTable; } // Start by looking in the cache, and // return immediately if the name // is already known in this content name = (String[])table.get(qName); if (name != null) { return name; } // We haven't seen this name in this // context before. Maybe in the parent // context, but we can't assume prefix // bindings are the same. name = new String[3]; name[2] = qName.intern(); int index = qName.indexOf(':'); // No prefix. if (index == -1) { if (isAttribute || defaultNS == null) { name[0] = ""; } else { name[0] = defaultNS; } name[1] = name[2]; } // Prefix else { String prefix = qName.substring(0, index); String local = qName.substring(index+1); String uri; if ("".equals(prefix)) { uri = defaultNS; } else { uri = (String)prefixTable.get(prefix); } if (uri == null) { return null; } name[0] = uri; name[1] = local.intern(); } // Save in the cache for future use. // (Could be shared with parent context...) table.put(name[2], name); return name; }
String [] processName (String qName, boolean isAttribute) { String name[]; Hashtable table; // detect errors in call sequence declsOK = false; // Select the appropriate table. if (isAttribute) { table = attributeNameTable; } else { table = elementNameTable; } // Start by looking in the cache, and // return immediately if the name // is already known in this content name = (String[])table.get(qName); if (name != null) { return name; } // We haven't seen this name in this // context before. Maybe in the parent // context, but we can't assume prefix // bindings are the same. name = new String[3]; name[2] = qName.intern(); int index = qName.indexOf(':'); // No prefix. if (index == -1) { if (isAttribute || defaultNS == null) { name[0] = ""; } else { name[0] = defaultNS; } name[1] = name[2]; } // Prefix else { String prefix = qName.substring(0, index); String local = qName.substring(index+1); String uri; if ("".equals(prefix)) { uri = defaultNS; } else { uri = (String)prefixTable.get(prefix); } if (uri == null || (!isAttribute && "xmlns".equals (prefix))) { return null; } name[0] = uri; name[1] = local.intern(); } // Save in the cache for future use. // (Could be shared with parent context...) table.put(name[2], name); return name; }
11,495
protected void installListeners(JToolBar toolbar) { dockingListener = createDockingListener(); toolBar.addMouseListener(dockingListener); toolBar.addMouseMotionListener(dockingListener); propertyListener = createPropertyListener(); toolBar.addPropertyChangeListener(propertyListener); toolBarContListener = createToolBarContListener(); toolBar.addContainerListener(toolBarContListener); windowListener = createFrameListener(); floatFrame.addWindowListener(windowListener); toolBarFocusListener = createToolBarFocusListener(); toolBar.addFocusListener(toolBarFocusListener); }
protected void installListeners() { dockingListener = createDockingListener(); toolBar.addMouseListener(dockingListener); toolBar.addMouseMotionListener(dockingListener); propertyListener = createPropertyListener(); toolBar.addPropertyChangeListener(propertyListener); toolBarContListener = createToolBarContListener(); toolBar.addContainerListener(toolBarContListener); windowListener = createFrameListener(); floatFrame.addWindowListener(windowListener); toolBarFocusListener = createToolBarFocusListener(); toolBar.addFocusListener(toolBarFocusListener); }
11,496
public void installUI(JComponent c) { super.installUI(c); if (c instanceof JToolBar) { toolBar = (JToolBar) c; toolBar.setOpaque(true); installDefaults(); installComponents(); installListeners(toolBar); installKeyboardActions(); } }
public void installUI(JComponent c) { super.installUI(c); if (c instanceof JToolBar) { toolBar = (JToolBar) c; toolBar.setOpaque(true); installDefaults(); installComponents(); installListeners(); installKeyboardActions(); } }
11,497
public EtchedBorderUIResource() { }
public EtchedBorderUIResource() { super(); }
11,498
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { }
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { }
11,499
public DataFlavor(String mimeType) throws ClassNotFoundException { this(mimeType, null); }
public DataFlavor() { this(mimeType, null); }
11,500
public DataFlavor(String mimeType) throws ClassNotFoundException { this(mimeType, null); }
public DataFlavor(String mimeType) throws ClassNotFoundException { mimeType = null; representationClass = null; humanPresentableName = null; }
11,501
public String getParameter(String paramName) { if ("humanPresentableName".equals(paramName)) return getHumanPresentableName(); return getParameter(paramName, mimeType); }
private static String getParameter(String paramName, String mimeString) { if ("humanPresentableName".equals(paramName)) return getHumanPresentableName(); return getParameter(paramName, mimeType); }
11,502
public String getParameter(String paramName) { if ("humanPresentableName".equals(paramName)) return getHumanPresentableName(); return getParameter(paramName, mimeType); }
public String getParameter(String paramName) { if ("humanPresentableName".equals(paramName)) return getHumanPresentableName(); return getParameter(paramName, mimeType); }
11,503
public void readExternal(ObjectInput stream) throws IOException, ClassNotFoundException { // FIXME: Implement me }
public void readExternal(ObjectInput stream) throws IOException, ClassNotFoundException, NotImplementedException { // FIXME: Implement me }
11,504
public void writeExternal(ObjectOutput stream) throws IOException { // FIXME: Implement me }
public void writeExternal(ObjectOutput stream) throws IOException, NotImplementedException { // FIXME: Implement me }
11,505
private Pattern (String regex, int flags) throws PatternSyntaxException { this.regex = regex; this.flags = flags; int gnuFlags = 0; if ((flags & CASE_INSENSITIVE) != 0) gnuFlags |= RE.REG_ICASE; if ((flags & MULTILINE) != 0) gnuFlags |= RE.REG_MULTILINE; if ((flags & DOTALL) != 0) gnuFlags |= RE.REG_DOT_NEWLINE; // not yet supported: // if ((flags & UNICODE_CASE) != 0) gnuFlags = // if ((flags & CANON_EQ) != 0) gnuFlags = RESyntax syntax = RESyntax.RE_SYNTAX_JAVA_1_4; if ((flags & UNIX_LINES) != 0) { // Use a syntax set with \n for linefeeds? syntax = new RESyntax(syntax); syntax.setLineSeparator("\n"); } if ((flags & COMMENTS) != 0) { // Use a syntax with support for comments? } try { this.re = new RE(regex, gnuFlags, syntax); } catch (REException e) { throw new PatternSyntaxException(e.getMessage(), regex, e.getPosition()); } }
private Pattern (String regex, int flags) throws PatternSyntaxException { this.regex = regex; this.flags = flags; int gnuFlags = 0; if ((flags & CASE_INSENSITIVE) != 0) gnuFlags |= RE.REG_ICASE; if ((flags & MULTILINE) != 0) gnuFlags |= RE.REG_MULTILINE; if ((flags & DOTALL) != 0) gnuFlags |= RE.REG_DOT_NEWLINE; // not yet supported: // if ((flags & UNICODE_CASE) != 0) gnuFlags = // if ((flags & CANON_EQ) != 0) gnuFlags = RESyntax syntax = RESyntax.RE_SYNTAX_JAVA_1_4; if ((flags & UNIX_LINES) != 0) { // Use a syntax set with \n for linefeeds? syntax = new RESyntax(syntax); syntax.setLineSeparator("\n"); } if ((flags & COMMENTS) != 0) { // Use a syntax with support for comments? } try { this.re = new RE(regex, gnuFlags, syntax); } catch (REException e) { PatternSyntaxException pse; pse = new PatternSyntaxException(e.getMessage(), regex, e.getPosition()); } }
11,506
public SocketAddress receive (ByteBuffer dst) throws IOException { if (!isOpen()) throw new ClosedChannelException(); try { DatagramPacket packet; int len = dst.capacity() - dst.position(); if (dst.hasArray()) { packet = new DatagramPacket (dst.array(), dst.arrayOffset() + dst.position(), len); } else { packet = new DatagramPacket (new byte [len], len); } boolean completed = false; try { begin(); setInChannelOperation(true); socket.receive (packet); completed = true; } finally { end (completed); setInChannelOperation(false); } if (!dst.hasArray()) { dst.put (packet.getData(), packet.getOffset(), packet.getLength()); } else { dst.position (dst.position() + packet.getLength()); } return packet.getSocketAddress(); } catch (SocketTimeoutException e) { return null; } }
public SocketAddress receive (ByteBuffer dst) throws IOException { if (!isOpen()) throw new ClosedChannelException(); try { DatagramPacket packet; int len = dst.remaining(); if (dst.hasArray()) { packet = new DatagramPacket (dst.array(), dst.arrayOffset() + dst.position(), len); } else { packet = new DatagramPacket (new byte [len], len); } boolean completed = false; try { begin(); setInChannelOperation(true); socket.receive (packet); completed = true; } finally { end (completed); setInChannelOperation(false); } if (!dst.hasArray()) { dst.put (packet.getData(), packet.getOffset(), packet.getLength()); } else { dst.position (dst.position() + packet.getLength()); } return packet.getSocketAddress(); } catch (SocketTimeoutException e) { return null; } }
11,508
public void setPaintLabels(boolean paint) { if (paint != paintLabels) { boolean oldPaintLabels = paintLabels; paintLabels = paint; firePropertyChange("paintLabels", oldPaintLabels, paintLabels); } }
public void setPaintLabels(boolean paint) { if (paint != paintLabels) { paintLabels = paint; firePropertyChange("paintLabels", oldPaintLabels, paintLabels); } }
11,511
public void setPaintLabels(boolean paint) { if (paint != paintLabels) { boolean oldPaintLabels = paintLabels; paintLabels = paint; firePropertyChange("paintLabels", oldPaintLabels, paintLabels); } }
public void setPaintLabels(boolean paint) { if (paint != paintLabels) { boolean oldPaintLabels = paintLabels; paintLabels = paint; if (paint && majorTickSpacing > 0) labelTable = createStandardLabels(majorTickSpacing); firePropertyChange("paintLabels", !paint, paint); } }
11,512
public void setSnapToTicks(boolean snap) { if (snap != snapToTicks) { snapToTicks = snap; fireStateChanged(); } }
public void setSnapToTicks(boolean snap) { if (snap != snapToTicks) { snapToTicks = snap; firePropertyChange("snapToTicks", !snap, snap); } }
11,514
public boolean intersects(Rectangle2D r) { return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight()); }
public boolean intersects(double x, double y, double w, double h) { return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight()); }
11,515
public boolean intersects(Rectangle2D r) { return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight()); }
public boolean intersects(Rectangle2D r) { if (w <= 0 || h <= 0) return false; double x1 = getX1(); double y1 = getY1(); double x2 = getX2(); double y2 = getY2(); if (x1 >= x && x1 <= x + w && y1 >= y && y1 <= y + h) return true; if (x2 >= x && x2 <= x + w && y2 >= y && y2 <= y + h) return true; double x3 = x + w; double y3 = y + h; return (linesIntersect(x1, y1, x2, y2, x, y, x, y3) || linesIntersect(x1, y1, x2, y2, x, y3, x3, y3) || linesIntersect(x1, y1, x2, y2, x3, y3, x3, y) || linesIntersect(x1, y1, x2, y2, x3, y, x, y)); }
11,516
public boolean add(E o) { add(size(), o); return true; }
public void add(int index, E o) { add(size(), o); return true; }
11,522
public boolean add(E o) { add(size(), o); return true; }
public boolean add(E o) { add(size(), o); return true; }
11,523
public static boolean requiresBidi(char[] text, int start, int end) { final int LEFT_TO_RIGHT = Character.DIRECTIONALITY_LEFT_TO_RIGHT; for (int i = start; i < end; i++) { char c = text[i]; if (Character.getDirectionality(c) != LEFT_TO_RIGHT) return true; } return false; }
public static boolean requiresBidi(char[] text, int start, int end) { for (int i = start; i < end; i++) { char c = text[i]; if (Character.getDirectionality(c) != LEFT_TO_RIGHT) return true; } return false; }
11,524
public static boolean requiresBidi(char[] text, int start, int end) { final int LEFT_TO_RIGHT = Character.DIRECTIONALITY_LEFT_TO_RIGHT; for (int i = start; i < end; i++) { char c = text[i]; if (Character.getDirectionality(c) != LEFT_TO_RIGHT) return true; } return false; }
public static boolean requiresBidi(char[] text, int start, int end) { final int LEFT_TO_RIGHT = Character.DIRECTIONALITY_LEFT_TO_RIGHT; for (int i = start; i < end; i++) { char c = text[i]; if (Character.getDirectionality(c) != LEFT_TO_RIGHT) return true; } return false; }
11,525
public Object getProperty(String name) throws IllegalArgumentException { if (IS_PREFIX_DEFAULTING.equals(name)) return new Boolean(prefixDefaulting); throw new IllegalArgumentException(name); }
public Object getProperty(String name) throws IllegalArgumentException { if (IS_REPAIRING_NAMESPACES.equals(name)) return new Boolean(prefixDefaulting); throw new IllegalArgumentException(name); }
11,526
public boolean isPropertySupported(String name) { if (IS_PREFIX_DEFAULTING.equals(name)) return true; return false; }
public boolean isPropertySupported(String name) { if (IS_REPAIRING_NAMESPACES.equals(name)) return true; return false; }
11,527
public void setProperty(String name, Object value) throws IllegalArgumentException { if (IS_PREFIX_DEFAULTING.equals(name)) prefixDefaulting = ((Boolean) value).booleanValue(); else throw new IllegalArgumentException(name); }
public void setProperty(String name, Object value) throws IllegalArgumentException { if (IS_REPAIRING_NAMESPACES.equals(name)) prefixDefaulting = ((Boolean) value).booleanValue(); else throw new IllegalArgumentException(name); }
11,528
protected FSEntry buildRootEntry() throws IOException { //a free inode has been found: create the inode and write it into the inode table long iNodeTableBlock = groupDescriptors[0].getInodeTable(); //the first block of the inode table INodeTable iNodeTable = new INodeTable(this, (int)iNodeTableBlock); //byte[] iNodeData = new byte[INode.INODE_LENGTH]; int iNodeNr = Ext2Constants.EXT2_ROOT_INO; INode iNode = new INode(this, new INodeDescriptor(iNodeTable, iNodeNr, 0, iNodeNr-1)); int rights = 0xFFFF & (Ext2Constants.EXT2_S_IRWXU | Ext2Constants.EXT2_S_IRWXG | Ext2Constants.EXT2_S_IRWXO); iNode.create( Ext2Constants.EXT2_S_IFDIR, rights, 0, 0); //trigger a write to disk iNode.update(); //add the inode to the inode cache synchronized(inodeCache) { inodeCache.put(new Integer(Ext2Constants.EXT2_ROOT_INO), iNode); } modifyUsedDirsCount(0, 1); Ext2Entry rootEntry = new Ext2Entry(iNode,"/",Ext2Constants.EXT2_FT_DIR, this, null); ((Ext2Directory)rootEntry.getDirectory()).addINode(Ext2Constants.EXT2_ROOT_INO, ".", Ext2Constants.EXT2_FT_DIR); ((Ext2Directory)rootEntry.getDirectory()).addINode(Ext2Constants.EXT2_ROOT_INO, "..", Ext2Constants.EXT2_FT_DIR); rootEntry.getDirectory().addDirectory("lost+found"); return rootEntry; }
protected FSEntry buildRootEntry() throws IOException { //a free inode has been found: create the inode and write it into the inode table long iNodeTableBlock = groupDescriptors[0].getInodeTable(); //the first block of the inode table INodeTable iNodeTable = new INodeTable(this, (int)iNodeTableBlock); //byte[] iNodeData = new byte[INode.INODE_LENGTH]; int iNodeNr = Ext2Constants.EXT2_ROOT_INO; INode iNode = new INode(this, new INodeDescriptor(iNodeTable, iNodeNr, 0, iNodeNr-1)); int rights = 0xFFFF & (Ext2Constants.EXT2_S_IRWXU | Ext2Constants.EXT2_S_IRWXG | Ext2Constants.EXT2_S_IRWXO); iNode.create( Ext2Constants.EXT2_S_IFDIR, rights, 0, 0); //trigger a write to disk iNode.update(); //add the inode to the inode cache synchronized(inodeCache) { inodeCache.put(new Integer(Ext2Constants.EXT2_ROOT_INO), iNode); } modifyUsedDirsCount(0, 1); Ext2Entry rootEntry = new Ext2Entry(iNode,"/",Ext2Constants.EXT2_FT_DIR, this, null); ((Ext2Directory)rootEntry.getDirectory()).addINode(Ext2Constants.EXT2_ROOT_INO, ".", Ext2Constants.EXT2_FT_DIR); ((Ext2Directory)rootEntry.getDirectory()).addINode(Ext2Constants.EXT2_ROOT_INO, "..", Ext2Constants.EXT2_FT_DIR); rootEntry.getDirectory().addDirectory("lost+found"); return rootEntry; }
11,530
protected INode createINode(int preferredBlockBroup, int fileFormat, int accessRights, int uid, int gid) throws FileSystemException, IOException { if(preferredBlockBroup >= superblock.getBlocksCount()) throw new FileSystemException("Block group "+preferredBlockBroup+" does not exist"); int groupNr = preferredBlockBroup; //first check the preferred block group, if it has any free inodes INodeReservation res = findFreeINode( groupNr ); //if no free inode has been found in the preferred block group, then try the others if(!res.isSuccessful()) { for(groupNr=0; groupNr<superblock.getBlockGroupNr(); groupNr++) { res = findFreeINode( groupNr ); if(res.isSuccessful()){ break; } } } if(!res.isSuccessful()) throw new FileSystemException("No free inodes found!"); //a free inode has been found: create the inode and write it into the inode table long iNodeTableBlock = groupDescriptors[preferredBlockBroup].getInodeTable(); //the first block of the inode table INodeTable iNodeTable = new INodeTable(this, (int)iNodeTableBlock); //byte[] iNodeData = new byte[INode.INODE_LENGTH]; int iNodeNr = res.getINodeNr((int)superblock.getINodesPerGroup()); INode iNode = new INode(this, new INodeDescriptor(iNodeTable, iNodeNr, groupNr, res.getIndex())); iNode.create( fileFormat, accessRights, uid, gid); //trigger a write to disk iNode.update(); log.debug("** NEW INODE ALLOCATED: inode number: "+iNode.getINodeNr()); //put the inode into the cache synchronized(inodeCache) { Integer key = new Integer(iNodeNr); if(inodeCache.containsKey(key)) throw new FileSystemException("Newly allocated inode is already in the inode cache!?"); else inodeCache.put(key, iNode); } return iNode; }
protected INode createINode(int preferredBlockBroup, int fileFormat, int accessRights, int uid, int gid) throws FileSystemException, IOException { if(preferredBlockBroup >= superblock.getBlocksCount()) throw new FileSystemException("Block group "+preferredBlockBroup+" does not exist"); int groupNr = preferredBlockBroup; //first check the preferred block group, if it has any free inodes INodeReservation res = findFreeINode( groupNr ); //if no free inode has been found in the preferred block group, then try the others if(!res.isSuccessful()) { for(groupNr=0; groupNr<superblock.getBlockGroupNr(); groupNr++) { res = findFreeINode( groupNr ); if(res.isSuccessful()){ break; } } } if(!res.isSuccessful()) throw new FileSystemException("No free inodes found!"); //a free inode has been found: create the inode and write it into the inode table long iNodeTableBlock = groupDescriptors[preferredBlockBroup].getInodeTable(); //the first block of the inode table INodeTable iNodeTable = new INodeTable(this, (int)iNodeTableBlock); //byte[] iNodeData = new byte[INode.INODE_LENGTH]; int iNodeNr = res.getINodeNr((int)superblock.getINodesPerGroup()); INode iNode = new INode(this, new INodeDescriptor(iNodeTable, iNodeNr, groupNr, res.getIndex())); iNode.create( fileFormat, accessRights, uid, gid); //trigger a write to disk iNode.update(); log.debug("** NEW INODE ALLOCATED: inode number: "+iNode.getINodeNr()); //put the inode into the cache synchronized(inodeCache) { Integer key = new Integer(iNodeNr); if(inodeCache.containsKey(key)) throw new FileSystemException("Newly allocated inode is already in the inode cache!?"); else inodeCache.put(key, iNode); } return iNode; }
11,532
public INode getINode(int iNodeNr) throws IOException, FileSystemException{ if((iNodeNr<1)||(iNodeNr>superblock.getINodesCount())) throw new FileSystemException("INode number ("+iNodeNr+") out of range (0-"+superblock.getINodesCount()+")"); Integer key=new Integer(iNodeNr); //log.debug("iNodeCache size: "+inodeCache.size()); synchronized(inodeCache) { //check if the inode is already in the cache if(inodeCache.containsKey(key)) return (INode)inodeCache.get(key); else{ int group = (int) ((iNodeNr - 1) / superblock.getINodesPerGroup()); int index = (int) ((iNodeNr - 1) % superblock.getINodesPerGroup()); //get the part of the inode table that contains the inode long iNodeTableBlock = groupDescriptors[group].getInodeTable(); //the first block of the inode table INodeTable iNodeTable = new INodeTable(this, (int)iNodeTableBlock); INode result = new INode(this, new INodeDescriptor(iNodeTable, iNodeNr, group, index)); result.read(iNodeTable.getInodeData(index)); inodeCache.put(key, result); return result; } } }
public INode getINode(int iNodeNr) throws IOException, FileSystemException{ if((iNodeNr<1)||(iNodeNr>superblock.getINodesCount())) throw new FileSystemException("INode number ("+iNodeNr+") out of range (0-"+superblock.getINodesCount()+")"); Integer key=new Integer(iNodeNr); //log.debug("iNodeCache size: "+inodeCache.size()); synchronized(inodeCache) { //check if the inode is already in the cache if(inodeCache.containsKey(key)) return (INode)inodeCache.get(key); else{ int group = (int) ((iNodeNr - 1) / superblock.getINodesPerGroup()); int index = (int) ((iNodeNr - 1) % superblock.getINodesPerGroup()); //get the part of the inode table that contains the inode long iNodeTableBlock = groupDescriptors[group].getInodeTable(); //the first block of the inode table INodeTable iNodeTable = new INodeTable(this, (int)iNodeTableBlock); INode result = new INode(this, new INodeDescriptor(iNodeTable, iNodeNr, group, index)); result.read(iNodeTable.getInodeData(index)); inodeCache.put(key, result); return result; } } }
11,534
public INode getINode(int iNodeNr) throws IOException, FileSystemException{ if((iNodeNr<1)||(iNodeNr>superblock.getINodesCount())) throw new FileSystemException("INode number ("+iNodeNr+") out of range (0-"+superblock.getINodesCount()+")"); Integer key=new Integer(iNodeNr); //log.debug("iNodeCache size: "+inodeCache.size()); synchronized(inodeCache) { //check if the inode is already in the cache if(inodeCache.containsKey(key)) return (INode)inodeCache.get(key); else{ int group = (int) ((iNodeNr - 1) / superblock.getINodesPerGroup()); int index = (int) ((iNodeNr - 1) % superblock.getINodesPerGroup()); //get the part of the inode table that contains the inode long iNodeTableBlock = groupDescriptors[group].getInodeTable(); //the first block of the inode table INodeTable iNodeTable = new INodeTable(this, (int)iNodeTableBlock); INode result = new INode(this, new INodeDescriptor(iNodeTable, iNodeNr, group, index)); result.read(iNodeTable.getInodeData(index)); inodeCache.put(key, result); return result; } } }
public INode getINode(int iNodeNr) throws IOException, FileSystemException{ if((iNodeNr<1)||(iNodeNr>superblock.getINodesCount())) throw new FileSystemException("INode number ("+iNodeNr+") out of range (0-"+superblock.getINodesCount()+")"); Integer key=new Integer(iNodeNr); //log.debug("iNodeCache size: "+inodeCache.size()); synchronized(inodeCache) { //check if the inode is already in the cache if(inodeCache.containsKey(key)) return (INode)inodeCache.get(key); else{ int group = (int) ((iNodeNr - 1) / superblock.getINodesPerGroup()); int index = (int) ((iNodeNr - 1) % superblock.getINodesPerGroup()); //get the part of the inode table that contains the inode long iNodeTableBlock = groupDescriptors[group].getInodeTable(); //the first block of the inode table INodeTable iNodeTable = new INodeTable(this, (int)iNodeTableBlock); INode result = new INode(this, new INodeDescriptor(iNodeTable, iNodeNr, group, index)); result.read(iNodeTable.getInodeData(index)); inodeCache.put(key, result); return result; } } }
11,535
public INode getINode(int iNodeNr) throws IOException, FileSystemException{ if((iNodeNr<1)||(iNodeNr>superblock.getINodesCount())) throw new FileSystemException("INode number ("+iNodeNr+") out of range (0-"+superblock.getINodesCount()+")"); Integer key=new Integer(iNodeNr); //log.debug("iNodeCache size: "+inodeCache.size()); synchronized(inodeCache) { //check if the inode is already in the cache if(inodeCache.containsKey(key)) return (INode)inodeCache.get(key); else{ int group = (int) ((iNodeNr - 1) / superblock.getINodesPerGroup()); int index = (int) ((iNodeNr - 1) % superblock.getINodesPerGroup()); //get the part of the inode table that contains the inode long iNodeTableBlock = groupDescriptors[group].getInodeTable(); //the first block of the inode table INodeTable iNodeTable = new INodeTable(this, (int)iNodeTableBlock); INode result = new INode(this, new INodeDescriptor(iNodeTable, iNodeNr, group, index)); result.read(iNodeTable.getInodeData(index)); inodeCache.put(key, result); return result; } } }
public INode getINode(int iNodeNr) throws IOException, FileSystemException{ if((iNodeNr<1)||(iNodeNr>superblock.getINodesCount())) throw new FileSystemException("INode number ("+iNodeNr+") out of range (0-"+superblock.getINodesCount()+")"); Integer key=new Integer(iNodeNr); //log.debug("iNodeCache size: "+inodeCache.size()); synchronized(inodeCache) { //check if the inode is already in the cache if(inodeCache.containsKey(key)) return (INode)inodeCache.get(key); else{ int group = (int) ((iNodeNr - 1) / superblock.getINodesPerGroup()); int index = (int) ((iNodeNr - 1) % superblock.getINodesPerGroup()); //get the part of the inode table that contains the inode long iNodeTableBlock = groupDescriptors[group].getInodeTable(); //the first block of the inode table INodeTable iNodeTable = new INodeTable(this, (int)iNodeTableBlock); INode result = new INode(this, new INodeDescriptor(iNodeTable, iNodeNr, group, index)); result.read(iNodeTable.getInodeData(index)); inodeCache.put(key, result); return result; } else return (INode)inodeCache.get(key); } else return (INode)inodeCache.get(key); } else return (INode)inodeCache.get(key);
11,536
public FSDirectory getDirectory() throws IOException { if(isDirectory()) return new Ext2Directory( iNode ); else throw new IOException("Not a directory"); }
public FSDirectory getDirectory() throws IOException { if(isDirectory()) return new Ext2Directory( iNode, fs ); else throw new IOException("Not a directory"); }
11,538
abstract public boolean isUserNode();
public boolean isUserNode() { AbstractPreferences root = this; while (root.parent != null) root = root.parent; return root == Preferences.userRoot(); }
11,539
public abstract ShortBuffer put (short b);
public ShortBuffer put (ShortBuffer src) { if (src == this) throw new IllegalArgumentException (); checkForOverflow(src.remaining ()); if (src.remaining () > 0) { short[] toPut = new short [src.remaining ()]; src.get (toPut); put (toPut); } return this; }
11,540
private void addEntry(ConfigurationElement element){ final String className = element.getAttribute("class"); final String entryName = element.getAttribute("name"); if (className != null) { try { final ClassLoader cl = Thread.currentThread().getContextClassLoader(); Class c = cl.loadClass(className); Object o = c.newInstance(); ExtFSEntry entry = (ExtFSEntry)o; if (entry.getName()==null){ if (entryName!=null){ entry.setName(entryName); } else { entry.setName(className); } } entry.setParent(extdir); FSEntry add = (FSEntry)entry; extdir.addFSE(add); } catch (ClassCastException ex) { log.error( "Given class " + className + " does not implement ."); } catch (ClassNotFoundException ex) { log.error("Cannot load " + className); } catch (IllegalAccessException ex) { log.error("No access to " + className); } catch (InstantiationException ex) { log.error(ex); } catch (IOException ex){ log.error("could not set name of file: "+ entryName ); } } }
private void addEntry(ConfigurationElement element){ final String className = element.getAttribute("class"); final String entryName = element.getAttribute("name"); if (className != null) { try { final ClassLoader cl = Thread.currentThread().getContextClassLoader(); Class<?> c = cl.loadClass(className); Object o = c.newInstance(); ExtFSEntry entry = (ExtFSEntry)o; if (entry.getName()==null){ if (entryName!=null){ entry.setName(entryName); } else { entry.setName(className); } } entry.setParent(extdir); FSEntry add = (FSEntry)entry; extdir.addFSE(add); } catch (ClassCastException ex) { log.error( "Given class " + className + " does not implement ."); } catch (ClassNotFoundException ex) { log.error("Cannot load " + className); } catch (IllegalAccessException ex) { log.error("No access to " + className); } catch (InstantiationException ex) { log.error(ex); } catch (IOException ex){ log.error("could not set name of file: "+ entryName ); } } }
11,541
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new ValueOfNode(select.clone(stylesheet), disableOutputEscaping); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
TemplateNode clone(Stylesheet stylesheet) TemplateNode ret = new ValueOfNode(select.clone(stylesheet), disableOutputEscaping); if (children != null) ret.children = children.clone(stylesheet); } if (next != null) ret.next = next.clone(stylesheet); } return ret; }
11,542
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new ValueOfNode(select.clone(stylesheet), disableOutputEscaping); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new ValueOfNode(select.clone(stylesheet), disableOutputEscaping); if (children != null) { ret.children = children.clone(stylesheet); if (next != null) { ret.next = next.clone(stylesheet); return ret;
11,543
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 (stylesheet.debug) { System.err.println("value-of: " + select + " -> " + ret); }*/ String value; if (ret instanceof Collection) { StringBuffer buf = new StringBuffer(); for (Iterator i = ((Collection) ret).iterator(); i.hasNext(); ) { Node node = (Node) i.next(); buf.append(Expr.stringValue(node)); } value = buf.toString(); } else { value = Expr._string(context, ret); } if (stylesheet.debug) { System.err.println("value-of: "+context+" "+ select + " -> "+ value); } if (value != null && value.length() > 0) { Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); Text textNode = doc.createTextNode(value); if (disableOutputEscaping) { textNode.setUserData("disable-output-escaping", "yes", stylesheet); } if (nextSibling != null) { parent.insertBefore(textNode, nextSibling); } else { parent.appendChild(textNode); } } // value-of doesn't process 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 (stylesheet.debug) System.err.println("value-of: " + select + " -> " + ret); }*/ String value; if (ret instanceof Collection) StringBuffer buf = new StringBuffer(); for (Iterator i = ((Collection) ret).iterator(); i.hasNext(); ) Node node = (Node) i.next(); buf.append(Expr.stringValue(node)); } value = buf.toString(); } else value = Expr._string(context, ret); } if (stylesheet.debug) System.err.println("value-of: "+context+" "+ select + " -> "+ value); } if (value != null && value.length() > 0) Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); Text textNode = doc.createTextNode(value); if (disableOutputEscaping) textNode.setUserData("disable-output-escaping", "yes", stylesheet); } if (nextSibling != null) parent.insertBefore(textNode, nextSibling); } else parent.appendChild(textNode); } } // value-of doesn't process children if (next != null) next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
11,544
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 (stylesheet.debug) { System.err.println("value-of: " + select + " -> " + ret); }*/ String value; if (ret instanceof Collection) { StringBuffer buf = new StringBuffer(); for (Iterator i = ((Collection) ret).iterator(); i.hasNext(); ) { Node node = (Node) i.next(); buf.append(Expr.stringValue(node)); } value = buf.toString(); } else { value = Expr._string(context, ret); } if (stylesheet.debug) { System.err.println("value-of: "+context+" "+ select + " -> "+ value); } if (value != null && value.length() > 0) { Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); Text textNode = doc.createTextNode(value); if (disableOutputEscaping) { textNode.setUserData("disable-output-escaping", "yes", stylesheet); } if (nextSibling != null) { parent.insertBefore(textNode, nextSibling); } else { parent.appendChild(textNode); } } // value-of doesn't process 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 (stylesheet.debug) { System.err.println("value-of: " + select + " -> " + ret); */ String value; if (ret instanceof Collection) { StringBuffer buf = new StringBuffer(); for (Iterator i = ((Collection) ret).iterator(); i.hasNext(); ) { Node node = (Node) i.next(); buf.append(Expr.stringValue(node)); value = buf.toString(); else { value = Expr._string(context, ret); if (stylesheet.debug) { System.err.println("value-of: "+context+" "+ select + " -> "+ value); if (value != null && value.length() > 0) { Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); Text textNode = doc.createTextNode(value); if (disableOutputEscaping) { textNode.setUserData("disable-output-escaping", "yes", stylesheet); if (nextSibling != null) { parent.insertBefore(textNode, nextSibling); else { parent.appendChild(textNode); // value-of doesn't process children if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling);
11,545
public String toString() { StringBuffer buf = new StringBuffer(getClass().getName()); buf.append('['); buf.append("select="); buf.append(select); if (disableOutputEscaping) { buf.append(",disableOutputEscaping"); } buf.append(']'); return buf.toString(); }
public String toString() { StringBuffer buf = new StringBuffer("value-of"); buf.append('['); buf.append("select="); buf.append(select); if (disableOutputEscaping) { buf.append(",disableOutputEscaping"); } buf.append(']'); return buf.toString(); }
11,546
public String toString() { StringBuffer buf = new StringBuffer(getClass().getName()); buf.append('['); buf.append("select="); buf.append(select); if (disableOutputEscaping) { buf.append(",disableOutputEscaping"); } buf.append(']'); return buf.toString(); }
public String toString() StringBuffer buf = new StringBuffer(getClass().getName()); buf.append('['); buf.append("select="); buf.append(select); if (disableOutputEscaping) buf.append(",disableOutputEscaping"); } buf.append(']'); return buf.toString(); }
11,547
public String toString() { StringBuffer buf = new StringBuffer(getClass().getName()); buf.append('['); buf.append("select="); buf.append(select); if (disableOutputEscaping) { buf.append(",disableOutputEscaping"); } buf.append(']'); return buf.toString(); }
public String toString() { StringBuffer buf = new StringBuffer(getClass().getName()); buf.append('['); buf.append("select="); buf.append(select); if (disableOutputEscaping) { buf.append(",disableOutputEscaping"); buf.append(']'); return buf.toString();
11,548
public CharSeqHolder(char[] initial_value) { value = initial_value; typecode.setLength(value.length); }
public CharSeqHolder() { value = initial_value; typecode.setLength(value.length); }
11,549
public CharSeqHolder(char[] initial_value) { value = initial_value; typecode.setLength(value.length); }
public CharSeqHolder(char[] initial_value) { value = initial_value; typecode.setLength(value.length); }
11,550
public Class getClass(ParsedArguments cmdLine) throws ClassNotFoundException { return Class.forName(getValue(cmdLine)); }
public Class getClass(ParsedArguments cmdLine) throws ClassNotFoundException { final ClassLoader cl = Thread.currentThread().getContextClassLoader(); return cl.loadClass(getValue(cmdLine)); }
11,551
public Graphics getGraphics() { Component parent = awtComponent.getParent(); ComponentPeer parentPeer = parent.getPeer(); Graphics g = parentPeer.getGraphics(); g.translate(awtComponent.getX(), awtComponent.getY()); g.setClip(0, 0, awtComponent.getWidth(), awtComponent.getHeight()); return g; }
public Graphics getGraphics() { Component parent = awtComponent.getParent(); ComponentPeer parentPeer = parent.getPeer(); Graphics g = parentPeer.getGraphics(); g.translate(awtComponent.getX(), awtComponent.getY()); g.setClip(0, 0, awtComponent.getWidth(), awtComponent.getHeight()); return g; }
11,554
public void handleEvent(AWTEvent e) { switch (e.getID()) { case PaintEvent.UPDATE: case PaintEvent.PAINT: // This only will work when the component is showing. if (awtComponent.isShowing()) { Graphics g = getGraphics(); Rectangle clip = ((PaintEvent)e).getUpdateRect(); g.clipRect(clip.x, clip.y, clip.width, clip.height); //if (this instanceof LightweightPeer) // { if (e.getID() == PaintEvent.UPDATE) awtComponent.update(g); else awtComponent.paint(g); // } // We paint the 'heavyweights' at last, so that they appear on top of // everything else. peerPaint(g); g.dispose(); } break; case MouseEvent.MOUSE_PRESSED: case MouseEvent.MOUSE_RELEASED: case MouseEvent.MOUSE_CLICKED: case MouseEvent.MOUSE_ENTERED: case MouseEvent.MOUSE_EXITED: handleMouseEvent((MouseEvent) e); break; case MouseEvent.MOUSE_MOVED: case MouseEvent.MOUSE_DRAGGED: handleMouseMotionEvent((MouseEvent) e); break; case KeyEvent.KEY_PRESSED: case KeyEvent.KEY_RELEASED: case KeyEvent.KEY_TYPED: handleKeyEvent((KeyEvent) e); break; default: // Other event types are not handled here. break; } }
public void handleEvent(AWTEvent e) { switch (e.getID()) { case PaintEvent.UPDATE: case PaintEvent.PAINT: // This only will work when the component is showing. if (awtComponent.isShowing()) { Graphics g = getGraphics(); Rectangle clip = ((PaintEvent)e).getUpdateRect(); g.clipRect(clip.x, clip.y, clip.width, clip.height); //if (this instanceof LightweightPeer) // { if (e.getID() == PaintEvent.UPDATE) awtComponent.update(g); else awtComponent.paint(g); // } // We paint the 'heavyweights' at last, so that they appear on top of // everything else. peerPaint(g); g.dispose(); } break; case MouseEvent.MOUSE_PRESSED: case MouseEvent.MOUSE_RELEASED: case MouseEvent.MOUSE_CLICKED: case MouseEvent.MOUSE_ENTERED: case MouseEvent.MOUSE_EXITED: handleMouseEvent((MouseEvent) e); break; case MouseEvent.MOUSE_MOVED: case MouseEvent.MOUSE_DRAGGED: handleMouseMotionEvent((MouseEvent) e); break; case KeyEvent.KEY_PRESSED: case KeyEvent.KEY_RELEASED: case KeyEvent.KEY_TYPED: handleKeyEvent((KeyEvent) e); break; default: // Other event types are not handled here. break; } }
11,556
public void handleEvent(AWTEvent e) { switch (e.getID()) { case PaintEvent.UPDATE: case PaintEvent.PAINT: // This only will work when the component is showing. if (awtComponent.isShowing()) { Graphics g = getGraphics(); Rectangle clip = ((PaintEvent)e).getUpdateRect(); g.clipRect(clip.x, clip.y, clip.width, clip.height); //if (this instanceof LightweightPeer) // { if (e.getID() == PaintEvent.UPDATE) awtComponent.update(g); else awtComponent.paint(g); // } // We paint the 'heavyweights' at last, so that they appear on top of // everything else. peerPaint(g); g.dispose(); } break; case MouseEvent.MOUSE_PRESSED: case MouseEvent.MOUSE_RELEASED: case MouseEvent.MOUSE_CLICKED: case MouseEvent.MOUSE_ENTERED: case MouseEvent.MOUSE_EXITED: handleMouseEvent((MouseEvent) e); break; case MouseEvent.MOUSE_MOVED: case MouseEvent.MOUSE_DRAGGED: handleMouseMotionEvent((MouseEvent) e); break; case KeyEvent.KEY_PRESSED: case KeyEvent.KEY_RELEASED: case KeyEvent.KEY_TYPED: handleKeyEvent((KeyEvent) e); break; default: // Other event types are not handled here. break; } }
public void handleEvent(AWTEvent e) { switch (e.getID()) { case PaintEvent.UPDATE: case PaintEvent.PAINT: // This only will work when the component is showing. if (awtComponent.isShowing()) { Graphics g = getGraphics(); Rectangle clip = ((PaintEvent)e).getUpdateRect(); g.clipRect(clip.x, clip.y, clip.width, clip.height); //if (this instanceof LightweightPeer) // { if (e.getID() == PaintEvent.UPDATE) awtComponent.update(g); else awtComponent.paint(g); // } // We paint the 'heavyweights' at last, so that they appear on top of // everything else. peerPaint(g); g.dispose(); } break; case MouseEvent.MOUSE_PRESSED: case MouseEvent.MOUSE_RELEASED: case MouseEvent.MOUSE_CLICKED: case MouseEvent.MOUSE_ENTERED: case MouseEvent.MOUSE_EXITED: handleMouseEvent((MouseEvent) e); break; case MouseEvent.MOUSE_MOVED: case MouseEvent.MOUSE_DRAGGED: handleMouseMotionEvent((MouseEvent) e); break; case KeyEvent.KEY_PRESSED: case KeyEvent.KEY_RELEASED: case KeyEvent.KEY_TYPED: handleKeyEvent((KeyEvent) e); break; default: // Other event types are not handled here. break; } }
11,557
protected void peerPaint(Graphics g) { if (swingComponent != null) swingComponent.getJComponent().paint(g); }
protected void peerPaint(Graphics g, boolean update) { if (swingComponent != null) swingComponent.getJComponent().paint(g); }
11,561
protected void peerPaint(Graphics g) { if (swingComponent != null) swingComponent.getJComponent().paint(g); }
protected void peerPaint(Graphics g) { if (swingComponent != null) swingComponent.getJComponent().paint(g); }
11,562
public void layoutContainer(Container parent) { // The way to interpret this function is basically to ignore the names // of methods it calls, and focus on the variable names here. getViewRect // doesn't, for example, return the view; it returns the port bounds in // view space. Likwise setViewPosition doesn't reposition the view; it // positions the port, in view coordinates. JViewport port = (JViewport) parent; Component view = port.getView(); if (view == null) return; // These dimensions and positions are in *view space*. Do not mix // variables in here from port space (eg. parent.getBounds()). This // function should be entirely in view space, because the methods on // the viewport require inputs in view space. Rectangle portBounds = port.getViewRect(); Dimension viewPref = view.getPreferredSize(); Dimension viewMinimum = view.getMinimumSize(); Point portLowerRight = new Point(portBounds.x + portBounds.width, portBounds.y + portBounds.height); // vertical implementation of the above rules if (portBounds.height >= viewMinimum.height) { portBounds.y = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportHeight()) viewPref.height = portBounds.height; } else { viewPref.height = viewMinimum.height; int overextension = portLowerRight.y - viewPref.height; if (overextension > 0) portBounds.y -= overextension; } // horizontal implementation of the above rules if (portBounds.width >= viewMinimum.width) { portBounds.x = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportWidth()) viewPref.width = portBounds.width; } else { viewPref.width = viewMinimum.width; int overextension = portLowerRight.x - viewPref.width; if (overextension > 0) portBounds.x -= overextension; } port.setViewPosition(portBounds.getLocation()); port.setViewSize(viewPref); }
public void layoutContainer(Container parent) { // The way to interpret this function is basically to ignore the names // of methods it calls, and focus on the variable names here. getViewRect // doesn't, for example, return the view; it returns the port bounds in // view space. Likwise setViewPosition doesn't reposition the view; it // positions the port, in view coordinates. JViewport port = (JViewport) parent; Component view = port.getView(); if (view == null) return; // These dimensions and positions are in *view space*. Do not mix // variables in here from port space (eg. parent.getBounds()). This // function should be entirely in view space, because the methods on // the viewport require inputs in view space. Rectangle portBounds = port.getViewRect(); Dimension viewPref = view.getPreferredSize(); Dimension viewMinimum = view.getMinimumSize(); Point portLowerRight = new Point(portBounds.x + portBounds.width, portBounds.y + portBounds.height); // vertical implementation of the above rules if (portBounds.height >= viewPref.height) { portBounds.y = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportHeight()) viewPref.height = portBounds.height; } else { viewPref.height = viewMinimum.height; int overextension = portLowerRight.y - viewPref.height; if (overextension > 0) portBounds.y -= overextension; } // horizontal implementation of the above rules if (portBounds.width >= viewMinimum.width) { portBounds.x = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportWidth()) viewPref.width = portBounds.width; } else { viewPref.width = viewMinimum.width; int overextension = portLowerRight.x - viewPref.width; if (overextension > 0) portBounds.x -= overextension; } port.setViewPosition(portBounds.getLocation()); port.setViewSize(viewPref); }
11,564
public void layoutContainer(Container parent) { // The way to interpret this function is basically to ignore the names // of methods it calls, and focus on the variable names here. getViewRect // doesn't, for example, return the view; it returns the port bounds in // view space. Likwise setViewPosition doesn't reposition the view; it // positions the port, in view coordinates. JViewport port = (JViewport) parent; Component view = port.getView(); if (view == null) return; // These dimensions and positions are in *view space*. Do not mix // variables in here from port space (eg. parent.getBounds()). This // function should be entirely in view space, because the methods on // the viewport require inputs in view space. Rectangle portBounds = port.getViewRect(); Dimension viewPref = view.getPreferredSize(); Dimension viewMinimum = view.getMinimumSize(); Point portLowerRight = new Point(portBounds.x + portBounds.width, portBounds.y + portBounds.height); // vertical implementation of the above rules if (portBounds.height >= viewMinimum.height) { portBounds.y = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportHeight()) viewPref.height = portBounds.height; } else { viewPref.height = viewMinimum.height; int overextension = portLowerRight.y - viewPref.height; if (overextension > 0) portBounds.y -= overextension; } // horizontal implementation of the above rules if (portBounds.width >= viewMinimum.width) { portBounds.x = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportWidth()) viewPref.width = portBounds.width; } else { viewPref.width = viewMinimum.width; int overextension = portLowerRight.x - viewPref.width; if (overextension > 0) portBounds.x -= overextension; } port.setViewPosition(portBounds.getLocation()); port.setViewSize(viewPref); }
public void layoutContainer(Container parent) { // The way to interpret this function is basically to ignore the names // of methods it calls, and focus on the variable names here. getViewRect // doesn't, for example, return the view; it returns the port bounds in // view space. Likwise setViewPosition doesn't reposition the view; it // positions the port, in view coordinates. JViewport port = (JViewport) parent; Component view = port.getView(); if (view == null) return; // These dimensions and positions are in *view space*. Do not mix // variables in here from port space (eg. parent.getBounds()). This // function should be entirely in view space, because the methods on // the viewport require inputs in view space. Rectangle portBounds = port.getViewRect(); Dimension viewPref = view.getPreferredSize(); Dimension viewMinimum = view.getMinimumSize(); Point portLowerRight = new Point(portBounds.x + portBounds.width, portBounds.y + portBounds.height); // vertical implementation of the above rules if (portBounds.height >= viewMinimum.height) { portBounds.y = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportHeight()) viewPref.height = portBounds.height; } else { int overextension = portLowerRight.y - viewPref.height; if (overextension > 0) portBounds.y -= overextension; } // horizontal implementation of the above rules if (portBounds.width >= viewMinimum.width) { portBounds.x = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportWidth()) viewPref.width = portBounds.width; } else { viewPref.width = viewMinimum.width; int overextension = portLowerRight.x - viewPref.width; if (overextension > 0) portBounds.x -= overextension; } port.setViewPosition(portBounds.getLocation()); port.setViewSize(viewPref); }
11,565
public void layoutContainer(Container parent) { // The way to interpret this function is basically to ignore the names // of methods it calls, and focus on the variable names here. getViewRect // doesn't, for example, return the view; it returns the port bounds in // view space. Likwise setViewPosition doesn't reposition the view; it // positions the port, in view coordinates. JViewport port = (JViewport) parent; Component view = port.getView(); if (view == null) return; // These dimensions and positions are in *view space*. Do not mix // variables in here from port space (eg. parent.getBounds()). This // function should be entirely in view space, because the methods on // the viewport require inputs in view space. Rectangle portBounds = port.getViewRect(); Dimension viewPref = view.getPreferredSize(); Dimension viewMinimum = view.getMinimumSize(); Point portLowerRight = new Point(portBounds.x + portBounds.width, portBounds.y + portBounds.height); // vertical implementation of the above rules if (portBounds.height >= viewMinimum.height) { portBounds.y = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportHeight()) viewPref.height = portBounds.height; } else { viewPref.height = viewMinimum.height; int overextension = portLowerRight.y - viewPref.height; if (overextension > 0) portBounds.y -= overextension; } // horizontal implementation of the above rules if (portBounds.width >= viewMinimum.width) { portBounds.x = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportWidth()) viewPref.width = portBounds.width; } else { viewPref.width = viewMinimum.width; int overextension = portLowerRight.x - viewPref.width; if (overextension > 0) portBounds.x -= overextension; } port.setViewPosition(portBounds.getLocation()); port.setViewSize(viewPref); }
public void layoutContainer(Container parent) { // The way to interpret this function is basically to ignore the names // of methods it calls, and focus on the variable names here. getViewRect // doesn't, for example, return the view; it returns the port bounds in // view space. Likwise setViewPosition doesn't reposition the view; it // positions the port, in view coordinates. JViewport port = (JViewport) parent; Component view = port.getView(); if (view == null) return; // These dimensions and positions are in *view space*. Do not mix // variables in here from port space (eg. parent.getBounds()). This // function should be entirely in view space, because the methods on // the viewport require inputs in view space. Rectangle portBounds = port.getViewRect(); Dimension viewPref = view.getPreferredSize(); Dimension viewMinimum = view.getMinimumSize(); Point portLowerRight = new Point(portBounds.x + portBounds.width, portBounds.y + portBounds.height); // vertical implementation of the above rules if (portBounds.height >= viewMinimum.height) { portBounds.y = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportHeight()) viewPref.height = portBounds.height; } else { viewPref.height = viewMinimum.height; int overextension = portLowerRight.y - viewPref.height; if (overextension > 0) portBounds.y -= overextension; } // horizontal implementation of the above rules if (portBounds.width >= viewPref.width) { portBounds.x = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportWidth()) viewPref.width = portBounds.width; } else { viewPref.width = viewMinimum.width; int overextension = portLowerRight.x - viewPref.width; if (overextension > 0) portBounds.x -= overextension; } port.setViewPosition(portBounds.getLocation()); port.setViewSize(viewPref); }
11,566
public void layoutContainer(Container parent) { // The way to interpret this function is basically to ignore the names // of methods it calls, and focus on the variable names here. getViewRect // doesn't, for example, return the view; it returns the port bounds in // view space. Likwise setViewPosition doesn't reposition the view; it // positions the port, in view coordinates. JViewport port = (JViewport) parent; Component view = port.getView(); if (view == null) return; // These dimensions and positions are in *view space*. Do not mix // variables in here from port space (eg. parent.getBounds()). This // function should be entirely in view space, because the methods on // the viewport require inputs in view space. Rectangle portBounds = port.getViewRect(); Dimension viewPref = view.getPreferredSize(); Dimension viewMinimum = view.getMinimumSize(); Point portLowerRight = new Point(portBounds.x + portBounds.width, portBounds.y + portBounds.height); // vertical implementation of the above rules if (portBounds.height >= viewMinimum.height) { portBounds.y = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportHeight()) viewPref.height = portBounds.height; } else { viewPref.height = viewMinimum.height; int overextension = portLowerRight.y - viewPref.height; if (overextension > 0) portBounds.y -= overextension; } // horizontal implementation of the above rules if (portBounds.width >= viewMinimum.width) { portBounds.x = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportWidth()) viewPref.width = portBounds.width; } else { viewPref.width = viewMinimum.width; int overextension = portLowerRight.x - viewPref.width; if (overextension > 0) portBounds.x -= overextension; } port.setViewPosition(portBounds.getLocation()); port.setViewSize(viewPref); }
public void layoutContainer(Container parent) { // The way to interpret this function is basically to ignore the names // of methods it calls, and focus on the variable names here. getViewRect // doesn't, for example, return the view; it returns the port bounds in // view space. Likwise setViewPosition doesn't reposition the view; it // positions the port, in view coordinates. JViewport port = (JViewport) parent; Component view = port.getView(); if (view == null) return; // These dimensions and positions are in *view space*. Do not mix // variables in here from port space (eg. parent.getBounds()). This // function should be entirely in view space, because the methods on // the viewport require inputs in view space. Rectangle portBounds = port.getViewRect(); Dimension viewPref = view.getPreferredSize(); Dimension viewMinimum = view.getMinimumSize(); Point portLowerRight = new Point(portBounds.x + portBounds.width, portBounds.y + portBounds.height); // vertical implementation of the above rules if (portBounds.height >= viewMinimum.height) { portBounds.y = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportHeight()) viewPref.height = portBounds.height; } else { viewPref.height = viewMinimum.height; int overextension = portLowerRight.y - viewPref.height; if (overextension > 0) portBounds.y -= overextension; } // horizontal implementation of the above rules if (portBounds.width >= viewMinimum.width) { portBounds.x = 0; if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportWidth()) viewPref.width = portBounds.width; } else { int overextension = portLowerRight.x - viewPref.width; if (overextension > 0) portBounds.x -= overextension; } port.setViewPosition(portBounds.getLocation()); port.setViewSize(viewPref); }
11,567
public InvokeHandler getHandler(String operation, CookieHolder cookie, boolean forwarding_allowed ) throws gnuForwardRequest { if (servant != null) { return servantToHandler(servant); } else { // Use servant locator to locate the servant. if (poa.servant_locator != null) { try { servant = poa.servant_locator.preinvoke(Id, poa, operation, cookie); return servantToHandler(servant); } catch (org.omg.PortableServer.ForwardRequest forw_ex) { if (forwarding_allowed) { throw new gnuForwardRequest(forw_ex.forward_reference); } else { servant = ForwardedServant.create(forw_ex.forward_reference); return servantToHandler(servant); } } } else // Use servant activator to locate the servant. if (poa.applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION) && poa.applies(ServantRetentionPolicyValue.RETAIN) ) { try { poa.activate_object_with_id(Id, servant, forwarding_allowed); servant = poa.id_to_servant(Id); return servantToHandler(servant); } catch (gnuForwardRequest forwarded) { throw forwarded; } catch (Exception ex) { BAD_OPERATION bad = new BAD_OPERATION("Unable to activate", Minor.Activation, CompletionStatus.COMPLETED_NO ); bad.initCause(ex); throw bad; } } else if (poa.default_servant != null) { servant = poa.default_servant; return servantToHandler(servant); } // No servant and no servant manager - throw exception. else { throw new BAD_OPERATION("Unable to activate", Minor.Activation, CompletionStatus.COMPLETED_NO ); } } }
public InvokeHandler getHandler(String operation, CookieHolder cookie, boolean forwarding_allowed ) throws gnuForwardRequest { if (servant != null && !noRetain) { return servantToHandler(servant); } else { // Use servant locator to locate the servant. if (poa.servant_locator != null) { try { servant = poa.servant_locator.preinvoke(Id, poa, operation, cookie); return servantToHandler(servant); } catch (org.omg.PortableServer.ForwardRequest forw_ex) { if (forwarding_allowed) { throw new gnuForwardRequest(forw_ex.forward_reference); } else { servant = ForwardedServant.create(forw_ex.forward_reference); return servantToHandler(servant); } } } else // Use servant activator to locate the servant. if (poa.applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION) && poa.applies(ServantRetentionPolicyValue.RETAIN) ) { try { poa.activate_object_with_id(Id, servant, forwarding_allowed); servant = poa.id_to_servant(Id); return servantToHandler(servant); } catch (gnuForwardRequest forwarded) { throw forwarded; } catch (Exception ex) { BAD_OPERATION bad = new BAD_OPERATION("Unable to activate", Minor.Activation, CompletionStatus.COMPLETED_NO ); bad.initCause(ex); throw bad; } } else if (poa.default_servant != null) { servant = poa.default_servant; return servantToHandler(servant); } // No servant and no servant manager - throw exception. else { throw new BAD_OPERATION("Unable to activate", Minor.Activation, CompletionStatus.COMPLETED_NO ); } } }
11,568
private void addCharset (Charset cs) { String canonicalName = cs.name (); charsets.put (canonicalName, cs); for (Iterator i = cs.aliases ().iterator (); i.hasNext (); ) canonicalNames.put (i.next (), canonicalName); }
private void addCharset (Charset cs) { String canonicalName = cs.name().toLowerCase(); charsets.put (canonicalName, cs); for (Iterator i = cs.aliases ().iterator (); i.hasNext (); ) canonicalNames.put (i.next (), canonicalName); }
11,571
private void addCharset (Charset cs) { String canonicalName = cs.name (); charsets.put (canonicalName, cs); for (Iterator i = cs.aliases ().iterator (); i.hasNext (); ) canonicalNames.put (i.next (), canonicalName); }
private void addCharset (Charset cs) { String canonicalName = cs.name (); charsets.put (canonicalName, cs); for (Iterator i = cs.aliases ().iterator (); i.hasNext (); ) canonicalNames.put (((String) i.next()).toLowerCase(), canonicalName); }
11,572
public Charset charsetForName (String charsetName) { return (Charset) charsets.get (canonicalize (charsetName)); }
public Charset charsetForName (String charsetName) { Charset cs = (Charset) charsets.get(canonicalNames.get(charsetName.toLowerCase())); if(cs == null && !extendedLoaded) { loadExtended(); cs = (Charset) charsets.get(canonicalNames.get(charsetName.toLowerCase())); } return cs; }
11,573
public static synchronized Provider provider () { if (singleton == null) { // @classpath-bugfix Security fix singleton = (Provider)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return new Provider(); } }); } return singleton; }
public static synchronized Provider provider () { if (singleton == null) { // @classpath-bugfix Security fix singleton = (Provider)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return new Provider(); } }); } return singleton; }
11,575
public JApplet() { super.setLayout(new BorderLayout(1, 1)); getRootPane(); // will do set/create }
public JApplet() { super.setLayout(new BorderLayout(1, 1)); getRootPane(); initStageDone = true; // will do set/create }
11,578
public static boolean[] read(InputStream input) { BooleanSeqHolder h = new BooleanSeqHolder(); h._read(input); return h.value; }
public static boolean[] read(InputStream input) { BooleanSeqHolder h = new BooleanSeqHolder(); h._read(input); return h.value; }
11,582
public static void write(OutputStream output, boolean[] value) { BooleanSeqHolder h = new BooleanSeqHolder(value); h._write(output); }
public static void write(OutputStream output, boolean[] value) { BooleanSeqHolder h = new BooleanSeqHolder(value); h._write(output); }
11,583
public String getUIClassID() { //Returns a string that specifies the name of the L&F class that renders this component. return "JScrollPane"; }
public String getUIClassID() { //Returns a string that specifies the name of the L&F class that renders this component. return "ScrollPaneUI"; }
11,584
private SocketImpl getImpl() throws SocketException { try { if (! implCreated) { impl.create(true); implCreated = true; } } catch (IOException e) { throw new SocketException(e.getMessage()); } return impl; }
private SocketImpl getImpl() throws SocketException { try { if (! implCreated) { impl.create(true); implCreated = true; } } catch (IOException e) { SocketException se = new SocketException(e.toString()); se.initCause(e); throw se; } return impl; }
11,585
public final void close () throws IOException { opened = false; implCloseChannel (); }
public final void close () throws IOException { opened = false; implCloseChannel (); }
11,586
public static Object DoShowOptionDialog(Component frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { JOptionPane p = new JOptionPane(msg, msg_type, opt_type, icon, opts, init); System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " + p.msg); JDialog a; if (frame == null) { a = new JDialog((Frame) frame, title, true); } else if (frame instanceof Dialog) { a = new JDialog((Dialog) frame, title, true); } else if (frame instanceof Frame) { a = new JDialog((Frame) frame, title, true); } else { System.out.println("HUUUUHHH, not a frame or dialog !"); a = new JDialog((Frame) null, title, true); } p.dialog = a; a.getContentPane().setLayout(new BorderLayout()); a.getContentPane().add(p, BorderLayout.CENTER); // package the deal a.pack(); a.setVisible(true); Object s = p.getValue(); System.out.println("RESULT FROM DIALOG = " + s); if (s == null) return null; return s; }
public static Object DoShowOptionDialog(Component frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { JOptionPane p = new JOptionPane(msg, msg_type, opt_type, icon, opts, init); System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " + p.msg); JOptionPane p = new JOptionPane(msg, msg_type, opt_type, icon, opts, init); System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " + p.msg); JDialog a; if (frame == null) { a = new JDialog((Frame) frame, title, true); } else if (frame instanceof Dialog) { a = new JDialog((Dialog) frame, title, true); } else if (frame instanceof Frame) { a = new JDialog((Frame) frame, title, true); } else { System.out.println("HUUUUHHH, not a frame or dialog !"); a = new JDialog((Frame) null, title, true); } p.dialog = a; a.getContentPane().setLayout(new BorderLayout()); a.getContentPane().add(p, BorderLayout.CENTER); // package the deal a.pack(); a.setVisible(true); Object s = p.getValue(); System.out.println("RESULT FROM DIALOG = " + s); if (s == null) return null; return s; }
11,587
public static Object DoShowOptionDialog(Component frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { JOptionPane p = new JOptionPane(msg, msg_type, opt_type, icon, opts, init); System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " + p.msg); JDialog a; if (frame == null) { a = new JDialog((Frame) frame, title, true); } else if (frame instanceof Dialog) { a = new JDialog((Dialog) frame, title, true); } else if (frame instanceof Frame) { a = new JDialog((Frame) frame, title, true); } else { System.out.println("HUUUUHHH, not a frame or dialog !"); a = new JDialog((Frame) null, title, true); } p.dialog = a; a.getContentPane().setLayout(new BorderLayout()); a.getContentPane().add(p, BorderLayout.CENTER); // package the deal a.pack(); a.setVisible(true); Object s = p.getValue(); System.out.println("RESULT FROM DIALOG = " + s); if (s == null) return null; return s; }
public static Object DoShowOptionDialog(Component frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { JOptionPane p = new JOptionPane(msg, msg_type, opt_type, icon, opts, init); System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " + p.msg); JDialog a; if (frame == null) { a = new JDialog((Frame) frame, title, true); } else if (frame instanceof Dialog) { a = new JDialog((Dialog) frame, title, true); } else if (frame instanceof Frame) { a = new JDialog((Frame) frame, title, true); } else { System.out.println("HUUUUHHH, not a frame or dialog !"); a = new JDialog((Frame) null, title, true); } p.dialog = a; a.getContentPane().setLayout(new BorderLayout()); a.getContentPane().add(p, BorderLayout.CENTER); // package the deal a.pack(); a.setVisible(true); Object s = p.getValue(); System.out.println("RESULT FROM DIALOG = " + s); if (s == null) return null; return s; }
11,588
public static Object DoShowOptionDialog(Component frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { JOptionPane p = new JOptionPane(msg, msg_type, opt_type, icon, opts, init); System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " + p.msg); JDialog a; if (frame == null) { a = new JDialog((Frame) frame, title, true); } else if (frame instanceof Dialog) { a = new JDialog((Dialog) frame, title, true); } else if (frame instanceof Frame) { a = new JDialog((Frame) frame, title, true); } else { System.out.println("HUUUUHHH, not a frame or dialog !"); a = new JDialog((Frame) null, title, true); } p.dialog = a; a.getContentPane().setLayout(new BorderLayout()); a.getContentPane().add(p, BorderLayout.CENTER); // package the deal a.pack(); a.setVisible(true); Object s = p.getValue(); System.out.println("RESULT FROM DIALOG = " + s); if (s == null) return null; return s; }
public static Object DoShowOptionDialog(Component frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { JOptionPane p = new JOptionPane(msg, msg_type, opt_type, icon, opts, init); System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " + p.msg); if (frame == null) { a = new JDialog((Frame)frame, title, true); } else if (frame instanceof Dialog) { a = new JDialog((Dialog) frame, title, true); } else if (frame instanceof Frame) { a = new JDialog((Frame) frame, title, true); } else { System.out.println("HUUUUHHH, not a frame or dialog !"); a = new JDialog((Frame)null, title, true); } if (frame == null) { a = new JDialog((Frame) frame, title, true); } else if (frame instanceof Dialog) { a = new JDialog((Dialog) frame, title, true); } else if (frame instanceof Frame) { a = new JDialog((Frame) frame, title, true); } else { System.out.println("HUUUUHHH, not a frame or dialog !"); a = new JDialog((Frame) null, title, true); } p.dialog = a; a.getContentPane().setLayout(new BorderLayout()); a.getContentPane().add(p, BorderLayout.CENTER); // package the deal a.pack(); a.setVisible(true); Object s = p.getValue(); System.out.println("RESULT FROM DIALOG = " + s); if (s == null) return null; return s; }
11,589
public static Object DoShowOptionDialog(Component frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { JOptionPane p = new JOptionPane(msg, msg_type, opt_type, icon, opts, init); System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " + p.msg); JDialog a; if (frame == null) { a = new JDialog((Frame) frame, title, true); } else if (frame instanceof Dialog) { a = new JDialog((Dialog) frame, title, true); } else if (frame instanceof Frame) { a = new JDialog((Frame) frame, title, true); } else { System.out.println("HUUUUHHH, not a frame or dialog !"); a = new JDialog((Frame) null, title, true); } p.dialog = a; a.getContentPane().setLayout(new BorderLayout()); a.getContentPane().add(p, BorderLayout.CENTER); // package the deal a.pack(); a.setVisible(true); Object s = p.getValue(); System.out.println("RESULT FROM DIALOG = " + s); if (s == null) return null; return s; }
public static Object DoShowOptionDialog(Component frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { JOptionPane p = new JOptionPane(msg, msg_type, opt_type, icon, opts, init); System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " + p.msg); JDialog a; if (frame == null) { a = new JDialog((Frame) frame, title, true); } else if (frame instanceof Dialog) { a = new JDialog((Dialog) frame, title, true); } else if (frame instanceof Frame) { a = new JDialog((Frame) frame, title, true); } else { System.out.println("HUUUUHHH, not a frame or dialog !"); a = new JDialog((Frame) null, title, true); } p.dialog = a; a.getContentPane().setLayout(new BorderLayout()); a.getContentPane().add(p, BorderLayout.CENTER); // package the deal a.pack(); a.setVisible(true); Object s = p.getValue(); System.out.println("RESULT FROM DIALOG = " + s); if (s == null) return null; return s; }
11,590
public static Object DoShowOptionDialog(Component frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { JOptionPane p = new JOptionPane(msg, msg_type, opt_type, icon, opts, init); System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " + p.msg); JDialog a; if (frame == null) { a = new JDialog((Frame) frame, title, true); } else if (frame instanceof Dialog) { a = new JDialog((Dialog) frame, title, true); } else if (frame instanceof Frame) { a = new JDialog((Frame) frame, title, true); } else { System.out.println("HUUUUHHH, not a frame or dialog !"); a = new JDialog((Frame) null, title, true); } p.dialog = a; a.getContentPane().setLayout(new BorderLayout()); a.getContentPane().add(p, BorderLayout.CENTER); // package the deal a.pack(); a.setVisible(true); Object s = p.getValue(); System.out.println("RESULT FROM DIALOG = " + s); if (s == null) return null; return s; }
public static Object DoShowOptionDialog(Component frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { JOptionPane p = new JOptionPane(msg, msg_type, opt_type, icon, opts, init); System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " + p.msg); JDialog a; if (frame == null) { a = new JDialog((Frame) frame, title, true); } else if (frame instanceof Dialog) { a = new JDialog((Dialog) frame, title, true); } else if (frame instanceof Frame) { a = new JDialog((Frame) frame, title, true); } else { System.out.println("HUUUUHHH, not a frame or dialog !"); a = new JDialog((Frame) null, title, true); } p.dialog = a; a.getContentPane().setLayout(new BorderLayout()); a.getContentPane().add(p, BorderLayout.CENTER); // package the deal a.pack(); a.setVisible(true); Object s = p.getValue(); System.out.println("RESULT FROM DIALOG = " + s); if (s == null) return null; return s; }
11,591
public static Object DoShowOptionDialog(Component frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { JOptionPane p = new JOptionPane(msg, msg_type, opt_type, icon, opts, init); System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " + p.msg); JDialog a; if (frame == null) { a = new JDialog((Frame) frame, title, true); } else if (frame instanceof Dialog) { a = new JDialog((Dialog) frame, title, true); } else if (frame instanceof Frame) { a = new JDialog((Frame) frame, title, true); } else { System.out.println("HUUUUHHH, not a frame or dialog !"); a = new JDialog((Frame) null, title, true); } p.dialog = a; a.getContentPane().setLayout(new BorderLayout()); a.getContentPane().add(p, BorderLayout.CENTER); // package the deal a.pack(); a.setVisible(true); Object s = p.getValue(); System.out.println("RESULT FROM DIALOG = " + s); if (s == null) return null; return s; }
public static Object DoShowOptionDialog(Component frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { JOptionPane p = new JOptionPane(msg, msg_type, opt_type, icon, opts, init); System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " + p.msg); JDialog a; if (frame == null) { a = new JDialog((Frame) frame, title, true); } else if (frame instanceof Dialog) { a = new JDialog((Dialog) frame, title, true); } else if (frame instanceof Frame) { a = new JDialog((Frame) frame, title, true); } else { System.out.println("HUUUUHHH, not a frame or dialog !"); a = new JDialog((Frame) null, title, true); } p.dialog = a; a.getContentPane().setLayout(new BorderLayout()); a.getContentPane().add(p, BorderLayout.CENTER); // package the deal a.pack(); a.setVisible(true); Object s = p.getValue(); System.out.println("RESULT FROM DIALOG = " + s); if (s == null) return null; return s; }
11,592
public String getUIClassID() { return "JOptionPane"; }
public String getUIClassID() { return "JOptionPane"; }
11,593
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); optionPane.setFont(defaults.getFont("OptionPane.font")); optionPane.setBackground(defaults.getColor("OptionPane.background")); optionPane.setForeground(defaults.getColor("OptionPane.foreground")); optionPane.setBorder(defaults.getBorder("OptionPane.border")); optionPane.setOpaque(true); messageBorder = defaults.getBorder("OptionPane.messageAreaBorder"); messageForeground = defaults.getColor("OptionPane.messageForeground"); buttonBorder = defaults.getBorder("OptionPane.buttonAreaBorder"); minimumSize = defaults.getDimension("OptionPane.minimumSize"); // FIXME: Image icons don't seem to work properly right now. // Once they do, replace the synthetic icons with these ones. /* warningIcon = (IconUIResource) defaults.getIcon("OptionPane.warningIcon"); infoIcon = (IconUIResource) defaults.getIcon("OptionPane.informationIcon"); errorIcon = (IconUIResource) defaults.getIcon("OptionPane.errorIcon"); questionIcon = (IconUIResource) defaults.getIcon("OptionPane.questionIcon"); */ }
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); optionPane.setFont(defaults.getFont("OptionPane.font")); optionPane.setBackground(defaults.getColor("OptionPane.background")); optionPane.setForeground(defaults.getColor("OptionPane.foreground")); optionPane.setBorder(defaults.getBorder("OptionPane.border")); optionPane.setOpaque(true); messageBorder = defaults.getBorder("OptionPane.messageAreaBorder"); messageForeground = defaults.getColor("OptionPane.messageForeground"); buttonBorder = defaults.getBorder("OptionPane.buttonAreaBorder"); minimumSize = defaults.getDimension("OptionPane.minimumSize"); // FIXME: Image icons don't seem to work properly right now. // Once they do, replace the synthetic icons with these ones. /* warningIcon = (IconUIResource) defaults.getIcon("OptionPane.warningIcon"); infoIcon = (IconUIResource) defaults.getIcon("OptionPane.informationIcon"); errorIcon = (IconUIResource) defaults.getIcon("OptionPane.errorIcon"); questionIcon = (IconUIResource) defaults.getIcon("OptionPane.questionIcon"); */ }
11,594
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); optionPane.setFont(defaults.getFont("OptionPane.font")); optionPane.setBackground(defaults.getColor("OptionPane.background")); optionPane.setForeground(defaults.getColor("OptionPane.foreground")); optionPane.setBorder(defaults.getBorder("OptionPane.border")); optionPane.setOpaque(true); messageBorder = defaults.getBorder("OptionPane.messageAreaBorder"); messageForeground = defaults.getColor("OptionPane.messageForeground"); buttonBorder = defaults.getBorder("OptionPane.buttonAreaBorder"); minimumSize = defaults.getDimension("OptionPane.minimumSize"); // FIXME: Image icons don't seem to work properly right now. // Once they do, replace the synthetic icons with these ones. /* warningIcon = (IconUIResource) defaults.getIcon("OptionPane.warningIcon"); infoIcon = (IconUIResource) defaults.getIcon("OptionPane.informationIcon"); errorIcon = (IconUIResource) defaults.getIcon("OptionPane.errorIcon"); questionIcon = (IconUIResource) defaults.getIcon("OptionPane.questionIcon"); */ }
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); optionPane.setFont(defaults.getFont("OptionPane.font")); optionPane.setBackground(defaults.getColor("OptionPane.background")); optionPane.setForeground(defaults.getColor("OptionPane.foreground")); optionPane.setBorder(defaults.getBorder("OptionPane.border")); optionPane.setOpaque(true); messageBorder = defaults.getBorder("OptionPane.messageAreaBorder"); messageForeground = defaults.getColor("OptionPane.messageForeground"); buttonBorder = defaults.getBorder("OptionPane.buttonAreaBorder"); minimumSize = defaults.getDimension("OptionPane.minimumSize"); // FIXME: Image icons don't seem to work properly right now. // Once they do, replace the synthetic icons with these ones. /* warningIcon = (IconUIResource) defaults.getIcon("OptionPane.warningIcon"); infoIcon = (IconUIResource) defaults.getIcon("OptionPane.informationIcon"); errorIcon = (IconUIResource) defaults.getIcon("OptionPane.errorIcon"); questionIcon = (IconUIResource) defaults.getIcon("OptionPane.questionIcon"); */ }
11,595
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); optionPane.setFont(defaults.getFont("OptionPane.font")); optionPane.setBackground(defaults.getColor("OptionPane.background")); optionPane.setForeground(defaults.getColor("OptionPane.foreground")); optionPane.setBorder(defaults.getBorder("OptionPane.border")); optionPane.setOpaque(true); messageBorder = defaults.getBorder("OptionPane.messageAreaBorder"); messageForeground = defaults.getColor("OptionPane.messageForeground"); buttonBorder = defaults.getBorder("OptionPane.buttonAreaBorder"); minimumSize = defaults.getDimension("OptionPane.minimumSize"); // FIXME: Image icons don't seem to work properly right now. // Once they do, replace the synthetic icons with these ones. /* warningIcon = (IconUIResource) defaults.getIcon("OptionPane.warningIcon"); infoIcon = (IconUIResource) defaults.getIcon("OptionPane.informationIcon"); errorIcon = (IconUIResource) defaults.getIcon("OptionPane.errorIcon"); questionIcon = (IconUIResource) defaults.getIcon("OptionPane.questionIcon"); */ }
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); optionPane.setFont(defaults.getFont("OptionPane.font")); optionPane.setBackground(defaults.getColor("OptionPane.background")); optionPane.setForeground(defaults.getColor("OptionPane.foreground")); optionPane.setBorder(defaults.getBorder("OptionPane.border")); optionPane.setOpaque(true); messageBorder = defaults.getBorder("OptionPane.messageAreaBorder"); messageForeground = defaults.getColor("OptionPane.messageForeground"); buttonBorder = defaults.getBorder("OptionPane.buttonAreaBorder"); minimumSize = UIManager.getDimension("OptionPane.minimumSize"); // FIXME: Image icons don't seem to work properly right now. // Once they do, replace the synthetic icons with these ones. /* warningIcon = (IconUIResource) defaults.getIcon("OptionPane.warningIcon"); infoIcon = (IconUIResource) defaults.getIcon("OptionPane.informationIcon"); errorIcon = (IconUIResource) defaults.getIcon("OptionPane.errorIcon"); questionIcon = (IconUIResource) defaults.getIcon("OptionPane.questionIcon"); */ }
11,596
public void layoutContainer(Container parent) { if (parent.countComponents() == 1) { // This should usually be true, but if it's not it is // probably nicer if we do not panic. Component c = parent.getComponent(0); } }
public void layoutContainer(Container parent) { if (parent.countComponents() == 1) { // This should usually be true, but if it's not it is // probably nicer if we do not panic. Component c = parent.getComponent(0); } }
11,597
public Dimension minimumLayoutSize(Container parent) { return null; }
public Dimension minimumLayoutSize(Container parent) { return null; }
11,598
public Dimension preferredLayoutSize(Container parent) { return null; }
public Dimension preferredLayoutSize(Container parent) { return null; }
11,599