Strings panel, Locale and wiring it up

My brain probably is wired differently than Adobe's /
Macromedia's, because I really don't get it.
I'm trying to use the strings panel to get Flash to
substitute international texts. Rudementary this works. However my
working mode is just a tad different that the three available in
Flash: I want to use the default determined language but be able to
override it later on (some users have their language set wrongly on
their computer... e.g. me).
First what I don't get: why can't I just set the active
language in the "automatically at runtime" mode? Flash knows the
textfields, its knows the translation table... Just set that
language and have flash update all fields... Why not?
Ok then, to the actionscript approach (in the first frame):
Locale.autoReplace = true;
Locale.initialize(); // initialize according to system
language
Locale.addDelayedInstance(mainmenu_concepts_txt,
"IDS_MENU_CONCEPTS");
Locale.addDelayedInstance(mainmenu_collection_txt,
"IDS_MENU_COLLECTION");
... // more addDelayedInstance
language_en_btn.onRelease = function()
Locale.loadLanguageXML("en");
language_de_btn.onRelease = function()
Locale.loadLanguageXML("de");
<Grumble>Why do I need to code out the links between
the translationtable and the textfields? Flash knows this
already.</Grumble>
Ok. Well, let's test that...
Comes up with English... Ok...
Click German.. Yes! All fields in German!
Click English... Yessss...
Click German... HEY!!!! Still English? WTF? Click again.
Noooo, not English, GERMAN!
Turns out the replace only occurs on the first load of a
language.
Now, either I simply don't get it, or I simply don't get it.
Do I really need to write this international stuff myself? I can,
you know. ;-)

Ok then. I wrote it myself; reimplemented the Locale's
interface in my own class. (It seems AS3 has a better Locale
implementation, so I also looked at that class.)

