Drawing images gives 2 different results with the same code.

Im adding my code on here, and its sort of long but ill try to explain it. Most of it you can ignore.
Anyway i'm making a tree menu with only 1 level of expansion. So you have a TreeMenu object, and this object has some Branch classes. These Branch classes have Leaf classes. That is all. On the menu there is also a little box where you can click to expand and collapse each branch. if a branch is expanded, all of its leaves are shown. if it is collapsed only the branch name is shown.
So far what I've described above works, there is a small scale compilable working program, that is alright. Theres just a few bugs to fix.
A little feature of the tree is if a branch or a leaf is selected (has been clicked on in the past) it has a blue background. This sort of works. The branch names seem to work alright, and some of the leaves. However other if you run the example i provided you can click on Leaf 1, and it will be ok, but if you click on Leaf 2 then there blue background is twice as big as it should be. But for the rest, it works ok.
This is weird to me because the same code handles any of these same situations. So it seems that i get 2 diferent results with the same code. If anyone would like to help heres some stuff you should know:
You can ignore Leaf class, i dont think theres any errors in there.
You can ignore just about all of Branch class except the update() method.
You can ignore all of TreeMenu class except the inner MouseListener class might be useful.
You can ignore TreeTester. Just the JFrame tester class.
to run the code:
javac TreeMenu.java
java TreeMenu
http://cs.ucsb.edu/~jsterling/treemenu.zip
thanks.

You make a good point Stefan but unfortunately I already checked that.  I have even copied the mapping (right click copy) and pasted it from the working Mapping to the bad Map (Paste) to make sure the context values were all the same.
I also opened all the queues and compared the values in each.  All values match exactly except for the result(out) queue.
In both tests I am using the same IDOC XML file. 
These are the only differences I see.
1.  The IDOC is exactly the same as far as I can tell but they come from two different source SWCV.  SAP APPL 4.7 and Steelcase_Procurement (ECC 6.0). 
2.  The working map uses a local UDF.  The bad map calls the UDF from a Function Group.  Is there a Java version difference between the two?
A better sample of the result queues look like this:
Correct Result:
Thickness of Glass: 20
Height: 10
Width: 5
Length: 18
Thickness of Glass: 10
Height: 15
Width: 8
Length: 14
Bad Result:
Thickness of Glass: 20
<null>
<null>
<null>
Width: 5
<null>
<null>
<null>
I took this chance to redesign my Variant Config output to separate the characteristics/values, but I'm still bothered that I was unable to determine what would cause the differing values.
Any ideas?
Thanks,
Matt

