bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
public static OutputStream newOutputStream(WritableByteChannel ch) { if (ch instanceof FileChannelImpl) return newOutputStream((FileChannelImpl) ch); return new ChannelOutputStream(ch); }
public static OutputStream newOutputStream(WritableByteChannel ch) { if (ch instanceof FileChannelImpl) return newOutputStream((FileChannelImpl) ch); return new ChannelOutputStream(ch); }
13,271
LookAndFeelInfo(String name, String clazz) { this.name = name; this.clazz = clazz; }
public LookAndFeelInfo(String name, String clazz) { this.name = name; this.clazz = clazz; }
13,273
String getClassName() { return clazz; }
public String getClassName() { return clazz; }
13,274
String getName() { return name; }
public String getName() { return name; }
13,275
public static Dimension getDimension(Object key) { System.out.println("UIManager.getDim"); return new Dimension(200,100); }
public static Dimension getDimension(Object key) { System.out.println("UIManager.getDim"); return new Dimension(200,100); }
13,276
public Dimension preferredLayoutSize ( Container c ) { Dimension p = super.preferredLayoutSize(c); return p; }
public Dimension preferredLayoutSize ( Container c ) { Dimension p = super.preferredLayoutSize(c); return p; }
13,277
JRootPane() { setLayout(createRootLayout()); setBackground(UIManager.getColor("control")); getGlassPane(); getLayeredPane(); getContentPane(); setDoubleBuffered(true); updateUI(); }
JRootPane() { setLayout(createRootLayout()); getGlassPane(); getLayeredPane(); getContentPane(); setDoubleBuffered(true); updateUI(); }
13,278
JComponent createContentPane() { JPanel p = new JPanel(); p.setName(this.getName()+".contentPane"); p.setLayout(new BorderLayout()); // p.setVisible(true); System.out.println("Created ContentPane: " + p); return p; }
JComponent createContentPane() { JPanel p = new JPanel(); p.setName(this.getName()+".contentPane"); p.setLayout(new BorderLayout()); // p.setVisible(true); return p; }
13,279
Component createGlassPane() { JPanel p = new JPanel(); p.setName(this.getName()+".glassPane"); p.setLayout(new BorderLayout()); p.setVisible(false); System.out.println("created the glasspane: "+p); return p; }
Component createGlassPane() { JPanel p = new JPanel(); p.setName(this.getName()+".glassPane"); p.setLayout(new BorderLayout()); p.setVisible(false); return p; }
13,280
void setJMenuBar(JMenuBar m) { menuBar = m; }
void setJMenuBar(JMenuBar m) { menuBar = m; getLayeredPane().add(menuBar, JLayeredPane.FRAME_CONTENT_LAYER); }
13,282
public FSEntryIterator(INode iNode) { //this.iNode = iNode; lastBlockIndex = -1; blockIndex = 0; //the byte index where the directory parsing has reached index=0; //the Ext2DirectoryRecord that has been read last current = null; log.debug("FSEntryIterator()"); }
public FSEntryIterator(INode iNode) { //this.iNode = iNode; lastBlockIndex = -1; blockIndex = 0; //the byte index where the directory parsing has reached index=0; //the Ext2DirectoryRecord that has been read last current = null; log.debug("FSEntryIterator()"); }
13,283
public boolean hasNext() { log.debug("FSEntryIterator.hasNext()"); if(noMoreEntries) return false; if(index>=iNode.getSize()) return false; //read the inode number of the next entry: blockIndex = Ext2Directory.this.translateToBlock( index ); blockOffset= Ext2Directory.this.translateToOffset( index ); try{ //read a new block if needed if(blockIndex != lastBlockIndex) { blockData = iNode.getDataBlock(blockIndex); lastBlockIndex = blockIndex; } //get the next directory record Ext2DirectoryRecord dr = new Ext2DirectoryRecord(blockData, blockOffset); index+=dr.getRecLen(); //inode nr=0 means the end of the directory if(dr.getINodeNr()!=0) { current = dr; return true; } else { log.debug("FSEntryIterator.hasNext(): null inode"); current = null; noMoreEntries=true; return false; } }catch(IOException e) { return false; } }
public boolean hasNext() { log.debug("FSEntryIterator.hasNext()"); if(noMoreEntries) return false; if(index>=iNode.getSize()) return false; //read the inode number of the next entry: blockIndex = Ext2Directory.this.translateToBlock( index ); blockOffset= Ext2Directory.this.translateToOffset( index ); try{ //read a new block if needed if(blockIndex != lastBlockIndex) { blockData = iNode.getDataBlock(blockIndex); lastBlockIndex = blockIndex; } //get the next directory record Ext2DirectoryRecord dr = new Ext2DirectoryRecord(blockData, blockOffset); index+=dr.getRecLen(); //inode nr=0 means the end of the directory if(dr.getINodeNr()!=0) { current = dr; return true; } else { log.debug("FSEntryIterator.hasNext(): null inode"); current = null; noMoreEntries=true; return false; } }catch(IOException e) { return false; } }
13,284
public boolean hasNext() { log.debug("FSEntryIterator.hasNext()"); if(noMoreEntries) return false; if(index>=iNode.getSize()) return false; //read the inode number of the next entry: blockIndex = Ext2Directory.this.translateToBlock( index ); blockOffset= Ext2Directory.this.translateToOffset( index ); try{ //read a new block if needed if(blockIndex != lastBlockIndex) { blockData = iNode.getDataBlock(blockIndex); lastBlockIndex = blockIndex; } //get the next directory record Ext2DirectoryRecord dr = new Ext2DirectoryRecord(blockData, blockOffset); index+=dr.getRecLen(); //inode nr=0 means the end of the directory if(dr.getINodeNr()!=0) { current = dr; return true; } else { log.debug("FSEntryIterator.hasNext(): null inode"); current = null; noMoreEntries=true; return false; } }catch(IOException e) { return false; } }
public boolean hasNext() { log.debug("FSEntryIterator.hasNext()"); if(noMoreEntries) return false; if(index>=iNode.getSize()) return false; //read the inode number of the next entry: blockIndex = Ext2Directory.this.translateToBlock( index ); blockOffset= Ext2Directory.this.translateToOffset( index ); try{ //read a new block if needed if(blockIndex != lastBlockIndex) { blockData = iNode.getDataBlock(blockIndex); lastBlockIndex = blockIndex; } //get the next directory record Ext2DirectoryRecord dr = new Ext2DirectoryRecord(blockData, blockOffset); index+=dr.getRecLen(); //inode nr=0 means the end of the directory if(dr.getINodeNr()!=0) { current = dr; return true; } else { log.debug("FSEntryIterator.hasNext(): null inode"); current = null; noMoreEntries=true; return false; } }catch(IOException e) { return false; } }
13,285
public Object next() { log.debug("FSEntryIterator.next()"); if(current == null) { //hasNext actually reads the next element if(!hasNext()) throw new NoSuchElementException(); } Ext2DirectoryRecord dr = current; current = null; try{ return new Ext2Entry( ((Ext2FileSystem)getFileSystem()).getINode(dr.getINodeNr()), dr.getName(), dr.getType() ); }catch(IOException e) { throw new NoSuchElementException(); }catch(FileSystemException e) { throw new NoSuchElementException(); } }
public Object next() { if(current == null) { //hasNext actually reads the next element if(!hasNext()) throw new NoSuchElementException(); } Ext2DirectoryRecord dr = current; current = null; try{ return new Ext2Entry( ((Ext2FileSystem)getFileSystem()).getINode(dr.getINodeNr()), dr.getName(), dr.getType() ); }catch(IOException e) { throw new NoSuchElementException(); }catch(FileSystemException e) { throw new NoSuchElementException(); } }
13,286
public Object next() { log.debug("FSEntryIterator.next()"); if(current == null) { //hasNext actually reads the next element if(!hasNext()) throw new NoSuchElementException(); } Ext2DirectoryRecord dr = current; current = null; try{ return new Ext2Entry( ((Ext2FileSystem)getFileSystem()).getINode(dr.getINodeNr()), dr.getName(), dr.getType() ); }catch(IOException e) { throw new NoSuchElementException(); }catch(FileSystemException e) { throw new NoSuchElementException(); } }
public Object next() { log.debug("FSEntryIterator.next()"); if(current == null) { //hasNext actually reads the next element if(!hasNext()) throw new NoSuchElementException(); } Ext2DirectoryRecord dr = current; current = null; try{ return new Ext2Entry( ((Ext2FileSystem)getFileSystem()).getINode(dr.getINodeNr()), dr.getName(), dr.getType(), fs ); }catch(IOException e) { throw new NoSuchElementException(); }catch(FileSystemException e) { throw new NoSuchElementException(); } }
13,287
public Object next() { log.debug("FSEntryIterator.next()"); if(current == null) { //hasNext actually reads the next element if(!hasNext()) throw new NoSuchElementException(); } Ext2DirectoryRecord dr = current; current = null; try{ return new Ext2Entry( ((Ext2FileSystem)getFileSystem()).getINode(dr.getINodeNr()), dr.getName(), dr.getType() ); }catch(IOException e) { throw new NoSuchElementException(); }catch(FileSystemException e) { throw new NoSuchElementException(); } }
public Object next() { log.debug("FSEntryIterator.next()"); if(current == null) { //hasNext actually reads the next element if(!hasNext()) throw new NoSuchElementException("Root cause: "+e.getMessage()); } Ext2DirectoryRecord dr = current; current = null; try{ return new Ext2Entry( ((Ext2FileSystem)getFileSystem()).getINode(dr.getINodeNr()), dr.getName(), dr.getType() ); }catch(IOException e) { throw new NoSuchElementException("Root cause: "+e.getMessage()); }catch(FileSystemException e) { throw new NoSuchElementException("Root cause: "+e.getMessage()); } }
13,288
public Ext2Directory(INode iNode) { this.iNode=iNode; valid=true; }
public Ext2Directory(INode iNode, Ext2FileSystem fs) { this.iNode=iNode; valid=true; }
13,289
public FSEntry addDirectory(String name) throws IOException { throw new IOException("EXT2 implementation is currently readonly"); }
public FSEntry addDirectory(String name) throws IOException { if(getMode()==Ext2FileSystem.RO) throw new IOException("Filesystem or directory is mounted read-only!"); INode newINode; Ext2DirectoryRecord dr; try{ int rights = 0xFFFF & (Ext2Constants.EXT2_S_IRWXU | Ext2Constants.EXT2_S_IRWXG | Ext2Constants.EXT2_S_IRWXO); newINode = fs.createINode((int)iNode.getGroup(), Ext2Constants.EXT2_S_IFDIR, rights, 0, 0); dr = new Ext2DirectoryRecord(newINode.getINodeNr(), Ext2Constants.EXT2_FT_DIR, name); }catch(FileSystemException fse) { throw new IOException(fse); } try{ addDirectoryRecord(dr); }catch(FileSystemException fse) { throw new IOException(fse); } return new Ext2Entry(newINode, name, Ext2Constants.EXT2_FT_REG_FILE, fs); }
13,291
public FSEntry addFile(String name) throws IOException { throw new IOException("EXT2 implementation is currently readonly"); }
public FSEntry addFile(String name) throws IOException { if(getMode()==Ext2FileSystem.RO) throw new IOException("Filesystem or directory is mounted read-only!"); INode newINode; Ext2DirectoryRecord dr; try{ int rights = 0xFFFF & (Ext2Constants.EXT2_S_IRWXU | Ext2Constants.EXT2_S_IRWXG | Ext2Constants.EXT2_S_IRWXO); newINode = fs.createINode((int)iNode.getGroup(), Ext2Constants.EXT2_S_IFREG, rights, 0, 0); dr = new Ext2DirectoryRecord(newINode.getINodeNr(), Ext2Constants.EXT2_FT_REG_FILE, name); }catch(FileSystemException fse) { throw new IOException(fse); } try{ addDirectoryRecord(dr); }catch(FileSystemException fse) { throw new IOException(fse); } return new Ext2Entry(newINode, name, Ext2Constants.EXT2_FT_REG_FILE, fs); }
13,292
public FSEntry getEntry(String name) { //parse the directory and search for the file Iterator iterator=iterator(); while(iterator.hasNext()) { FSEntry entry = (FSEntry)iterator.next(); if(entry.getName().equals(name)) return entry; } return null; }
public FSEntry getEntry(String name) throws IOException{ //parse the directory and search for the file Iterator iterator=iterator(); while(iterator.hasNext()) { FSEntry entry = (FSEntry)iterator.next(); if(entry.getName().equals(name)) return entry; } return null; }
13,293
public Iterator iterator() { log.debug("Ext2Directory.Iterator()"); return new FSEntryIterator(iNode); }
public Iterator iterator() throws IOException { log.debug("Ext2Directory.Iterator()"); return new FSEntryIterator(iNode); }
13,294
public void remove(String name) throws IOException { throw new IOException("EXT2 implementation is currently readonly"); }
public void remove(String name) throws IOException { if(getMode()==Ext2FileSystem.RO) throw new IOException("Filesystem or directory is mounted read-only!"); throw new IOException("remove not yet implemented"); }
13,295
public Ext2DirectoryRecord(byte[] data, int offset) { iNodeNr = (int) Ext2Utils.get32(data, offset); recLen = Ext2Utils.get16(data, offset + 4); nameLen = Ext2Utils.get8(data, offset + 6); type = Ext2Utils.get8(data, offset + 7); name = new StringBuffer(); if (iNodeNr != 0) { //XXX character conversion for (int i = 0; i < nameLen; i++) name.append((char) Ext2Utils.get8(data, offset + 8 + i)); log.debug("Ext2DirectoryRecord(): iNode=" + iNodeNr + ", name=" + name); } }
public Ext2DirectoryRecord(byte[] data, int offset) { iNodeNr = (int) Ext2Utils.get32(data, offset); recLen = Ext2Utils.get16(data, offset + 4); nameLen = Ext2Utils.get8(data, offset + 6); type = Ext2Utils.get8(data, offset + 7); name = new StringBuffer(); if (iNodeNr != 0) { //XXX character conversion for (int i = 0; i < nameLen; i++) name.append((char) Ext2Utils.get8(data, offset + 8 + i)); log.debug("Ext2DirectoryRecord(): iNode=" + iNodeNr + ", name=" + name); } }
13,296
public int getRecLen() { return recLen; }
public int getRecLen() { return Ext2Utils.get16(data, offset+4); }
13,297
public int getINodeNr() { return iNodeNr; }
public int getINodeNr() { return (int)Ext2Utils.get32(data, offset); }
13,298
public short getType() { return type; }
public short getType() { return type; }
13,300
static void updateComponentTreeUI(JFrame comp) { }
static void updateComponentTreeUI(JFrame comp) { }
13,301
public Object put(Object reason, Object severity) { if (reason == null) throw new NullPointerException("reason is null"); if (severity == null) throw new NullPointerException("severity is null"); return put((PrinterStateReason) reason, (Severity) severity); }
public Object put(Object reason, Object severity) { if (reason == null) throw new NullPointerException("reason is null"); if (severity == null) throw new NullPointerException("severity is null"); return super.put((PrinterStateReason) reason, (Severity) severity); }
13,302
private void updateLFN() { //System.out.println("Update LFN"); Iterator allEntries = shortNameIndex.values().iterator(); Vector destination = new Vector(); while (allEntries.hasNext()) { LfnEntry currentEntry = (LfnEntry)allEntries.next(); FatBasicDirEntry[] encoded = currentEntry.compactForm(); for (int i = 0; i < encoded.length; i++) { destination.add(encoded[i]); } } int size = destination.size(); for (int i = 0; i < size; i++) { entries.set(i, destination.get(i)); } int entireSize = entries.size(); for (int i = size; i < entireSize; i++) { entries.set(i, null); // remove stale entries } }
private void updateLFN() throws IOException{ //System.out.println("Update LFN"); Iterator allEntries = shortNameIndex.values().iterator(); Vector destination = new Vector(); while (allEntries.hasNext()) { LfnEntry currentEntry = (LfnEntry)allEntries.next(); FatBasicDirEntry[] encoded = currentEntry.compactForm(); for (int i = 0; i < encoded.length; i++) { destination.add(encoded[i]); } } int size = destination.size(); for (int i = 0; i < size; i++) { entries.set(i, destination.get(i)); } int entireSize = entries.size(); for (int i = size; i < entireSize; i++) { entries.set(i, null); // remove stale entries } }
13,303
private void updateLFN() { //System.out.println("Update LFN"); Iterator allEntries = shortNameIndex.values().iterator(); Vector destination = new Vector(); while (allEntries.hasNext()) { LfnEntry currentEntry = (LfnEntry)allEntries.next(); FatBasicDirEntry[] encoded = currentEntry.compactForm(); for (int i = 0; i < encoded.length; i++) { destination.add(encoded[i]); } } int size = destination.size(); for (int i = 0; i < size; i++) { entries.set(i, destination.get(i)); } int entireSize = entries.size(); for (int i = size; i < entireSize; i++) { entries.set(i, null); // remove stale entries } }
private void updateLFN() { //System.out.println("Update LFN"); Iterator allEntries = shortNameIndex.values().iterator(); Vector destination = new Vector(); while (allEntries.hasNext()) { LfnEntry currentEntry = (LfnEntry)allEntries.next(); FatBasicDirEntry[] encoded = currentEntry.compactForm(); for (int i = 0; i < encoded.length; i++) { destination.add(encoded[i]); } } final int size = destination.size(); if(entries.size()<size){ if (!canChangeSize(size)) { throw new IOException("Directory is full"); } } boolean useAdd=false; for (int i = 0; i < size; i++) { entries.set(i, destination.get(i)); } int entireSize = entries.size(); for (int i = size; i < entireSize; i++) { entries.set(i, null); // remove stale entries } }
13,304
private void updateLFN() { //System.out.println("Update LFN"); Iterator allEntries = shortNameIndex.values().iterator(); Vector destination = new Vector(); while (allEntries.hasNext()) { LfnEntry currentEntry = (LfnEntry)allEntries.next(); FatBasicDirEntry[] encoded = currentEntry.compactForm(); for (int i = 0; i < encoded.length; i++) { destination.add(encoded[i]); } } int size = destination.size(); for (int i = 0; i < size; i++) { entries.set(i, destination.get(i)); } int entireSize = entries.size(); for (int i = size; i < entireSize; i++) { entries.set(i, null); // remove stale entries } }
private void updateLFN() { //System.out.println("Update LFN"); Iterator allEntries = shortNameIndex.values().iterator(); Vector destination = new Vector(); while (allEntries.hasNext()) { LfnEntry currentEntry = (LfnEntry)allEntries.next(); FatBasicDirEntry[] encoded = currentEntry.compactForm(); for (int i = 0; i < encoded.length; i++) { destination.add(encoded[i]); } } int size = destination.size(); for (int i = 0; i < size; i++) { if(!useAdd){ try{ entries.set(i, destination.get(i)); }catch(ArrayIndexOutOfBoundsException aEx){ useAdd=true; } } if(useAdd){ entries.add(i, destination.get(i)); } } int entireSize = entries.size(); for (int i = size; i < entireSize; i++) { entries.set(i, null); // remove stale entries } }
13,305
private void updateLFN() { //System.out.println("Update LFN"); Iterator allEntries = shortNameIndex.values().iterator(); Vector destination = new Vector(); while (allEntries.hasNext()) { LfnEntry currentEntry = (LfnEntry)allEntries.next(); FatBasicDirEntry[] encoded = currentEntry.compactForm(); for (int i = 0; i < encoded.length; i++) { destination.add(encoded[i]); } } int size = destination.size(); for (int i = 0; i < size; i++) { entries.set(i, destination.get(i)); } int entireSize = entries.size(); for (int i = size; i < entireSize; i++) { entries.set(i, null); // remove stale entries } }
private void updateLFN() { //System.out.println("Update LFN"); Iterator allEntries = shortNameIndex.values().iterator(); Vector destination = new Vector(); while (allEntries.hasNext()) { LfnEntry currentEntry = (LfnEntry)allEntries.next(); FatBasicDirEntry[] encoded = currentEntry.compactForm(); for (int i = 0; i < encoded.length; i++) { destination.add(encoded[i]); } } int size = destination.size(); for (int i = 0; i < size; i++) { entries.set(i, destination.get(i)); } final int entireSize = entries.size(); for (int i = size; i < entireSize; i++) { entries.set(i, null); // remove stale entries } }
13,306
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { comp.addNotify(); if (comp.isLightweight()) enableEvents(comp.eventMask); } invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } }
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { comp.addNotify(); if (comp.isLightweight()) enableEvents(comp.eventMask); } invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } }
13,308
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { comp.addNotify(); if (comp.isLightweight()) enableEvents(comp.eventMask); } invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } }
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { comp.addNotify(); if (comp.isLightweight()) enableEvents(comp.eventMask); } invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } }
13,309
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { comp.addNotify(); if (comp.isLightweight()) enableEvents(comp.eventMask); } invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } }
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { comp.addNotify(); if (comp.isLightweight()) enableEvents(comp.eventMask); } if (component == null) component = new Component[4]; if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } }
13,310
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { comp.addNotify(); if (comp.isLightweight()) enableEvents(comp.eventMask); } invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } }
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { comp.addNotify(); if (comp.isLightweight()) enableEvents(comp.eventMask); } invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } }
13,311
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { comp.addNotify(); if (comp.isLightweight()) enableEvents(comp.eventMask); } invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } }
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { comp.addNotify(); if (comp.isLightweight()) enableEvents(comp.eventMask); } invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } }
13,312
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { comp.addNotify(); if (comp.isLightweight()) enableEvents(comp.eventMask); } invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } }
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { comp.addNotify(); if (comp.isLightweight()) enableEvents(comp.eventMask); } invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } }
13,313
public void addNotify() { addNotifyContainerChildren(); super.addNotify(); }
public void addNotify() { addNotifyContainerChildren(); super.addNotify(); }
13,314
private void addNotifyContainerChildren() { synchronized (getTreeLock()) { for (int i = ncomponents; --i >= 0;) { component[i].addNotify(); if (component[i].isLightweight()) enableEvents(component[i].eventMask); } } }
private void addNotifyContainerChildren() { synchronized (getTreeLock()) { for (int i = ncomponents; --i >= 0;) { component[i].addNotify(); if (component[i].isLightweight()) enableEvents(component[i].eventMask); } } }
13,315
public void addPropertyChangeListener(PropertyChangeListener l) { }
public void addPropertyChangeListener(PropertyChangeListener l) { }
13,316
public void applyComponentOrientation(ComponentOrientation o) { if (orientation == null) throw new NullPointerException(); }
public void applyComponentOrientation(ComponentOrientation o) { if (orientation == null) throw new NullPointerException(); }
13,317
public int countComponents() { return getComponentCount(); }
public int countComponents() { return getComponentCount(); }
13,318
void dispatchEventImpl(AWTEvent e) { if ((e.id <= ContainerEvent.CONTAINER_LAST && e.id >= ContainerEvent.CONTAINER_FIRST) && (containerListener != null || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
void dispatchEventImpl(AWTEvent e) { if ((e.id <= ContainerEvent.CONTAINER_LAST && e.id >= ContainerEvent.CONTAINER_FIRST) && (containerListener != null || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
13,319
public void doLayout() { if (layoutMgr != null) layoutMgr.layoutContainer(this); }
public void doLayout() { if (layoutMgr != null) layoutMgr.layoutContainer(this); }
13,320
public Component getComponentAt(int x, int y) { synchronized (getTreeLock()) { if (!contains(x, y)) return null; for (int i = 0; i < ncomponents; ++i) { // Ignore invisible children... if (!component[i].isVisible()) continue; int x2 = x - component[i].x; int y2 = y - component[i].y; if (component[i].contains(x2, y2)) return component[i]; } return this; } }
public Component getComponentAt(int x, int y) { synchronized (getTreeLock()) { if (!contains(x, y)) return null; for (int i = 0; i < ncomponents; ++i) { // Ignore invisible children... if (!component[i].isVisible()) continue; int x2 = x - component[i].x; int y2 = y - component[i].y; if (component[i].contains(x2, y2)) return component[i]; } return this; } }
13,321
public int getComponentCount() { return ncomponents; }
public int getComponentCount() { return ncomponents; }
13,322
public Insets getInsets() { if (peer == null) return new Insets(0, 0, 0, 0); return ((ContainerPeer) peer).getInsets(); }
public Insets getInsets() { if (peer == null) return new Insets(0, 0, 0, 0); return ((ContainerPeer) peer).getInsets(); }
13,323
public Dimension getMinimumSize() { if (layoutMgr != null) return layoutMgr.minimumLayoutSize(this); else return super.getMinimumSize(); }
public Dimension getMinimumSize() { if (layoutMgr != null) return layoutMgr.minimumLayoutSize(this); else return super.getMinimumSize(); }
13,324
public Dimension getPreferredSize() { if (layoutMgr != null) return layoutMgr.preferredLayoutSize(this); else return super.getPreferredSize(); }
public Dimension getPreferredSize() { if (layoutMgr != null) return layoutMgr.preferredLayoutSize(this); else return super.getPreferredSize(); }
13,325
public Insets insets() { return getInsets(); }
public Insets insets() { return getInsets(); }
13,326
public void layout() { doLayout(); }
public void layout() { doLayout(); }
13,327
public Component locate(int x, int y) { return getComponentAt(x, y); }
public Component locate(int x, int y) { return getComponentAt(x, y); }
13,328
public Dimension minimumSize() { return getMinimumSize(); }
public Dimension minimumSize() { return getMinimumSize(); }
13,329
public void paint(Graphics g) { if (!isShowing()) return; super.paint(g); visitChildren(g, GfxPaintVisitor.INSTANCE, true); }
public void paint(Graphics g) { if (!isShowing()) return; super.paint(g); visitChildren(g, GfxPaintVisitor.INSTANCE, true); }
13,330
public Dimension preferredSize() { return getPreferredSize(); }
public Dimension preferredSize() { return getPreferredSize(); }
13,331
public void setFocusTraversalKeys(int id, Set keys) { if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS && id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS && id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS && id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS) throw new IllegalArgumentException(); }
public void setFocusTraversalKeys(int id, Set keys) { if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS && id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS && id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS && id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS) throw new IllegalArgumentException(); }
13,332
public void validate() { synchronized (getTreeLock()) { if (!isValid()) { validateTree(); } } }
public void validate() { synchronized (getTreeLock()) { if (!isValid()) { validateTree(); } } }
13,333
private void visitChild(Graphics gfx, GfxVisitor visitor, Component comp) { Rectangle bounds = comp.getBounds(); Rectangle clip = gfx.getClipBounds().intersection(bounds); if (clip.isEmpty()) return; Graphics gfx2 = gfx.create(); gfx2.setClip(clip.x, clip.y, clip.width, clip.height); gfx2.translate(bounds.x, bounds.y); visitor.visit(comp, gfx2); }
private void visitChild(Graphics gfx, GfxVisitor visitor, Component comp) { Rectangle bounds = comp.getBounds(); Rectangle clip = gfx.getClipBounds().intersection(bounds); if (clip.isEmpty()) return; Graphics gfx2 = gfx.create(); gfx2.setClip(clip.x, clip.y, clip.width, clip.height); gfx2.translate(bounds.x, bounds.y); visitor.visit(comp, gfx2); }
13,334
private void visitChild(Graphics gfx, GfxVisitor visitor, Component comp) { Rectangle bounds = comp.getBounds(); Rectangle clip = gfx.getClipBounds().intersection(bounds); if (clip.isEmpty()) return; Graphics gfx2 = gfx.create(); gfx2.setClip(clip.x, clip.y, clip.width, clip.height); gfx2.translate(bounds.x, bounds.y); visitor.visit(comp, gfx2); }
private void visitChild(Graphics gfx, GfxVisitor visitor, Component comp) { Rectangle bounds = comp.getBounds(); Rectangle clip = gfx.getClipBounds().intersection(bounds); if (clip.isEmpty()) return; Graphics gfx2 = gfx.create(); gfx2.setClip(clip.x, clip.y, clip.width, clip.height); gfx2.translate(bounds.x, bounds.y); visitor.visit(comp, gfx2); }
13,335
private void visitChildren(Graphics gfx, GfxVisitor visitor, boolean lightweightOnly) { synchronized (getTreeLock()) { for (int i = 0; i < ncomponents; ++i) { Component comp = component[i]; boolean applicable = comp.isVisible() && (comp.isLightweight() || !lightweightOnly); if (applicable) visitChild(gfx, visitor, comp); } } }
private void visitChildren(Graphics gfx, GfxVisitor visitor, boolean lightweightOnly) { synchronized (getTreeLock()) { for (int i = 0; i < ncomponents; ++i) { Component comp = component[i]; boolean applicable = comp.isVisible() && (comp.isLightweight() || !lightweightOnly); if (applicable) visitChild(gfx, visitor, comp); } } }
13,336
LightweightDispatcher(Container c) { }
LightweightDispatcher(Container c) { }
13,337
void enableEvents(long l) { }
void enableEvents(long l) { }
13,338
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) { // a disabled scrollbar has no thumb in the metal look and feel if (!c.isEnabled()) return; // first we fill the background g.setColor(thumbColor); g.fillRect(thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height); // draw the outer dark line int hAdj = 1; int wAdj = 1; if (scrollbar.getOrientation() == HORIZONTAL) hAdj++; else wAdj++; g.setColor(new Color(102, 102, 153)); g.drawRect(thumbBounds.x, thumbBounds.y, thumbBounds.width - wAdj, thumbBounds.height - hAdj); // draw the inner light line g.setColor(thumbHighlightColor); g.drawLine(thumbBounds.x + 1, thumbBounds.y + 1, thumbBounds.x + thumbBounds.width - 2, thumbBounds.y + 1); g.drawLine(thumbBounds.x + 1, thumbBounds.y + 1, thumbBounds.x + 1, thumbBounds.y + thumbBounds.height - 2); // draw the shadow line UIDefaults def = UIManager.getLookAndFeelDefaults(); g.setColor(def.getColor("ScrollBar.shadow")); g.drawLine(thumbBounds.x + 1, thumbBounds.y + thumbBounds.height, thumbBounds.x + thumbBounds.width, thumbBounds.y + thumbBounds.height); // draw the pattern MetalUtils.fillMetalPattern(g, thumbBounds.x + 3, thumbBounds.y + 3, thumbBounds.width - 6, thumbBounds.height - 6, thumbHighlightColor, new Color(102, 102, 153)); }
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) { // a disabled scrollbar has no thumb in the metal look and feel if (!c.isEnabled()) return; // first we fill the background g.setColor(thumbColor); g.fillRect(thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height); // draw the outer dark line int hAdj = 1; int wAdj = 1; if (scrollbar.getOrientation() == HORIZONTAL) hAdj++; else wAdj++; g.setColor(new Color(102, 102, 153)); g.drawRect(thumbBounds.x, thumbBounds.y, thumbBounds.width - wAdj, thumbBounds.height - hAdj); // draw the inner light line g.setColor(thumbHighlightColor); g.drawLine(thumbBounds.x + 1, thumbBounds.y + 1, thumbBounds.x + thumbBounds.width - 2, thumbBounds.y + 1); g.drawLine(thumbBounds.x + 1, thumbBounds.y + 1, thumbBounds.x + 1, thumbBounds.y + thumbBounds.height - 2); // draw the shadow line UIDefaults def = UIManager.getLookAndFeelDefaults(); g.setColor(def.getColor("ScrollBar.shadow")); g.drawLine(thumbBounds.x + 1, thumbBounds.y + thumbBounds.height, thumbBounds.x + thumbBounds.width, thumbBounds.y + thumbBounds.height); // draw the pattern MetalUtils.fillMetalPattern(c, g, thumbBounds.x + 3, thumbBounds.y + 3, thumbBounds.width - 6, thumbBounds.height - 6, thumbHighlightColor, new Color(102, 102, 153)); }
13,340
public ImageWriteParam(Locale locale) { this.locale = locale; }
protected ImageWriteParam() { this.locale = locale; }
13,357
public ImageWriteParam(Locale locale) { this.locale = locale; }
public ImageWriteParam(Locale locale) { }
13,358
public void connect() throws IOException { if (connected) { return; } String host = url.getHost(); int port = url.getPort(); String username = url.getUserInfo(); String password = null; if (username != null) { int ci = username.indexOf(':'); if (ci != -1) { password = username.substring(ci + 1); username = username.substring(0, ci); } } else { username = "anonymous"; PrivilegedAction a = new GetSystemPropertyAction("user.name"); String systemUsername =(String) AccessController.doPrivileged(a); a = new GetLocalHostAction(); InetAddress localhost =(InetAddress) AccessController.doPrivileged(a); password = systemUsername + "@" + ((localhost == null) ? "localhost" : localhost.getHostName()); } connection = new FTPConnection(host, port); if (!connection.authenticate(username, password)) { throw new SecurityException("Authentication failed"); } connection.setPassive(passive); if (representationType != -1) { connection.setRepresentationType(representationType); } if (fileStructure != -1) { connection.setFileStructure(fileStructure); } if (transferMode != -1) { connection.setTransferMode(transferMode); } }
public void connect() throws IOException { if (connected) { return; } String host = url.getHost(); int port = url.getPort(); String username = url.getUserInfo(); String password = null; if (username != null) { int ci = username.indexOf(':'); if (ci != -1) { password = username.substring(ci + 1); username = username.substring(0, ci); } } else { username = "anonymous"; PrivilegedAction a = new GetPropertyAction("user.name"); String systemUsername =(String) AccessController.doPrivileged(a); a = new GetLocalHostAction(); InetAddress localhost =(InetAddress) AccessController.doPrivileged(a); password = systemUsername + "@" + ((localhost == null) ? "localhost" : localhost.getHostName()); } connection = new FTPConnection(host, port); if (!connection.authenticate(username, password)) { throw new SecurityException("Authentication failed"); } connection.setPassive(passive); if (representationType != -1) { connection.setRepresentationType(representationType); } if (fileStructure != -1) { connection.setFileStructure(fileStructure); } if (transferMode != -1) { connection.setTransferMode(transferMode); } }
13,359
public String getApproveButtonText(JFileChooser fc) { if (fc.getApproveButtonText() != null) return fc.getApproveButtonText(); else if (fc.getDialogType() == JFileChooser.SAVE_DIALOG) return saveButtonText; else return openButtonText; }
public String getApproveButtonText(JFileChooser fc) { if (fc.getApproveButtonText() != null) return fc.getApproveButtonText(); else if (fc.getDialogType() == JFileChooser.SAVE_DIALOG) return saveButtonText; else return openButtonText; }
13,360
public FileView getFileView(JFileChooser fc) { if (fc.getFileView() != null) return fc.getFileView(); return fv; }
public FileView getFileView(JFileChooser fc) { if (fc.getFileView() != null) return fc.getFileView(); return fv; }
13,361
public Node adoptNode(Node source) { switch (source.getNodeType()) { case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR); case ENTITY_NODE: case NOTATION_NODE: throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } if (source instanceof DomNode) { DomNode src = (DomNode) source; DomNode dst = src; if (dst.parent != null) { dst = (DomNode) dst.cloneNode(true); } dst.setOwner(this); src.notifyUserDataHandlers(UserDataHandler.NODE_ADOPTED, src, dst); return dst; } return null; }
public Node adoptNode(Node source) { int sourceNodeType = source.getNodeType(); switch (sourceNodeType) { case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR); case ENTITY_NODE: case NOTATION_NODE: throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } if (source instanceof DomNode) { DomNode src = (DomNode) source; DomNode dst = src; if (dst.parent != null) { dst = (DomNode) dst.cloneNode(true); } dst.setOwner(this); src.notifyUserDataHandlers(UserDataHandler.NODE_ADOPTED, src, dst); return dst; } return null; }
13,363
public Node adoptNode(Node source) { switch (source.getNodeType()) { case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR); case ENTITY_NODE: case NOTATION_NODE: throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } if (source instanceof DomNode) { DomNode src = (DomNode) source; DomNode dst = src; if (dst.parent != null) { dst = (DomNode) dst.cloneNode(true); } dst.setOwner(this); src.notifyUserDataHandlers(UserDataHandler.NODE_ADOPTED, src, dst); return dst; } return null; }
public Node adoptNode(Node source) { switch (source.getNodeType()) { case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR); case ENTITY_NODE: case NOTATION_NODE: throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } if (source instanceof DomNode) { DomNode src = (DomNode) source; DomNode dst = src; if (dst.parent != null) { dst = (DomNode) dst.cloneNode(true); } dst.setOwner(this); src.notifyUserDataHandlers(UserDataHandler.NODE_ADOPTED, src, dst); return dst; } else { Node dst = null; switch (sourceNodeType) { case Node.ATTRIBUTE_NODE: { Attr src = (Attr) source; String nodeName = src.getNodeName(); String localName = src.getLocalName(); String namespaceUri = src.getNamespaceURI(); dst = (localName == null) ? createAttribute(nodeName) : createAttributeNS(namespaceUri, nodeName); adoptChildren(src, dst); break; } case Node.CDATA_SECTION_NODE: { CDATASection src = (CDATASection) source; dst = createCDATASection(src.getData()); break; } case Node.COMMENT_NODE: { Comment src = (Comment) source; dst = createComment(src.getData()); break; } case Node.DOCUMENT_FRAGMENT_NODE: { DocumentFragment src = (DocumentFragment) source; dst = createDocumentFragment(); adoptChildren(src, dst); break; } case Node.ELEMENT_NODE: { Element src = (Element) source; String nodeName = src.getNodeName(); String localName = src.getLocalName(); String namespaceUri = src.getNamespaceURI(); dst = (localName == null) ? createElement(nodeName) : createElementNS(namespaceUri, nodeName); adoptAttributes(src, dst); adoptChildren(src, dst); break; } case Node.ENTITY_REFERENCE_NODE: { EntityReference src = (EntityReference) source; dst = createEntityReference(src.getNodeName()); adoptChildren(src, dst); break; } case Node.PROCESSING_INSTRUCTION_NODE: { ProcessingInstruction src = (ProcessingInstruction) source; dst = createProcessingInstruction(src.getTarget(), src.getData()); break; } case Node.TEXT_NODE: { Text src = (Text) source; dst = createTextNode(src.getData()); break; } } return dst; } }
13,364
public synchronized StringBuffer delete(int start, int end) { if (start < 0 || start > count || start > end) throw new StringIndexOutOfBoundsException(start); if (end > count) end = count; // This will unshare if required. ensureCapacity_unsynchronized(count); if (count - end != 0) System.arraycopy(value, end, value, start, count - end); count -= end - start; return this; }
public synchronized StringBuffer delete(int start, int end) { if (start < 0 || start > count || start > end) throw new StringIndexOutOfBoundsException(start); if (end > count) end = count; // This will unshare if required. ensureCapacity_unsynchronized(count); if (count - end != 0) VMSystem.arraycopy(value, end, value, start, count - end); count -= end - start; return this; }
13,365
private void ensureCapacity_unsynchronized(int minimumCapacity) { if (shared || minimumCapacity > value.length) { // We don't want to make a larger vector when `shared' is // set. If we do, then setLength becomes very inefficient // when repeatedly reusing a StringBuffer in a loop. int max = (minimumCapacity > value.length ? value.length * 2 + 2 : value.length); minimumCapacity = (minimumCapacity < max ? max : minimumCapacity); char[] nb = new char[minimumCapacity]; System.arraycopy(value, 0, nb, 0, count); value = nb; shared = false; } }
private void ensureCapacity_unsynchronized(int minimumCapacity) { if (shared || minimumCapacity > value.length) { // We don't want to make a larger vector when `shared' is // set. If we do, then setLength becomes very inefficient // when repeatedly reusing a StringBuffer in a loop. int max = (minimumCapacity > value.length ? value.length * 2 + 2 : value.length); minimumCapacity = (minimumCapacity < max ? max : minimumCapacity); char[] nb = new char[minimumCapacity]; VMSystem.arraycopy(value, 0, nb, 0, count); value = nb; shared = false; } }
13,366
public synchronized void getChars(int srcOffset, int srcEnd, char[] dst, int dstOffset) { if (srcOffset < 0 || srcEnd > count || srcEnd < srcOffset) throw new StringIndexOutOfBoundsException(); System.arraycopy(value, srcOffset, dst, dstOffset, srcEnd - srcOffset); }
public synchronized void getChars(int srcOffset, int srcEnd, char[] dst, int dstOffset) { if (srcOffset < 0 || srcEnd > count || srcEnd < srcOffset) throw new StringIndexOutOfBoundsException(); VMSystem.arraycopy(value, srcOffset, dst, dstOffset, srcEnd - srcOffset); }
13,367
public synchronized StringBuffer insert(int offset, char[] str, int str_offset, int len) { if (offset < 0 || offset > count || len < 0 || str_offset < 0 || str_offset > str.length - len) throw new StringIndexOutOfBoundsException(); ensureCapacity_unsynchronized(count + len); System.arraycopy(value, offset, value, offset + len, count - offset); System.arraycopy(str, str_offset, value, offset, len); count += len; return this; }
public synchronized StringBuffer insert(int offset, char[] str, int str_offset, int len) { if (offset < 0 || offset > count || len < 0 || str_offset < 0 || str_offset > str.length - len) throw new StringIndexOutOfBoundsException(); ensureCapacity_unsynchronized(count + len); System.arraycopy(value, offset, value, offset + len, count - offset); System.arraycopy(str, str_offset, value, offset, len); count += len; return this; }
13,368
public synchronized StringBuffer replace(int start, int end, String str) { if (start < 0 || start > count || start > end) throw new StringIndexOutOfBoundsException(start); int len = str.count; // Calculate the difference in 'count' after the replace. int delta = len - (end > count ? count : end) + start; ensureCapacity_unsynchronized(count + delta); if (delta != 0 && end < count) System.arraycopy(value, end, value, end + delta, count - end); str.getChars(0, len, value, start); count += delta; return this; }
public synchronized StringBuffer replace(int start, int end, String str) { if (start < 0 || start > count || start > end) throw new StringIndexOutOfBoundsException(start); int len = str.count; // Calculate the difference in 'count' after the replace. int delta = len - (end > count ? count : end) + start; ensureCapacity_unsynchronized(count + delta); if (delta != 0 && end < count) VMSystem.arraycopy(value, end, value, end + delta, count - end); str.getChars(0, len, value, start); count += delta; return this; }
13,369
private void resolveNeutralTypes() { // This implements rules N1 and N2. final int runCount = getRunCount(); int previousLevel = baseEmbedding; for (int run = 0; run < runCount; ++run) { int start = getRunStart(run); int end = getRunLimit(run); int level = getRunLevel(run); byte embeddingDirection = (((level % 2) == 0) ? Character.DIRECTIONALITY_LEFT_TO_RIGHT : Character.DIRECTIONALITY_RIGHT_TO_LEFT); // These are the names used in the Bidi algorithm. byte sor = (((Math.max(previousLevel, level) % 2) == 0) ? Character.DIRECTIONALITY_LEFT_TO_RIGHT : Character.DIRECTIONALITY_RIGHT_TO_LEFT); int nextLevel; if (run == runCount - 1) nextLevel = baseEmbedding; else nextLevel = getRunLevel(run + 1); byte eor = (((Math.max(level, nextLevel) % 2) == 0) ? Character.DIRECTIONALITY_LEFT_TO_RIGHT : Character.DIRECTIONALITY_RIGHT_TO_LEFT); byte prevStrong = sor; int neutralStart = -1; for (int i = start; i <= end; ++i) { byte newStrong = -1; byte thisType = i == end ? eor : types[i]; switch (thisType) { case Character.DIRECTIONALITY_LEFT_TO_RIGHT: newStrong = Character.DIRECTIONALITY_LEFT_TO_RIGHT; break; case Character.DIRECTIONALITY_RIGHT_TO_LEFT: case Character.DIRECTIONALITY_ARABIC_NUMBER: case Character.DIRECTIONALITY_EUROPEAN_NUMBER: newStrong = Character.DIRECTIONALITY_RIGHT_TO_LEFT; break; case Character.DIRECTIONALITY_BOUNDARY_NEUTRAL: case Character.DIRECTIONALITY_OTHER_NEUTRALS: case Character.DIRECTIONALITY_SEGMENT_SEPARATOR: case Character.DIRECTIONALITY_PARAGRAPH_SEPARATOR: if (neutralStart == -1) neutralStart = i; break; } // If we see a strong character, update all the neutrals. if (newStrong != -1) { if (neutralStart != -1) { byte override = (prevStrong == newStrong ? prevStrong : embeddingDirection); for (int j = neutralStart; j < i; ++j) types[i] = override; } prevStrong = newStrong; neutralStart = -1; } } previousLevel = level; } }
private void resolveNeutralTypes() { // This implements rules N1 and N2. final int runCount = getRunCount(); int previousLevel = baseEmbedding; for (int run = 0; run < runCount; ++run) { int start = getRunStart(run); int end = getRunLimit(run); int level = getRunLevel(run); byte embeddingDirection = (((level % 2) == 0) ? Character.DIRECTIONALITY_LEFT_TO_RIGHT : Character.DIRECTIONALITY_RIGHT_TO_LEFT); // These are the names used in the Bidi algorithm. byte sor = (((Math.max(previousLevel, level) % 2) == 0) ? Character.DIRECTIONALITY_LEFT_TO_RIGHT : Character.DIRECTIONALITY_RIGHT_TO_LEFT); int nextLevel; if (run == runCount - 1) nextLevel = baseEmbedding; else nextLevel = getRunLevel(run + 1); byte eor = (((Math.max(level, nextLevel) % 2) == 0) ? Character.DIRECTIONALITY_LEFT_TO_RIGHT : Character.DIRECTIONALITY_RIGHT_TO_LEFT); byte prevStrong = sor; int neutralStart = -1; for (int i = start; i <= end; ++i) { byte newStrong = -1; byte thisType = i == end ? eor : types[i]; switch (thisType) { case Character.DIRECTIONALITY_LEFT_TO_RIGHT: newStrong = Character.DIRECTIONALITY_LEFT_TO_RIGHT; break; case Character.DIRECTIONALITY_RIGHT_TO_LEFT: case Character.DIRECTIONALITY_ARABIC_NUMBER: case Character.DIRECTIONALITY_EUROPEAN_NUMBER: newStrong = Character.DIRECTIONALITY_RIGHT_TO_LEFT; break; case Character.DIRECTIONALITY_BOUNDARY_NEUTRAL: case Character.DIRECTIONALITY_OTHER_NEUTRALS: case Character.DIRECTIONALITY_SEGMENT_SEPARATOR: case Character.DIRECTIONALITY_PARAGRAPH_SEPARATOR: if (neutralStart == -1) neutralStart = i; break; } // If we see a strong character, update all the neutrals. if (newStrong != -1) { if (neutralStart != -1) { byte override = (prevStrong == newStrong ? prevStrong : embeddingDirection); for (int j = neutralStart; j < i; ++j) types[j] = override; } prevStrong = newStrong; neutralStart = -1; } } previousLevel = level; } }
13,370
public static long getSize(String size) { if((size == null) || size.trim().equals("")) return 0; int multiplier = 1; if(size.endsWith("T")) { multiplier = T; size = size.substring(0, size.length() - 1); } else if(size.endsWith("G")) { multiplier = G; size = size.substring(0, size.length() - 1); } else if(size.endsWith("M")) { multiplier = M; size = size.substring(0, size.length() - 1); } else if(size.endsWith("K")) { multiplier = K; size = size.substring(0, size.length() - 1); } return Long.parseLong(size) * multiplier; }
public static long getSize(String size) { if((size == null) || size.trim().equals("")) return 0; int multiplier = 1; if(size.endsWith("T")) { multiplier = T; size = size.substring(0, size.length() - 1); } else if(size.endsWith("G")) { multiplier = G; size = size.substring(0, size.length() - 1); } else if(size.endsWith("M")) { multiplier = M; size = size.substring(0, size.length() - 1); } else if(size.endsWith("K")) { multiplier = K; size = size.substring(0, size.length() - 1); } return Long.parseLong(size) * multiplier; }
13,371
public static String size(long v) { // Is < 1Kb? if (v < K) { return String.valueOf(v) + "b"; } // Is < 1Mb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "K"; } // Is < 1Gb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "M"; } // Is < 1Tb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "G"; } // Large... v = v >>> 10; return String.valueOf(v) + "T"; }
public static String size(long v) { // Is < 1Kb? if (v < K) { return String.valueOf(v) + "B"; } // Is < 1Mb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "K"; } // Is < 1Gb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "M"; } // Is < 1Tb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "G"; } // Large... v = v >>> 10; return String.valueOf(v) + "T"; }
13,372
public static String size(long v) { // Is < 1Kb? if (v < K) { return String.valueOf(v) + "b"; } // Is < 1Mb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "K"; } // Is < 1Gb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "M"; } // Is < 1Tb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "G"; } // Large... v = v >>> 10; return String.valueOf(v) + "T"; }
public static String size(long v) { // Is < 1Kb? if (v < K) { return String.valueOf(v) + "b"; } // Is < 1Mb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "KB"; } // Is < 1Gb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "M"; } // Is < 1Tb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "G"; } // Large... v = v >>> 10; return String.valueOf(v) + "T"; }
13,373
public static String size(long v) { // Is < 1Kb? if (v < K) { return String.valueOf(v) + "b"; } // Is < 1Mb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "K"; } // Is < 1Gb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "M"; } // Is < 1Tb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "G"; } // Large... v = v >>> 10; return String.valueOf(v) + "T"; }
public static String size(long v) { // Is < 1Kb? if (v < K) { return String.valueOf(v) + "b"; } // Is < 1Mb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "K"; } // Is < 1Gb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "MB"; } // Is < 1Tb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "G"; } // Large... v = v >>> 10; return String.valueOf(v) + "T"; }
13,374
public static String size(long v) { // Is < 1Kb? if (v < K) { return String.valueOf(v) + "b"; } // Is < 1Mb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "K"; } // Is < 1Gb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "M"; } // Is < 1Tb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "G"; } // Large... v = v >>> 10; return String.valueOf(v) + "T"; }
public static String size(long v) { // Is < 1Kb? if (v < K) { return String.valueOf(v) + "b"; } // Is < 1Mb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "K"; } // Is < 1Gb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "M"; } // Is < 1Tb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "GB"; } // Large... v = v >>> 10; return String.valueOf(v) + "T"; }
13,375
public static String size(long v) { // Is < 1Kb? if (v < K) { return String.valueOf(v) + "b"; } // Is < 1Mb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "K"; } // Is < 1Gb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "M"; } // Is < 1Tb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "G"; } // Large... v = v >>> 10; return String.valueOf(v) + "T"; }
public static String size(long v) { // Is < 1Kb? if (v < K) { return String.valueOf(v) + "b"; } // Is < 1Mb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "K"; } // Is < 1Gb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "M"; } // Is < 1Tb? v = v >>> 10; if (v < K) { return String.valueOf(v) + "G"; } // Large... v = v >>> 10; return String.valueOf(v) + "TB"; }
13,376
public boolean desiredAssertionStatus() { ClassLoader c = getClassLoader(); Object status; if (c == null) return VMClassLoader.defaultAssertionStatus(); if (c.classAssertionStatus != null) synchronized (c) { status = c.classAssertionStatus.get(getName()); if (status != null) return status.equals(Boolean.TRUE); } else { status = ClassLoader.StaticData.systemClassAssertionStatus .get(getName()); if (status != null) return status.equals(Boolean.TRUE); } if (c.packageAssertionStatus != null) synchronized (c) { String name = getPackagePortion(getName()); if ("".equals(name)) status = c.packageAssertionStatus.get(null); else do { status = c.packageAssertionStatus.get(name); name = getPackagePortion(name); } while (!"".equals(name) && status == null); if (status != null) return status.equals(Boolean.TRUE); } else { String name = getPackagePortion(getName()); if ("".equals(name)) status = ClassLoader.StaticData.systemPackageAssertionStatus .get(null); else do { status = ClassLoader.StaticData.systemPackageAssertionStatus .get(name); name = getPackagePortion(name); } while (!"".equals(name) && status == null); if (status != null) return status.equals(Boolean.TRUE); } return c.defaultAssertionStatus; }
public boolean desiredAssertionStatus() { ClassLoader c = getClassLoader(); Object status; if (c == null) return VMClassLoader.defaultAssertionStatus(); if (c.classAssertionStatus != null) synchronized (c) { status = c.classAssertionStatus.get(getName()); if (status != null) { return status.equals(Boolean.TRUE); } else { status = ClassLoader.StaticData.systemClassAssertionStatus .get(getName()); if (status != null) { return status.equals(Boolean.TRUE); } if (c.packageAssertionStatus != null) synchronized (c) { String name = getPackagePortion(getName()); if ("".equals(name)) status = c.packageAssertionStatus.get(null); else do { status = c.packageAssertionStatus.get(name); name = getPackagePortion(name); } while (!"".equals(name) && status == null); if (status != null) { return status.equals(Boolean.TRUE); } else { String name = getPackagePortion(getName()); if ("".equals(name)) status = ClassLoader.StaticData.systemPackageAssertionStatus .get(null); else do { status = ClassLoader.StaticData.systemPackageAssertionStatus .get(name); name = getPackagePortion(name); } while (!"".equals(name) && status == null); if (status != null) { return status.equals(Boolean.TRUE); } return c.defaultAssertionStatus; }
13,377
public final VmMethod getDeclaredMethod(String name, String signature) { return getMethod(name, signature, true, false, VmMember.calcHashCode( name, signature)); }
public final VmMethod getDeclaredMethod(String name, String signature) { return getMethod(name, signature, true, false, VmMember.calcHashCode( name, signature)); }
13,379
public final VmField getDeclaredField(String name) { return getDeclaredField(name, null); }
public final VmField getDeclaredField(String name) { return getDeclaredField(name, null); }
13,380
public NoSuchFieldException(String s) { super(s); }
public NoSuchFieldException() { super(s); }
13,381
public NoSuchFieldException(String s) { super(s); }
public NoSuchFieldException(String s) { }
13,382
public final VmMethod getMethod(String name, VmType[] argTypes) { return getMethod(name, argTypes, false); }
public final VmMethod getMethod(String name, VmType[] argTypes) { return getMethod(name, argTypes, false); }
13,383
public synchronized void postEvent(AWTEvent evt) { if (evt == null) throw new NullPointerException(); if (next != null) { next.postEvent(evt); return; } /* * Check for any events already on the queue with the same source and * ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id == evt.id && (src = qevt.getSource()) == evt.getSource() && src instanceof Component) { /* * If there are, call coalesceEvents on the source component to * see if they can be combined. */ Component srccmp = (Component) src; AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt); if (coalesced_evt != null) { /* Yes. Replace the existing event with the combined event. */ queue[i] = coalesced_evt; return; } break; } if (++i == queue.length) i = 0; } queue[next_in] = evt; if (++next_in == queue.length) next_in = 0; if (next_in == next_out) { /* Queue is full. Extend it. */ AWTEvent[] oldQueue = queue; queue = new AWTEvent[queue.length * 2]; int len = oldQueue.length - next_out; System.arraycopy(oldQueue, next_out, queue, 0, len); if (next_out != 0) System.arraycopy(oldQueue, 0, queue, len, next_out); next_out = 0; next_in = oldQueue.length; } if (dispatchThread == null || !dispatchThread.isAlive()) { System.out .println("Start new dispatchThread old=" + dispatchThread); dispatchThread = new EventDispatchThread(this); dispatchThread.start(); } // Window events might represent the closing of a window, which // might cause the end of the dispatch thread's life, so we'll wake // it up here to give it a chance to check for shutdown. if (!isDispatchThread() || (evt.getID() == WindowEvent.WINDOW_CLOSED) || (evt.getID() == WindowEvent.WINDOW_CLOSING)) ((ClasspathToolkit) Toolkit.getDefaultToolkit()).wakeNativeQueue(); notify(); }
public synchronized void postEvent(AWTEvent evt) { if (evt == null) throw new NullPointerException(); if (next != null) { next.postEvent(evt); return; } /* * Check for any events already on the queue with the same source and * ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id == evt.id && (src = qevt.getSource()) == evt.getSource() && src instanceof Component) { /* * If there are, call coalesceEvents on the source component to * see if they can be combined. */ Component srccmp = (Component) src; AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt); if (coalesced_evt != null) { /* Yes. Replace the existing event with the combined event. */ queue[i] = coalesced_evt; return; } break; } if (++i == queue.length) i = 0; } queue[next_in] = evt; if (++next_in == queue.length) next_in = 0; if (next_in == next_out) { /* Queue is full. Extend it. */ AWTEvent[] oldQueue = queue; queue = new AWTEvent[queue.length * 2]; int len = oldQueue.length - next_out; System.arraycopy(oldQueue, next_out, queue, 0, len); if (next_out != 0) System.arraycopy(oldQueue, 0, queue, len, next_out); next_out = 0; next_in = oldQueue.length; } if (dispatchThread == null || !dispatchThread.isAlive()) { System.out .println("Start new dispatchThread old=" + dispatchThread); dispatchThread = new EventDispatchThread(this); dispatchThread.start(); } // Window events might represent the closing of a window, which // might cause the end of the dispatch thread's life, so we'll wake // it up here to give it a chance to check for shutdown. if (!isDispatchThread() || (evt.getID() == WindowEvent.WINDOW_CLOSED) || (evt.getID() == WindowEvent.WINDOW_CLOSING)) ((ClasspathToolkit) Toolkit.getDefaultToolkit()).wakeNativeQueue(); notify(); }
13,384
public InvocationEvent(Object source, Runnable runnable, Object notifier, boolean catchExceptions) { this(source, INVOCATION_DEFAULT, runnable, notifier, catchExceptions); }
public InvocationEvent(Object source, Runnable runnable, Object notifier, boolean catchExceptions) { this(source, INVOCATION_DEFAULT, runnable, notifier, catchExceptions); }
13,386
public InvocationEvent(Object source, Runnable runnable, Object notifier, boolean catchExceptions) { this(source, INVOCATION_DEFAULT, runnable, notifier, catchExceptions); }
public InvocationEvent(Object source, Runnable runnable, Object notifier, boolean catchExceptions) { this(source, INVOCATION_DEFAULT, runnable, null, false); }
13,387
public char[] getPassword() { return (password); }
public char[] getPassword() { return password; }
13,388
public String getUserName() { return (username); }
public String getUserName() { return username; }
13,389
public boolean isSelected () { return (index == -1); }
public boolean isSelected () { return (index != -1); }
13,390
AbstractButton FindButton(ButtonModel m) { for (int i = 0; i < v.size(); i++) { AbstractButton a = (AbstractButton) v.get(i); if (a.getModel() == m) { return a; } } return null; }
AbstractButton FindButton(ButtonModel m) { for (int i = 0; i < v.size(); i++) { AbstractButton a = (AbstractButton) v.get(i); if (a.getModel() == m) { return a; } } return null; }
13,391
public void setSelected(ButtonModel m, boolean b) { if ((m == sel) && (b == true)) { // clicked on sam item twice. System.out.println("PRESSED TWICE:" + m + ", sel=" + sel); return; } if (sel != null) { System.out.println("DESELECTING: " + sel); sel.setSelected(!b); AbstractButton but = FindButton(sel); if (but != null) { System.out.println("REPAINT-REQUIST: " + but.text); //but.revalidate(); but.repaint(); } } else { System.out.println("NO SELECTION YET"); } sel = m; }
public void setSelected(ButtonModel m, boolean b) { if ((m == sel) && (b == true)) { // clicked on sam item twice. System.out.println("PRESSED TWICE:" + m + ", sel=" + sel); return; } if (sel != null) { System.out.println("DESELECTING: " + sel); sel.setSelected(!b); AbstractButton but = FindButton(sel); if (but != null) { System.out.println("REPAINT-REQUIST: " + but.text); //but.revalidate(); but.repaint(); } } else { System.out.println("NO SELECTION YET"); } sel = m; }
13,393
public void setSelected(ButtonModel m, boolean b) { if ((m == sel) && (b == true)) { // clicked on sam item twice. System.out.println("PRESSED TWICE:" + m + ", sel=" + sel); return; } if (sel != null) { System.out.println("DESELECTING: " + sel); sel.setSelected(!b); AbstractButton but = FindButton(sel); if (but != null) { System.out.println("REPAINT-REQUIST: " + but.text); //but.revalidate(); but.repaint(); } } else { System.out.println("NO SELECTION YET"); } sel = m; }
public void setSelected(ButtonModel m, boolean b) { if ((m == sel) && (b == true)) { // clicked on sam item twice. System.out.println("PRESSED TWICE:" + m + ", sel=" + sel); return; } System.out.println("DESELECTING: " + sel); sel.setSelected(!b); System.out.println("DESELECTING: " + sel); sel.setSelected(!b); AbstractButton but = FindButton(sel); if (but != null) { System.out.println("REPAINT-REQUIST: " + but.text); //but.revalidate(); but.repaint(); } } else { System.out.println("NO SELECTION YET"); } sel = m; }
13,394
public void setSelected(ButtonModel m, boolean b) { if ((m == sel) && (b == true)) { // clicked on sam item twice. System.out.println("PRESSED TWICE:" + m + ", sel=" + sel); return; } if (sel != null) { System.out.println("DESELECTING: " + sel); sel.setSelected(!b); AbstractButton but = FindButton(sel); if (but != null) { System.out.println("REPAINT-REQUIST: " + but.text); //but.revalidate(); but.repaint(); } } else { System.out.println("NO SELECTION YET"); } sel = m; }
public void setSelected(ButtonModel m, boolean b) { if ((m == sel) && (b == true)) { // clicked on sam item twice. System.out.println("PRESSED TWICE:" + m + ", sel=" + sel); return; } if (sel != null) { System.out.println("DESELECTING: " + sel); sel.setSelected(!b); AbstractButton but = FindButton(sel); if (but != null) { System.out.println("REPAINT-REQUIST: " + but.text); //but.revalidate(); but.repaint(); } } else { System.out.println("NO SELECTION YET"); } sel = m; }
13,395
public abstract boolean addEntry(Principal caller, AclEntry entry) throws NotOwnerException;
boolean addEntry(Principal caller, AclEntry entry) throws NotOwnerException;
13,396