Similar Messages

  • Bug in Flash 8 when using Strings Panel?

    A problem with the strings panel in Flash 8 I have found is
    that, when working with 6 languages, if you save and close down
    your Flash file with the Strings panel hidden, and re-open the FLA
    and then view the strings panel/view your text on the stage (or
    open the xml file) that, in my cae, some EN strings have been
    corrupted/mutated to other languages.
    This is obviously a bug in Flash which corrupts one of the
    XML files if the strings panel is closed. Why does it do this? Its
    very annoying having to remember to open the strings panel whenever
    I load that specific project, even if I am not going to use it. And
    the panel takes up a lot of space as it is so can't leave it open
    all the time for other projects.
    Any ideas?

    Howdy. I'm having a very similar problem. I'm working with 21
    languages (including EN) on the strings panel in Flash 8. I've
    found that my languages get corrupted -- EN strings get substituted
    in for some, not all localized strings in the panel -- when I
    publish or test the movie. I was publishing for Flash 7. When I
    changed my publishing settings to Flash 8, the problem went away.
    Have you gotten any answers to your problem?

  • Put html tag in xml genreted with strings panel

    Hello,
    I created an multilanguage application with the "strings
    "panel.
    My customer need to put some words in italic inside the
    dynamic textfield.
    So I used <i> tag or cdata tag insied the xml, but
    nothing works, even if I put the textfield in "html" format.
    So How can I do.
    Do we need to change the "locale.as" class?
    thanks.
    Regards,

    Is the dynamic text field set to embed the fonts? (Properties
    Panel >
    Character.... radio button clicked to specify ranges)
    If it is, set it to no characters. Also make sure your
    dynamic text field
    is set in the properties panel to render as html.
    Here is a test:
    Create a new Flash document, select the text tool from the
    tools menu and
    create a text area on the stage. Make it a dynamic text field
    in the
    properties panel and click the render as html button. Give it
    an instance
    name of "myText" and on frame one of the main timeline put
    the following
    actionscript.
    myText.htmlText = "<i> This is Italics</i>. This
    is not"
    Test the movie and it should show what you are looking for.
    Dan Mode
    --> Adobe Community Expert
    *Flash Helps*
    http://www.smithmediafusion.com/blog/?cat=11
    *THE online Radio*
    http://www.tornadostream.com
    *Must Read*
    http://www.smithmediafusion.com/blog
    "tof69" <[email protected]> wrote in message
    news:efb464$7cm$[email protected]..
    > Hello,
    > I created an multilanguage application with the "strings
    "panel.
    > My customer need to put some words in italic inside the
    dynamic textfield.
    > So I used
    tag or cdata tag insied the xml, but nothing works, even if
    > I
    > put the textfield in "html" format.
    > So How can I do.
    > Do we need to change the "locale.as" class?
    > thanks.
    > Regards,
    >
    >

  • [Forum FAQ] How to install and configure Windows Server Essentials Experience role on Windows Server 2012 R2 Standard via PowerShell locally and remotely

    As we all know,
    the Windows Server Essentials Experience role is available in Windows Server 2012 R2 Standard and Windows Server 2012 R2 Datacenter. We can add the Windows Server
    Essentials Experience role in Server Manager or via Windows PowerShell.
    In this article, we introduce the steps to install and configure Windows
    Server Essentials Experience role on Windows Server 2012 R2 Standard via PowerShell locally and remotely. For better analyze, we divide this article into two parts.
    Before installing the Windows Server Essentials Experience Role, please use
    Get-WindowsFeature
    PowerShell cmdlet to ensure the Windows Server Essentials Experience (ServerEssentialsRole) is available. (Figure 1)
    Figure 1.
    Part 1: Install Windows Server Essentials Experience role locally
    Add Windows Server Essentials Experience role
    Run Windows PowerShell as administrator, then type
    Add-WindowsFeature ServerEssentialsRole cmdlet to install Windows Server Essentials Experience role. (Figure 2)
    Figure 2.
    Note: It is necessary to configure Windows Server Essentials Experience (Post-deployment Configuration). Otherwise, you will encounter following issue when opening Dashboard.
    (Figure 3)
    Figure 3.
      2. Configure Windows Server Essentials Experience role
    (1)  In an existing domain environment
    Firstly, please join the Windows Server 2012 R2 Standard computer to the existing domain through the path:
    Control Panel\System\Change Settings\”Change…”\Member of. (Figure 4)
    Figure 4.
    After that, please install Windows Server Essentials Experience role as original description. After installation completed, please use the following command to configure Windows
    Server Essentials:
    Start-WssConfigurationService –Credential <Your Credential>
    Note: The type of
    Your Credential should be as: Domain-Name\Domain-User-Account.
    You must be a member of the Enterprise Admin group and Domain Admin group in Active Directory when using the command above to configure Windows Server Essentials. (Figure 5)
    Figure 5.
    Next, you can type the password for the domain account. (Figure 6)
    Figure 6.
    After setting the credential, please type “Y” to continue to configure Windows Server Essentials. (Figure 7)
    Figure 7.
    By the way, you can use
    Get-WssConfigurationStatus
    PowerShell cmdlet to
    get the status of the configuration of Windows Server Essentials. Specify the
    ShowProgress parameter to view a progress indicator. (Figure 8)
    Figure 8.
    (2) In a non-domain environment
    Open PowerShell (Run as Administrator) on the Windows Server 2012 R2 Standard and type following PowerShell cmdlets: (Figure 9)
    Start-WssConfigurationService -CompanyName "xxx" -DNSName "xxx" -NetBiosName "xxx" -ComputerName "xxx” –NewAdminCredential $cred
    Figure 9.
    After you type the commands above and click Enter, you can create a new administrator credential. (Figure 10)
    After creating the new administrator credential, please type “Y” to continue to configure Windows Server Essentials. (Figure 11)
    After a reboot, all the configurations will be completed and you can open the Windows Server Essentials Dashboard without any errors. (Figure 12)
    Figure 12.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Part 2: Install and configure Windows Server Essentials Experience role remotely
    In an existing domain environment
    In an existing domain environment, please use following command to provide credential and then add Server Essentials Role: (Figure 13)
    Add-WindowsFeature -Name ServerEssentialsRole
    -ComputerName xxx -Credential DomainName\DomainAccount
    Figure 13.
    After you enter the credential, it will start install Windows Server Essentials role on your computer. (Figure 14)
    Figure 14.
    After the installation completes, it will return the result as below:
    Figure 15.
    Next, please use the
    Enter-PSSession
    cmdlet and provide the correct credential to start an interactive session with a remote computer. You can use the commands below:
    Enter-PSSession –ComputerName
    xxx –Credential DomainName\DomainAccount (Figure 16)
    Figure 16.
    Then, please configure Server Essentials Role via
    Add-WssConfigurationService cmdlet and it also needs to provide correct credential. (Figure 17)
    Figure 17.
    After your credential is accepted, it will update and prepare your server. (Figure 18)
    Figure 18.
    After that, please type “Y” to continue to configure Windows Server Essentials. (Figure 19)
    Figure 19.
    2. In a non-domain environment
    In my test environment, I set up two computers running Windows Server 2012 R2 Standard and use Server1 as a target computer. The IP addresses for the two computers are as
    below:
    Sevrer1: 192.168.1.54
    Server2: 192.168.1.53
    Run
    Enable-PSRemoting –Force on Server1. (Figure 20)
    Figure 20.
    Since there is no existing domain, it is necessary to add the target computer (Server1) to a TrustedHosts list (maintained by WinRM) on Server 2. We can use following command
    to
    add the TrustedHosts entry:
    Set-Item WSMan:\localhost\Client\TrustedHosts IP-Address
    (Figure 21)
    Figure 21.
    Next, we can use
    Enter-PSSession
    cmdlet and provide the correct credential to start an interactive session with the remote computer. (Figure 22)
    Figure 22.
    After that, you can install Windows Server Essentials Experience Role remotely via Add-WindowsFeature ServerEssentialsRole cmdlet. (Figure 23)
    Figure 23.
    From figure 24, we can see that the installation is completed.
    Figure 24.
    Then you can use
    Start-WssConfigurationService cmdlet to configure Essentials Role and follow the steps in the first part (configure Windows Server Essentials Experience in a non-domain environment) as the steps would be the same.
    The figure below shows the status of Windows Server Essentials.
    Figure
    25.
    Finally, we have successfully configured Windows Server Essentials on Server1. (Figure 26)
    Figure 26.
    More information:
    [Forum
    FAQ] Introduce Windows Powershell Remoting
    Windows Server Essentials Setup Cmdlets
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

  • Using a WRT54G as a second wireless and wired router on a LAN

    I have setup a WRT54G as a second wired and wireless router on my local LAN.
    The WAN wired side of the WRT54G is setup completely DHCP. It gets IP 192.168.1.104 most of the time. (I have used a PC with DHCP on theis ethernet wire and it gets to the internet OK). 
    The LAN side of the WRT54G is setup as 192.168.20.1 and all wireless and wired devices connecting to it get ips of 192.168.20.xxx and communicate between them selfs perfectly.  However, none of them can get to the internet through the WRT54G.  What have I done wrong?
    Thank You

    I guess your WRT54G is not connected to Internet directly, but it's connected to another router that has Internet access.
    If this is the case, you can configure this device as access point/hub only in order to get Internet access from the other router. Ignore the WAN connection on this WRT54G, just connect both router's LAN port with crossover cable.. After that configure the WRT54G's wireless setting. You can get more detailed info on how to do it in following article:
    Quick Guide to Configure Wireless Router as Access Point
    Hope helps..

  • Hostname is .local and Kerberos problems

    Hi
    Having problems with our new xserve. The computername as set in server admin is 'serverx' which is giving a local hostname of serverx.local. I have DNS running with one zone of <domainname>.org.uk, servername of serverx giving a FQSN or serverx.<domainname>.org.uk
    However i had an email out from the mailman mailing list asking for permission to allow a post to a mailing list and it had the link to click on as http://Serverx.local/mailman/.....
    Obviously i'd like this to be http://serverx.<domainname>.org.uk
    This also extends to the server's searchbase, which on the old server we migrated from was dc=<hostname>,dc=org,dc=uk which now is showing as dc=serverx,dc=local under opendirectory - settings - protocals
    The Open directory pane shows everything running apart from Kerberos which is stopped. If i try and kerberize the server using the realm name of <DOMAINNAME>.ORG.UK it whirrs away before returning me to the 'kerberize the open directory master' dialogue. Looking at the slapconfig log i get the errors...
    The KDC is not running error = 3
    failed to configure error = 3
    Is there a way to change this so that the domain name and seachbase are correct and how do i get the KDC to run so i can kerberize the server.
    Hope some of that makes sense...
    Thanks
    Quad 2GHz Intel Xserve   Mac OS X (10.4.9)   2GB ram

    I had similar issues with .local and trying to migrate away. I decided to manually massage a backup into the non-.local domain. It worked for me, but I will stress that you should make a copy of your backup to do this on.
    First, decide what new domain you want to use. If you're building on a private network, you can use a non-valid domain, like '.int' . Setup your DNS.
    Use Server Admin to make a backup of your OD Domain. Make a copy. Burn it to CD. We don't want the original to change.
    Kerberize to the new domain. Make a new backup and burn it to CD as well.
    Open a modifiable copy of the backup. In it are many files, most of them are straight text files of one flavor or another. Time to get dirty...
    Backup.ldif is the big file to work with. You must go in and change all of the olddomain.locals to newdomain.tla (this is pseudocode, please use your own domains where you see these two.) You must also change all of the dc=olddomain,dc=local to dc=newdomain,dc=tla . The fun about this file is that Apple wraps it manually, which makes search and replace tedious, as there will be some of these things at the end of lines. The good news is that they are far from random, so you can search for parts of the name (local is a good search) and find the next iteration. Here are a couple examples...
    ...dc=ol
    ddomain,dc=local
    ...dc
    =olddomain,dc=local
    ...dc=olddoma
    in,dc=local
    The key is to search and replace the whole thing at once. I used textedit and pasted the entire offending text into the find box, then replaced with the proper new dc= values. You need not worry about wrapping, the importer doesn't care. The key is to make sure that you get it all.
    Now do the same with all of the other files. I didn't touch authservermain, which already had the new Kerberos domain in it. I did modify these files...
    Backup.ldif
    authserverreplicas
    authserveroverflow.x
    DSLDAPv3PluginConfig.plist
    slapd_macosxserver.conf
    local.dump
    local.krb5realm
    Make sure to check the other files, as different configurations will yield info in different files.
    Once you are done with this, it's time to turn your nice pretty domain into a standalone. It appears that the archive and restore tools are much better in 10.4.x that older versions, so it actually works to restore things. There was one caveat. My standalone seemed to ignore the /etc/krb5adm.keytab, which then caused the conversion to Master domain to hang. Move to krb5adm.keytab.old it in case you need to restore.
    Make your server a Master again, this time with the new FQDN and search string.
    Import your modified backup. Your users should now be in place, although I lost my domain admins in the process.
    Finally, backup your domain, revert to standalone, toss the .keytab, convert to Master, and restore. This last step converts the bdb back into text, then back to the bdb. I was having a little strangeness until I did this step, which I believe clears up some cruft.
    Here are the benefits that I've seen in this process...
    - Passwords translate
    - migration is complete to new domain
    - easily restorable and/or recoverable
    Of course, your mileage may vary.

  • Strings panel autoselecting leading problems

    I have a couple of dynamic text fields containing RETURN
    (charCode 13).
    They work fine when the Strings panel is set to "manual using
    stage language", but when I switch to "automatically at runtime"
    the leading seems to double. I use Flash 8 and flash player 8.
    After searching all the Flash 8 litterature available on the
    Adobe site, checking for autoinserted characters, and a number of
    non-scientific trial-and-errors, I'm stuck.
    The obvious work-around would be to publish each language
    version separately, but all software demos I'm to produce would
    benefit greatly from the auto-language feature.
    Does anybody know what I'm doing wrong?
    Wille

    Yes, the format validation for it is number. I'm reasonably certain it always used to be number, though.
    Should their be any detriment elsewhere if I had it changed to Char?
    The field (in our test system) is protected against update - how can I remove the protection to test this?
    Thanks for your help so far :)

  • Making Multiple Panels invisible and visible

    So I have this problem, Im trying to make different panels visible and invisible by the means of a button. I believe my code is sound, but its not working. I would really appreciate it if someone were to look at my code and solve this problem. Basically my button isnt working.
    import java.awt.image.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Scanner;
    public class panels extends JFrame
    private JPanel panel1, panel2, panel3, panel4;
    private JLabel title;
    private JButton test;
    public panels ()
    setSize (400,800);
    JButton test = new JButton ("test");
    title = new JLabel ("");
    JPanel panel1 = new JPanel();
    panel1.setPreferredSize(new Dimension(200,200));
    panel1.setLayout (new GridLayout(5,2));
    panel1.setBackground(Color.black);
    JPanel panel2 = new JPanel();
    panel2.setPreferredSize(new Dimension (200,200));
    panel2.setBackground(Color.red);
    JPanel panel3 = new JPanel();
    panel3.setPreferredSize (new Dimension (200,200));
    panel3.setBackground(Color.orange);
    JPanel panel4 = new JPanel();
    panel4.setPreferredSize(new Dimension (200,200));
    panel4.setBackground(Color.green);
    Container container = getContentPane ();
    container.setLayout (new GridLayout(4,1));
    container.setBackground (Color.white);
    container.add(panel1);
    panel1.add(test);
    container.add(panel2);
    container.add(panel3);
    container.add(panel4);
    ButtonHandler handler = new ButtonHandler ();
    test.addActionListener (handler);
    setVisible (true);
    public static void main (String args[])
    panels application = new panels ();
    private class ButtonHandler implements ActionListener
    public void actionPerformed (ActionEvent event)
    if (event.getSource () == test)
    panel1.setVisible(true);
    panel2.setVisible(false);
    panel3.setVisible(false);
    panel4.setVisible(false);
    }

    Take a look at this example and you will see that your code is missing a few things.
    http://www.javaprogrammingforums.com/java-swing-tutorials/278-how-add-actionlistener-jbutton-java-swing.html
    There are plenty of examles on the web of how to do that
    http://www.youtube.com/watch?v=GvTZ2Huo0T4

  • Locale and addXMLPath

    I've got a web app that runs from "/app", and my Flash
    control loads from "/flash". This control is localized and the
    language files are stored in "/flash/en", "/flash/ja", etc.
    However, the Flash app attempts to load it's resources from
    "/app/en", "/app/ja", etc. I was surprised by this-- I thought
    these files would load relative to the Flash object, not the URL of
    the host document.
    I'd like to control the full path to the language files, and
    I believe it is possible, but I'm having trouble. The
    "Locale.addXMLPath" method is (I think) the method I'm looking for,
    but so far I haven't gotten it to work.
    First of all, am I suppose to give it the path to the
    directory where the XML files live, or the path to the XML file
    itself?
    // Like this?
    Locale.addXMLPath("en", "/flash/en");
    // or...
    Locale.addXMLPath("en", "/flash/en/flash_obj_en.xml");
    Second, how should I configure the Flash control so that it
    delays the loading of the XML file until these paths are assigned?
    Configure for string replacement "automatically at runtime" or "via
    ActionScript at runtime"? I just don't want avoid having to invoke
    a method for every localized text field in the Flash control.
    I haven't found much on Google about "addXMLPath"-- the Flash
    documentation has an example, but the example doesn't actually
    *call* addXMLPath. And most user-written pages about it aren't in
    English. :)

    There's an internationalisation forum here. You might have more luck in there. As a starting point though, yes you can use it from a JSP, (although conventionally you'd have separate JSPs containing translations rather than dynamically include the text, it's a performance thing). I assume that you realise that it won't do the translation for you(?).

  • Panel refreshing and double buffering

    Hi all swing experts
    Could any one solve the problem.I have an application,which is having a JSplit pane.
    On the left of the JSplit pane , there is a tree. When u click a node from the tree
    that will be selected and you can place that node into the right side panel.
    And the same way you can click an another node (redirection or sink) and drop into the
    panel.you can draw a line by clicking the source and the sink / or redirection.
    The line is getting drawn dynamically by getting the x,y coordinates of the node.
    once the line is drawn am storing the line into vector, since this is getting drawn
    dynamically once if i minimize and maxmize it will disappear.
    For avoiding this am trying to redraw the old line from the vector when the window
    is getting activated, here the problem starts it draws the line but the line
    is getting disappeared immly.
    HOW DO I SOLVE THIS?
    is it possible to solve this problem with double buffering tech? if so how?
    PL HELP.
    Software - Visual Tool
    Last Modified -7/23/01
    sami
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.border.TitledBorder;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.plaf.FontUIResource;
    import javax.swing.tree.*;
    import java.lang.System;
    import java.net.*;
    import java.awt.image.*;
    import javax.swing.event.*;
    public class CompTree extends JFrame implements TreeSelectionListener,WindowListener{      
    // Swing components declarations     
         public JSplitPane jSplitPane1,jSplitPaneTop;
         public JScrollPane treeScrollPane,splitScrollPane;     
    public JTree mainTree,jtree ;
    public static DefaultMutableTreeNode topchildnode1, topchildnode2, topchildnode3,toptreenode;
    DrawPanel dp = new DrawPanel();
         public int i=0;
         public int j=0;
         public int flag = 1 ;
         public String var,S,R,D;
    Frame fr = new Frame("GUI TOOL");
    public CompTree()
         File nFile = null ;     
         mainTree = DrawTree(nFile,"N") ;
         mainTree.updateUI();
         mainTree.setBackground(new Color(105,205,159));     
              // Tree is getting added into scroll pane
         treeScrollPane = new JScrollPane(mainTree);
              treeScrollPane.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    treeScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
              splitScrollPane = new JScrollPane();
              splitScrollPane.setViewportView(dp.panel1);          
              splitScrollPane.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    splitScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    jSplitPane1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,treeScrollPane,splitScrollPane);          
         jSplitPane1.setOneTouchExpandable(true);
         jSplitPane1.setContinuousLayout(true);
    jSplitPane1.addComponentListener(new ComponentAdapter(){
              public void componentResized(ComponentEvent e) {      
                   System.out.println("Componenet resized");
              flag = 1;
              paint(dp.panel1.getGraphics());          
    //Provide minimum sizes for the two components in the split pane
    Dimension minimumSize = new Dimension(150,75);
              splitScrollPane.setMinimumSize(minimumSize);
    //Provide a preferred size for the split pane
    jSplitPane1.setPreferredSize(new Dimension(700, 500));
              //setContentPane(jSplitPane1);
              fr.add(jSplitPane1);
              fr.setSize(700,500);
              fr.setVisible(true);          
              fr.addWindowListener(this);     
    public void windowActivated(WindowEvent we){
         System.out.println("activated");
         dp.draw();
    public void windowClosed(WindowEvent we){System.out.println("closed");}
    public void windowIconified(WindowEvent we){System.out.println("iconified");}
    public void windowDeiconified(WindowEvent we){
         dp.draw();
         System.out.println("deiconified");
    public void windowDeactivated(WindowEvent we){System.out.println("deactivated");}
    public void windowOpened(WindowEvent we){
         dp.repaint();
         System.out.println("opened");
    public void windowClosing(WindowEvent we){
         System.exit(0);
         System.out.println("closing");
         public void valueChanged(TreeSelectionEvent e) {
              DefaultMutableTreeNode node = (DefaultMutableTreeNode)
              mainTree.getLastSelectedPathComponent();     
              String strRootNode = "" ;
              try{
                   Object rootNode = node.getRoot();          
                   strRootNode = rootNode.toString() ;
              catch(Exception eRoot)
                   System.out.println("Error in geting Root Node");
              if (node == null) return;
              Object nodeInfo = node.getUserObject();          
              TreeNode ParentNode = node.getParent();               
              final String strParentName = node.toString() ;
                   if (strParentName.equals("Source"))
              System.out.println("Before source");     
              var = "S";
              System.out.println("This is source");
              else if (strParentName.equals("Redirection"))
    var ="R";
              else if (strParentName.equals("Sink") )
                   var ="D";
              else
                   if ( strRootNode != strParentName){
         public JTree DrawTree( File file, String strIsValid)
                   jtree = new JTree();
                   toptreenode = new DefaultMutableTreeNode("Start");
                   topchildnode1 = new DefaultMutableTreeNode("Source");
                   topchildnode2 = new DefaultMutableTreeNode("Sink");
                   topchildnode3 = new DefaultMutableTreeNode("Redirection");
                   toptreenode.add(topchildnode1);
                   toptreenode.add(topchildnode2);
                   toptreenode.add(topchildnode3);
                   jtree.putClientProperty("JTree.lineStyle", "Angled");
                   DefaultTreeModel defaulttreemodel = new DefaultTreeModel(toptreenode);
                   jtree.setModel(defaulttreemodel);
                   DefaultTreeSelectionModel defaulttreeselectionmodel = new DefaultTreeSelectionModel();
                   defaulttreeselectionmodel.setSelectionMode(1);
                   jtree.setSelectionModel(defaulttreeselectionmodel);
                   jtree.addTreeSelectionListener(this);
                   jtree.setEditable(true);
                   return jtree;      
    public static void main(String args[]){
         CompTree ct = new CompTree();
         * This class contains all the component related to panel 1
         * this can be used for .....
    public class DrawPanel extends JPanel implements ActionListener,
         ComponentListener,MouseListener,KeyListener{
         public JRadioButton uniRadio,multiRadio,show;
         public JButton sBut,rBut,dBut;
         public int flag = 1 ;
         public int Radio = 1;
         public boolean sIndicator = true;
         public boolean rIndicator = true;
         public boolean isDestSelected = false;
         public boolean isDestFirstTime = true;
    public int x1 = 0 ;
         public int y1 = 0 ;
         public int x2 = 0 ;
         public int y2 = 0;
         public int x3 = 0;
         public int y3 = 0;
         public int k=0;
         public int l = 40;
    public int b = 40;     
         public String connection1,connection2,connection3,destination1,destination2;
         public int locX;
         public int locY;
    public JPanel panel1 = new JPanel ();      
    public JPanel panel2 = new JPanel ();     
         Vector lines = new Vector();
         Vector colors = new Vector();
         Vector obj = new Vector();
    Vector source = new Vector();
         Vector loc = new Vector();
         BasicStroke stroke = new BasicStroke(2.0f);
    Icon compImage = new ImageIcon("network1.gif"); //new
    Icon workImage = new ImageIcon("tconnect02.gif");
    Icon lapImage = new ImageIcon("server02.gif");
         public DrawPanel(){
         am adding radio button for checking the mode unicast and broad cast mode -- new
    uniRadio = new JRadioButton("Unicast Mode");
    uniRadio.setMnemonic(KeyEvent.VK_B);
    uniRadio.setSelected(true);
    multiRadio = new JRadioButton("Broadcast Mode");
    multiRadio.setMnemonic(KeyEvent.VK_C);
    show = new JRadioButton("show Panel");
    show.setMnemonic(KeyEvent.VK_C);
         ButtonGroup group = new ButtonGroup();
    group.add(uniRadio);
    group.add(multiRadio);
              group.add(show);
         /*     Border border = ButtonGroup.getBorder();
              Border margin = new EmptyBorder(10,10,10,10);
              ButtonGroup.setBorder(new CompoundBorder(border,margin)); */
              uniRadio.addActionListener(this);
         multiRadio.addActionListener(this);
              show.addActionListener(this);
    panel1.add(uniRadio);
              panel1.add(multiRadio);
              panel1.add(show);
              uniRadio.setBounds(150,15,100,40);
              multiRadio.setBounds(260,15,120,40);
              show.setBounds(390,15,100,40);
              uniRadio.setBackground(new Color(105,200,205));
              multiRadio.setBackground(new Color(105,200,205));
              show.setBackground(new Color(105,200,205));
              /*****************PANEL 1*********************/
              panel1.setLayout(null);
    panel1.setBounds(new Rectangle(0,0,400,400));
              panel1.setBackground(new Color(105,100,205));
              panel1.addComponentListener(this);
              panel1.addMouseListener(this);      
         public void sourceObject(String name)
    sBut = new JButton(compImage);
         panel1.add(sBut);     
         sBut.setMnemonic(KeyEvent.VK_F);
         sBut.setBounds(new Rectangle(locX,locY,l,b));     
         sBut.addActionListener(this);
         sBut.addMouseListener(this);
         sBut.addKeyListener(this);
    System.out.println("am inside the source object") ;
         sBut.setBackground(new Color(105,100,205));
         System.out.println("key number" +sBut.getMnemonic());
         System.out.println("MY LOCATION : SBUT : "+ sBut.getLocation());
         public void redirectionObject(String name)
         rBut = new JButton(workImage);
         panel1.add(rBut);
         rBut.setBounds(new Rectangle(locX,locY,l,b));     
    rBut.addActionListener(this);
         rBut.addMouseListener(this);
         rBut.addKeyListener(this);
         rBut.setBackground(new Color(105,100,205));
    System.out.println("am inside the redirection :" + j) ;
    System.out.println("MY LOCATION : RBUT : "+ rBut.getLocation());          
    public void destinationObject(String name){     
         dBut = new JButton(lapImage);
         panel1.add(dBut);     
         dBut.setBackground(new Color(105,100,205));
    System.out.println("am inside the destination object") ;     
    dBut.setBounds(new Rectangle(locX,locY,l,b));                    
         System.out.println("am inside the destination:" + j) ;
         dBut.addActionListener(this);
         dBut.addMouseListener(this);
         dBut.addKeyListener(this);
         System.out.println("MY LOCATION : DBUT : "+ dBut.getLocation());           
    public void paintComponent(Graphics g){
    super.paintComponent(g);
         System.out.println("inside paint");
         Graphics2D g2 = (Graphics2D) g;
    g2.setStroke(stroke);
    if(flag == 1){
         /* this is for drawing current line, this will be drawn when component event happens */
              g.setColor(getForeground());
    System.out.println("inside flag");
    int np = lines.size();
                        System.out.println("Total number of lines present the buffer to draw :" + np);
                             for (int I=0; I < np; I++) {                       
         Rectangle p = (Rectangle)lines.elementAt(I);
                        g2.setColor((Color)colors.elementAt(I));
                             System.out.println("width" + p.width);
                             g2.setColor(Color.red);
                        //     g2.setPaint(p.x,p.y,p.width,p.height);
                             g2.drawLine(p.x,p.y,p.width,p.height);                         
                             System.out.println("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
                             System.out.println(obj.elementAt(I));
                             System.out.println("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
                             System.out.println(p.x +"," +","+ p.y + ","+ ","+ p.width+ "," + ","+ p.height);
    flag = -1;
    }else if(flag == -1){
         if(x1 != 0 && y1 != 0 && x2 != 0 && y2 != 0 ){
    connection1 = "source to redirection";
    g2.setColor(Color.red);
         g2.drawLine(x1,y1,x2,y2);          
         lines.addElement(new Rectangle(x1,y1,x2,y2));
         colors.addElement(getForeground());
         obj.addElement(connection1);
         x1 = 0 ;y1 = 0 ;
         x2 = 0 ;y2 = 0 ;
    else if (x2 != 0 && y2 != 0 && x3 != 0 && y3 != 0 )
              connection2 = "Redirection to Destination";
              g2.setColor(Color.green);
                   g2.drawLine(x2,y2,x3,y3);                    
    colors.addElement(getForeground());
                   lines.addElement(new Rectangle(x2,y2,x3,y3));               
                   obj.addElement(connection2);
                   x2 = 0; y2 = 0 ;
                   x3 = 0 ; y3 = 0 ;                    
    else if (x1 != 0 && y1 != 0 && x3 != 0 && y3 != 0)
                   connection3 = "Source to Destination";
                   g2.setColor(Color.red);
                   g2.drawLine(x1,y1,x3,y3);                    
    colors.addElement(getForeground());
                   lines.addElement(new Rectangle(x1,y1,x3,y3));                              
                   obj.addElement(connection3);
                        x1 = 0; y1 = 0 ;
                        x3 = 0 ; y3 = 0 ;                    
                        /*     Image offscreen = panel1.createImage(400,400);
              Graphics og = offscreen.getGraphics();
         og.drawLine(200,200,500,500);
              g.drawImage(offscreen,0,0,null); */
    // Component Listener's method
    public void componentHidden(ComponentEvent e) { 
    if(e.getSource().equals(panel1)){System.out.println("Componenet Hidden");}
              System.out.println("Componenet Hidden");
    public void componentMoved(ComponentEvent e) {
              System.out.println("Componenet moved");
              draw();
    public void componentResized(ComponentEvent e) {      
              System.out.println("Componenet resized");
              flag = 1;
              paintComponent(panel1.getGraphics());
    public void componentShown(ComponentEvent e) {     
              System.out.println("Componenet Shown");
    // Mouse Listerner's Method
         public void mouseClicked(MouseEvent me){
    if (me.getSource().equals(panel1))
              System.out.println("inside mouse clicked");
                        if(var == "S"){
    the boolean sIndicator will allow the usage of source object only once
         This is the case for both unicast and multi cast.It has been restricted
         to single use.
                             if (sIndicator){
                             System.out.println("inside mouse clicked");
                        System.out.println("locX" + locX);
                        locX = me.getX();
    locY = me.getY();
                   sourceObject("Source");
                             sIndicator = false;
                        }else{}
              }else if (var == "R")
    if(rIndicator){
    if(!isDestSelected){
    System.out.println("redirection" + locX);
    locX = me.getX();
    locY = me.getY();
                   redirectionObject("Redirection");
                   rIndicator = false;
                   }else{}
    } else{}
              }else if(var == "D"){
              if(Radio == 1 && isDestSelected == false){
              System.out.println("Destination -- uni cast mode" + locX);
    locX = me.getX();
    locY = me.getY();
                   destinationObject("Sink");
              isDestSelected = true;
              } else if (Radio == 2)
                                  System.out.println("Destination -- Multicast mode" + locX);
                                  locX = me.getX();
                                  locY = me.getY();
                                  destinationObject("Sink");
                                  isDestSelected = true;                    
         public void mousePressed(MouseEvent me){System.out.println("am inside mouse pressed"); }
         public void mouseReleased(MouseEvent me){
              System.out.println("am inside mouse released");
              paintComponent(panel1.getGraphics());
         public void mouseEntered(MouseEvent me){}
         public void mouseExited(MouseEvent me){}
    // key Listener
    public void keyReleased(KeyEvent e) {        
                        Component compo =(JButton)e.getSource();                               
                             if (e.getKeyChar() == e.VK_DELETE){                         
                             remove(compo);
              public void keyTyped(KeyEvent e) {}
              public void keyPressed(KeyEvent e){}
    public void remove(Component comp){          
    System.out.println("inside delete key" );                         
         panel1.remove(comp);
         panel1.repaint();     
         public void draw(){
              super.paint(panel1.getGraphics());
              System.out.println("inside draw");
              flag = 1;
              paintComponent(panel1.getGraphics());     
         public void actionPerformed(ActionEvent e)
                             if(e.getSource().equals(sBut)){
                                  System.out.println("am s button");                
                                  x1 = sBut.getX() + l;
                                  y1 = sBut.getY() + (b/2);
                             else if(e.getSource().equals(rBut)){
                                  System.out.println("am r button");               
                                  x2 = rBut.getX() ;
                                  y2 = rBut.getY()+ b/2;
                                  System.out.println("x2 : " + x2 + "y2 :" +y2 );
                             else if(e.getSource().equals(dBut)){
                                  System.out.println("am d button");                
                                  x3 = dBut.getX();
                                  y3 = dBut.getY()+ b/2;
                             else if (e.getSource().equals(uniRadio)){
                                  System.out.println("uni radio");
                                  Radio = 1 ;
                             } else if (e.getSource().equals(multiRadio)){
                                       System.out.println("multi radio");
                                       Radio = 2;
                             } else if (e.getSource().equals(show)){            
                                  System.out.println("inside show");
    *********************************************

    ok
    i don't take a long time tracing your code, but i think u have to overwrite the repaint methode so it 's call the methode which will paint the line each time.
    hope this will help!

  • CS3: Viewing local and remote files simultaneously

    A friend recently purchased a new computer. On her previous PC, she could expand the Files view in Dreamweaver (v9) CS3 and see a split screen -- local files on one side, remote files on the other.
    She removed CS3 from her old machine and installed (from the same disks) on her new machine. Now, she cannot see the local/remote split screen.
    She can expand the Files tab (F8) to fill the screen - but that doesn't help. She checked, and her FTP settings are correct and connect properly.
    I know it's possible to do this is CS3 - I've seen her do it and I always worked in this view going back to Dreamweaver 4 - but the option to see local/remote seems to be gone!
    Any suggestions on how to fix this would be appreciated.

    Assuming you have properly defined both local and remote site settings -- Sites > Manage Sites....
    Your files panel  may be too narrow to see it.  Open it up wide, notice the icon at far right for "Expand / Collapse?" 
    See screenshot:
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • What is the difference between string != null and null !=string ?

    Hi,
    what is the difference between string != null and null != string ?
    which is the best option ?
    Thanks
    user8729783

    Like you've presented it, nothing.  There is no difference and neither is the "better option".

  • Hetrogenous join: ms access local and oracle on server

    Hello
    I want to know if it is possible to join tables from a local client ms access db and an oracle db on a server. I have used the link feature in ms access and the hsodbc feature of oracle, but the ms access db is local and the oracle is not. Is there anyway that I can control the local access db from a link from the oracle db on the remote server?
    Thanx

    There is no such facility as of now to acces Oracle table from DB2 database or anything.
    You can spool the data into flat file for MS access table and import that data into
    Oracle table.

  • Cannot uninstall I tunes. In control panel add and remove programs it will not give me the option to remove any of the I tunes. In program files it tells me access denied to remove any of the related items. I have tried using the removal methods from i tu

    My i tunes will not work at all. I have tried all the steps given to remove my I tunes player but in my control panel, add and remove programs it does not give me an option to remove any of the apple/ I tunes. I tried to go to program files and remove all the files but access is denied. This all started about 1 1/2 years ago and with every i tunes update i got more and more errors or problems until it stopped working. At one time i could remove and reinstall i tunes to try to fix it but now i cannot do anything. I believe one of the last  was i could not open i tune because it was being used or was on another network, not 100% sure its been so long and frustrating I quit trying 6 months ago. Hopefully someones got some help !!!
    Thanks I appreciate your time; Philip

    See Troubleshooting issues with iTunes for Windows updates.
    tt2

  • I tried to update iTunes yesterday.  The update failed.  Now when I try to open iTunes it says that the version isn't localized and needs to be run in English.  It has never been in another language.

    I attempted to update iTunes yesterday.  The update failed.  iTunes now won't open and displays an error message that the program isn't localized and needs to be run in the English version.  I'm in the US and the computer and program has never been used in another language.  I tried reinstalling the full download for the new version and that failed as well.  I logged out; shut down; restarted; retried the update; etc.  Still no luck and the same message.  Thoughts?

    Solving MSVCR80 issue and Windows iTunes install issues.
    Thanks to user turingtest2 for this solution.
    Solving MSVCR80 issue and Windows iTunes install issues.
    If the above doesn’t do the trick entirely, then use the instructions in the following as it applies to the version of Windows you are using:
    HT1925: Removing and Reinstalling iTunes for Windows XP
    HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    You may be required to boot into safe mode to complete the folder deletion process.

Maybe you are looking for

  • Problems Setting Up Developer Users

    I am having a problem setting up developer users and I am trying to determine if I am missing a step or if there is a configuration problem on my staging and production systems. What I want to do should be very simple. I want to create a user that ca

  • Indesign.exe has encountered a problem and needs to close.

    After formatting my hard drive and reinstalling InDesign CS3, I am not able to open the program. When I click the shortcut to start the program, it starts to load for about 10-15 seconds, then freezes and gives me this error message: "Indesign.exe ha

  • Can't backup Oracle DB on Windows 2008 R2 via DB13

    Hi All, I'm having an issue that is driving me nuts. First off, I'm using CA arcserve version 16. I checked the read me and i fall into the supported versions. Windows Server 2008 R2 Service Pack 1 x64 with BR*TOOLS 7.2 for Oracle 11gr2 Windows Serve

  • Laptop-mode / laptop-mode-tools lcd brightness issue

    I have an issue with my lcd brightness config in laptop-mode tools here is the brightness values [venky@ARCHROCKS ~]$ cat /proc/acpi/video/VID/LCD/brightness levels: 72 24 12 24 36 48 60 72 84 100 current: 72 [venky@ARCHROCKS ~]$ following is my lcd-

  • Can't ftp to site in Dreamweaver

    I have just installed Dreamweaver CS4 on a new desktop running Vista. I have set up access to my websites but keep getting an error that access is refused, may lack permissions etc. However, on the same machine I can access my sites using ftp in Inte