Forcing a JTree to only accept one type of node?

So I have a JTree and I want to make sure that all of its nodes are of the same, specific type (that type being a custom extension of DefaultMutableTreeNode).
The way to do this that initially crosses my mind is to extend JTree and override the add method and constructor to only accept nodes of this type (and just throw an exception if given a node if a different type). Then I realized that if someone connected up a bunch of some other kind of node but rooted it with the custom node, the custom JTree would accept it. Then I thought I'd probably have to override my node's add method so that you can't add nodes of other types to it either. This seems like a lot of work that I'd like to avoid if possible.
Does anyone see a more straightforward way of doing this?

Don't subclass JTree. Subclass DefaultTreeModel to only accept your kind of node, or probably better still, just write your own TreeModel. Making the modifications to TreeNode seems odd to me.

Similar Messages

  • When importing files into fcpx from go pro hero2, some are importing as .mov and some as .mp4. when making a multi cam clip it will only add one type, if you try and add the other it says camera clip cannot be processed.

    when importing files into fcpx from go pro hero2, some are importing as .mov and some as .mp4. when making a multi cam clip it will only add one type, if you try and add the other it says camera clip cannot be processed. need to figure out why it randomly imports differently, or how to add different file tyoes to multi cam.

    here is one that is imported and stays .mp4. the specs are same as original file before import.
    here is one that has changed somehow during import. specs on original file are same as above, but once it is imported it changes to this in event folder, and others randomly keep the above specs.

  • Old I-tunes accepted both my i-pods now it only accepts one and tells me that I CANNOT SYNC MY SECOND I-POD AS A DUPLICATED NAME WAS USED...DON'T KNOW WHAT THIS MEANS CAN ANYONE HELP?

    Old I-tunes accepted both my i-pods - now it only accepts one and tells me the second cannot be synched as a duplicate name has been used.
    There is no explanation as to what I must do to put this right....can anyone help with this? Thanks.   

    If you are wondering why you are not getting any responses, it is because you have vented a complaint without any details that make any sense or give anyone something to work on.
    If you want help, I suggest actually detailing what has happened, with versions of software etc. Anything that would let us assist.
    As a start I am guessing that you have not really got the hang of "How it all works". Firstly download the Pages09_UserGuide.pdf from under the Help menu. Read that and view the Video Tutorials in the same place. A good addition would be the iWork 09 Missing manual book and something to help you learn how to use your Mac.
    If there are specific tasks you need help with:
    http://www.freeforum101.com/iworktipsntrick/index.php?mforum=iworktipsntrick
    Is a good resource.
    Peter

  • ID only lists one type of Times font

    ID CS 3 on XP Pro SP3 system. I have both an open type (with True Type outlines) and type 1 version of Times New Roman on my system, but ID only lists the open type version. Is there a way I can get it to list both, because the open type shows up as an embeded subset of a true type font when I export files to PDF? BTW, my ID font file is empty, so I imagine ID only looks at the system font folder for fonts.

    I don't know what would solve this particular problem, but I'd recommend using a 3rd party font management progam.
    I use fontxplorer, but there was a better free one listed a few weeks ago that I can't find the link for. Maybe someone else can chime in?

  • Do smart playlists only accept one variable?

    My smart playlists no longer do anything if I have more then one variable selected. Is this a new "feature"? Is there a work around?

    Taylor.
    Interesting.  It looks to me like iTunes 12 works the same as previous releases (see below).  But...  as an experiment, choose Edit Smart Playlist, and while the window is there, does anything happen if you hold down the Option key?

  • L2TP VPN Server only accepts one client at a time

    We have an ISA570 on Site 1 with the following Network Config:
    192.168.100.XXX
    255.255.255.0
    192.168.100.254 (GW)
    ISA570
    ISP Modem in Bridge Mode
    So let us call my location right now as site 2. Although the network setup does not matter, let me just state it.
    192.168.101.XXX
    255.255.255.0
    192.168.101.254 (GW)
    Cisco RV042
    ISP Modem in Bridge Mode
    L2TP Client Network Pool:
    192.168.103.100 - 192.168.100.200
    255.255.255.0
    DNS1 192.168.100.254
    =======================================================================================
    So here comes the situation
    Client  1 with IP address of 192.168.101.24 connects to Site 1 via L2TP. He  uses this VPN Tunnel for a desktop application which is hosted at site  1.
    Client 2 with IP address of 192.168.101.17 connects  to Site 1 via L2TP but is unsuccessful. Screen1.jpg below shows the  Windows VPN Error.
    Screen1.jpg
    I can not post my configs as of now because the WAN1 of site 1 is very congested. For now I will post the guides which I followed.
    http://www.cisco.com/en/US/docs/security/small_business_security/isa500/administration/guide/ISA500_VPN.html#wp1393916
    http://www.cisco.com/en/US/docs/security/small_business_security/isa500/administration/guide/ISA500_VPN.html#wp1479596
    What am I missing here?

    Hi Dan,
    The site-to-site VPN tunnel should still work with those settings.  For the IPSec VPN Client, we have the Cisco VPN Client that should work.  There should be a copy of it on the CD that came with the ISA500. 
    Here is a link that has information on setting up the Remote Access VPN on the ISA500:
    http://www.cisco.com/en/US/docs/security/small_business_security/isa500/technical_reference/vpn/Configuring_VPN_with_Cisco_ISA500_Series_Security_Appliances.pdf
    The section 'Configuration Examples of EzVPN, SSLVPN and Site-to-Site Between Cisco ISA500 Appliances' has an example at the beginning.
    Let me know if that helps.
    Thanks,
    Brandon

  • How to force RH9 to use only one master stylesheet for all Word imports?

    I have set a stylesheet (css) as the default for my RH9 WebHelp project in project settings. When I import Word documents into the project, the edit import setting dialog does not show this stylesheet in the list of available stylesheets for the import.
    What is happening instead is a proliferation of unwanted stylesheets derived from all the imported documents. I then have to manually re-set all the new topics to the master stylesheet.
    How can I stop this, and force RH9 to use only the one master stylesheet for all imports?

    cid:[email protected]
    Hi Peter,
    That’s what I thought I was doing in the Project Settings>Import tab>CSS for Style Mapping selection. Maybe that isn’t what it’s meant to do. It’s just getting annoying having all these unneeded files popping up in the project manager so that I have trouble distinguishing the “real” topics from the extra stuff.
    Michael West | Business Improvement | Aurecon
    Ph: +61 3 8683 1996 | Fax: +61 3 8683 1444 | Mob: 0407 485 228
    Email: [email protected]
    PO Box 321, South Melbourne | VIC 3205 | Australia
    http://www.aurecongroup.com
    http://www.aurecongroup.com/apac/groupentity/

  • Restrict airport to only join one network

    After an "upgrade" recently, when I reboot my iMac G5, it fails to find its usual airport base station, and will then proceed to try to join my neighbor's unprotected wireless access point. I have to manually click no after it offers to join, wait a couple of seconds, and then manually choose the correct option from a list of at least three.
    Neither my older iMac nor my laptop experience this problem, and this behavior is new since a recent upgrade.
    Is there some configuration file I can edit to force this computer to only join one wireless network, and to keep trying until it gets it right?

    This worked, although it has nothing to do with unix, but I thought as long as I posted this question, I should post how I fixed it:
    [10/6] [Updated] Our Mac OS X 10.4.8 AirPort/Internet Re-Connect Problem Fixed
    After we tested the latest Mac OS X update, v10.4.8, on our 2.33GHz 24" iMac Core 2 Duo, we added another user account for the long-term tester. But after a restart or cold start, the iMac would reconnect to our AirPort network but it would get assigned an internal IP address rather than one from our router so it would not connect to the internet.
    This problem could be temporarily solved by using the AirPort menu icon to turn off and then turn back on the AirPort card. This was frustrating because the original user account on our iMac continued to connect automatically to the network and internet after a restart or sleep as did all of our other Macs upgraded to 10.4.8.
    We tried everything listed by Apple in its technical support articles (e.g. Article Number 304482) and provided on other Web sites, including deleting the preferred network in the System Preferences Network pane and re-adding it. We even tried deleting every AirPort-related preference ".plist" file including the "Networkinterface.plist" as recommended on another Web site yesterday. Nothing worked.
    Then we tried a variation on Apple's suggestion and it worked. Here are the steps:
    Open System Preferences, select the Network pane and select AirPort in the "Show:" popup menu.
    Set the "By default, join:" popup menu to "Preferred networks."
    Delete the listed preferred networks using the "-" button but this time we did not add it back again with the "+" button as Apple recommends.
    Set the "By default, join:" popup menu to "Automatic."
    Restart.
    Manually rejoin the AirPort network using the AirPort menu icon, i.e. selecting the network (or selecting "Other" and typing in the network name if hidden) and typing in the WPA (or WEP) password.
    Now every time we restart our iMac, it automatically connects again to the AirPort network and gets an IP address assigned by the router so that it also connects to the internet.
    Restart again: it should join automatically without delay
    [Update: Reader Karl Warschau pointed out that his 24" iMac Core 2 Duo will not reconnect after a restart if his WiFi network's name (SSID) is hidden. However, if its name is broadcast, then it works. He confirmed this with an AppleCare tech. We have also confirmed this.] [Bill Fox]
    http://macsonly.com/arch00610.html
    G5 2x2.5 GHZ and a few others   Mac OS X (10.4.7)  

  • I transferred data from my Macbook Pro to my Mac mini but it forced me to make a new user for my old data.  How do I transfer my music, pics, and docs from the "old" user to the new user (so that I only have one user instead of 2?)

    I transferred data from my Macbook Pro to my Mac mini but it forced me to make a new user for my old data.  How do I transfer my music, pics, and docs from the "old" user to the new user (so that I only have one user instead of 2?)

    Unless you transfer the files from Setup Assistant, Migration Assistant creates a new user with the data.
    To transfer the files to your first user, you have to log on this new user, and copy all your files to /Users/Shard folder. This is a folder where you can put the files you want to share between two or more users, and all users can read and write in it.
    After copying the files, go to your first user, open /Users/Shared folder, and copy the files to your user folders. If you migrated applications, you must know that they are stored in a common folder (/Applications), so you don't have to transfer them. To open /Users/Shared folder, open Go menu (in the menu bar) > Go to Folder, and type the folder

  • I am trying to purchase an app and update my apps all are free but it won't accept my security code, all itkeeps saying is that my payment method has been declined, I only have one card so can't try another

    I am trying to purchase an app and update my apps all are free but it won't accept my card, all it keeps saying is that my payment method has been declined, I only have one card so can't try another. Now I can't use some of my apps because they are waiting to be updated. Somebody please help!!

    Hello Sriggers,
    Welcome to the Apple Support Communities!
    I understand that you are attempting to update some applications on your iPhone but the payment method was declined. In this situation, I would recommend reading over the information in the attached article to help resolve the situation. 
    Pay an unpaid balance in the iTunes Store - Apple Support
    Best,
    Joe

  • My ipod nano 6 will only play one or two songs then I have to force the next song to play. It will start several songs before settling on one. This just started and I havent changed anything. How to I make it go back to playing songs continuously?

    My ipod nano 6 will only play one or two songs then I have to force the next song to play. It will then start several songs before settling on one. This just started and I havent changed anything. How to I make it go back to playing songs continuously?

    Then back it up and do a restore.  If that does not work and if you are still under warranty, call Apple tech support or take the iPod to your local Apple Store or an AASP.
    iPod Tutorials
    iPod Manuals
    iTunes & iPod Hints & Tips

  • Force oraclexe to only display one page at all times

    <pre>Hallo everyone. In oracleXE,when logged in , if you have the same page open in two or more browser windows . the pages change session state.
    This is normal behaviour but for my requirements this could be dangerous (a user thinking he has submitted some information when actually he has submitted the information set in session state by the other page).
    How can you restrict/force OracleXE to show only one page at all times?.
    Or, how can you restrict Oraclxe so that certain pages can be shown in only one browser window at a time</pre>

    Hallo Dietmar,
    The page that i use,uses a view with instead of triggers to update the underlying tables.
    I do use dml for updating the view, but I use an application item to store the
    number of the current form accessed. ( a form that is used in the process that i
    have to automate) .
    If two browser windows are open and the application item is changed, it will be set
    to the value in the window that updated the item last.
    When i open the first browser window and save the form, the value of the
    application item used will be the value set by the window that updated the form
    last.
    How can I make it possible for a user to open two browser windows in one
    session, without this problem, or if that isn't possible, how can i restrict the user
    from opening more than one application page in the same session?
    [pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How do I force smart mailbox to only show me mail from one mailbox while also showing multiple senders?

    How do I force smart mailbox to only show me mail from one mailbox while also showing multiple senders?

    It would help to post what you've tried. It does, indeed, appear that -h is the switch, and the man includes several examples, so if you've followed the examples and it's not working then that hints that you should pass it back to Apple.
    You also don't say how you're implementing your change. Are you invoking slapd manually, or are you editing /System/Library/LaunchDaemons/org.openldap.slapd.plist ?
    You should be doing the latter, and I'd expect to see something like this:
    <array>
      <string>/usr/libexec/slapd</string>
      <string>-d</string>
      <string>0</string>
      <string>-h</string>
      <string>ldap://x.x.x.20/ ldap://127.0.0.1/ ldapi://%2Fvar%2Frun%2Fldapi</string>
    </array>
    (note the inclusion of ldap://127.0.0.1/ as an entry - you'll need to run on localhost as well the .20 address since all the local services will look to localhost)
    You might also need an ldaps URL if you're using SSL but let's walk before we try to run

  • Photoshop Action That Only Opens One File Type

    I want to create an action that only opens one particular file type, performs some changes to it, then finds all the others of that file type. I can do everything else and use the Image Processor to run it, but I can't find any way to tell the action to only open .GIF files and ignore everything else. Am I just missing something obvious?
    Thanks,
    Andacar

    See this post about the Picture Processor:
    http://forums.adobe.com/message/5146485#5146485
    Another possibilty besides perhaps using a script, is if you have the latest photoshop cs6 version from the cloud, which allows conditional actions.
    However, since i'm not on the creative cloud i don't know, but maybe someone else that does have the cloud version can comment.
    added: doesn't  appear so for the new conditionals
    Message was edited by: R_Kelly

  • How to configure OC4J to force the access only to one page after the log in

    Hi,
    I want to know how could I force the access to only one page of the web application when the user first time accesses.
    I don't want to use session. Is there another way, say by configuring the OC4J configuration files?
    Thanks

    Hi,
    you can write a servlet filter for the we application that checks if the accessed page is the login page and if not of the login page was accessed before
    Frank

Maybe you are looking for

  • Oracle 8i connection

    Hi all ! I try to connect to Oracle database using jdk 1.3, and defining classpath = classe12.jar. There's no problem at compilation but errors runtime. Thanks, it's urgent !!!!!! The source: import java.sql.*; import oracle.jdbc.driver.*; public cla

  • JButton and exception problem

    Hi all, I created a JButton, named open _DB, and add an ActionListener to this. I want that when I click the button the methods in the loop executed (see below for code). However, I always get exceptions. How can I catch these exceptions? If I use a

  • Use of microphone on Adobe Connect

    Hello, I use Adobe Connect with flashplayer 9 for my studies. I can hear the teacher but I cannot Speak through my microphone. I can see my microphone in grey but I cannot speak. My microphone works well and I need to use my micro. Could you help me

  • Quotes convert to junk character in Generic SQL

    The filter on source (GENERIC SQL logical schema) uses <%=odiRef.getPop("I_POP")%> for Iterface Id. However, the quotes in <%=odiRef.getPop("I_POP")% is getting converted to junk character. Any inputs greatly appreciated.. Thanks,

  • Picking data directly from ALV List

    HI experts ! I have a scenario in which the client is executing some tcodes ( Some hourly, some daily , some weekly, ome monthly ) and all the data gets displayed in alv list . The requirement is that is it possible for XI to pick that data directly