bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public ImageCapabilities getImageCapabilities() throws NotImplementedException { throw new Error("not implemented"); }
|
public ImageCapabilities getImageCapabilities() { throw new Error("not implemented"); }
| 14,516
|
public ImageCapabilities getImageCapabilities() throws NotImplementedException { throw new Error("not implemented"); }
|
public ImageCapabilities getImageCapabilities() throws NotImplementedException { if (imageCapabilities == null) imageCapabilities = new ImageCapabilities(false); return imageCapabilities; }
| 14,517
|
boolean chain(REToken next) { if (next instanceof RETokenChar) { RETokenChar cnext = (RETokenChar) next; // assume for now that next can only be one character int newsize = ch.length + cnext.ch.length; char[] chTemp = new char [newsize]; System.arraycopy(ch,0,chTemp,0,ch.length); System.arraycopy(cnext.ch,0,chTemp,ch.length,cnext.ch.length); ch = chTemp; return false; } else return super.chain(next); }
|
boolean chain(REToken next) { if (next instanceof RETokenChar && ((RETokenChar)next).insens == insens) { RETokenChar cnext = (RETokenChar) next; // assume for now that next can only be one character int newsize = ch.length + cnext.ch.length; char[] chTemp = new char [newsize]; System.arraycopy(ch,0,chTemp,0,ch.length); System.arraycopy(cnext.ch,0,chTemp,ch.length,cnext.ch.length); ch = chTemp; return false; } else return super.chain(next); }
| 14,520
|
void dispatchEventImpl(AWTEvent e) { if (e.id <= AdjustmentEvent.ADJUSTMENT_LAST && e.id >= AdjustmentEvent.ADJUSTMENT_FIRST && (adjustment_listeners != null || (eventMask & AWTEvent.ADJUSTMENT_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
|
void dispatchEventImpl(AWTEvent e) { if (e.id <= AdjustmentEvent.ADJUSTMENT_LAST && e.id >= AdjustmentEvent.ADJUSTMENT_FIRST && (adjustment_listeners != null || (eventMask & AWTEvent.ADJUSTMENT_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
| 14,521
|
public static void main(String[] args) throws Exception { final ParsedArguments cmdLine = HELP_INFO.parse(args); final File file = ARG_TOUCH.getFile(cmdLine); final File parentFile = file.getParentFile(); if (!file.exists()) { if (!parentFile.exists()) { if (!parentFile.mkdirs()) { System.err.println("Parent dirs can't create"); } } if (file.createNewFile()) { System.out.println("File created"); } else { System.err.println("File can't create"); } } else { System.out.println("File already exist"); } }
|
public static void main(String[] args) throws Exception { final ParsedArguments cmdLine = HELP_INFO.parse(args); final File file = ARG_TOUCH.getFile(cmdLine); final File parentFile = file.getParentFile(); if (!file.exists()) { if (parentFile!=null && !parentFile.exists()) { if (!parentFile.mkdirs()) { System.err.println("Parent dirs can't create"); } } if (file.createNewFile()) { System.out.println("File created"); } else { System.err.println("File can't create"); } } else { System.out.println("File already exist"); } }
| 14,523
|
public static void main(String[] argv) throws Exception { initEnv(); SwingTextScreenConsoleManager cm = new SwingTextScreenConsoleManager(); new Thread(new CommandShell((TextConsole) cm.createConsole(null, ConsoleManager.CreateOptions.TEXT | ConsoleManager.CreateOptions.SCROLLABLE))). start(); }
|
public static void main(String[] argv) throws Exception { initEnv(); SwingTextScreenConsoleManager cm = new SwingTextScreenConsoleManager(); new Thread(new CommandShell((TextConsole) cm.createConsole("Console 1", ConsoleManager.CreateOptions.TEXT | ConsoleManager.CreateOptions.SCROLLABLE))). start(); }
| 14,524
|
public SampleModel getSampleModel() { return sampleModel; }
|
public SampleModel getSampleModel (int width, int height) { return sampleModel; }
| 14,525
|
public SampleModel getSampleModel() { return sampleModel; }
|
public SampleModel getSampleModel() { if (width <= 0 || height <= 0) throw new IllegalArgumentException ("invalid dimension"); if (width * height < Math.min (width, height)) throw new IllegalArgumentException ("width * height > Integer.MAX_VALUE"); return sampleModel.createCompatibleSampleModel (width, height); }
| 14,526
|
public synchronized byte[] getINodeTableBlock(int blockNo) throws FileSystemException, IOException{ if(blockNo < blockCount) return fs.getBlock(firstBlock+blockNo); else throw new FileSystemException("Trying to get block #"+blockNo+ "of an inode table that only has "+blockCount+" blocks"); }
|
private byte[] getINodeTableBlock(int blockNo) throws FileSystemException, IOException{ if(blockNo < blockCount) return fs.getBlock(firstBlock+blockNo); else throw new FileSystemException("Trying to get block #"+blockNo+ "of an inode table that only has "+blockCount+" blocks"); }
| 14,527
|
public synchronized void writeINodeTableBlock(byte[] data, int blockNo) throws FileSystemException, IOException { if(blockNo < blockCount) fs.writeBlock(firstBlock+blockNo, data, false); else throw new FileSystemException("Trying to write block #"+blockNo+ "of an inode table that only has "+blockCount+" blocks"); }
|
private void writeINodeTableBlock(byte[] data, int blockNo) throws FileSystemException, IOException { if(blockNo < blockCount) fs.writeBlock(firstBlock+blockNo, data, false); else throw new FileSystemException("Trying to write block #"+blockNo+ "of an inode table that only has "+blockCount+" blocks"); }
| 14,528
|
public static FileSystemView getFileSystemView() { if (File.separator.equals("/")) return new UnixFileSystemView(); // else if (File.Separator.equals("\")) // return new Win32FileSystemView(); // else // return new GenericFileSystemView(); return null; }
|
public static FileSystemView getFileSystemView() { if (File.separator.equals("/")) defaultFileSystemView = new UnixFileSystemView(); // else if (File.Separator.equals("\")) // return new Win32FileSystemView(); // else // return new GenericFileSystemView(); return null; }
| 14,529
|
public static FileSystemView getFileSystemView() { if (File.separator.equals("/")) return new UnixFileSystemView(); // else if (File.Separator.equals("\")) // return new Win32FileSystemView(); // else // return new GenericFileSystemView(); return null; }
|
public static FileSystemView getFileSystemView() { if (File.separator.equals("/")) return new UnixFileSystemView(); // else if (File.Separator.equals("\")) // return new Win32FileSystemView(); // else // return new GenericFileSystemView(); } return defaultFileSystemView; }
| 14,530
|
public void addSelectionPath(TreePath value0) { if (!isPathSelected(value0)) { if (isSelectionEmpty()) setSelectionPath(value0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = value0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0; fireValueChanged(new TreeSelectionEvent(this, value0, true, leadPath, value0)); } }
|
public void addSelectionPath(TreePath path) { if (!isPathSelected(value0)) { if (isSelectionEmpty()) setSelectionPath(value0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = value0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0; fireValueChanged(new TreeSelectionEvent(this, value0, true, leadPath, value0)); } }
| 14,531
|
public void addSelectionPath(TreePath value0) { if (!isPathSelected(value0)) { if (isSelectionEmpty()) setSelectionPath(value0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = value0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0; fireValueChanged(new TreeSelectionEvent(this, value0, true, leadPath, value0)); } }
|
public void addSelectionPath(TreePath value0) { if (!isPathSelected(path)) { if (isSelectionEmpty()) setSelectionPath(value0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = value0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0; fireValueChanged(new TreeSelectionEvent(this, value0, true, leadPath, value0)); } }
| 14,532
|
public void addSelectionPath(TreePath value0) { if (!isPathSelected(value0)) { if (isSelectionEmpty()) setSelectionPath(value0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = value0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0; fireValueChanged(new TreeSelectionEvent(this, value0, true, leadPath, value0)); } }
|
public void addSelectionPath(TreePath value0) { if (!isPathSelected(value0)) { if (isSelectionEmpty()) setSelectionPath(path); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = value0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0; fireValueChanged(new TreeSelectionEvent(this, value0, true, leadPath, value0)); } }
| 14,533
|
public void addSelectionPath(TreePath value0) { if (!isPathSelected(value0)) { if (isSelectionEmpty()) setSelectionPath(value0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = value0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0; fireValueChanged(new TreeSelectionEvent(this, value0, true, leadPath, value0)); } }
|
public void addSelectionPath(TreePath value0) { if (!isPathSelected(value0)) { if (isSelectionEmpty()) setSelectionPath(value0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = path; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0; fireValueChanged(new TreeSelectionEvent(this, value0, true, leadPath, value0)); } }
| 14,534
|
public void addSelectionPath(TreePath value0) { if (!isPathSelected(value0)) { if (isSelectionEmpty()) setSelectionPath(value0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = value0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0; fireValueChanged(new TreeSelectionEvent(this, value0, true, leadPath, value0)); } }
|
public void addSelectionPath(TreePath value0) { if (!isPathSelected(value0)) { if (isSelectionEmpty()) setSelectionPath(value0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = value0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0; fireValueChanged(new TreeSelectionEvent(this, value0, true, leadPath, value0)); } }
| 14,535
|
public void addSelectionPaths(TreePath[] value0) { if (value0 != null) { TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (!isPathSelected(v0)) { if (isSelectionEmpty()) setSelectionPath(v0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = v0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0[value0.length - 1]; fireValueChanged(new TreeSelectionEvent(this, v0, true, leadPath, value0[0])); } } } }
|
public void addSelectionPaths(TreePath[] paths) { if (value0 != null) { TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (!isPathSelected(v0)) { if (isSelectionEmpty()) setSelectionPath(v0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = v0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0[value0.length - 1]; fireValueChanged(new TreeSelectionEvent(this, v0, true, leadPath, value0[0])); } } } }
| 14,536
|
public void addSelectionPaths(TreePath[] value0) { if (value0 != null) { TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (!isPathSelected(v0)) { if (isSelectionEmpty()) setSelectionPath(v0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = v0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0[value0.length - 1]; fireValueChanged(new TreeSelectionEvent(this, v0, true, leadPath, value0[0])); } } } }
|
public void addSelectionPaths(TreePath[] value0) { if (paths != null) { TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (!isPathSelected(v0)) { if (isSelectionEmpty()) setSelectionPath(v0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = v0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0[value0.length - 1]; fireValueChanged(new TreeSelectionEvent(this, v0, true, leadPath, value0[0])); } } } }
| 14,537
|
public void addSelectionPaths(TreePath[] value0) { if (value0 != null) { TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (!isPathSelected(v0)) { if (isSelectionEmpty()) setSelectionPath(v0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = v0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0[value0.length - 1]; fireValueChanged(new TreeSelectionEvent(this, v0, true, leadPath, value0[0])); } } } }
|
public void addSelectionPaths(TreePath[] value0) { if (value0 != null) { TreePath v0 = null; for (int i = 0; i < paths.length; i++) { v0 = value0[i]; if (!isPathSelected(v0)) { if (isSelectionEmpty()) setSelectionPath(v0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = v0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0[value0.length - 1]; fireValueChanged(new TreeSelectionEvent(this, v0, true, leadPath, value0[0])); } } } }
| 14,538
|
public void addSelectionPaths(TreePath[] value0) { if (value0 != null) { TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (!isPathSelected(v0)) { if (isSelectionEmpty()) setSelectionPath(v0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = v0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0[value0.length - 1]; fireValueChanged(new TreeSelectionEvent(this, v0, true, leadPath, value0[0])); } } } }
|
public void addSelectionPaths(TreePath[] value0) { if (value0 != null) { TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = paths[i]; if (!isPathSelected(v0)) { if (isSelectionEmpty()) setSelectionPath(v0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = v0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0[value0.length - 1]; fireValueChanged(new TreeSelectionEvent(this, v0, true, leadPath, value0[0])); } } } }
| 14,539
|
public void addSelectionPaths(TreePath[] value0) { if (value0 != null) { TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (!isPathSelected(v0)) { if (isSelectionEmpty()) setSelectionPath(v0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = v0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0[value0.length - 1]; fireValueChanged(new TreeSelectionEvent(this, v0, true, leadPath, value0[0])); } } } }
|
public void addSelectionPaths(TreePath[] value0) { if (value0 != null) { TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (!isPathSelected(v0)) { if (isSelectionEmpty()) setSelectionPath(v0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = v0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = paths[paths.length - 1]; fireValueChanged(new TreeSelectionEvent(this, v0, true, leadPath, value0[0])); } } } }
| 14,540
|
public void addSelectionPaths(TreePath[] value0) { if (value0 != null) { TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (!isPathSelected(v0)) { if (isSelectionEmpty()) setSelectionPath(v0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = v0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0[value0.length - 1]; fireValueChanged(new TreeSelectionEvent(this, v0, true, leadPath, value0[0])); } } } }
|
public void addSelectionPaths(TreePath[] value0) { if (value0 != null) { TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (!isPathSelected(v0)) { if (isSelectionEmpty()) setSelectionPath(v0); else { TreePath[] temp = new TreePath[selection.length + 1]; System.arraycopy(selection, 0, temp, 0, selection.length); temp[temp.length - 1] = v0; selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); } leadPath = value0[value0.length - 1]; fireValueChanged(new TreeSelectionEvent(this, v0, true, leadPath, paths[0])); } } } }
| 14,541
|
protected boolean arePathsContiguous(TreePath[] value0) { return false; // TODO }
|
protected boolean arePathsContiguous(TreePath[] paths) { return false; // TODO }
| 14,542
|
protected boolean canPathsBeAdded(TreePath[] value0) { return false; // TODO }
|
protected boolean canPathsBeAdded(TreePath[] paths) { return false; // TODO }
| 14,543
|
protected boolean canPathsBeRemoved(TreePath[] value0) { return false; // TODO }
|
protected boolean canPathsBeRemoved(TreePath[] paths) { return false; // TODO }
| 14,544
|
public boolean isPathSelected(TreePath value0) { if (selection == null) return false; for (int i = 0; i < selection.length; i++) { if (selection[i].equals(value0)) return true; } return false; }
|
public boolean isPathSelected(TreePath path) { if (selection == null) return false; for (int i = 0; i < selection.length; i++) { if (selection[i].equals(value0)) return true; } return false; }
| 14,545
|
public boolean isPathSelected(TreePath value0) { if (selection == null) return false; for (int i = 0; i < selection.length; i++) { if (selection[i].equals(value0)) return true; } return false; }
|
public boolean isPathSelected(TreePath value0) { if (selection == null) return false; for (int i = 0; i < selection.length; i++) { if (selection[i].equals(path)) return true; } return false; }
| 14,546
|
public boolean isRowSelected(int value0) { return false; // TODO }
|
public boolean isRowSelected(int row) { return false; // TODO }
| 14,547
|
public void removeSelectionPath(TreePath value0) { int index = -1; if (isPathSelected(value0)) { for (int i = 0; i < selection.length; i++) { if (selection[i].equals(value0)) { index = i; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, value0, false, leadPath, value0)); } }
|
public void removeSelectionPath(TreePath path) { int index = -1; if (isPathSelected(value0)) { for (int i = 0; i < selection.length; i++) { if (selection[i].equals(value0)) { index = i; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, value0, false, leadPath, value0)); } }
| 14,548
|
public void removeSelectionPath(TreePath value0) { int index = -1; if (isPathSelected(value0)) { for (int i = 0; i < selection.length; i++) { if (selection[i].equals(value0)) { index = i; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, value0, false, leadPath, value0)); } }
|
public void removeSelectionPath(TreePath value0) { int index = -1; if (isPathSelected(path)) { for (int i = 0; i < selection.length; i++) { if (selection[i].equals(value0)) { index = i; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, value0, false, leadPath, value0)); } }
| 14,549
|
public void removeSelectionPath(TreePath value0) { int index = -1; if (isPathSelected(value0)) { for (int i = 0; i < selection.length; i++) { if (selection[i].equals(value0)) { index = i; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, value0, false, leadPath, value0)); } }
|
public void removeSelectionPath(TreePath value0) { int index = -1; if (isPathSelected(value0)) { for (int i = 0; i < selection.length; i++) { if (selection[i].equals(path)) { index = i; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, value0, false, leadPath, value0)); } }
| 14,550
|
public void removeSelectionPath(TreePath value0) { int index = -1; if (isPathSelected(value0)) { for (int i = 0; i < selection.length; i++) { if (selection[i].equals(value0)) { index = i; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, value0, false, leadPath, value0)); } }
|
public void removeSelectionPath(TreePath value0) { int index = -1; if (isPathSelected(value0)) { for (int i = 0; i < selection.length; i++) { if (selection[i].equals(value0)) { index = i; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, value0, false, leadPath, value0)); } }
| 14,551
|
public void removeSelectionPaths(TreePath[] value0) { if (value0 != null) { int index = -1; TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (isPathSelected(v0)) { for (int x = 0; x < selection.length; x++) { if (selection[i].equals(v0)) { index = x; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, v0, false, leadPath, value0[0])); } } } }
|
public void removeSelectionPaths(TreePath[] paths) { if (value0 != null) { int index = -1; TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (isPathSelected(v0)) { for (int x = 0; x < selection.length; x++) { if (selection[i].equals(v0)) { index = x; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, v0, false, leadPath, value0[0])); } } } }
| 14,552
|
public void removeSelectionPaths(TreePath[] value0) { if (value0 != null) { int index = -1; TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (isPathSelected(v0)) { for (int x = 0; x < selection.length; x++) { if (selection[i].equals(v0)) { index = x; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, v0, false, leadPath, value0[0])); } } } }
|
public void removeSelectionPaths(TreePath[] value0) { if (paths != null) { int index = -1; TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (isPathSelected(v0)) { for (int x = 0; x < selection.length; x++) { if (selection[i].equals(v0)) { index = x; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, v0, false, leadPath, value0[0])); } } } }
| 14,553
|
public void removeSelectionPaths(TreePath[] value0) { if (value0 != null) { int index = -1; TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (isPathSelected(v0)) { for (int x = 0; x < selection.length; x++) { if (selection[i].equals(v0)) { index = x; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, v0, false, leadPath, value0[0])); } } } }
|
public void removeSelectionPaths(TreePath[] value0) { if (value0 != null) { int index = -1; TreePath v0 = null; for (int i = 0; i < paths.length; i++) { v0 = value0[i]; if (isPathSelected(v0)) { for (int x = 0; x < selection.length; x++) { if (selection[i].equals(v0)) { index = x; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, v0, false, leadPath, value0[0])); } } } }
| 14,554
|
public void removeSelectionPaths(TreePath[] value0) { if (value0 != null) { int index = -1; TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (isPathSelected(v0)) { for (int x = 0; x < selection.length; x++) { if (selection[i].equals(v0)) { index = x; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, v0, false, leadPath, value0[0])); } } } }
|
public void removeSelectionPaths(TreePath[] value0) { if (value0 != null) { int index = -1; TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = paths[i]; if (isPathSelected(v0)) { for (int x = 0; x < selection.length; x++) { if (selection[i].equals(v0)) { index = x; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, v0, false, leadPath, value0[0])); } } } }
| 14,555
|
public void removeSelectionPaths(TreePath[] value0) { if (value0 != null) { int index = -1; TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (isPathSelected(v0)) { for (int x = 0; x < selection.length; x++) { if (selection[i].equals(v0)) { index = x; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, v0, false, leadPath, value0[0])); } } } }
|
public void removeSelectionPaths(TreePath[] value0) { if (value0 != null) { int index = -1; TreePath v0 = null; for (int i = 0; i < value0.length; i++) { v0 = value0[i]; if (isPathSelected(v0)) { for (int x = 0; x < selection.length; x++) { if (selection[i].equals(v0)) { index = x; break; } } TreePath[] temp = new TreePath[selection.length - 1]; System.arraycopy(selection, 0, temp, 0, index); System.arraycopy(selection, index + 1, temp, index, selection.length - index - 1); selection = new TreePath[temp.length]; System.arraycopy(temp, 0, selection, 0, temp.length); fireValueChanged(new TreeSelectionEvent(this, v0, false, leadPath, paths[0])); } } } }
| 14,556
|
public void setRowMapper(RowMapper value0) { // TODO }
|
public void setRowMapper(RowMapper rowMapper) { // TODO }
| 14,557
|
public void setSelectionPaths(TreePath[] value0) { // TODO }
|
public void setSelectionPaths(TreePath[] paths) { // TODO }
| 14,558
|
private boolean verifyHashes(String entry, Attributes attr) { int verified = 0; // The bytes for ENTRY's manifest entry, which are signed in the // signature file. byte[] entryBytes = null; try { entryBytes = readManifestEntry(super.getEntry(entry)); } catch (IOException ioe) { if (DEBUG) { debug(ioe); ioe.printStackTrace(); } return false; } for (Iterator it = attr.entrySet().iterator(); it.hasNext(); ) { Map.Entry e = (Map.Entry) it.next(); String key = String.valueOf(e.getKey()); if (!key.endsWith(DIGEST_KEY_SUFFIX)) continue; String alg = key.substring(0, key.length() - DIGEST_KEY_SUFFIX.length()); try { byte[] hash = Base64InputStream.decode((String) e.getValue()); MessageDigest md = MessageDigest.getInstance(alg); md.update(entryBytes); byte[] hash2 = md.digest(); if (DEBUG) debug("verifying SF entry " + entry + " alg: " + md.getAlgorithm() + " expect=" + new java.math.BigInteger(hash).toString(16) + " comp=" + new java.math.BigInteger(hash2).toString(16)); if (!Arrays.equals(hash, hash2)) return false; verified++; } catch (IOException ioe) { if (DEBUG) { debug(ioe); ioe.printStackTrace(); } return false; } catch (NoSuchAlgorithmException nsae) { if (DEBUG) { debug(nsae); nsae.printStackTrace(); } return false; } } // We have to find at least one valid digest. return verified > 0; }
|
private boolean verifyHashes(String entry, Attributes attr) { int verified = 0; // The bytes for ENTRY's manifest entry, which are signed in the // signature file. byte[] entryBytes = null; try { ZipEntry e = super.getEntry(entry); if (e == null) { if (DEBUG) debug("verifyHashes: no entry '" + entry + "'"); return false; } entryBytes = readManifestEntry(e); } catch (IOException ioe) { if (DEBUG) { debug(ioe); ioe.printStackTrace(); } return false; } for (Iterator it = attr.entrySet().iterator(); it.hasNext(); ) { Map.Entry e = (Map.Entry) it.next(); String key = String.valueOf(e.getKey()); if (!key.endsWith(DIGEST_KEY_SUFFIX)) continue; String alg = key.substring(0, key.length() - DIGEST_KEY_SUFFIX.length()); try { byte[] hash = Base64InputStream.decode((String) e.getValue()); MessageDigest md = MessageDigest.getInstance(alg); md.update(entryBytes); byte[] hash2 = md.digest(); if (DEBUG) debug("verifying SF entry " + entry + " alg: " + md.getAlgorithm() + " expect=" + new java.math.BigInteger(hash).toString(16) + " comp=" + new java.math.BigInteger(hash2).toString(16)); if (!Arrays.equals(hash, hash2)) return false; verified++; } catch (IOException ioe) { if (DEBUG) { debug(ioe); ioe.printStackTrace(); } return false; } catch (NoSuchAlgorithmException nsae) { if (DEBUG) { debug(nsae); nsae.printStackTrace(); } return false; } } // We have to find at least one valid digest. return verified > 0; }
| 14,559
|
public Node cloneNode(boolean deep) { IIOMetadataNode newnode = new IIOMetadataNode(name); newnode.parent = null; newnode.obj = obj; if (deep) { for (int i=0; i < children.size(); i++) newnode.children.add(((Node)children.get(i)).cloneNode(deep)); } // clone attrs for (Iterator it = attrs.values().iterator(); it.hasNext();) { IIOAttr attr = (IIOAttr)it.next(); newnode.attrs.put(attr.name, attr.cloneNode(deep)); attr.owner = newnode; } return newnode; }
|
public Node cloneNode(boolean deep) { IIOMetadataNode newnode = new IIOMetadataNode(name); newnode.parent = null; newnode.obj = obj; if (deep) { for (int i=0; i < children.size(); i++) newnode.children.add(((Node)children.get(i)).cloneNode(deep)); } // clone attrs for (Iterator it = attrs.values().iterator(); it.hasNext();) { IIOMetadataNodeAttr attr = (IIOMetadataNodeAttr)it.next(); newnode.attrs.put(attr.name, attr.cloneNode(deep)); attr.owner = newnode; } return newnode; }
| 14,560
|
public short compareDocumentPosition(Node other) throws DOMException { throw new Error("not implemented"); }
|
public short compareDocumentPosition(Node other) throws DOMException { return Element.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC; }
| 14,561
|
public Attr getAttributeNode(String name) { String val = getAttribute(name); if (val != null) return new IIOAttr(name, val, this); return null; }
|
public Attr getAttributeNode(String name) { String val = getAttribute(name); if (val != null) return new IIOMetadataNodeAttr(this, name, val); return null; }
| 14,562
|
public String getBaseURI() { throw new Error("not implemented"); }
|
public String getBaseURI() { return null; }
| 14,563
|
public Object getFeature(String feature, String version) { throw new Error("not implemented"); }
|
public Object getFeature(String feature, String version) { return null; }
| 14,564
|
public TypeInfo getSchemaTypeInfo() { throw new Error("not implemented"); }
|
public TypeInfo getSchemaTypeInfo() { return null; }
| 14,565
|
public String getTextContent() throws DOMException { throw new Error("not implemented"); }
|
public String getTextContent() throws DOMException { return null; }
| 14,566
|
public Object getUserData(String key) { throw new Error("not implemented"); }
|
public Object getUserData(String key) { return null; }
| 14,567
|
public boolean isDefaultNamespace(String namespaceURI) { throw new Error("not implemented"); }
|
public boolean isDefaultNamespace(String namespaceURI) { return true; }
| 14,568
|
public boolean isEqualNode(Node arg) { throw new Error("not implemented"); }
|
public boolean isEqualNode(Node arg) { return true; }
| 14,569
|
public String lookupNamespaceURI(String prefix) { throw new Error("not implemented"); }
|
public String lookupNamespaceURI(String prefix) { return null; }
| 14,570
|
public String lookupPrefix(String namespaceURI) { throw new Error("not implemented"); }
|
public String lookupPrefix(String namespaceURI) { return null; }
| 14,571
|
public void setAttribute(String name, String value) { Attr attr = (Attr) getAttributeNode(name); if (attr != null) attr.setValue(value); else attrs.put(name, new IIOAttr(name, value, this)); }
|
public void setAttribute(String name, String value) { Attr attr = (Attr) getAttributeNode(name); if (attr != null) attr.setValue(value); else attrs.put(name, new IIOMetadataNodeAttr(this, name, value)); }
| 14,572
|
public void setIdAttribute(String name, boolean isId) throws DOMException { throw new Error("not implemented"); }
|
public void setIdAttribute(String name, boolean isId) throws DOMException { }
| 14,573
|
public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException { throw new Error("not implemented"); }
|
public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException { }
| 14,574
|
public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException { throw new Error("not implemented"); }
|
public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException { }
| 14,575
|
public void setTextContent(String textContent) throws DOMException { throw new Error("not implemented"); }
|
public void setTextContent(String textContent) throws DOMException { }
| 14,576
|
public Object setUserData(String key, Object data, UserDataHandler handler) { throw new Error("not implemented"); }
|
public Object setUserData(String key, Object data, UserDataHandler handler) { return null; }
| 14,577
|
public AccessibleContext getAccessibleContext(){ /* Create the context if this is the first request */ if (accessibleContext == null) { AccessibleAWTCheckBox ac = new AccessibleAWTCheckBox(); accessibleContext = ac; addItemListener(ac); } return accessibleContext;}
|
public AccessibleContext getAccessibleContext(){ /* Create the context if this is the first request */ if (accessibleContext == null) { AccessibleAWTCheckbox ac = new AccessibleAWTCheckbox(); accessibleContext = ac; addItemListener(ac); } return accessibleContext;}
| 14,578
|
public Component getComponent() { return null; }
|
public final Component getComponent() { return null; }
| 14,579
|
public void actionPerformed(ActionEvent ae) throws NotImplementedException { // TODO: Implement this properly. }
|
public void actionPerformed(ActionEvent ae) { // TODO: Implement this properly. }
| 14,580
|
public void componentMoved(ComponentEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
public void componentMoved(ComponentEvent e) { // TODO: What should be done here, if anything? }
| 14,582
|
protected JScrollPane getScrollPane() throws NotImplementedException { // FIXME: Not implemented. return null; }
|
protected JScrollPane getScrollPane() { // FIXME: Not implemented. return null; }
| 14,584
|
protected JScrollPane getScrollPane() throws NotImplementedException { // FIXME: Not implemented. return null; }
|
protected JScrollPane getScrollPane() throws NotImplementedException { // FIXME: Not implemented. JScrollPane found = null; Component p = tree.getParent(); while (p != null && !(p instanceof JScrollPane)) p = p.getParent(); if (p instanceof JScrollPane) found = (JScrollPane) p; return found; }
| 14,585
|
protected void startTimer() throws NotImplementedException { // TODO: Implement this properly. }
|
protected void startTimer() { // TODO: Implement this properly. }
| 14,586
|
public void mousePressed(MouseEvent e) { // Any mouse click cancels the previous waiting edit action, initiated // by the single click on the selected node. if (startEditTimer != null) { startEditTimer.stop(); startEditTimer = null; } Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); // Cancel the editing session if clicked on the different row. if (tree.isEditing() && row != editingRow) cancelEditing(tree); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { TreePath currentLead = tree.getLeadSelectionPath(); if (currentLead != null && currentLead.equals(path) && e.getClickCount() == 1 && tree.isEditable()) { // Schedule the editing session. final TreePath editPath = path; if (startEditTimer != null) startEditTimer.stop(); startEditTimer = new Timer(WAIT_TILL_EDITING, new ActionListener() { public void actionPerformed(ActionEvent e) { startEditing(editPath, EDIT); } }); startEditTimer.setRepeats(false); startEditTimer.start(); } else { if (e.getClickCount() == 2 && ! isLeaf(row)) toggleExpandState(path); else selectPathForEvent(path, e); } } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
|
public void mousePressed(MouseEvent e) { // Any mouse click cancels the previous waiting edit action, initiated // by the single click on the selected node. if (tree != null && tree.isEnabled()) { startEditTimer.stop(); startEditTimer = null; } Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); // Cancel the editing session if clicked on the different row. if (tree.isEditing() && row != editingRow) cancelEditing(tree); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { TreePath currentLead = tree.getLeadSelectionPath(); if (currentLead != null && currentLead.equals(path) && e.getClickCount() == 1 && tree.isEditable()) { // Schedule the editing session. final TreePath editPath = path; if (tree != null && tree.isEnabled()) startEditTimer.stop(); startEditTimer = new Timer(WAIT_TILL_EDITING, new ActionListener() { public void actionPerformed(ActionEvent e) { startEditing(editPath, EDIT); } }); startEditTimer.setRepeats(false); startEditTimer.start(); } else { if (e.getClickCount() == 2 && ! isLeaf(row)) toggleExpandState(path); else selectPathForEvent(path, e); } } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
| 14,588
|
public void mousePressed(MouseEvent e) { // Any mouse click cancels the previous waiting edit action, initiated // by the single click on the selected node. if (startEditTimer != null) { startEditTimer.stop(); startEditTimer = null; } Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); // Cancel the editing session if clicked on the different row. if (tree.isEditing() && row != editingRow) cancelEditing(tree); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { TreePath currentLead = tree.getLeadSelectionPath(); if (currentLead != null && currentLead.equals(path) && e.getClickCount() == 1 && tree.isEditable()) { // Schedule the editing session. final TreePath editPath = path; if (startEditTimer != null) startEditTimer.stop(); startEditTimer = new Timer(WAIT_TILL_EDITING, new ActionListener() { public void actionPerformed(ActionEvent e) { startEditing(editPath, EDIT); } }); startEditTimer.setRepeats(false); startEditTimer.start(); } else { if (e.getClickCount() == 2 && ! isLeaf(row)) toggleExpandState(path); else selectPathForEvent(path, e); } } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
|
public void mousePressed(MouseEvent e) { // Any mouse click cancels the previous waiting edit action, initiated // by the single click on the selected node. if (startEditTimer != null) { startEditTimer.stop(); startEditTimer = null; } Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); // Cancel the editing session if clicked on the different row. if (tree.isEditing() && row != editingRow) cancelEditing(tree); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { TreePath currentLead = tree.getLeadSelectionPath(); if (currentLead != null && currentLead.equals(path) && e.getClickCount() == 1 && tree.isEditable()) { // Schedule the editing session. final TreePath editPath = path; if (startEditTimer != null) startEditTimer.stop(); startEditTimer = new Timer(WAIT_TILL_EDITING, new ActionListener() { public void actionPerformed(ActionEvent e) { startEditing(editPath, EDIT); } }); startEditTimer.setRepeats(false); startEditTimer.start(); } else { if (e.getClickCount() == 2 && ! isLeaf(row)) toggleExpandState(path); else selectPathForEvent(path, e); } } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
| 14,589
|
public void mousePressed(MouseEvent e) { // Any mouse click cancels the previous waiting edit action, initiated // by the single click on the selected node. if (startEditTimer != null) { startEditTimer.stop(); startEditTimer = null; } Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); // Cancel the editing session if clicked on the different row. if (tree.isEditing() && row != editingRow) cancelEditing(tree); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { TreePath currentLead = tree.getLeadSelectionPath(); if (currentLead != null && currentLead.equals(path) && e.getClickCount() == 1 && tree.isEditable()) { // Schedule the editing session. final TreePath editPath = path; if (startEditTimer != null) startEditTimer.stop(); startEditTimer = new Timer(WAIT_TILL_EDITING, new ActionListener() { public void actionPerformed(ActionEvent e) { startEditing(editPath, EDIT); } }); startEditTimer.setRepeats(false); startEditTimer.start(); } else { if (e.getClickCount() == 2 && ! isLeaf(row)) toggleExpandState(path); else selectPathForEvent(path, e); } } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
|
public void mousePressed(MouseEvent e) { // Any mouse click cancels the previous waiting edit action, initiated // by the single click on the selected node. if (startEditTimer != null) { startEditTimer.stop(); startEditTimer = null; } Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); // Cancel the editing session if clicked on the different row. if (tree.isEditing() && row != editingRow) cancelEditing(tree); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { TreePath currentLead = tree.getLeadSelectionPath(); if (currentLead != null && currentLead.equals(path) && e.getClickCount() == 1 && tree.isEditable()) { // Schedule the editing session. final TreePath editPath = path; if (startEditTimer != null) startEditTimer.stop(); startEditTimer = new Timer(WAIT_TILL_EDITING, new ActionListener() { public void actionPerformed(ActionEvent e) { startEditing(editPath, EDIT); } }); startEditTimer.setRepeats(false); startEditTimer.start(); } else { if (e.getClickCount() == 2 && ! isLeaf(row)) toggleExpandState(path); else selectPathForEvent(path, e); } } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
| 14,590
|
public void mousePressed(MouseEvent e) { // Any mouse click cancels the previous waiting edit action, initiated // by the single click on the selected node. if (startEditTimer != null) { startEditTimer.stop(); startEditTimer = null; } Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); // Cancel the editing session if clicked on the different row. if (tree.isEditing() && row != editingRow) cancelEditing(tree); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { TreePath currentLead = tree.getLeadSelectionPath(); if (currentLead != null && currentLead.equals(path) && e.getClickCount() == 1 && tree.isEditable()) { // Schedule the editing session. final TreePath editPath = path; if (startEditTimer != null) startEditTimer.stop(); startEditTimer = new Timer(WAIT_TILL_EDITING, new ActionListener() { public void actionPerformed(ActionEvent e) { startEditing(editPath, EDIT); } }); startEditTimer.setRepeats(false); startEditTimer.start(); } else { if (e.getClickCount() == 2 && ! isLeaf(row)) toggleExpandState(path); else selectPathForEvent(path, e); } } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
|
public void mousePressed(MouseEvent e) { // Any mouse click cancels the previous waiting edit action, initiated // by the single click on the selected node. if (startEditTimer != null) { startEditTimer.stop(); startEditTimer = null; } Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); if (SwingUtilities.isLeftMouseButton(e)) checkForClickInExpandControl(path, x, y); // Cancel the editing session if clicked on the different row. if (tree.isEditing() && row != editingRow) cancelEditing(tree); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { TreePath currentLead = tree.getLeadSelectionPath(); if (currentLead != null && currentLead.equals(path) && e.getClickCount() == 1 && tree.isEditable()) { // Schedule the editing session. final TreePath editPath = path; if (startEditTimer != null) startEditTimer.stop(); startEditTimer = new Timer(WAIT_TILL_EDITING, new ActionListener() { public void actionPerformed(ActionEvent e) { startEditing(editPath, EDIT); } }); startEditTimer.setRepeats(false); startEditTimer.start(); } else { if (e.getClickCount() == 2 && ! isLeaf(row)) toggleExpandState(path); else selectPathForEvent(path, e); } } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
| 14,591
|
public void mousePressed(MouseEvent e) { // Any mouse click cancels the previous waiting edit action, initiated // by the single click on the selected node. if (startEditTimer != null) { startEditTimer.stop(); startEditTimer = null; } Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); // Cancel the editing session if clicked on the different row. if (tree.isEditing() && row != editingRow) cancelEditing(tree); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { TreePath currentLead = tree.getLeadSelectionPath(); if (currentLead != null && currentLead.equals(path) && e.getClickCount() == 1 && tree.isEditable()) { // Schedule the editing session. final TreePath editPath = path; if (startEditTimer != null) startEditTimer.stop(); startEditTimer = new Timer(WAIT_TILL_EDITING, new ActionListener() { public void actionPerformed(ActionEvent e) { startEditing(editPath, EDIT); } }); startEditTimer.setRepeats(false); startEditTimer.start(); } else { if (e.getClickCount() == 2 && ! isLeaf(row)) toggleExpandState(path); else selectPathForEvent(path, e); } } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
|
public void mousePressed(MouseEvent e) { // Any mouse click cancels the previous waiting edit action, initiated // by the single click on the selected node. if (startEditTimer != null) { startEditTimer.stop(); startEditTimer = null; } Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); // Cancel the editing session if clicked on the different row. if (tree.isEditing() && row != editingRow) cancelEditing(tree); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { TreePath currentLead = tree.getLeadSelectionPath(); if (currentLead != null && currentLead.equals(path) && e.getClickCount() == 1 && tree.isEditable()) { // Schedule the editing session. final TreePath editPath = path; if (startEditTimer != null) startEditTimer.stop(); startEditTimer = new Timer(WAIT_TILL_EDITING, new ActionListener() { public void actionPerformed(ActionEvent e) { startEditing(editPath, EDIT); } }); startEditTimer.setRepeats(false); startEditTimer.start(); } else { if (e.getClickCount() == 2 && ! isLeaf(row)) toggleExpandState(path); else selectPathForEvent(path, e); } } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
| 14,592
|
public void mousePressed(MouseEvent e) { // Any mouse click cancels the previous waiting edit action, initiated // by the single click on the selected node. if (startEditTimer != null) { startEditTimer.stop(); startEditTimer = null; } Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); // Cancel the editing session if clicked on the different row. if (tree.isEditing() && row != editingRow) cancelEditing(tree); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { TreePath currentLead = tree.getLeadSelectionPath(); if (currentLead != null && currentLead.equals(path) && e.getClickCount() == 1 && tree.isEditable()) { // Schedule the editing session. final TreePath editPath = path; if (startEditTimer != null) startEditTimer.stop(); startEditTimer = new Timer(WAIT_TILL_EDITING, new ActionListener() { public void actionPerformed(ActionEvent e) { startEditing(editPath, EDIT); } }); startEditTimer.setRepeats(false); startEditTimer.start(); } else { if (e.getClickCount() == 2 && ! isLeaf(row)) toggleExpandState(path); else selectPathForEvent(path, e); } } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
|
public void mousePressed(MouseEvent e) { // Any mouse click cancels the previous waiting edit action, initiated // by the single click on the selected node. if (startEditTimer != null) { startEditTimer.stop(); startEditTimer = null; } Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); // Cancel the editing session if clicked on the different row. if (tree.isEditing() && row != editingRow) cancelEditing(tree); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { TreePath currentLead = tree.getLeadSelectionPath(); if (currentLead != null && currentLead.equals(path) && e.getClickCount() == 1 && tree.isEditable()) { // Schedule the editing session. final TreePath editPath = path; if (startEditTimer != null) startEditTimer.stop(); startEditTimer = new Timer(WAIT_TILL_EDITING, new ActionListener() { public void actionPerformed(ActionEvent e) { startEditing(editPath, EDIT); } }); startEditTimer.setRepeats(false); startEditTimer.start(); } else { if (e.getClickCount() == 2 && ! isLeaf(row)) toggleExpandState(path); else selectPathForEvent(path, e); } } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
| 14,593
|
public void mousePressed(MouseEvent e) { // Any mouse click cancels the previous waiting edit action, initiated // by the single click on the selected node. if (startEditTimer != null) { startEditTimer.stop(); startEditTimer = null; } Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); // Cancel the editing session if clicked on the different row. if (tree.isEditing() && row != editingRow) cancelEditing(tree); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { TreePath currentLead = tree.getLeadSelectionPath(); if (currentLead != null && currentLead.equals(path) && e.getClickCount() == 1 && tree.isEditable()) { // Schedule the editing session. final TreePath editPath = path; if (startEditTimer != null) startEditTimer.stop(); startEditTimer = new Timer(WAIT_TILL_EDITING, new ActionListener() { public void actionPerformed(ActionEvent e) { startEditing(editPath, EDIT); } }); startEditTimer.setRepeats(false); startEditTimer.start(); } else { if (e.getClickCount() == 2 && ! isLeaf(row)) toggleExpandState(path); else selectPathForEvent(path, e); } } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
|
public void mousePressed(MouseEvent e) { // Any mouse click cancels the previous waiting edit action, initiated // by the single click on the selected node. if (startEditTimer != null) { startEditTimer.stop(); startEditTimer = null; } Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); // Cancel the editing session if clicked on the different row. if (tree.isEditing() && row != editingRow) cancelEditing(tree); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { TreePath currentLead = tree.getLeadSelectionPath(); if (currentLead != null && currentLead.equals(path) && e.getClickCount() == 1 && tree.isEditable()) { // Schedule the editing session. final TreePath editPath = path; if (startEditTimer != null) startEditTimer.stop(); startEditTimer = new Timer(WAIT_TILL_EDITING, new ActionListener() { public void actionPerformed(ActionEvent e) { startEditing(editPath, EDIT); } }); startEditTimer.setRepeats(false); startEditTimer.start(); } else { if (e.getClickCount() == 2 && ! isLeaf(row)) toggleExpandState(path); else selectPathForEvent(path, e); } } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
| 14,594
|
public void propertyChange(PropertyChangeEvent event) { String property = event.getPropertyName(); if (property.equals(JTree.ROOT_VISIBLE_PROPERTY)) { validCachedPreferredSize = false; treeState.setRootVisible(tree.isRootVisible()); tree.repaint(); } else if (property.equals(JTree.SELECTION_MODEL_PROPERTY)) { treeSelectionModel = tree.getSelectionModel(); treeSelectionModel.setRowMapper(treeState); } else if (property.equals(JTree.TREE_MODEL_PROPERTY)) { treeModel = tree.getModel(); treeModel.addTreeModelListener(treeModelListener); } }
|
public void propertyChange(PropertyChangeEvent event) { String property = event.getPropertyName(); if (property.equals(JTree.ROOT_VISIBLE_PROPERTY)) { validCachedPreferredSize = false; treeState.setRootVisible(tree.isRootVisible()); tree.repaint(); } else if (property.equals(JTree.SELECTION_MODEL_PROPERTY)) { treeSelectionModel = tree.getSelectionModel(); treeSelectionModel.setRowMapper(treeState); } else if (property.equals(JTree.TREE_MODEL_PROPERTY)) { treeModel = tree.getModel(); treeModel.addTreeModelListener(treeModelListener); } }
| 14,595
|
public TreeHomeAction(int direction, String name) throws NotImplementedException { // TODO: Implement this properly }
|
public TreeHomeAction(int direction, String name) throws NotImplementedException { // TODO: Implement this properly }
| 14,596
|
public void actionPerformed(ActionEvent e) throws NotImplementedException { // TODO: Implement this properly }
|
public void actionPerformed(ActionEvent e) { // TODO: Implement this properly }
| 14,598
|
public boolean isEnabled() throws NotImplementedException { // TODO: Implement this properly return false; }
|
public boolean isEnabled() { // TODO: Implement this properly return false; }
| 14,600
|
public boolean isEnabled() throws NotImplementedException { // TODO: Implement this properly return false; }
|
public boolean isEnabled() throws NotImplementedException { // TODO: Implement this properly return (tree != null) && tree.isEnabled(); }
| 14,601
|
public TreeIncrementAction(int direction, String name) throws NotImplementedException { // TODO: Implement this properly }
|
public TreeIncrementAction(int direction, String name) throws NotImplementedException { // TODO: Implement this properly }
| 14,602
|
public void actionPerformed(ActionEvent e) { TreePath currentPath = tree.getLeadSelectionPath(); int currentRow; if (currentPath != null) currentRow = treeState.getRowForPath(currentPath); else currentRow = 0; int rows = treeState.getRowCount(); int nextRow = currentRow + 1; int prevRow = currentRow - 1; boolean hasNext = nextRow < rows; boolean hasPrev = prevRow >= 0 && rows > 0; TreePath newPath; String command = e.getActionCommand(); if (command.equals("selectPreviousChangeLead") && hasPrev) { newPath = treeState.getPathForRow(prevRow); tree.setSelectionPath(newPath); tree.setAnchorSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } else if (command.equals("selectPreviousExtendSelection") && hasPrev) { newPath = treeState.getPathForRow(prevRow); // If the new path is already selected, the selection shrinks, // unselecting the previously current path. if (tree.isPathSelected(newPath)) tree.getSelectionModel().removeSelectionPath(currentPath); // This must be called in any case because it updates the model // lead selection index. tree.addSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } else if (command.equals("selectPrevious") && hasPrev) { newPath = treeState.getPathForRow(prevRow); tree.setSelectionPath(newPath); } else if (command.equals("selectNext") && hasNext) { newPath = treeState.getPathForRow(nextRow); tree.setSelectionPath(newPath); } else if (command.equals("selectNextExtendSelection") && hasNext) { newPath = treeState.getPathForRow(nextRow); // If the new path is already selected, the selection shrinks, // unselecting the previously current path. if (tree.isPathSelected(newPath)) tree.getSelectionModel().removeSelectionPath(currentPath); // This must be called in any case because it updates the model // lead selection index. tree.addSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } else if (command.equals("selectNextChangeLead") && hasNext) { newPath = treeState.getPathForRow(nextRow); tree.setSelectionPath(newPath); tree.setAnchorSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } }
|
public void actionPerformed(ActionEvent e) { TreePath currentPath = tree.getLeadSelectionPath(); int currentRow; if (currentPath != null) currentRow = treeState.getRowForPath(currentPath); else currentRow = 0; int rows = treeState.getRowCount(); int nextRow = currentRow + 1; int prevRow = currentRow - 1; boolean hasNext = nextRow < rows; boolean hasPrev = prevRow >= 0 && rows > 0; TreePath newPath; String command = (String) getValue(Action.NAME); if (command.equals("selectPreviousChangeLead") && hasPrev) { newPath = treeState.getPathForRow(prevRow); tree.setSelectionPath(newPath); tree.setAnchorSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } else if (command.equals("selectPreviousExtendSelection") && hasPrev) { newPath = treeState.getPathForRow(prevRow); // If the new path is already selected, the selection shrinks, // unselecting the previously current path. if (tree.isPathSelected(newPath)) tree.getSelectionModel().removeSelectionPath(currentPath); // This must be called in any case because it updates the model // lead selection index. tree.addSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } else if (command.equals("selectPrevious") && hasPrev) { newPath = treeState.getPathForRow(prevRow); tree.setSelectionPath(newPath); } else if (command.equals("selectNext") && hasNext) { newPath = treeState.getPathForRow(nextRow); tree.setSelectionPath(newPath); } else if (command.equals("selectNextExtendSelection") && hasNext) { newPath = treeState.getPathForRow(nextRow); // If the new path is already selected, the selection shrinks, // unselecting the previously current path. if (tree.isPathSelected(newPath)) tree.getSelectionModel().removeSelectionPath(currentPath); // This must be called in any case because it updates the model // lead selection index. tree.addSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } else if (command.equals("selectNextChangeLead") && hasNext) { newPath = treeState.getPathForRow(nextRow); tree.setSelectionPath(newPath); tree.setAnchorSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } }
| 14,604
|
public void actionPerformed(ActionEvent e) throws NotImplementedException { // TODO: Implement this properly. }
|
public void actionPerformed(ActionEvent e) { // TODO: Implement this properly. }
| 14,606
|
public boolean isEnabled() throws NotImplementedException { // FIXME: Not implemented. return false; }
|
public boolean isEnabled() { // FIXME: Not implemented. return false; }
| 14,608
|
public boolean isEnabled() throws NotImplementedException { // FIXME: Not implemented. return false; }
|
public boolean isEnabled() throws NotImplementedException { // FIXME: Not implemented. return (tree != null) && tree.isEnabled(); }
| 14,609
|
public void actionPerformed(ActionEvent e) { TreePath current = tree.getLeadSelectionPath(); if (current == null) return; if (e.getActionCommand().equals("selectParent")) { if (current == null) return; if (tree.isExpanded(current)) { tree.collapsePath(current); } else { // If the node is not expanded (also, if it is a leaf node), // we just select the parent. We do not select the root if it // is not visible. TreePath parent = current.getParentPath(); if (parent != null && !(parent.getPathCount()==1 && !tree.isRootVisible()) ) tree.setSelectionPath(parent); } } else if (e.getActionCommand().equals("selectChild")) { Object node = current.getLastPathComponent(); int nc = treeModel.getChildCount(node); if (nc == 0 || treeState.isExpanded(current)) { // If the node is leaf or it is already expanded, // we just select the next row. int nextRow = tree.getLeadSelectionRow() + 1; if (nextRow <= tree.getRowCount()) tree.setSelectionRow(nextRow); } else { tree.expandPath(current); } } }
|
public void actionPerformed(ActionEvent e) { TreePath current = tree.getLeadSelectionPath(); if (current == null) return; String command = (String) getValue(Action.NAME); if (command.equals("selectParent")) { if (current == null) return; if (tree.isExpanded(current)) { tree.collapsePath(current); } else { // If the node is not expanded (also, if it is a leaf node), // we just select the parent. We do not select the root if it // is not visible. TreePath parent = current.getParentPath(); if (parent != null && !(parent.getPathCount()==1 && !tree.isRootVisible()) ) tree.setSelectionPath(parent); } } else if (e.getActionCommand().equals("selectChild")) { Object node = current.getLastPathComponent(); int nc = treeModel.getChildCount(node); if (nc == 0 || treeState.isExpanded(current)) { // If the node is leaf or it is already expanded, // we just select the next row. int nextRow = tree.getLeadSelectionRow() + 1; if (nextRow <= tree.getRowCount()) tree.setSelectionRow(nextRow); } else { tree.expandPath(current); } } }
| 14,613
|
public void actionPerformed(ActionEvent e) { TreePath current = tree.getLeadSelectionPath(); if (current == null) return; if (e.getActionCommand().equals("selectParent")) { if (current == null) return; if (tree.isExpanded(current)) { tree.collapsePath(current); } else { // If the node is not expanded (also, if it is a leaf node), // we just select the parent. We do not select the root if it // is not visible. TreePath parent = current.getParentPath(); if (parent != null && !(parent.getPathCount()==1 && !tree.isRootVisible()) ) tree.setSelectionPath(parent); } } else if (e.getActionCommand().equals("selectChild")) { Object node = current.getLastPathComponent(); int nc = treeModel.getChildCount(node); if (nc == 0 || treeState.isExpanded(current)) { // If the node is leaf or it is already expanded, // we just select the next row. int nextRow = tree.getLeadSelectionRow() + 1; if (nextRow <= tree.getRowCount()) tree.setSelectionRow(nextRow); } else { tree.expandPath(current); } } }
|
public void actionPerformed(ActionEvent e) { TreePath current = tree.getLeadSelectionPath(); if (current == null) return; if (e.getActionCommand().equals("selectParent")) { if (current == null) return; if (tree.isExpanded(current)) { tree.collapsePath(current); } else { // If the node is not expanded (also, if it is a leaf node), // we just select the parent. We do not select the root if it // is not visible. TreePath parent = current.getParentPath(); if (parent != null && !(parent.getPathCount()==1 && !tree.isRootVisible()) ) tree.setSelectionPath(parent); } } else if (command.equals("selectChild")) { Object node = current.getLastPathComponent(); int nc = treeModel.getChildCount(node); if (nc == 0 || treeState.isExpanded(current)) { // If the node is leaf or it is already expanded, // we just select the next row. int nextRow = tree.getLeadSelectionRow() + 1; if (nextRow <= tree.getRowCount()) tree.setSelectionRow(nextRow); } else { tree.expandPath(current); } } }
| 14,614
|
public BasicTreeUI() { validCachedPreferredSize = false; drawingCache = new Hashtable(); nodeDimensions = createNodeDimensions(); configureLayoutCache(); propertyChangeListener = createPropertyChangeListener(); focusListener = createFocusListener(); treeSelectionListener = createTreeSelectionListener(); mouseListener = createMouseListener(); keyListener = createKeyListener(); selectionModelPropertyChangeListener = createSelectionModelPropertyChangeListener(); componentListener = createComponentListener(); cellEditorListener = createCellEditorListener(); treeExpansionListener = createTreeExpansionListener(); treeModelListener = createTreeModelListener(); editingRow = - 1; lastSelectedRow = - 1; }
|
public BasicTreeUI() { validCachedPreferredSize = false; drawingCache = new Hashtable(); nodeDimensions = createNodeDimensions(); configureLayoutCache(); propertyChangeListener = createPropertyChangeListener(); focusListener = createFocusListener(); treeSelectionListener = createTreeSelectionListener(); mouseListener = createMouseListener(); keyListener = createKeyListener(); selectionModelPropertyChangeListener = createSelectionModelPropertyChangeListener(); componentListener = createComponentListener(); cellEditorListener = createCellEditorListener(); treeExpansionListener = createTreeExpansionListener(); treeModelListener = createTreeModelListener(); editingRow = - 1; lastSelectedRow = - 1; }
| 14,615
|
protected void checkForClickInExpandControl(TreePath path, int mouseX, int mouseY) { if (isLocationInExpandControl(path, mouseX, mouseY)) toggleExpandState(path); }
|
protected void checkForClickInExpandControl(TreePath path, int mouseX, int mouseY) { if (isLocationInExpandControl(path, mouseX, mouseY)) handleExpandControlClick(path, mouseX, mouseY); }
| 14,616
|
protected void completeUIInstall() throws NotImplementedException { // TODO: Implement this properly. }
|
protected void completeUIInstall() { // TODO: Implement this properly. }
| 14,617
|
protected void completeUIUninstall() throws NotImplementedException { // TODO: Implement this properly. }
|
protected void completeUIUninstall() { // TODO: Implement this properly. }
| 14,619
|
protected TreeCellEditor createDefaultCellEditor() { if (currentCellRenderer != null) return new DefaultTreeCellEditor( tree, (DefaultTreeCellRenderer) currentCellRenderer, cellEditor); return new DefaultTreeCellEditor( tree, (DefaultTreeCellRenderer) createDefaultCellRenderer(), cellEditor); }
|
protected TreeCellEditor createDefaultCellEditor() { if (currentCellRenderer != null) return new DefaultTreeCellEditor( tree, (DefaultTreeCellRenderer) currentCellRenderer, cellEditor); return new DefaultTreeCellEditor( tree, (DefaultTreeCellRenderer) createDefaultCellRenderer(), cellEditor); }
| 14,621
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("Tree.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); ActionMap parentActionMap = new ActionMapUIResource(); action = new TreeAction(); Object keys[] = focusInputMap.allKeys(); for (int i = 0; i < keys.length; i++) { parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), convertModifiers(((KeyStroke) keys[i]).getModifiers())), (String) focusInputMap.get((KeyStroke) keys[i])); parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), ((KeyStroke) keys[i]).getModifiers()), (String) focusInputMap.get((KeyStroke) keys[i])); parentActionMap.put( (String) focusInputMap.get((KeyStroke) keys[i]), new ActionListenerProxy( action, (String) focusInputMap.get((KeyStroke) keys[i]))); } parentInputMap.setParent(tree.getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).getParent()); parentActionMap.setParent(tree.getActionMap().getParent()); tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent( parentInputMap); tree.getActionMap().setParent(parentActionMap); }
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("Tree.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); ActionMap parentActionMap = new ActionMapUIResource(); action = new TreeAction(); Object keys[] = focusInputMap.allKeys(); for (int i = 0; i < keys.length; i++) { parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), convertModifiers(((KeyStroke) keys[i]).getModifiers())), (String) focusInputMap.get((KeyStroke) keys[i])); parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), ((KeyStroke) keys[i]).getModifiers()), (String) focusInputMap.get((KeyStroke) keys[i])); parentActionMap.put( (String) focusInputMap.get((KeyStroke) keys[i]), new ActionListenerProxy( action, (String) focusInputMap.get((KeyStroke) keys[i]))); } parentInputMap.setParent(tree.getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).getParent()); parentActionMap.setParent(tree.getActionMap().getParent()); tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent( parentInputMap); tree.getActionMap().setParent(parentActionMap); }
| 14,622
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("Tree.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); ActionMap parentActionMap = new ActionMapUIResource(); action = new TreeAction(); Object keys[] = focusInputMap.allKeys(); for (int i = 0; i < keys.length; i++) { parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), convertModifiers(((KeyStroke) keys[i]).getModifiers())), (String) focusInputMap.get((KeyStroke) keys[i])); parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), ((KeyStroke) keys[i]).getModifiers()), (String) focusInputMap.get((KeyStroke) keys[i])); parentActionMap.put( (String) focusInputMap.get((KeyStroke) keys[i]), new ActionListenerProxy( action, (String) focusInputMap.get((KeyStroke) keys[i]))); } parentInputMap.setParent(tree.getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).getParent()); parentActionMap.setParent(tree.getActionMap().getParent()); tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent( parentInputMap); tree.getActionMap().setParent(parentActionMap); }
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("Tree.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); ActionMap parentActionMap = new ActionMapUIResource(); action = new TreeAction(); for (int i = 0; i < keys.length; i++) { parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), convertModifiers(((KeyStroke) keys[i]).getModifiers())), (String) focusInputMap.get((KeyStroke) keys[i])); parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), ((KeyStroke) keys[i]).getModifiers()), (String) focusInputMap.get((KeyStroke) keys[i])); parentActionMap.put( (String) focusInputMap.get((KeyStroke) keys[i]), new ActionListenerProxy( action, (String) focusInputMap.get((KeyStroke) keys[i]))); } parentInputMap.setParent(tree.getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).getParent()); parentActionMap.setParent(tree.getActionMap().getParent()); tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent( parentInputMap); tree.getActionMap().setParent(parentActionMap); }
| 14,623
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("Tree.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); ActionMap parentActionMap = new ActionMapUIResource(); action = new TreeAction(); Object keys[] = focusInputMap.allKeys(); for (int i = 0; i < keys.length; i++) { parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), convertModifiers(((KeyStroke) keys[i]).getModifiers())), (String) focusInputMap.get((KeyStroke) keys[i])); parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), ((KeyStroke) keys[i]).getModifiers()), (String) focusInputMap.get((KeyStroke) keys[i])); parentActionMap.put( (String) focusInputMap.get((KeyStroke) keys[i]), new ActionListenerProxy( action, (String) focusInputMap.get((KeyStroke) keys[i]))); } parentInputMap.setParent(tree.getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).getParent()); parentActionMap.setParent(tree.getActionMap().getParent()); tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent( parentInputMap); tree.getActionMap().setParent(parentActionMap); }
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("Tree.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); ActionMap parentActionMap = new ActionMapUIResource(); action = new TreeAction(); Object keys[] = focusInputMap.allKeys(); for (int i = 0; i < keys.length; i++) { parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), convertModifiers(((KeyStroke) keys[i]).getModifiers())), (String) focusInputMap.get((KeyStroke) keys[i])); parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), ((KeyStroke) keys[i]).getModifiers()), (String) focusInputMap.get((KeyStroke) keys[i])); parentActionMap.put( (String) focusInputMap.get((KeyStroke) keys[i]), new ActionListenerProxy( action, (String) focusInputMap.get((KeyStroke) keys[i]))); } parentInputMap.setParent(tree.getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).getParent()); parentActionMap.setParent(tree.getActionMap().getParent()); tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent( parentInputMap); tree.getActionMap().setParent(parentActionMap); }
| 14,624
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("Tree.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); ActionMap parentActionMap = new ActionMapUIResource(); action = new TreeAction(); Object keys[] = focusInputMap.allKeys(); for (int i = 0; i < keys.length; i++) { parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), convertModifiers(((KeyStroke) keys[i]).getModifiers())), (String) focusInputMap.get((KeyStroke) keys[i])); parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), ((KeyStroke) keys[i]).getModifiers()), (String) focusInputMap.get((KeyStroke) keys[i])); parentActionMap.put( (String) focusInputMap.get((KeyStroke) keys[i]), new ActionListenerProxy( action, (String) focusInputMap.get((KeyStroke) keys[i]))); } parentInputMap.setParent(tree.getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).getParent()); parentActionMap.setParent(tree.getActionMap().getParent()); tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent( parentInputMap); tree.getActionMap().setParent(parentActionMap); }
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("Tree.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); ActionMap parentActionMap = new ActionMapUIResource(); action = new TreeAction(); Object keys[] = focusInputMap.allKeys(); for (int i = 0; i < keys.length; i++) { parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), convertModifiers(((KeyStroke) keys[i]).getModifiers())), (String) focusInputMap.get((KeyStroke) keys[i])); parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), ((KeyStroke) keys[i]).getModifiers()), (String) focusInputMap.get((KeyStroke) keys[i])); parentActionMap.put( (String) focusInputMap.get((KeyStroke) keys[i]), new ActionListenerProxy( action, (String) focusInputMap.get((KeyStroke) keys[i]))); } parentInputMap.setParent(tree.getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).getParent()); parentActionMap.setParent(tree.getActionMap().getParent()); tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent( parentInputMap); tree.getActionMap().setParent(parentActionMap); }
| 14,625
|
protected void installListeners() { tree.addPropertyChangeListener(propertyChangeListener); tree.addFocusListener(focusListener); tree.addTreeSelectionListener(treeSelectionListener); tree.addMouseListener(mouseListener); tree.addKeyListener(keyListener); tree.addPropertyChangeListener(selectionModelPropertyChangeListener); tree.addComponentListener(componentListener); tree.addTreeExpansionListener(treeExpansionListener); if (treeModel != null) treeModel.addTreeModelListener(treeModelListener); }
|
protected void installListeners() { tree.addPropertyChangeListener(propertyChangeListener); tree.addFocusListener(focusListener); tree.addTreeSelectionListener(treeSelectionListener); tree.addMouseListener(mouseListener); tree.addKeyListener(keyListener); selectionModelPropertyChangeListener = createSelectionModelPropertyChangeListener(); if (treeSelectionModel != null && selectionModelPropertyChangeListener != null) { treeSelectionModel.addPropertyChangeListener (selectionModelPropertyChangeListener); } componentListener = createComponentListener(); tree.addComponentListener(componentListener); tree.addTreeExpansionListener(treeExpansionListener); if (treeModel != null) treeModel.addTreeModelListener(treeModelListener); }
| 14,626
|
public void installUI(JComponent c) { tree = (JTree) c; treeModel = tree.getModel(); prepareForUIInstall(); super.installUI(c); installDefaults(); installComponents(); installKeyboardActions(); installListeners(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; setModel(tree.getModel()); treeSelectionModel = tree.getSelectionModel(); setRootVisible(tree.isRootVisible()); treeState.setRootVisible(tree.isRootVisible()); updateExpandedDescendants(new TreePath(new Object[] { treeModel.getRoot() })); completeUIInstall(); }
|
public void installUI(JComponent c) { tree = (JTree) c; prepareForUIInstall(); super.installUI(c); installDefaults(); installComponents(); installKeyboardActions(); installListeners(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; setModel(tree.getModel()); treeSelectionModel = tree.getSelectionModel(); setRootVisible(tree.isRootVisible()); treeState.setRootVisible(tree.isRootVisible()); updateExpandedDescendants(new TreePath(new Object[] { treeModel.getRoot() })); completeUIInstall(); }
| 14,628
|
public void installUI(JComponent c) { tree = (JTree) c; treeModel = tree.getModel(); prepareForUIInstall(); super.installUI(c); installDefaults(); installComponents(); installKeyboardActions(); installListeners(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; setModel(tree.getModel()); treeSelectionModel = tree.getSelectionModel(); setRootVisible(tree.isRootVisible()); treeState.setRootVisible(tree.isRootVisible()); updateExpandedDescendants(new TreePath(new Object[] { treeModel.getRoot() })); completeUIInstall(); }
|
public void installUI(JComponent c) { tree = (JTree) c; treeModel = tree.getModel(); prepareForUIInstall(); installDefaults(); installComponents(); installKeyboardActions(); installListeners(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; setModel(tree.getModel()); treeSelectionModel = tree.getSelectionModel(); setRootVisible(tree.isRootVisible()); treeState.setRootVisible(tree.isRootVisible()); updateExpandedDescendants(new TreePath(new Object[] { treeModel.getRoot() })); completeUIInstall(); }
| 14,629
|
public void installUI(JComponent c) { tree = (JTree) c; treeModel = tree.getModel(); prepareForUIInstall(); super.installUI(c); installDefaults(); installComponents(); installKeyboardActions(); installListeners(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; setModel(tree.getModel()); treeSelectionModel = tree.getSelectionModel(); setRootVisible(tree.isRootVisible()); treeState.setRootVisible(tree.isRootVisible()); updateExpandedDescendants(new TreePath(new Object[] { treeModel.getRoot() })); completeUIInstall(); }
|
public void installUI(JComponent c) { tree = (JTree) c; treeModel = tree.getModel(); prepareForUIInstall(); super.installUI(c); installDefaults(); installComponents(); installKeyboardActions(); installListeners(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; setModel(tree.getModel()); treeSelectionModel = tree.getSelectionModel(); setRootVisible(tree.isRootVisible()); treeState.setRootVisible(tree.isRootVisible()); updateExpandedDescendants(new TreePath(new Object[] { treeModel.getRoot() })); completeUIInstall(); }
| 14,630
|
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; int row = getRowForPath(tree, path); if (! isLeaf(row)) { Rectangle bounds = getPathBounds(tree, path); if (hasControlIcons() && (mouseX < bounds.x) && (mouseX > (bounds.x - getCurrentControlIcon(path).getIconWidth() - gap))) cntlClick = true; } return cntlClick; }
|
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; int row = getRowForPath(tree, path); if (! isLeaf(row)) { Rectangle bounds = getPathBounds(tree, path); if (hasControlIcons() && (mouseX < bounds.x) && (mouseX > (bounds.x - getCurrentControlIcon(path).getIconWidth() - gap))) cntlClick = true; } return cntlClick; }
| 14,631
|
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; int row = getRowForPath(tree, path); if (! isLeaf(row)) { Rectangle bounds = getPathBounds(tree, path); if (hasControlIcons() && (mouseX < bounds.x) && (mouseX > (bounds.x - getCurrentControlIcon(path).getIconWidth() - gap))) cntlClick = true; } return cntlClick; }
|
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; int row = getRowForPath(tree, path); if (! isLeaf(row)) { int width = 8; Icon expandedIcon = getExpandedIcon(); if (expandedIcon != null) width = expandedIcon.getIconWidth(); if (hasControlIcons() && (mouseX < bounds.x) && (mouseX > (bounds.x - getCurrentControlIcon(path).getIconWidth() - gap))) cntlClick = true; } return cntlClick; }
| 14,632
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.