How to translate a XYLineChart along with other items?

This code plots a XYLineChart and a straigth line: by left mouse click and drag anywhere on the graph, XYLine is translated left/right and up down while the black line do not.
I would like to bind the black line and the XYLine so that when I click and drag, both lines move together.
How to accomplish this?
Thanks
import javafx.application.Application;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.event.EventHandler; 
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.XYChart;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.Node;
import javafx.scene.chart.LineChart;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.LineTo;
import javafx.scene.shape.MoveTo;
import javafx.scene.shape.Path;
public class JavaFXMovePath extends Application {
Path path;
BorderPane pane;
XYChart.Series series1 = new XYChart.Series();
SimpleDoubleProperty rectinitX = new SimpleDoubleProperty();
SimpleDoubleProperty rectinitY = new SimpleDoubleProperty();
SimpleDoubleProperty rectX = new SimpleDoubleProperty();
SimpleDoubleProperty rectY = new SimpleDoubleProperty();
@Override
public void start(Stage stage) {
    final NumberAxis xAxis = new NumberAxis(1, 12, 1);
    final NumberAxis yAxis = new NumberAxis(0.53000, 0.53910, 0.0005);
    xAxis.setAnimated(false);
    yAxis.setAnimated(false);
    yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis) {
        @Override
        public String toString(Number object) {
            return String.format("%7.5f", object);
    final LineChart<Number, Number> lineChart = new LineChart<Number, Number>(xAxis, yAxis);
    lineChart.setCreateSymbols(false);
    lineChart.setAlternativeRowFillVisible(false);
    lineChart.setAnimated(false);
    lineChart.setLegendVisible(false);
    series1.getData().add(new XYChart.Data(1, 0.53185));
    series1.getData().add(new XYChart.Data(2, 0.532235));
    series1.getData().add(new XYChart.Data(3, 0.53234));
    series1.getData().add(new XYChart.Data(4, 0.538765));
    series1.getData().add(new XYChart.Data(5, 0.53442));
    series1.getData().add(new XYChart.Data(6, 0.534658));
    series1.getData().add(new XYChart.Data(7, 0.53023));
    series1.getData().add(new XYChart.Data(8, 0.53001));
    series1.getData().add(new XYChart.Data(9, 0.53589));
    series1.getData().add(new XYChart.Data(10, 0.53476));
    pane = new BorderPane();
    pane.setCenter(lineChart);
    Scene scene = new Scene(pane, 800, 600);
    lineChart.getData().addAll(series1);
    stage.setScene(scene);        
    path = new Path();
    path.setStrokeWidth(5);
    path.setStroke(Color.RED);
    scene.setOnMouseClicked(mouseHandler);
    scene.setOnMouseDragged(mouseHandler);
    scene.setOnMouseEntered(mouseHandler);
    scene.setOnMouseExited(mouseHandler);
    scene.setOnMouseMoved(mouseHandler);
    scene.setOnMousePressed(mouseHandler);
    scene.setOnMouseReleased(mouseHandler);
    stage.show();
EventHandler<MouseEvent> mouseHandler = new EventHandler<MouseEvent>() {
    @Override
    public void handle(MouseEvent mouseEvent) {
        if (mouseEvent.getEventType() == MouseEvent.MOUSE_PRESSED) {            
            rectinitX.set(mouseEvent.getX());
            rectinitY.set(mouseEvent.getY());
        else if (mouseEvent.getEventType() == MouseEvent.MOUSE_DRAGGED || mouseEvent.getEventType() == MouseEvent.MOUSE_MOVED) {
            LineChart<Number, Number> lineChart = (LineChart<Number, Number>) pane.getCenter();
            NumberAxis yAxis = (NumberAxis) lineChart.getYAxis();
            NumberAxis xAxis = (NumberAxis) lineChart.getXAxis();
            double Tgap = xAxis.getWidth()/(xAxis.getUpperBound() - xAxis.getLowerBound());
            double newXlower=xAxis.getLowerBound(), newXupper=xAxis.getUpperBound();
            double newYlower=yAxis.getLowerBound(), newYupper=yAxis.getUpperBound();
            //double xAxisShift = getSceneShift(xAxis);
            //double yAxisShift = getSceneShift(yAxis);          
            //double yAxisStep=yAxis.getHeight()/(yAxis.getUpperBound()-yAxis.getLowerBound());           
            double Delta=0.3;
            if(mouseEvent.getEventType() == MouseEvent.MOUSE_DRAGGED){
            if(rectinitX.get() < mouseEvent.getX()){   
                newXlower=xAxis.getLowerBound()-Delta;
                newXupper=xAxis.getUpperBound()-Delta;
        else if(rectinitX.get() > mouseEvent.getX()){   
                newXlower=xAxis.getLowerBound()+Delta;
                newXupper=xAxis.getUpperBound()+Delta;
            xAxis.setLowerBound( newXlower );
            xAxis.setUpperBound( newXupper );
            //========== Y-Axis Moving ============================
            if(rectinitY.get() < mouseEvent.getY()){   
                newYlower=yAxis.getLowerBound()+Delta/1000;
                newYupper=yAxis.getUpperBound()+Delta/1000;
            else if(rectinitY.get() > mouseEvent.getY()){   
                newYlower=yAxis.getLowerBound()-Delta/1000;
                newYupper=yAxis.getUpperBound()-Delta/1000;
            yAxis.setLowerBound(newYlower);
            yAxis.setUpperBound(newYupper);                      
            rectinitX.set(mouseEvent.getX());
            rectinitY.set(mouseEvent.getY());
            MoveTo moveTo = new MoveTo();
            moveTo.setX(80);
            moveTo.setY(80);
            LineTo lineTo1 = new LineTo();
            lineTo1.setX(80);
            lineTo1.setY(80);
            LineTo lineTo2 = new LineTo();
            lineTo2.setX(200);
            lineTo2.setY(200);
            path.getElements().add(moveTo);
            path.getElements().add(lineTo1);
            path.getElements().add(lineTo2);
            path.setStrokeWidth(3);
            path.setStroke(Color.BLACK);
            pane.getChildren().add(path);                               
//private static double getSceneShift(Node node) {
//    double shift = 0;
//    do { 
//        shift += node.getLayoutX(); 
//        node = node.getParent();
//    } while (node != null);
//    return shift;
public static void main(String[] args) {
    launch(args); 
}

The model-based search is standard ADF functionality.
Jheadstart simply generate the search component on the page. There are a lot of addiitonal properties on af:query that you can set that we do not expose through the Jheadstart application definition editor.
You can create a custom template to set those additional properties.
See the af:query tag doc for more info:
http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e12419/tagdoc/af_query.html
Steven Davelaar,
Jheadstart Team.

Similar Messages

  • HT5225 how do I get my icloud a/c onto my mailbox along with other email a/c's ?

    How do i get move my icloud a/c onto my mailbox along with other email accounts ?

    What Mac OS are you using? It should be setup automatically if using 10.7.2 or later after moving to iCloud.

  • I had a drive failure and lost the iWeb file along with other things.   I did manage to save a lot of user file documents but I don't see or   recognize the my iWeb site file. It was on a 15" G4 Titanium pb. I'm trying to find a way, using version 2.0.4

    I had a drive failure and lost the iWeb file along with other things. 
    I did manage to save a lot of user file documents but I don't see or 
    recognize the iWeb site file. It was on a 15" G4 Titanium pb.
    I'm trying to find a way, using version 2.0.4 of iWeb on a different 
    pb to recover the file into the iWeb app or a way to download the site into iWeb.
    There are 6 pages of images and text, and it 
    would be a task for me to recreate the whole thing again. I did 
    download the site but I don't know how or if I can get iWeb to see it and open it.
    Does anyone have any knowledge about this? The link to my site:
    <http://web.mac.com/danauerbach>
    Any suggestions will be most appreciated.
    dan auerbach
    [email protected]

    Unfortunately iWeb cannot read or import previously published files, only generate them.  You'll have to recreate your site from scratch.
    However, Chapter 2.3 on the iWeb FAQ.org site has tips on using some of the existing files, image, audio, video, etc., from the published site in the recreation of the site.
    OT

  • Withholding tax lines are being cleared along with other line items

    Hi All,
    While doing J1INCHLN(payment making of TDS), system giving error i.e.
    "Withholding tax lines are being aleared along with other line items"
    Please suggest me in this issue...it would be great help for me.
    Thanks,
    Saisri

    Hi,
    As per my analysis we found some documents, here We have made advance payment to vendors with TDS and again rised invoce to vendors with TDS and these documents have been nockedoff in F-54.
    We have many documents of such nature and as per me it is because of these documents  the system is throwing error. Pls. advice as to how to proceed on this.
    Thanks,
    Saisri

  • How to share administrator iPhoto library with other users on same iMac?

    How to share administrator iPhoto library with other users on same iMac?

    This is the part I'm referring to:
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
    Any user can drag a pic from the Shared Library to their own in the iPhoto Window.
    Remember iPhoto must be running in both accounts for this to work.
    The library stays in the Pictures folder for this.

  • How do I stop sharing mail with other users on my computer

    How do I stop sharing mail with other users on my Macbook pro?

    You may have to set up different user accounts in the computer if you wish to
    continue sharing the computer among other people, and only use the Mail app.
    Otherwise, if you use a webmail such as yahoo, gmail, or other, just use a browser
    and login each time; then there is no saving of your email to the computer as such.
    I've never used an email client software, nor had an ISP based email account. So
    my numerous computers have never downloaded email into software. No loss.
    But the answers do include setting up extra user accounts, not admin level, so the
    other users do not mess with the operating system; a standard account or just a
    guest account to use a browser to access web-based login email accounts, works.
    There are third-party email client for OS X, some are free applications, others are
    part of a larger browser product, such as SeaMonkey, & other Mozilla derivatives.
    They provide an email segment or client aspect; unlike Firefox that's a browser.
    Setup information should be within the Help viewer in the computer itself. Or by a
    simple search online, including the OS X version and any email client software
    your computer may have installed. Some browser software includes email client.
    Also there are several ways to go in this matter. I don't see questions, only answers.
    To learn how the Mail application works, if you want to import everyone's mail, then
    figure how to set up user accounts in the OS X. Or use web-mail & login by browser.
    Hopefully you can find the best solution for the unasked question.
    Good luck & happy computing!

  • How do I share my playlists with other accounts/users on my Mac?

    How do I share my playlists with other accounts/users on my Mac?

    Hello,
    I have a similar question, which I posted 8perhaps inappropriately) in the Home Sharing discussion: https://discussions.apple.com/message/17405588#17405588
    The problem I have is that it simply doesn't work and the question I have is how you do not move the the iTunes Library file or the iTunes Library.xml file when they are actually in the folder you are told by the article to move in the first place.

  • How to make plant default on the line item along with the item category

    Hi All,
    I want to default Plant on the line item along with the item category.In order to meet the following scnario.
    1. I have two plants,first plant is maintained for the valuated item and the second plant is maintained for the non valuated item (Free Goods).
    Whenever user is entering an item in the sales order for which corresponding free goods item is maintained in the master record.System is proposing two lines items in the sales order.
    First line item is the main item which appears along with the Plant 1 which contains valuated items
    Second line item is for the Free of charge item which is being proposed from Plant 2, which contains the non valuated items.
    I want that the system should always propose Plant 1 with main item and Plant 2 with the Free of Charge item by default. (Along with the item category TAN and TANN)
    Rahul

    Delivering Plant is determined in the following order
    1. Customer material info record.
    2. Customer master
    3. Material master.
    Use one of them an default your plant.
    I think in your case you can use the materila master which will give an item level plant different. The other two will default the plant at the header level.
    regards
    jude

  • WH  tax line items cleared along with Other line items Message no:8I701

    hI guru,
    When i run J1INCHLN  System givem the error is : Withholding tax line items cleared along with other line items, message no:8I701
    Pleas any one give solution ..
    I also cheked as respective g/l for tds IN FBL3N . All line items are opend.
    Also cheked all selection parameter in J1INCHLN  and FBL3N .is same .
    Why the sys behaviour like this .
    Thanks is andvance
    Milind

    HI,
    he error is occuring in this part of the
    unction Module J_1IEWT_CHALLAN_UPDATE
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    LOOP AT p_t_ausz1.
    Select the cleared line item from bseg table.
       SELECT SINGLE * FROM bseg INTO  p_bseg_tab
                WHERE bukrs = p_t_ausz1-bukrs
                AND   belnr = p_t_ausz1-belnr
                AND   gjahr = p_t_ausz1-gjahr
                AND   buzei = p_t_ausz1-buzei
                AND   ktosl = 'WIT'
                AND   qsskz NE space .
       IF sy-subrc <> 0.
    This is not an ewt clearing transaction relevant for challan update.
         p_no_with_clear = 'X'.
         EXIT.
       ELSE.
         APPEND p_bseg_tab.
       ENDIF.
    ENDLOOP.
    Even if one line item chosen is not of withholding tax entry, system
    should exit by error message.
    DESCRIBE TABLE p_bseg_tab LINES  p_bseg_lines.
    DESCRIBE TABLE p_t_ausz1  LINES  p_with_lines.
       IF p_bseg_lines > 0.
    At least one entry is found in bseg table for challan update.    IF p_with_lines NE p_bseg_lines.
    At least one line chosen by the user is not for challan updation.
          MESSAGE e701(8i).
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
    This is a clear case,that you are trying to post some documents
    which does not match with the selection parameters.
    I feel the above problem could be due to some document/s (open items of
    the earlier years)are incorrect which is causing the reported problem.
    Kindly run the challan update program for smaller date range so that you
    can find the faulty document.
    Hope this solves your query.
    Reg
    Madhu M

  • Is there a way to get the calculator from the dashboard to appear along with other programs?  Can anyone recommend a calculator which will work as a stand alone app?

    AS it stands now, in order to use the calculator that comes with the Dashboard, you cannot read from a list of numbers in, lets say, word or excel. The dashboard is full screen and nothing can stand along side it. Is there a way to get the calculator from the dashboard to appear along with other programs?  Can anyone recommend a calculator which will work as a stand alone app?

    there is one, just search with spotlight "Calculator".
    It works great!
    Hope this helps.

  • Image on jsp from database along with other elements on image.

    Hi All,
    I wish to display an image which is stored in my database along with other contents on the page.
    I am able to display the image on an entirely new page but I do not wish to display it on a new page. Neither frames etc fit on my current page design.
    Kindly help

    I have a jsp page ..
    I have a byte stream in which i have stored the image from the database (the image is stored in databse as blob) in that jsp.When i use output stream object to display the image from the database (as suggested by many in this forum), the image is displayed in a new page. I wish to display the image along with my other elements like text etc in the same page.

  • HT204389 I just got an iPhone 4S model number MD439LL/A still have the box that it came in along with other info. I can not find Siri. I have looked in settings general and  settings general restrictions. Can anyone help me out?

    I just got an iPhone 4S model number MD439LL/A still have the box that it came in along with other info. I can not find Siri. I have looked in settings>general and  settings>general>restrictions. Can anyone help me out?

    That model is an iPhone 4, not a 4S.
    http://support.apple.com/kb/HT3939

  • How I can combine pdf file with other pdf file

    How I can combine pdf file with other pdf file ?

    Or from Adobe Reader via https://createpdf.acrobat.com/

  • How can i connect iphone 4 with other mobile through bluetooth

    how can i connect iphone 4 with other mobile through bluetooth

    You can't. iPhone does not have this feature.
    Some iOS apps will allow you to connect to other iOS devices for peer-to-peer games, or sending photos, but not to other makes of phone.

  • I seem to have lost my home and bookmarks button along with others from my web browser

    I seem to have lost my home and bookmarks buttons, along with others, from my web browser

    <u>'''Can't see the Menu Bar'''</u> (File, Edit, View, History...Help)? Hold down the key ( key in OSX) and press the following letters in this exact order: V T M
    The Menu Bar should now be displayed permanently, unless you turn it off again (View > Toolbars). Turning the Menu Bar on and off is a new feature in version 3.6.
    <u>'''See other bars'''</u> under View > Toolbars. Clicking on one of them will place a check mark (display) or remove the check mark (not displayed).
    <u>'''To display the Status Bar'''</u>, View, then click Status bar to place a check mark (display) or remove the check mark (not displayed).
    <u>'''Full Screen mode'''</u>
    http://kb.mozillazine.org/Netbooks#Full_screen
    Also see:
    ''' [[Back and forward or other toolbar buttons are missing]]'''
    '''[[Navigation Toolbar items]]'''
    <u>'''''Other Issues''''': to correct security/stability issues</u>
    <u>'''Update Java'''</u>: your version 1.6.0_19; current version 1.6.0.20 (<u>important security update 04-15-2010</u>)
    ''(Windows users: Do the manual update; very easy.)''
    See: '''[http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates Updating Java]'''
    Do the update with Firefox closed.

Maybe you are looking for

  • Can't connect to printer through Router - Help!

    Brand new to Mac & getting frustrated. I have a SMC router with a Pixma ip6600D connected to the usb port on the router. I can connect to the internet without a problem and the printer works fine if I plug it directly into the MacBook. However I cann

  • How to "end" function definition in SQL plus?

    I am using Oracle 11g and SQL plus. I am trying to define a function and get back to the SQL prompt, but it is just not exiting the function definition. SQL> create function dept_count (dept_name varchar(20)) 2 returns integer 3 begin 4 declare d_cou

  • BubbleChecker  show  false  for matrix on  AfterChooseFromList event

    Hi expert, i have UDO form with a text field and matrix .Added CFL in both field  .Bubblechecker tools  show true for text  field and false(error)  for matrix column .please  help why bubblechecker tools  show false only for matrix CFL. [B1Listener(B

  • Character encoding (unicode to utf-8) conversion problem

    I have run into a problem that I can't seem to find a solution to. my users are copying and pasting from MS-Word. My DB is Oracle with its encoding set to "UTF-8". Using Oracle's thin driver it automatically converts to the DB's default character set

  • Accessing or creating thumbnail images of pages to use in navigation

    In Bridge I can scroll through the Indesign pages by scrolling through the thumbnail images without opening the Indesign file. Is it possible to access those thumbnails so that I can use them as page navigation buttons in the Indesign file, or is the