Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 114283 Details for
Bug 157517
JTree.getSelectionModel().setSelectionMode throws exception
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
Device.java
Device.java (text/plain), 3.65 KB, created by
Pete Zaitcev
on 2005-05-12 07:43:36 UTC
(
hide
)
Description:
Device.java
Filename:
MIME Type:
Creator:
Pete Zaitcev
Created:
2005-05-12 07:43:36 UTC
Size:
3.65 KB
patch
obsolete
>/* > * Java USB code for USBmonitor program > * Copyright (C) 2001 by David Harding > * > * This program is free software; you can redistribute it and/or modify > * it under the terms of the GNU Lesser General Public License as > * published by the Free Software Foundation; either version 2.1 of the > * License, or (at your option) any later version. > * > * This program is distributed in the hope that it will be useful, > * but WITHOUT ANY WARRANTY; without even the implied warranty of > * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > * GNU Lesser General Public License for more details. > * > * You should have received a copy of the GNU Lesser General Public > * License along with this program; if not, write to the Free Software > * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > */ > > >import java.io.IOException; >import java.io.Serializable; >import java.util.*; >import javax.swing.tree.*; >import javax.swing.event.*; >import javax.swing.table.*; >import javax.swing.*; >import java.awt.*; >import java.awt.event.*; > > >/** > * Class used to store information about device. > * > * @author David Harding > * @version 0.1 > */ >public class Device implements TreeModel >{ > /** > * The list of devices connected to this one. > */ > public Vector children; > > /** > * This returns a textual representation of the Device and its > * children. The integer refers to the level of indent alrady > * repsent in the Bus, as the device does not necessarily know > * its level in a system. > */ > public String toString(int indent) > { > return(indent + " foo"); > } > > > /** > * This returns the Bus object on which this device sits. > * > * This method is required by the TreeModel interface. > */ > public Object getRoot() > { > return this; > } > > /** > * This returns the child of the particular. > * > * This method is required by the TreeModel interface. > */ > public Object getChild(Object parent, int index) > { > /*StringBuffer rep=new StringBuffer(); > > rep.append("getChild called with dev,num "); > rep.append(((Device)parent).num); > rep.append(" , "); > rep.append(index); > System.out.println(rep.toString());*/ > return ((Device)parent).children.get(index); > } > > /** > * This method gets the number of children for a parent. > * > * This method is required by the TreeModel interface. > */ > public int getChildCount(Object parent) > { > return ((Device)parent).children.size(); > } > > /** > * This method returns the index of the child in parent's children. > * > * This method is required by the TreeModel interface. > */ > public int getIndexOfChild(Object parent, Object child) > { > return ((Device)parent).children.indexOf(child); > } > > /** > * This method returns whether the object is a leaf or not. > * i.e. whether this device is not a hub, although a nhub with no > * devices attatched will also return true. > * > * This method is required by the TreeModel interface. > */ > public boolean isLeaf(Object dev) > { > return ((Device)dev).children.size() == 0; > } > > /** > * valueForPathChanged not fully implemented. > * > * This method is required by the TreeModel interface. > */ > public void valueForPathChanged(TreePath path, Object NewValue) > { > } > /** > * addTreeModelListener not fully implemented. > * > * This method is required by the TreeModel interface. > */ > public void addTreeModelListener(TreeModelListener l) > { > > } > /** > * removeTreeModelListener not fully implemented. > * > * This method is required by the TreeModel interface. > */ > public void removeTreeModelListener(TreeModelListener l) > { > > } > > /** > * This returns a brief textual representation of the Device > */ > public String toString() > { > return("foo"); > } > > > public Device(){ > children = new Vector(); > } >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 157517
:
114282
| 114283