Similar Messages

  • UDF has 2 different results with the same input

    Hello,
    I have two mappings of the ORDERS idoc.  In both mappings I use the following UDF function to create a long string output:
    public void matConfig(String[] CHAR, String[] CHARTXT, String[] VALUE, String[] VALUETXT, String[] POSEX, String[] LINE, ResultList result, Container container) throws StreamTransformationException{
    int i, j;
    String crlf = "\r\n";
    StringBuffer matConfig;
    j = 0;
    for (i = 0; i < POSEX.length; i++) {
      matConfig = new StringBuffer();
      while (LINE.length > j && Integer.parseInt(POSEX<i>) == Integer.parseInt(LINE[j])) {
        if (matConfig.length() > 0)
          matConfig.append(crlf);
        if ((CHARTXT[j].length() > 0) || (CHAR[j].length() > 0)) {
          if (CHARTXT[j].length() > 0)
            matConfig.append(CHARTXT[j]);
          else
            matConfig.append(CHAR[j]);
          matConfig.append(" : ");
          if (VALUETXT<i>.length() > 0)
            matConfig.append(VALUETXT[j]);
          else
            matConfig.append(VALUE[j]);
          j++;        
      result.addValue(matConfig.toString());     
      result.addContextChange();
    I have checked the queues of all the inbound fields and the values match exactly but in one mapping the output in the queue for this UDF looks like this:
    Correct Result:
    Thickness of Glass: 20 Height: 10 Width: 5 Length: 18
    Thickness of Glass: 10 Height: 15 Width: 8 Length: 14
    Bad Result:
    Thickness of Glass: 20
    Width: 5
    How can the same input using the same java code (cut and pasted to make sure it matched) return 2 different values.  I have verified that they both use the same Imports as well.  The bad one is part of a function library while the good one is a local function. 
    Any ideas?
    Thanks,
    Matt
    Edited by: Matthew Herbert on May 29, 2010 12:09 AM

    You make a good point Stefan but unfortunately I already checked that.  I have even copied the mapping (right click copy) and pasted it from the working Mapping to the bad Map (Paste) to make sure the context values were all the same.
    I also opened all the queues and compared the values in each.  All values match exactly except for the result(out) queue.
    In both tests I am using the same IDOC XML file. 
    These are the only differences I see.
    1.  The IDOC is exactly the same as far as I can tell but they come from two different source SWCV.  SAP APPL 4.7 and Steelcase_Procurement (ECC 6.0). 
    2.  The working map uses a local UDF.  The bad map calls the UDF from a Function Group.  Is there a Java version difference between the two?
    A better sample of the result queues look like this:
    Correct Result:
    Thickness of Glass: 20
    Height: 10
    Width: 5
    Length: 18
    Thickness of Glass: 10
    Height: 15
    Width: 8
    Length: 14
    Bad Result:
    Thickness of Glass: 20
    <null>
    <null>
    <null>
    Width: 5
    <null>
    <null>
    <null>
    I took this chance to redesign my Variant Config output to separate the characteristics/values, but I'm still bothered that I was unable to determine what would cause the differing values.
    Any ideas?
    Thanks,
    Matt

  • Different results with the same character array.. help me to find out why..

    Hi,
    The following code is giving some unexpected results can anyone explain it...
    *public class A1{*
         public static void main(String[] args)
              char[] a = {'1','2','3','4'};
              System.out.println(a);
    System.out.println(a+"")
    The Result is :
    *1234*
    *(some address of array)*
    Can anyone tell me why it happens that same aray is giving one time the string value and one time an address....
    Edited by: Shenshah on Jun 12, 2008 3:23 AM

    If you look at the API docs you will see that PrintStream has multiple println methods.
    Each of your println calls invokes different one.
    System.out.println(a);calls println(char[]) which according to the docs prints the characters in the array.. ("abcd" in this case)
    System.out.println(a+"") calls println(String). concatenating the empty string to a causes a.toString() to be invoked and the "address info" that you see is the result of that toString() call.

  • Two very different results using the same settings (H.264 / Quicktime Pro)

    I’m a bit confused, I have used Quicktime Pro (v7.1) to encode DV into H.264 for iPod and this particular video is 18 minutes long and came out looking very good with the following settings;
    VIDEO: H.264 at 200kbps, Baseline Profile, 25fps, Auto Key Frames, 320x240 or 640x480, Multipass Best quality encoding.
    AUDIO: AAC Audio at 96kbps, 24kHz sampling freq, Stereo.
    However here is the twist…
    When I use the same exact settings to encode just the 30 second opener (from the 18 minute video) the encoded opener looks bad and blocky!
    Why? Same settings would make you assume that you should get a same or similar result, or am I wrong?
    The reason I have tried encoding this 30 second opener is that I am trying to work out which settings work best on the iPod (another issue) and I don’t want to spend hours test encoding the full 18 minute video, as you know H.264 is SLOW to encode!
    So can anyone help in regard to two very different results using the same settings?
    Regards,
    J
    PC   Windows XP  

    Alvin,
    Is it a commercially-released or home-burned CD?
    If it's commercially-released, try "encouraging" the recalcitrant computer by using the iTunes Advanced menu > Get CD Track Names command when it shows Audio CD.
    If it's home-burned, you will find that only the computer that actually burned the disc will know what's on it. The information won't be transferred to another computer.
    Let us know which, if either, of these situations applies to you.

  • Publish two publications from different customers with the same Adobe DPS ID

    Hello:
    I have a publication made on InDesign and I have uploaded it to the Adobe Server with my Adobe DPS account. For the first publication, I published the publication with the Folio Producer on the digitalpublishing portal, and then I created the app using the Adobe Viewer Builder. Then, I tried it locally on my iPad. It was working fine and I could see my publication.
    Now, I do need to upload a new publication for a different customer with the same Adobe DPS account and I need to create a different app with the new customer look and feel but I don't want to show the first publication in this new app, only the last one.
    In a nushell, I need to keep separated two publications (or more) when they are published if I'm using the same DPS Account... Is that possible?
    Saludos Cordiales,

    Hi Leo,
    Every title should have its own publication AdobeID (a title can contain multiple editions / folios).
    So you have to request for every title you want to work on a provisioned account with Adobe. Make sure that you have setup the corresponding emailaddress / emailalias. For example [email protected] and [email protected]
    After the accounts have been provisioned you can:
    * upload and organize multiple folios for that publication in the corresponding Folio Producer
    * Create a viewer with your Viewer Builder and on the first page supply the AdobeID for the give publication
    You can request new publication accounts any time and these are included with your DPS subscription.
    When you first account got provisioned, you should have received an excel document to request provisioning for the various publications. In this document you can list the accounts you want to use for publications, individual users of the system and viewer builder access.
    With kind regards,
    Klaasjan Tukker
    Adobe Systems Benelux

  • My Ipod classic has started to play mono only through the headphones. I have tried different headphones with the same outcome. Is the device repairable or better to upgrade?

    My Ipod classic has started to play mono only through the headphones. I have tried different headphones with the same outcome. Is the device repairable or better to upgrade?

    Hey Grimeymouse, 
    Thank you for contributing to the Apple Support Communities. 
    It sounds like your iPod classic is only playing sound in mono when using multiple headphones. 
    Since you've likely isolated this behavior to the iPod by trying multiple headphones, see this advice from the "The headphones don't work" section of the iPod troubleshooting basics and service FAQ: 
    If the issue appears to be with the iPod, try resetting it. If that doesn't work, then restore iPod with the latest iPod software using iTunes 7 or later.
    All the best,
    Jeremy 

  • How to force OSX to connect to a specific Access Point i.e. manually choosing beetween different APs with the same SSID?

    My office room is near different APs with the same SSID, my Snow Leopard selects automatically to join the AP with stronger signal.
    But this AP isn't running well, so I want to force my mac to join a AP with weaker signal.
    (I've the same troubel as described in https://discussions.apple.com/message/6470508#6470508)
    Note that I'm a guest user and I hanen't access to APs, so I cannot change their SSID.
    Any idea how to force Mac to join a specific AP?
    Thanks,
    adso

    My office room is near different APs with the same SSID, my Snow Leopard selects automatically to join the AP with stronger signal.
    But this AP isn't running well, so I want to force my mac to join a AP with weaker signal.
    (I've the same troubel as described in https://discussions.apple.com/message/6470508#6470508)
    Note that I'm a guest user and I hanen't access to APs, so I cannot change their SSID.
    Any idea how to force Mac to join a specific AP?
    Thanks,
    adso

  • My iPhone is merging different contacts with the same firstname into one contact. How can i resolve this.

    My Bosses iPhone is merging different contacts with the same firstname into one contact. How can i resolve this? He seems very disturbed and thinks i don't know what i'm doing. I've set up all his devices to sync across and now its messed up on his iPad, and two iPhones.
    E.G Contacts with firstname 'Adams' and different numbers are synced into one account.
    Now i have no clue how many contacts are this way cos he has a huge number of contacts (he's the ceo).
    Please i need a suggestion on how to fix this.
    Thanks for the help.

    Janie Mac wrote:
    Cannot find settings to then go to general then about.
    How do I edit the device in iTunes?
    Double-click on the name.
    My screen shot shows both devices because I sync wirelessly.  Right now I can change the iPod name but not the iPad name because the iPod is idle while the iPad is syncing.  In another minute or two, I'll be able to change the iPad name.

  • Different Risk Analysis Results with the same user from 2 different RAR

    Hi..
    I've loaded the same Risks, Rules, etc, into 2 GRC RAR environments (Sandbox and Quality systems); both of them are connected with the same SAP ECC system. But when I do a User Risk analysis (authorization level), the result from Sandbox is different from Quality system. I donu2019t have users or roles mitigated yet, users are synchronized, rules are exactly the same and I donu2019t know what happen??... Please, help me.
    Thanks...

    Hi...
    If I do a Full Sync of users to the same ECC system from both RAR boxes, I got different number of users loaded (i.e. 18757 vs. 18141), similar case with the full sync of roles. (13100 vs.  13150).
    If I load exactly the same set of functions to both RAR systems and I generate the rules, I got the same problem, different number of rules is generated.
    I've verified both RAR configuration and they are the same (excluded users, roles mitigated, etc.)
    Is it a normal behavior? What could be wrong?
    Thanks in advance!!

  • Need to run the same query on different databases with the same argument

    Hi folks,
    I've a script: obj, which has simple stuff, when I execute @obj
    this asked me for the object_name
    and in return gives me object/s if it exists in this (connected) db.
    Now to check in 2 other dbs, I've to disconnect from here and then connect to those dbs and run the same @obj there and give the same argument, e.g., EMP and it'll return the answer.
    What is desired ... if not very hard on you :-(
    Some thing like @objAll
    asked only once object_name ... e.g., I gave EMP
    now go to all the 3 dbs and give me the result in ONE spool file only.
    What do you think, is this tough, I did something, but it was not involved connecting to different dbs, within the same script, but here we cannot create db links and have to disconnect and connect to the db to get some information.
    Please do reply, if my question is not understandable or any ...
    Thanks in advance.
    Best regards.
    Edited by: user8604530 on Jun 27, 2012 1:51 PM

    As far as i understand from your question : you cannot create db links ? right..
    well another option is to create a shell script , something like this :
    vi check.sh
    export ORACLE_SID=db1
    sqlplus / as sysdba <<EOF
    select query comes here;
    exit;
    EOF
    export ORACLE_SID=db2
    sqlplus / as sysdba <<EOF
    select query comes here;
    exit;
    EOFchmod 777 check.sh
    This does the job for you.. I am unsure how to pass the parameters in sql while running through a sheel script.. but if thats possible you will be able to achieve what you want.
    Regards
    Kk
    Edited by: Kk on Jun 27, 2012 2:44 PM

  • Why do I get two different results from the same coefficients?

    I am getting two different results from the Polynomial Evaluation function.
    For the first one, I am getting the coefficients from a Polynomial Fit function.  I feed the coefficients from the Fit function into the Poly Eval function and get the correct result of 12.8582 when I evaluate 49940.
    For the second one, I create constant array of the SAME values that were returned from the Polynomial Fit function (i typed them in).  However, I am getting an incorrect result of -120.7913 when I feed the constant array into the Poly Eval function when I evauate 49940.
    How can this happen when I am using the same array values?
    Attached is an image of what I am explaining.
    Solved!
    Go to Solution.
    Attachments:
    polynomial_evaluation.jpg ‏213 KB

    Hi Altran,
    are you sure about using the "same" coefficients?
    Did you compare them? Did you (atleast) set the display properties to 17 significant digits?
    Please attach a VI instead of a picture...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • My magic mouse won't connect to Yosemite 10.10.2 I've tried 2 different mice with the same outcome.

    I have an early 2013 MBP with Yosemite 10.10.2. Connectivity with the magic mouse has steadily gotten worse, now it won't connect at all. I've tried connecting with two different mice, one about 5 years old and one about 2 years old, both with the same result. Any one else have this issue?

    Hello rachste,
    I'm sorry to hear you are having these mouse issues with your MacBook Pro. If you continue to have connectivity issues with your Bluetooth mice, you may find the information and troubleshooting steps outlined in the following article helpful (apologies if you have already seen it):
    Troubleshooting wireless mouse and keyboard issues - Apple Support
    Sincerely,
    - Brenden

  • How do I view multiple images from different projects at the same time?

    Hello
    I've been trying to find the answer in the user manual, but no luck so far.
    I did find how to open 2 projects at once, but I can only see one image at a time in the viewer and I have to keep going back and forth between projects to compare images. (These are scans of old photos and I want to eliminate the ones that are poorer quality, so need to compare numerous images from 2 sets of scans)
    How can I view an image from one project at the same time as an image from another? I know that it can be done in the same project by apple-clicking the second, third etc image, but this doesn't work if the images are from different projects.
    Thank you
    Elizabeth

    Thank you again Tony
    I've now created an album, independent of the projects, and dragged test images into it and it does just the job I needed. Now i just need to keep my brain sorted with which ones are which while i'm working
    Elizabeth

  • Itunes match with two different libraries on two different computers with the same apple ID? How?

    I have a work PC that I synch with my itunes library and it works totally fine. I also have a macbook at home with a different library on it. Both compuers share the same apple id. will itunes match synch all the devices with the same library? If so do I only need one itunes match purchase or do I need one for each computer? The apple help desk (phone support) and apple store I recently visited were unable to provide me with answers to my questions.

    Just create a new account. On one iPod go to Settings>iTunes and App stores and sing out and sign in with other account. Same for Settings>iCloud and Settings Messages. Also go to Settings>Face time and add the new iD email addrss as the Caling email address and delete the other one.
    - Apps are locked to the account that purchased them.
    - To update apps you have to sign into the account that purchased the apps. If you have apps that need updating purchased from more than one account you have to update them one at a time until the remaining apps were purchased from one account.

  • WPC: unable to add different resources with the same name into a WPC page

    Hi,
    I got a WPC problem when adding different KM resources with the same name into a WPC page.  Only one KM resource is able to be added in WPC.
    For example:
    There two "article.html" with different content and RID:
    1. /company_a/article.html
    2. /company_b/article.html
    when adding these two html pages into a WPC page, only one page will be shown.
    This means that a WPC page is not able to contain resources with same file names.  I think the problem might lie on the resource-linking mechanism of WPC. WPC will add a resource link in the page folder, when a new resource is drag&dropped into WPC.
    Anyone has some good ideas to solve my problem? Thanks a lot.
    Regards
    Lei NING
    Edited by: Lei NING on Apr 15, 2008 4:16 PM

    As this is not possible and double entries cause this problem, why not just pu both napes in the contact details on the same number. IE John Smith & Peter Jones all in the first name, by doing this if you search your contacts either by searching for john, peter, smith or jones the number will show up and if either calls the number will show John Smith & Peter Jones, it may not be perfect but will work. As the phone only recognises a number if two seperate entries of the number exist with different names it cannot possibly know who is calling ?
    If I have helped at all, a click on the White Star is always appreciated :
    you can also help others by marking 'accept as solution' 

Maybe you are looking for

  • Safari quit unexpectedly when I try to open my gmail box for working

    Hello Safari quit unexpectedly with this message Thank you Process:         WebProcess [3654] Path: /System/Library/StagedFrameworks/Safari/WebKit2.framework/WebProcess.app/Conten ts/MacOS/WebProcess Identifier:      com.apple.WebProcess Version:    

  • "peer not authenticated" in IDT when connecting to https

    I am trying to create an ODATA connection in Information Design Tool (4.1 SP2). In the Service Root URI, if I use HTTPS, it gives me an error: "peer not authenticated" I have this issue in both external (like https://api.datamarket.azure.com/data.ash

  • Cannot import iPhoto photos

    I keep getting an error when I try to export my all of my iphotos. It will only copy about 2000 of my 17K pictures. Don't know what to do?

  • Score editor: beamed grace notes

    Hi, I usually do this in order to create beamed grace notes: "If you want to create beamed grace notes, try using a polyphonic staff style (see "Adding Staffs to a Staff Style" on page 747) with no rests displayed for the second voice. Assign the des

  • Missing mail

    I have id'd 3 email contacts who do not receive my emails, ( they do show up in my sent mail), but I do not get a reject message.  They are on different networks (optonline, mindspring and me.com) using both PCs and macs.  If I send them an email fro