rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
}
public void popupMenuWillBecomeVisible(PopupMenuEvent event) { // Adds topWindowListener to top-level window to listener to // ComponentEvents fired by it. We need to cancel this popup menu // if topWindow to which this popup belongs was resized or moved. Component invoker = popupMenu.getInv...
popupMenu.setOpaque(true);
public void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); popupMenu.setBackground(defaults.getColor("PopupMenu.background")); popupMenu.setBorder(defaults.getBorder("PopupMenu.border")); popupMenu.setFont(defaults.getFont("PopupMenu.font")); popupMenu.setForeground(defa...
System.out.println("Before getPreferences");
protected void startPlugin() throws PluginException { this.processor = new ConfigurationProcessor(); System.out.println("Before getPreferences"); this.config = new NetConfigurationData(getPreferences()); System.out.println("After getPreferences"); this.service = new ConfigurationS...
System.out.println("After getPreferences");
protected void startPlugin() throws PluginException { this.processor = new ConfigurationProcessor(); System.out.println("Before getPreferences"); this.config = new NetConfigurationData(getPreferences()); System.out.println("After getPreferences"); this.service = new ConfigurationS...
g.drawRect(focusRect.x - 1, focusRect.y - 1, focusRect.width + 1, focusRect.height + 1);
g.drawRect(focusRect.x - 1, focusRect.y, focusRect.width + 1, focusRect.height);
protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) { if (b.hasFocus() && b.isFocusPainted()) { Color savedColor = g.getColor(); g.setColor(getFocusColor()); Rectangle focusRect = iconRect.union(textRect); g.drawRect(fo...
return "Button";
return "Button.";
protected String getPropertyPrefix() { return "Button"; }
focusColor = defaults.getColor(prefix + ".focus"); b.setForeground(defaults.getColor(prefix + ".foreground")); b.setBackground(defaults.getColor(prefix + ".background")); b.setMargin(defaults.getInsets(prefix + ".margin")); b.setBorder(defaults.getBorder(prefix + ".border")); b.setIconTextGap(defaults.getInt(prefix + "...
focusColor = defaults.getColor(prefix + "focus"); b.setForeground(defaults.getColor(prefix + "foreground")); b.setBackground(defaults.getColor(prefix + "background")); b.setMargin(defaults.getInsets(prefix + "margin")); b.setBorder(defaults.getBorder(prefix + "border")); b.setIconTextGap(defaults.getInt(prefix + "textI...
protected void installDefaults(AbstractButton b) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); String prefix = getPropertyPrefix(); focusColor = defaults.getColor(prefix + ".focus"); b.setForeground(defaults.getColor(prefix + ".foreground")); b.setBackground(defaults.getColor(prefix + "....
(InputMap) defaults.get(prefix + ".focusInputMap"));
(InputMap) defaults.get(prefix + "focusInputMap"));
protected void installDefaults(AbstractButton b) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); String prefix = getPropertyPrefix(); focusColor = defaults.getColor(prefix + ".focus"); b.setForeground(defaults.getColor(prefix + ".foreground")); b.setBackground(defaults.getColor(prefix + "....
int indirectCount = fs.getSuperblock().getBlockSize() << 2;
int indirectCount = fs.getSuperblock().getBlockSize() >> 2;
public byte[] getDataBlock(long i) throws IOException { //get the direct blocks (0; 11) if(i<12) return fs.getBlock( Ext2Utils.get32(data,40+(int)i*4) ); //see the indirect blocks (12; indirectCount-1) int indirectCount = fs.getSuperblock().getBlockSize() << 2; //a block index is 4 bytes long if(i<12+indirectCo...
public byte[] getBlock(long nr) throws IOException{
protected byte[] getBlock(long nr) throws IOException{
public byte[] getBlock(long nr) throws IOException{ if(isClosed()) throw new IOException("FS closed (fs instance: "+this+")"); //log.debug("blockCache size: "+blockCache.size()); int blockSize = superblock.getBlockSize(); Block result; Integer key=new Integer((int)(nr)); synchronized(blockCache) { ...
else if (e.id == FocusEvent.FOCUS_LOST) {
public boolean dispatchEvent (AWTEvent e) { if (e instanceof WindowEvent) { Window target = (Window) e.getSource (); if (e.id == WindowEvent.WINDOW_ACTIVATED) setGlobalActiveWindow (target); else if (e.id == WindowEvent.WINDOW_GAINED_FOCUS) setGlobalFocusedWindow (targe...
if (focusOwner != null)
if (focusOwner != null && ! (focusOwner instanceof Window))
public boolean dispatchEvent (AWTEvent e) { if (e instanceof WindowEvent) { Window target = (Window) e.getSource (); if (e.id == WindowEvent.WINDOW_ACTIVATED) setGlobalActiveWindow (target); else if (e.id == WindowEvent.WINDOW_GAINED_FOCUS) setGlobalFocusedWindow (targe...
} else if (e.id == FocusEvent.FOCUS_LOST) {
public boolean dispatchEvent (AWTEvent e) { if (e instanceof WindowEvent) { Window target = (Window) e.getSource (); if (e.id == WindowEvent.WINDOW_ACTIVATED) setGlobalActiveWindow (target); else if (e.id == WindowEvent.WINDOW_GAINED_FOCUS) setGlobalFocusedWindow (targe...
firePropertyChange("activeWindow", activeWindow, window); try { fireVetoableChange("activeWindow", activeWindow, window); activeWindow = window; } catch (PropertyVetoException e) { }
setGlobalObject (currentActiveWindows, window, "activeWindow");
protected void setGlobalActiveWindow(Window window) { // XXX Should this send focus events to the windows involved? firePropertyChange("activeWindow", activeWindow, window); try { fireVetoableChange("activeWindow", activeWindow, window); activeWindow = window; } catch (PropertyVet...
{ firePropertyChange("focusedWindow", focusedWindow, window); try { fireVetoableChange("focusedWindow", focusedWindow, window); focusedWindow = window; } catch (PropertyVetoException e) { } }
setGlobalObject (currentFocusedWindows, window, "focusedWindow");
protected void setGlobalFocusedWindow(Window window) { // XXX Should this send focus events to the windows involved? if (window == null || window.focusable) { firePropertyChange("focusedWindow", focusedWindow, window); try { fireVetoableChange("focusedWindow", focusedWind...
throw new Error("not implemented");
e.setSource (target); dispatchEvent (e);
public final void redispatchEvent(Component target, AWTEvent e) { throw new Error("not implemented"); }
{ firePropertyChange("focusOwner", focusOwner, owner); try { fireVetoableChange("focusOwner", focusOwner, owner); focusOwner = owner;
setGlobalObject (currentFocusOwners, owner, "focusOwner");
protected void setGlobalFocusOwner(Component owner) { // XXX Should this send focus events to the components involved? if (owner == null || owner.focusable) { firePropertyChange("focusOwner", focusOwner, owner); try { fireVetoableChange("focusOwner", focusOwner, owner); ...
catch (PropertyVetoException e) { } } }
protected void setGlobalFocusOwner(Component owner) { // XXX Should this send focus events to the components involved? if (owner == null || owner.focusable) { firePropertyChange("focusOwner", focusOwner, owner); try { fireVetoableChange("focusOwner", focusOwner, owner); ...
{ firePropertyChange("permanentFocusOwner", permanentFocusOwner, focusOwner); try { fireVetoableChange("permanentFocusOwner", permanentFocusOwner, focusOwner); permanentFocusOwner = focusOwner; } catch (PropertyVetoException e) { }
setGlobalObject (currentPermanentFocusOwners, focusOwner, "permanentFocusOwner");
protected void setGlobalPermanentFocusOwner(Component focusOwner) { // XXX Should this send focus events to the components involved? if (focusOwner == null || focusOwner.focusable) { firePropertyChange("permanentFocusOwner", permanentFocusOwner, focusOwner); try ...
}
protected void setGlobalPermanentFocusOwner(Component focusOwner) { // XXX Should this send focus events to the components involved? if (focusOwner == null || focusOwner.focusable) { firePropertyChange("permanentFocusOwner", permanentFocusOwner, focusOwner); try ...
protected Component getGlobalPermanentFocusOwner() { return permanentFocusOwner == null ? focusOwner : permanentFocusOwner;
protected Component getGlobalPermanentFocusOwner () { return (Component) getGlobalObject (currentPermanentFocusOwners);
protected Component getGlobalPermanentFocusOwner() { // XXX Need a way to test if this thread is in the context of the focus // owner, and throw a SecurityException if that is the case. // XXX Implement. return permanentFocusOwner == null ? focusOwner : permanentFocusOwner; }
protected void setGlobalCurrentFocusCycleRoot(Container cycleRoot)
public void setGlobalCurrentFocusCycleRoot (Container cycleRoot)
protected void setGlobalCurrentFocusCycleRoot(Container cycleRoot) { firePropertyChange("currentFocusCycleRoot", focusCycleRoot, cycleRoot); focusCycleRoot = cycleRoot; }
firePropertyChange("currentFocusCycleRoot", focusCycleRoot, cycleRoot); focusCycleRoot = cycleRoot;
setGlobalObject (currentFocusCycleRoots, cycleRoot, "currentFocusCycleRoot");
protected void setGlobalCurrentFocusCycleRoot(Container cycleRoot) { firePropertyChange("currentFocusCycleRoot", focusCycleRoot, cycleRoot); focusCycleRoot = cycleRoot; }
return focusOwner;
Component focusOwner = (Component) getGlobalObject (currentFocusOwners); return (focusOwner == null) ? getGlobalPermanentFocusOwner () : focusOwner;
protected Component getGlobalFocusOwner() { // XXX Need a way to test if this thread is in the context of the focus // owner, and throw a SecurityException if that is the case. // XXX Implement. return focusOwner; }
return focusedWindow;
return (Window) getGlobalObject (currentFocusedWindows);
protected Window getGlobalFocusedWindow() { // XXX Need a way to test if this thread is in the context of the focus // owner, and throw a SecurityException if that is the case. // XXX Implement. return focusedWindow; }
return(menus.size());
return countMenus ();
getMenuCount(){ // FIXME: How does the help menu fit in here? return(menus.size());}
public int getItemCount() { return (items.size()); }
getItemCount() { return countItems (); }
public int getItemCount() { return (items.size()); }
public MenuItem getItem(int index) { return ((MenuItem) items.elementAt(index)); }
getItem(int index) { return((MenuItem)items.elementAt(index)); }
public MenuItem getItem(int index) { return ((MenuItem) items.elementAt(index)); }
public static AWTKeyStroke getAWTKeyStroke(int keyCode, int modifiers, boolean release)
public static AWTKeyStroke getAWTKeyStroke(char keyChar)
public static AWTKeyStroke getAWTKeyStroke(int keyCode, int modifiers, boolean release) { return getAWTKeyStroke(KeyEvent.CHAR_UNDEFINED, keyCode, extend(modifiers), release); }
return getAWTKeyStroke(KeyEvent.CHAR_UNDEFINED, keyCode, extend(modifiers), release);
return getAWTKeyStroke(keyChar, KeyEvent.VK_UNDEFINED, 0, false);
public static AWTKeyStroke getAWTKeyStroke(int keyCode, int modifiers, boolean release) { return getAWTKeyStroke(KeyEvent.CHAR_UNDEFINED, keyCode, extend(modifiers), release); }
public abstract void setLabel(String label);
void setLabel (String label);
public abstract void setLabel(String label);
limit(capacity());
public FloatBuffer compact () { int copied = 0; while (remaining () > 0) { put (copied, get ()); copied++; } position (copied); return this; }
return BIG_ENDIAN;
return (System.getProperty ("gnu.cpu.endian").equals("big") ? BIG_ENDIAN : LITTLE_ENDIAN);
public static ByteOrder nativeOrder() { return BIG_ENDIAN; }
private MyClassLoader (URL[] urls, ClassLoader parent, String annotation)
MyClassLoader (URL[] urls, ClassLoader parent, String annotation)
private MyClassLoader (URL[] urls, ClassLoader parent, String annotation) { super (urls, parent); this.annotation = annotation; }
for (j = i; j < num && ! found_one; ++j)
for (j = i; j < num; ++j)
public void layoutContainer (Container parent) { synchronized (parent.getTreeLock ()) { int num = parent.getComponentCount (); // This is more efficient than calling getComponents(). Component[] comps = parent.component; Dimension d = parent.getSize (); Insets ins = parent.getInsets (); ComponentOrientation ...
if (! comps[i].visible)
if (! comps[j].visible)
public void layoutContainer (Container parent) { synchronized (parent.getTreeLock ()) { int num = parent.getComponentCount (); // This is more efficient than calling getComponents(). Component[] comps = parent.component; Dimension d = parent.getSize (); Insets ins = parent.getInsets (); ComponentOrientation ...
Dimension c = comps[i].getPreferredSize ();
Dimension c = comps[j].getPreferredSize ();
public void layoutContainer (Container parent) { synchronized (parent.getTreeLock ()) { int num = parent.getComponentCount (); // This is more efficient than calling getComponents(). Component[] comps = parent.component; Dimension d = parent.getSize (); Insets ins = parent.getInsets (); ComponentOrientation ...
x = (d.width - new_w) / 2;
x = ins.left + (d.width - new_w) / 2 + hgap;
public void layoutContainer (Container parent) { synchronized (parent.getTreeLock ()) { int num = parent.getComponentCount (); // This is more efficient than calling getComponents(). Component[] comps = parent.component; Dimension d = parent.getSize (); Insets ins = parent.getInsets (); ComponentOrientation ...
x = d.width - new_w;
x = ins.left + (d.width - new_w) + hgap;
public void layoutContainer (Container parent) { synchronized (parent.getTreeLock ()) { int num = parent.getComponentCount (); // This is more efficient than calling getComponents(). Component[] comps = parent.component; Dimension d = parent.getSize (); Insets ins = parent.getInsets (); ComponentOrientation ...
comps[k].setBounds (x, y, c.width, new_h);
comps[k].setBounds (x, y + (new_h - c.height) / 2, c.width, c.height);
public void layoutContainer (Container parent) { synchronized (parent.getTreeLock ()) { int num = parent.getComponentCount (); // This is more efficient than calling getComponents(). Component[] comps = parent.component; Dimension d = parent.getSize (); Insets ins = parent.getInsets (); ComponentOrientation ...
return new primitiveArrayTypeCode(TCKind.tk_string);
return new ArrayTypeCode(TCKind.tk_string);
public static TypeCode type() { return new primitiveArrayTypeCode(TCKind.tk_string); }
protected AccessibleJSplitPane(JSplitPane value0)
protected AccessibleJSplitPane()
protected AccessibleJSplitPane(JSplitPane value0) { super(value0); }
super(value0);
protected AccessibleJSplitPane(JSplitPane value0) { super(value0); }
accessibleContext = new AccessibleJSplitPane(this);
accessibleContext = new AccessibleJSplitPane();
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) accessibleContext = new AccessibleJSplitPane(this); return accessibleContext; }
public boolean isDesignTime();
boolean isDesignTime();
public boolean isDesignTime();
public void setDesignTime(boolean designTime);
void setDesignTime(boolean designTime);
public void setDesignTime(boolean designTime);
if (viewSize == null) return getView().getPreferredSize();
if (isViewSizeSet) return viewSize;
public Dimension getViewSize() { if (viewSize == null) return getView().getPreferredSize(); else return viewSize; }
return viewSize;
return getView().getSize();
public Dimension getViewSize() { if (viewSize == null) return getView().getPreferredSize(); else return viewSize; }
verticalScrollBar = scrollPane.getVerticalScrollBar(); horizontalScrollBar = scrollPane.getHorizontalScrollBar(); verticalScrollBarPolicy = scrollPane.getVerticalScrollBarPolicy(); horizontalScrollBarPolicy = scrollPane.getHorizontalScrollBarPolicy();
vsb = scrollPane.getVerticalScrollBar(); hsb = scrollPane.getHorizontalScrollBar(); vsbPolicy = scrollPane.getVerticalScrollBarPolicy(); hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();
public void syncWithScrollPane(JScrollPane scrollPane) { viewport = scrollPane.getViewport(); verticalScrollBar = scrollPane.getVerticalScrollBar(); horizontalScrollBar = scrollPane.getHorizontalScrollBar(); verticalScrollBarPolicy = scrollPane.getVerticalScrollBarPolicy(); horizontalScrollBarPolicy = ...
throw new RuntimeException(ex);
return null;
public VmType findLoadedClass(String name) { if (classInfos != null) { if (name.indexOf('/') >= 0) { throw new IllegalArgumentException( "name contains '/'"); } final ClassInfo ci = getClassInfo(name, false); if (ci != null) { try { ...
defExHandler = null;
defExHandler = Address.zero();
public void compileRuntime(VmMethod method, ObjectResolver resolver, int level, NativeStream os) { if (method.isNative()) { throw new IllegalArgumentException("Cannot compile native methods"); } // long start = System.currentTimeMillis(); // System.out.println("Comp...
AbstractVmClassLoader clc,
VmClassLoader clc,
public static final VmType defineClass( String className, byte[] data, int offset, int class_image_length, boolean rejectNatives, AbstractVmClassLoader clc, SelectorMap selectorMap, VmStatics statics) { cl_init(); VmType cls = decodeClass(data, offset, class_image_length, rejectNatives, clc, selectorMap, sta...
public abstract void read(cdrInput in);
public abstract void read(AbstractCdrInput in);
public abstract void read(cdrInput in);
public abstract void write(cdrOutput out);
public abstract void write(AbstractCdrOutput out);
public abstract void write(cdrOutput out);
return new primitiveArrayTypeCode(TCKind.tk_long);
return new ArrayTypeCode(TCKind.tk_long);
public static TypeCode type() { return new primitiveArrayTypeCode(TCKind.tk_long); }
if (ctx.length < 3)
if (ctx.length < 5)
public static ClassLoader getCallingClassLoader() { Class[] ctx = getClassContext(); if (ctx.length < 3) return null; return ctx[2].getClassLoader(); }
return ctx[2].getClassLoader();
return ctx[4].getClassLoader();
public static ClassLoader getCallingClassLoader() { Class[] ctx = getClassContext(); if (ctx.length < 3) return null; return ctx[2].getClassLoader(); }
public static double getDouble (ByteBuffer buffer, int index, ByteOrder order)
public static double getDouble (ByteBuffer buffer, ByteOrder order)
public static double getDouble (ByteBuffer buffer, int index, ByteOrder order) { return Double.longBitsToDouble (getLong (buffer, index, order)); }
return Double.longBitsToDouble (getLong (buffer, index, order));
return Double.longBitsToDouble (getLong (buffer, order));
public static double getDouble (ByteBuffer buffer, int index, ByteOrder order) { return Double.longBitsToDouble (getLong (buffer, index, order)); }
public static void putDouble (ByteBuffer buffer, int index, double value, ByteOrder order)
public static void putDouble (ByteBuffer buffer, double value, ByteOrder order)
public static void putDouble (ByteBuffer buffer, int index, double value, ByteOrder order) { putLong (buffer, index, Double.doubleToRawLongBits (value), order); }
putLong (buffer, index, Double.doubleToRawLongBits (value), order);
putLong (buffer, Double.doubleToRawLongBits (value), order);
public static void putDouble (ByteBuffer buffer, int index, double value, ByteOrder order) { putLong (buffer, index, Double.doubleToRawLongBits (value), order); }
public DefaultMutableTreeNode() { }
public DefaultMutableTreeNode() { this(null, true); }
public DefaultMutableTreeNode() { // TODO } // DefaultMutableTreeNode()
public void add(MutableTreeNode child) {
public void add(MutableTreeNode child) { if (child == null) throw new IllegalArgumentException(); if (! allowsChildren) throw new IllegalStateException();
public void add(MutableTreeNode child) { children.add(child); child.setParent(this); } // add()
public Enumeration children() {
public Enumeration children() { if (children.size() == 0) return EMPTY_ENUMERATION;
public Enumeration children() { return children.elements(); } // children()
public Object clone() { return null; }
public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { return null; } }
public Object clone() { return null; // TODO } // clone()
public Enumeration depthFirstEnumeration() { return null; }
public Enumeration depthFirstEnumeration() { return postorderEnumeration(); }
public Enumeration depthFirstEnumeration() { return null; // TODO } // depthFirstEnumeration()
public TreeNode getChildAfter(TreeNode node) {
public TreeNode getChildAfter(TreeNode node) { if (node == null || node.getParent() != this) throw new IllegalArgumentException();
public TreeNode getChildAfter(TreeNode node) { // Variables int index; // Check node if (node == null || node.getParent() != this) { throw new IllegalArgumentException(); } // if // Get index of child node index = getIndex(node); // Check for child after index++; if (index == getChildCount()) { return n...
int index;
int index = getIndex(node) + 1;
public TreeNode getChildAfter(TreeNode node) { // Variables int index; // Check node if (node == null || node.getParent() != this) { throw new IllegalArgumentException(); } // if // Get index of child node index = getIndex(node); // Check for child after index++; if (index == getChildCount()) { return n...
if (node == null || node.getParent() != this) { throw new IllegalArgumentException(); }
if (index == getChildCount()) return null;
public TreeNode getChildAfter(TreeNode node) { // Variables int index; // Check node if (node == null || node.getParent() != this) { throw new IllegalArgumentException(); } // if // Get index of child node index = getIndex(node); // Check for child after index++; if (index == getChildCount()) { return n...
index = getIndex(node); index++; if (index == getChildCount()) { return null; }
public TreeNode getChildAfter(TreeNode node) { // Variables int index; // Check node if (node == null || node.getParent() != this) { throw new IllegalArgumentException(); } // if // Get index of child node index = getIndex(node); // Check for child after index++; if (index == getChildCount()) { return n...
public TreeNode getChildBefore(TreeNode node) {
public TreeNode getChildBefore(TreeNode node) { if (node == null || node.getParent() != this) throw new IllegalArgumentException();
public TreeNode getChildBefore(TreeNode node) { // Variables int index; // Check node if (node == null || node.getParent() != this) { throw new IllegalArgumentException(); } // if // Get index of child node index = getIndex(node); // Check for child before index--; if (index < 0) { return null; } // if...
int index;
int index = getIndex(node) - 1;
public TreeNode getChildBefore(TreeNode node) { // Variables int index; // Check node if (node == null || node.getParent() != this) { throw new IllegalArgumentException(); } // if // Get index of child node index = getIndex(node); // Check for child before index--; if (index < 0) { return null; } // if...
if (node == null || node.getParent() != this) { throw new IllegalArgumentException(); }
if (index < 0) return null;
public TreeNode getChildBefore(TreeNode node) { // Variables int index; // Check node if (node == null || node.getParent() != this) { throw new IllegalArgumentException(); } // if // Get index of child node index = getIndex(node); // Check for child before index--; if (index < 0) { return null; } // if...
index = getIndex(node); index--; if (index < 0) { return null; }
public TreeNode getChildBefore(TreeNode node) { // Variables int index; // Check node if (node == null || node.getParent() != this) { throw new IllegalArgumentException(); } // if // Get index of child node index = getIndex(node); // Check for child before index--; if (index < 0) { return null; } // if...
public int getDepth() {
public int getDepth() { if ((! allowsChildren) || children.size() == 0) return 0;
public int getDepth() { // Variables TreeNode node; int depth; int current; int size; Stack stack; int index; // Check for children if (allowsChildren == false || children.size() == 0) { return 0; } // if // Process Depths stack = new Stack(); stack.push(new Integer(0)); node = getChildA...
TreeNode node; int depth; int current; int size; Stack stack; int index; if (allowsChildren == false || children.size() == 0) { return 0; } stack = new Stack();
Stack stack = new Stack();
public int getDepth() { // Variables TreeNode node; int depth; int current; int size; Stack stack; int index; // Check for children if (allowsChildren == false || children.size() == 0) { return 0; } // if // Process Depths stack = new Stack(); stack.push(new Integer(0)); node = getChildA...
node = getChildAt(0); depth = 0; current = 1; while (stack.empty() == false) { if (node.getChildCount() != 0) {
TreeNode node = getChildAt(0); int depth = 0; int current = 1; while (! stack.empty()) { if (node.getChildCount() != 0) {
public int getDepth() { // Variables TreeNode node; int depth; int current; int size; Stack stack; int index; // Check for children if (allowsChildren == false || children.size() == 0) { return 0; } // if // Process Depths stack = new Stack(); stack.push(new Integer(0)); node = getChildA...
} else { if (current > depth) depth = current;
public int getDepth() { // Variables TreeNode node; int depth; int current; int size; Stack stack; int index; // Check for children if (allowsChildren == false || children.size() == 0) { return 0; } // if // Process Depths stack = new Stack(); stack.push(new Integer(0)); node = getChildA...
} else {
int size; int index;
public int getDepth() { // Variables TreeNode node; int depth; int current; int size; Stack stack; int index; // Check for children if (allowsChildren == false || children.size() == 0) { return 0; } // if // Process Depths stack = new Stack(); stack.push(new Integer(0)); node = getChildA...
if (current > depth) { depth = current; } do {
do {
public int getDepth() { // Variables TreeNode node; int depth; int current; int size; Stack stack; int index; // Check for children if (allowsChildren == false || children.size() == 0) { return 0; } // if // Process Depths stack = new Stack(); stack.push(new Integer(0)); node = getChildA...
index = ((Integer) stack.pop()).intValue(); index++;
} while (index >= size && node != this);
public int getDepth() { // Variables TreeNode node; int depth; int current; int size; Stack stack; int index; // Check for children if (allowsChildren == false || children.size() == 0) { return 0; } // if // Process Depths stack = new Stack(); stack.push(new Integer(0)); node = getChildA...
} while (index >= size && node != this); if (index < size) {
if (index < size) {
public int getDepth() { // Variables TreeNode node; int depth; int current; int size; Stack stack; int index; // Check for children if (allowsChildren == false || children.size() == 0) { return 0; } // if // Process Depths stack = new Stack(); stack.push(new Integer(0)); node = getChildA...
public DefaultMutableTreeNode getFirstLeaf() {
public DefaultMutableTreeNode getFirstLeaf() { TreeNode current = this;
public DefaultMutableTreeNode getFirstLeaf() { // Variables TreeNode current; current = this; while (current.getChildCount() > 0) { current = current.getChildAt(0); } // while return (DefaultMutableTreeNode) current; } // getFirstLeaf()
TreeNode current; current = this; while (current.getChildCount() > 0) {
while (current.getChildCount() > 0)
public DefaultMutableTreeNode getFirstLeaf() { // Variables TreeNode current; current = this; while (current.getChildCount() > 0) { current = current.getChildAt(0); } // while return (DefaultMutableTreeNode) current; } // getFirstLeaf()
}
public DefaultMutableTreeNode getFirstLeaf() { // Variables TreeNode current; current = this; while (current.getChildCount() > 0) { current = current.getChildAt(0); } // while return (DefaultMutableTreeNode) current; } // getFirstLeaf()
public DefaultMutableTreeNode getLastLeaf() {
public DefaultMutableTreeNode getLastLeaf() { TreeNode current = this; int size = current.getChildCount();
public DefaultMutableTreeNode getLastLeaf() { // Variables TreeNode current; int size; current = this; size = current.getChildCount(); while (size > 0) { current = current.getChildAt(size - 1); size = current.getChildCount(); } // while return (DefaultMutableTreeNode) current; } // getLastLeaf()
TreeNode current; int size; current = this; size = current.getChildCount(); while (size > 0) {
while (size > 0) {
public DefaultMutableTreeNode getLastLeaf() { // Variables TreeNode current; int size; current = this; size = current.getChildCount(); while (size > 0) { current = current.getChildAt(size - 1); size = current.getChildCount(); } // while return (DefaultMutableTreeNode) current; } // getLastLeaf()
public int getLeafCount() {
public int getLeafCount() { int count = 0; Enumeration e = depthFirstEnumeration();
public int getLeafCount() { // Variables Enumeration e; int count; TreeNode current; // Get Enumeration of all descendants e = depthFirstEnumeration(); // Process Nodes count = 0; while (e.hasMoreElements() == true) { current = (TreeNode) e.nextElement(); if (current.isLeaf() == true) { count++; } ...
Enumeration e; int count; TreeNode current;
while (e.hasMoreElements()) { TreeNode current = (TreeNode) e.nextElement();
public int getLeafCount() { // Variables Enumeration e; int count; TreeNode current; // Get Enumeration of all descendants e = depthFirstEnumeration(); // Process Nodes count = 0; while (e.hasMoreElements() == true) { current = (TreeNode) e.nextElement(); if (current.isLeaf() == true) { count++; } ...
e = depthFirstEnumeration(); count = 0; while (e.hasMoreElements() == true) { current = (TreeNode) e.nextElement(); if (current.isLeaf() == true) {
if (current.isLeaf())
public int getLeafCount() { // Variables Enumeration e; int count; TreeNode current; // Get Enumeration of all descendants e = depthFirstEnumeration(); // Process Nodes count = 0; while (e.hasMoreElements() == true) { current = (TreeNode) e.nextElement(); if (current.isLeaf() == true) { count++; } ...
} }
}
public int getLeafCount() { // Variables Enumeration e; int count; TreeNode current; // Get Enumeration of all descendants e = depthFirstEnumeration(); // Process Nodes count = 0; while (e.hasMoreElements() == true) { current = (TreeNode) e.nextElement(); if (current.isLeaf() == true) { count++; } ...
public int getLevel() {
public int getLevel() { int count = -1; TreeNode current = this;
public int getLevel() { // Variables TreeNode current; int count; // Lookup Parent count = -1; current = this; do { current = current.getParent(); count++; } while (current != null); return count; } // getLevel()
TreeNode current; int count; count = -1; current = this; do {
do {
public int getLevel() { // Variables TreeNode current; int count; // Lookup Parent count = -1; current = this; do { current = current.getParent(); count++; } while (current != null); return count; } // getLevel()
public DefaultMutableTreeNode getNextLeaf() { return null; }
public DefaultMutableTreeNode getNextLeaf() { if (parent == null) return null; return null; }
public DefaultMutableTreeNode getNextLeaf() { return null; // TODO } // getNextLeaf()
public DefaultMutableTreeNode getNextNode() { return null; }
public DefaultMutableTreeNode getNextNode() { if (getChildCount() != 0) return (DefaultMutableTreeNode) getChildAt(0); DefaultMutableTreeNode node = this; DefaultMutableTreeNode sibling; do { sibling = node.getNextSibling(); node = (DefaultMutableTreeNode) node.getParent(); } while (sibling == null && node != null)...
public DefaultMutableTreeNode getNextNode() { return null; // TODO } // getNextNode()
public DefaultMutableTreeNode getNextSibling() {
public DefaultMutableTreeNode getNextSibling() { if (parent == null) return null;
public DefaultMutableTreeNode getNextSibling() { // Variables int index; int size; // Check for Parent if (parent == null) { return null; } // if // Get Index of this node index = parent.getIndex(this); // Check for Next Sibling size = parent.getChildCount(); index++; if (index == size) { return null...
int index; int size;
int index = parent.getIndex(this) + 1;
public DefaultMutableTreeNode getNextSibling() { // Variables int index; int size; // Check for Parent if (parent == null) { return null; } // if // Get Index of this node index = parent.getIndex(this); // Check for Next Sibling size = parent.getChildCount(); index++; if (index == size) { return null...
if (parent == null) {
if (index == parent.getChildCount())
public DefaultMutableTreeNode getNextSibling() { // Variables int index; int size; // Check for Parent if (parent == null) { return null; } // if // Get Index of this node index = parent.getIndex(this); // Check for Next Sibling size = parent.getChildCount(); index++; if (index == size) { return null...
} index = parent.getIndex(this); size = parent.getChildCount(); index++; if (index == size) { return null; }
public DefaultMutableTreeNode getNextSibling() { // Variables int index; int size; // Check for Parent if (parent == null) { return null; } // if // Get Index of this node index = parent.getIndex(this); // Check for Next Sibling size = parent.getChildCount(); index++; if (index == size) { return null...
public TreeNode[] getPath() { TreeNode[] path; int size; int index; TreeNode current; size = getLevel() + 1; path = new TreeNode[size]; current = this; for (index = size - 1; index >= 0; index--) { path[index] = current; current = current.getParent(); } return path; }
public TreeNode[] getPath() { return getPathToRoot(this, 0); }
public TreeNode[] getPath() { // Variables TreeNode[] path; int size; int index; TreeNode current; // Determine length of Path size = getLevel() + 1; // Create Path path = new TreeNode[size]; current = this; for (index = size - 1; index >= 0; index--) { path[index] = current; current = current.getPa...