In Flex2, How to get coordinates in a view port?

I know one can use something like
fooUIControl.localToGlobal(new Point(x,y))
to get the coordinates corresponding to the origin at the top
left of the main flex app 'document'.
In case that the main flex app scrolls, how can I get the
coordinates corresponding to the origin at the top left of the
visible screen (or the 'viewport')? Or in other words, how can I
find out how many pixels are scrolled in X and Y? Thanks.

The horizontalScrollPosition and verticalScrollPosition
properties of a scrolling container tell you how many pixels it has
scrolled.

Similar Messages

  • How to get coordinates from Google Map

    I wonder how to get coordinates from Google Map to JavaFX application when click has occured. Here is an example of code:
    public class JavaFXApplication extends Application {
    public void showCoordinates(String coords)
            System.out.println("Coordinates: " + coords);
        @Override public void start(Stage stage)
            final WebView webView = new WebView();
            final WebEngine webEngine = webView.getEngine();
            webEngine.load(getClass().getResource("googlemap.html").toString());
            webEngine.getLoadWorker().stateProperty().addListener(
                    new ChangeListener<State>() {
                        @Override
                        public void changed(ObservableValue<? extends State> ov, State oldState, State newState) {
                            if (newState == State.SUCCEEDED) {
                                JSObject window = (JSObject) webEngine.executeScript("window");
                                window.setMember("java", new JavaFXApplication());
            BorderPane root = new BorderPane();
            root.setCenter(webView);
            stage.setTitle("Google maps");
            Scene scene = new Scene(root,1000,700, Color.web("#666970"));
            stage.setScene(scene);
            stage.show();
       public static void main(String[] args){
            Application.launch(args);
    // googlemap.html file
    <!DOCTYPE html>
    <html>
        <head>
            <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
            <style type="text/css">
                html { height: 100% }
                body { height: 100%; margin: 0px; padding: 0px }
                #map_canvas { height: 100%; background-color: #666970; }
            </style>       
            <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false">
            </script>
            <script type="text/javascript">           
                function initialize() {
                    var latlng = new google.maps.LatLng(40.75089, -73.93804);
                    var myOptions = {
                        zoom: 10,
                        center: latlng,
                        mapTypeId: google.maps.MapTypeId.ROADMAP,
                        mapTypeControl: false,
                        panControl: true,
                        navigationControl: true,
                        streetViewControl: false,
                        backgroundColor: "#666970"
                    var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);    
                    document.map = map;
            google.maps.event.addListener(map, 'click', function(event) {
                //java.showCoordinates(event.latLng); ???
            map.setCenter(location);
            </script>
        </head>
        <body onload="initialize()">
            <div id="map_canvas" style="width:100%; height:100%"></div>
        </body>
    </html>Edited by: krbltik on 03.10.2012 22:59

    Hi, welcome!
    You may also have a look at GPS Info Qt, available for free at Ovi Store: http://store.ovi.com/content/165671
    GPS Info Qt is a nice Qt app. I have it on my C6-01 and I like it.
    Regards.

  • How to get relationship between two  views in the  reports

    How to get relationship between two  views in the  reports, I am doing a deletion program , it is fully relates to views , how to get relationship between them in the reports

    Hi,
    Please explain your question in detail...what do you want to read ?
    If you want to know about the navigation links between the views then you can use APIs  like
    wdComponentAPI.getComponentInfo().findInWindows("windowName").getViewUsageByID("Name").getNavigationLinks();
    Iterate through the navigationLinkInfo from above collection and can read the other properties .
    I haven't tried the above , but it should work !!!
    Regards,Anilkumar

  • How to get coordinates of components. PLEASE HELP ME URGENT!

    Hi, I am trying to get the coordinates of my components that are tabbed pane buttons, buttons, text fields etc so I can place an image of a pointer under it that points to it and then under the image of the pointer I would put a label describing the button for example "press the tab to start". Then when I press tab1 the image of pointer image points to the next component and has a label under pointer.
    Now I have tried using componenet.getX() and getY() and then set the values of the the image panel to use then the label panel so they be placed under the component, these panels are not using layout manager but absolute positioning. If the window is resized then the labels and image of pointer should also adjust. I have tried putting the label and arrow into a glasspane and now layerdpane as some people here suggested which when I do then add it to contentpane the main panel with the components is not there but the layerd pane is.
    I am having huge difficulties with this and if someone can Please just tell me or even better give me an example code how to find out the coordinates of components so I can place my image of pointers and labels underneath them I will be very grateful of you. I am on a verge of giving up accomplish what I am doing and I am new to the swing framework. My progress to solve this has been very slow and frustrating. I just hope someone here can help.

    I tried the both of codes given. But the code given by both the person i have not understand. And what they there code is doing. This is the code form my side if this example help u.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    * Author Waheed-Ul-Haq ( BS(CS)-8 )
    public class Samulation2
         JPanel pane;
         JLabel label1;
         JTextField entProcesfld;
         JButton buttCreat;
         JButton buttReslt;
         JLabel usrProcesID[];
         JTextField usrArivTam[];
         int processes;
         public JComponent createComponents()
         pane = new JPanel();
         pane.setLayout (null);     
         label1 = new JLabel();     //Label for to tell user to enter no of Processes.
         label1.setText("Enter the no. of Processes");
         pane.add(label1);
         label1.setBounds(20, 25, 150, label1.getPreferredSize().height);
         entProcesfld = new JTextField();     //TextField to enter no of processes.
         entProcesfld.setToolTipText("Enter the no of Processes.");
         pane.add(entProcesfld);
         entProcesfld.setBounds(180, 25, 100, entProcesfld.getPreferredSize().height);
         buttCreat = new JButton();          //Button to create the TextFields.
         buttCreat.setText("Create TextFields");
         pane.add(buttCreat);               //Adding cutton to Jpane.
         buttCreat.setBounds(new Rectangle(new Point(30, 60), buttCreat.getPreferredSize()));
         buttCreat.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        buttCreatActionPerformed(e);
                   } } );          //ActionListenr to Create the TextFields.
         pane.setPreferredSize(new Dimension(600,600));
         return pane;
         }     //-------END of Component createComponents()--------//
         private void buttCreatActionPerformed(ActionEvent e)     //Action to Create the TextFields.
                   processes = Integer.parseInt (entProcesfld.getText ());
                   JLabel Labproces = new JLabel();     //Label of Processes.
                   Labproces.setText("Processes");
                   pane.add(Labproces);
                   Labproces.setBounds(new Rectangle(new Point(15, 105), Labproces.getPreferredSize()));
                   JLabel labArivTam = new JLabel();     //Label of Arival time.
                   labArivTam.setText("Arrial Time");
                   pane.add(labArivTam);
                   labArivTam.setBounds(new Rectangle(new Point(90, 105), labArivTam.getPreferredSize()));
                   //----Creating Dynamic JLabels------//
                   usrProcesID  = new JLabel[processes];     /* Makes an array */
                   int yXis = 125;          //Variable for Y-axix of JLabel.
                   for(int i=0; i<processes; i++)      /* i takes each value from 0 to processes-1 */
                    usrProcesID[i] = new JLabel("P" + i);      /* Makes a JLabel at an array place */
                    pane.add(usrProcesID);      /* Adds a JLabel (rather than an array) */
    usrProcesID[i].setBounds(new Rectangle(new Point(28, yXis), usrProcesID[i].getPreferredSize()));
    yXis = yXis + 25;     /* Increses the Y-axis to show JLabels. */
    }     //EndFor     
    //-------End Dynamic JLabels---------//               
                   //-----Creating Dynamic Arival Time TextFields-----//
                   usrArivTam = new JTextField[processes];          /* Makes an array */
                   yXis = 125;          //Variable for Y-axix of JTextField.
                   for(int i=0; i<processes; i++)      /* i takes each value from 0 to processes-1 */
    usrArivTam[i] = new JTextField();     /* Makes a JTextField at an array place */
    usrArivTam[i].setToolTipText("Enter Arival Time.");
    pane.add(usrArivTam[i]);      /* Adds a JTestField (rather than an array) */
    usrArivTam[i].setBounds(100, yXis, 35, usrArivTam[i].getPreferredSize().height);
    yXis = yXis + 25;     /* Increses the Y-axis to show JTextFields. */
    }     //EndFor     
    //-----End Dynamic Arival Time TextFields.-----//
    //----Calculating points for Label and textfields.
    Point poi = new Point();
    poi = usrArivTam[processes-1].getLocation ();     //Getting the location of the last text field of ArivalTime.
    //-----Label for Average Waiting time.--------\\
    JLabel averWaitLB = new JLabel();
    averWaitLB.setText("Average Waiting Time");
              pane.add(averWaitLB);
              averWaitLB.setBounds(new Rectangle(new Point(30, (int)poi.getY()+50), averWaitLB.getPreferredSize()));
    //-----TextField for Average Waiting Time.--------\\
    JTextField averWaitTF = new JTextField();
    averWaitTF.setText ("Hello");
    averWaitTF.setEditable(false);
    pane.add (averWaitTF);
    averWaitTF.setBounds(190, (int)poi.getY()+50, 35, averWaitTF.getPreferredSize().height);
    }     //------END of void buttResltActionPerformed(ActionEvent e)---------//
         private static void createAndShowGUI()
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);
    //Create and set up the window.
    JFrame frame = new JFrame("Priority Scheduling (Non-Preemptive)....");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Samulation2 application = new Samulation2();
    //Create and set up the content pane.
    JComponent components = application.createComponents ();
    components.setOpaque (true);
    int vertSB = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS;
              int horzSB = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS;
              JScrollPane scrollPane = new JScrollPane(components, vertSB, horzSB);
    scrollPane.setPreferredSize (new Dimension(720,455));
    frame.getContentPane ().add (scrollPane,null);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    }     //------END Of void createAndShowGUI()--------//
         public static void main(String[] args)
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
         }     //---------End of main()----------------//
    }     //--------END of class Samulation2----------//
    If any body help me implementing the ScrollBars in this code. I am unable to use Scroll Bars with this code while using NULL layout. If any body tell me how to get the Size and set for the pane.

  • How to get coordinates of FileSystemTree selected item ?

    Hi can some one clue me in how to get the coordinates of the
    selected itwn in a FileSystemsTree ?
    thx
    -g

    Hi Amy,
    I looked at the code, this is the width calculation.
    There are four (4) parts to each of the tree node display:
    1) the indent, from _listData.indent Only value id _data is
    not null
    2) the disclosureIcon.width
    3) icon.measuredWidth
    4) label measured or explicate width
    The positions are calculated by:
    1a) disclosureIcon.x = the indent
    1b) disclosureIcon.setActualSize = disclosureIcon.width,
    disclosureIcon.height
    2a) icon.x = the indent + disclosureIcon.width
    2b) icon.setActualSize = icon.width, icon.height
    3a) lable.x = the indent + disclosureIcon.width + icon.width
    3b) lable.setActualSize = lable.width, lable.height
    The label width:
    label.width: the size of the visible portion of the label in
    the parent. It may be clipped/truncated.
    label.textWidth: the total size of the text in the label
    Maybe I can get the code finished today.
    BTW, as I'm moving through this processes of learning flex,
    the one thing I've noticed is the lack of a concise MVC model or at
    least a breakout of the more complex UI components. I'd assume for
    such a strategic product, there would be more investment by Adobe
    in these technical areas. But, I guess its easier putting people on
    a bus and send them to city to city.
    -g

  • How to get data form another view

    Hello together,
    I am more or less a newby in objective-c …
    The Problem is that I have 2 different ViewControllers. I create a NSArray with a lot of Data in view1. After that I want to write this data into a UITableView which is in view2.
    But I do not know how to get the data from view1?
    If anyone has an idea I would be very thankful.
    Best wishes,
    Stephan

    Hi,
    You mean Data transfer between two components..
    To pass the value from one component to other component, you can use used component scenario.
    For example let use assume we have two comp ..
    Comp A,
    Comp B.
    now we need to pass the value from Comp A to Comp B.
    Then declare the Comp A as used component in Comp B.
    Now then you can create a node in the comp A component controller and check the interface check box there then the
    node and the attribute will be present in the interface controller also .
    and this interface controller context you can access in the component and map it to view there and display it.
    Webdynpro Application Integration..
    http://wiki.sdn.sap.com/wiki/display/WDABAP/WebdynproApplicationsIntegration
    cheers,
    Kris.

  • Please Help(How to get RadioButtons in tree View)

    Hi.
    Sub/Requirement: How to implement RadioButtons in tree view with/without using xml file.
    I have a requirement like this i want to display RadioButton in tree view.
    I implemented tree same as which is given in sampleApplications.
    In this sampleApplications they implemted tree by using xml file.
    I also implemented tree by Generating xml file. In this xml file i get the values from the database. I am using <netui:tree > tag.
    Is it possible to implement tree without using xml file. I need to generate tree Dynamically.
    Please any one help me to come out with this solution.

    The issue here is while you are retrieving all the details, you are consistently overwriting them in the request.setAttribute() call before you get to the JSP to display them.
    Do you actually have a class/object called Student?
    That object should have attributes for classes, subjects, teachers (all of which are lists apparently)
    public class Student{
      String name;
      List classes;
      List subjects;
      List teachers;
      // appropriate getter/setter methods
    }Then you load each student, and populate its individual lists.
    That lets you pass the list of students, each student having its own lists for display.
    Hope this helps,
    evnafets

  • How to get a tree-oriented view of a pdf document's sections in Acrobat 8 Professional?

    Hi, I have a PDF that has a document outline (with table of contents etc.). This may be a stupid question, but in earlier versions of Acrobat Reader -- I used to be able to get a navigation panel that showed the sections in a tree-form that made it easy to jump to a given section. I now have the Acrobat 8 pro.. and when I read PDF's with it, I do NOT get this tree-oriented view.. but just a thumbnail or page oriented view. How can I get the other view?
    Thanks,
    -Sundar

    Well.. the contents page seems ok, and when I click on the lines in the contents page, Adobe takes me to the right spot. Others (w/ earlier versions of Acrobat) also are able to see the outine. I have to conclude that perhaps pro8 is just broken. (I guess I have to talk to someone to figure out how I can get my reader back.. because right now even the reader launches Acrobat Pro..). Sigh.

  • How do get video to hdmi TV port without using apple tv?

    My new non retina macbook pro 13 inch is supposed to arrive soon.  My old 42 inch Vizeo only has one hdmi port that works so I was planning to use it a s moniter  for  my DAW.  The apple tv is for the living room, not the room where my DAW is.  But as far as I can tell there is no mini display or anything on this computer other than thunderbold , usb and  firewire, the firewire to be used for my MOTU audio interface. Any ideas on how to get this old  VIzeo  to be external moniter basically

    Take a look at this;
    http://support.apple.com/kb/HT4241
    There's some additional links in there to the products themselves. Will allow you to connect it to the HDMI port on the TV and not have to use the Apple TV.
    Regards,

  • How to get OSB to stop appending port # in the endpoint of a published WSDL

    This is the closest thread I could find to my issue, but still is not quite what I am looking for: How to get ip number in WSDL instead of host name? I have an OSB server behind a VIP, and I am publishing a proxy service for an external client to call. The VIP only accepts connections over SSL/https. OSB only hosts services on http/port 80, and the VIP handles the connectivity and security between them.
    I wrote a wsdl by hand, set my endpoint to the VIP address (https), created the proxy service, and deployed to OSB. I can test the service all day in SoapUI by calling the VIP, so far so good. However, when the client calls https://VIP/myService/?wsdl, he sees the wsdl's endpoint populated as http://VIP/myService:80.
    How do I stop OSB from appending :80 to the endpoint in the wsdl? This makes it unusable for any client caller to generate code by calling ?wsdl, so it forces us to export the wsdl and all schema files and provide to clients by hand. What configuration setting can we change that will fix this behavior?

    vladodias wrote:
    OSB only hosts services on http/port 80...You can change OSB to host on any port you want and can also configure security...
    http://docs.oracle.com/cd/E28280_01/dev.1111/e15866/model.htm
    http://docs.oracle.com/cd/E28280_01/web.1111/e13707/ssl.htm#i1200848
    appending :80 to the endpoint in the wsdl ... makes it unusable for any client caller to generate code by calling ?wsdl
    I should have mentioned that :80 was an external constraint, so it was not an option to change this portion of the OSB configuration...
    Most wsdl clients should be able to call a wsdl from any port as well... The presence of :80 shouldn't make any difference... So, I can't quite understand that either...The point is to be able to provide a framework to clients that needs as few settings overridden as possible, so we'd like the published endpoint to actually match the true endpoint that we would expect a client to call.

  • How to get informations on x$ view

    I want to know information on x$ view (or xm$ view).
    Is there anyone to know how to get this information?
    I would appreciate it if anyone let me know.

    aden, kang wrote:
    I want to know information on x$ view (or xm$ view).
    Is there anyone to know how to get this information?
    I would appreciate it if anyone let me know.To understand the X$ tables ( they are not views) , you need to understand what they represent. There is no site/note AFAIK which tells about the description of these tables in a clear and concise manner, makes sense as these are internal tables and are supposed to be known by Oracle's internal people only. At the most what you can find from the net is the description of the table's name , information about the column and their description is not avaiable anywhere. This you have to dig yourself.
    For a start, you can see what the correspondng V$ view of the table is showing and than have to start matching the columns of the views with the X$ with your own research.
    HTH
    Aman....

  • How to get browser to highlight viewed sites

    After I have done a google search when I visit one of the the sites that the search found and then go to another it does not highlight the previously viewed site so that I know which ones I have visited. Any suggestions on how to get the system to do this? Thanks.

    I am running Tiger
    IMAC Mac OS X (10.5.4)
    Okay, but you might want to change the computer information in your setup.
    Which version of Safari? What exactly are you doing?
    I have Safari 3.0.2 (I never use Safari so I don't bother updating). I open a Window, do a Google search, click on a blue link, takes me to the new page. I click the back arrow which takes me back to my Google results where I now see the link is a purple color. Not the best of contrast colors I have to admit. This isn't happening for you?

  • How to get spisipic part of view in jframe

    Hello all.
    I wrote a project and run it on other comp with small screen. Now I can see only part of the Jframe.I added a scrollBar to Jframe and now I need to write to it a listener.
    My qustion is how to get spicific view from a jframe.
    Because a can get the value from the scrollBar so now I need to know what is the function to move view in jframe.
    thanks alot.
    please do not give me tutorial on scrollbar
    Edited by: vitaly87 on 00:24 27/04/2011
    Edited by: vitaly87 on 00:25 27/04/2011
    Edited by: vitaly87 on 00:31 27/04/2011

    vitaly87 wrote:
    ..plese do not give me tutoriol on scrollbarWhat about a tutorial on spelling?
    Edited by: Andrew Thompson on Apr 27, 2011 5:51 PM
    My qustion is how to get spicific view from a jframe.If you fixed that to something like..
    My question is how to get specific view from a JFrame.I could edit my reply to nothing - to save bandwidth for readers of the thread.

  • How to get a WIDE screen view in Laptop...

    I am using Sun Solaris 10 for x86 on Virtual Machine. But i am unable to get a wide screen view. I have a 15.4" screen laptop.
    Do i need to change any setting in my Vitual Box????
    Presently, i am getting a view having Aspect ration 1:1. i am looking for 16:9 aspect ration screen.

    Hey,
    Wide screen view for Solaris on virtual machine? I use the newest [virtualbox for windows|http://www.softsea.com/review/VirtualBox-for-Windows.html] version, what if you use vboxmanage setextradata resolution x*y? Look in the manual for the correct syntax. It might actually work. you can also try to force it in xorg.conf.
    Hope this tip can help.

  • How to Get Most Current User View Before Checking In.

    Hi,
    We have several custom workflows which users can start from end-user menu and have some resource accounts created/modified after approvals.
    User view is checked out once at the beginning of each workflow, then some user attributes are modified through forms and user view is checked in with new attributes at the end.
    If any user starts a workflow (say W2) before completion of another workflow (say W1) he started before, and W1 is completed when W2 is waiting for approvals or etc., W2 completely discards changes made to user view through W1 since it has already checked out the user view before.
    If I checkout the user once more just before checkin, I'm able to get a current user view but this time changes made through forms used in the current workflow are lost.
    What's the best way, to get an updated user view of the user without overwriting any changes made out of the running workflow and losing form data?
    Regards,
    Mehtap.

    In a situation like this, you should probably change the front end to store the changes in workflow variables instead of using the view directly. Then, post approval, you checkout the view and apply the changes. I've used this approach to perform changes on large numbers of users (kind of like a bulk action, only more reliable).
    Alternatively, you can checkout the user object at the beginning of the workflow, and this will prevent your race condition by putting a lock on it. This will obviously cause problems (for you) if your users expect to be able to do multiple changes simultaneously. Don't try this approach if an angry mob will storm your cubicle -- IDM coders are hard to come by.
    Jason

Maybe you are looking for

  • ODS Rollback tables post upgrade

    Hi All, We are currently upgrading our BW system from SAP BW 3.5 to BI 7.0. After upgrade, we noticed the roll back tables of ODS are missing. However, we are able to load data in the ODS and view them. Could you suggest any way to re-create these ro

  • Preserving PDF version after Save during "Extend Features in Reader"

    Hi, I'm using Acrobat Pro 9 and I'm attempting to make a fillable form that needs to be compatible with Acrobat 5 (PDF v1.4) . I can make the form, but when I extend features in reader, the copy it saves is PDF v1.6 (Acrobat 7). Is there any way to m

  • No Attachment in outlook web access

    When creating a purchase order from the SAP, we have a partner that should get the Layout in PDF of the Purchase order via Email, when sending it to this email, the partner get this email however: 1. if the partner looks at Outlook he can see email a

  • Option of auto reclaiming 'abandoned' connection in DB conn pool

    Hi, All, It seems that by default DB conn pool implementation in Web AS 6.40 Java has the freature of automatically reclaiming 'abondoned' database connection when it detects a connection has been idle for a period of time. I wonder whether this feat

  • How can you stop a dunning letter from printing?

    Hi, We've set-up 3 dunning letters for our customers but we only want levels 1 and 2 to send a dunning letter. Level 3 should update the customer master but no letter should be sent. Unfortunately we can't get this to work and a letter is created for