FXML Scene Is acting weird, Or im doing something very stupid

Hi Guys.
heres whats happening, i have a circle and a cubic curve.
I want my Circle to do a pathTransition in that cubic curve. The problem is, It doesnt do it where i want to. It starts way out of the line, and i need to manually insert the circle where i want it to. But it always go out of the line, no matter what.
I did a testLine to see waht was happening and i had to do this :
c1.relocate(lineTest.getStartX() + 90,lineTest.getStartY() - 10);
Anyway, what am i doing wrong ?
  @FXML
    private void moveToBottomSpot()
     Path onePath = new Path();
    c1.setVisible(true);
    //c1.relocate(lineTest.getStartX() + 90,lineTest.getStartY() - 10);
    c1.relocate(lineOfBottom.getStartX() - 10 ,lineOfBottom.getStartY() + 25);
    final PathTransition pathTransition = PathTransitionBuilder.create()
            .duration(Duration.millis(1500))
            .cycleCount(1)
            .node(c1)
            .path(lineOfBottom)
            .build();
       pathTransition.play(); 
    }

Ok.
I re-made the program without FXML and it works great. But, i have an issue.
How i reverse the path that a node makes ?
I think i need to use timeLine;
Can anyone give me a hand ?
* To change this template, choose Tools | Templates
* and open the template in the editor.
package PilhaBola;
import javafx.animation.PathTransition;
import javafx.animation.PathTransitionBuilder;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.CubicCurve;
import javafx.scene.shape.CubicCurveBuilder;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.RectangleBuilder;
import javafx.scene.shape.Shape;
import javafx.stage.Stage;
import javafx.util.Duration;
* @author André
public class PilhaBola extends Application {
     * @param args the command line arguments
    public static void main(String[] args) {
        launch(args);
    @Override
    public void start(Stage primaryStage) {
     Group root = new Group();
      Rectangle r0 = RectangleBuilder.create()
                .fill(Color.TRANSPARENT)
                .y(380)
                .x(260)
                .width(140)
                .height(80)
                .build();
      Rectangle r1 = RectangleBuilder.create()
                .fill(Color.TRANSPARENT)
                .y(300)
                .x(260)
                .width(140)
                .height(80)
                .build();
      Rectangle r2 = RectangleBuilder.create()
                .fill(Color.TRANSPARENT)
                .y(220)
                .x(260)
                .width(140)
                .height(80)
                .build();
        r0.setStroke(Color.BLACK);
        r1.setStroke(Color.BLACK);
        r2.setStroke(Color.BLACK);
        Circle c0 = new Circle(550,20,20,Color.BLACK);
        Circle c1 = new Circle(550,70,20,Color.BLACK);      
        final Circle c2 = new Circle(550,130,20,Color.BLACK);  
        CubicCurve cc0 = CubicCurveBuilder.create()
            .startX(520)
            .startY(150)
            .endX(320)
            .endY(430)
            .controlX1(320)
            .controlX2(320)
            .controlY1(50)
            .controlY2(420)
            .stroke(Color.BLACK)
            .opacity(0) 
            .build();
        final CubicCurve cc1 = CubicCurveBuilder.create()
            .startX(520)
            .startY(150)
            .endX(320)
            .endY(350)
            .controlX1(320)
            .controlX2(320)
            .controlY1(50)
            .controlY2(420)
            .opacity(0) 
            .stroke(Color.DARKBLUE)
            .build();
         CubicCurve cc2 = CubicCurveBuilder.create()
            .startX(520)
            .startY(130)
            .endX(320)
            .endY(270)
            .controlX1(320)
            .controlX2(320)
            .controlY1(50)
            .controlY2(270)
            .stroke(Color.PINK)
            .opacity(0) 
            .build();
         Button push = new Button("Push");
         push.setOnAction(new EventHandler<ActionEvent>() {
          @Override
            public void handle(ActionEvent event) {
                final PathTransition pathTransition = getPathBallToStack(c2,cc1);
                pathTransition.play();
         Button pull = new Button("Pull");
         pull.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                final PathTransition pathTransition = getPathStackToBall(c2,cc1);
                pathTransition.play();
        root.getChildren().add(push);
        root.getChildren().add(cc0);
        root.getChildren().add(cc1);
        root.getChildren().add(cc2);
        root.getChildren().add(c0);
        root.getChildren().add(c1);
        root.getChildren().add(c2);
        root.getChildren().add(r2);
        root.getChildren().add(r0);
        root.getChildren().add(r1);
        Scene scene = new Scene(root,600,600);
        primaryStage.setTitle("Hello World!");
        primaryStage.setScene(scene);
        primaryStage.show();
    public static PathTransition getPathBallToStack(Node n,CubicCurve p)
        final PathTransition pathTransition = PathTransitionBuilder.create()
            .duration(Duration.millis(1500))
            .cycleCount(1)
            .node(n)
            .path(p)
            .build();
        return pathTransition;
       private static PathTransition getPathStackToBall(Node n,CubicCurve p)
            final PathTransition pathTransition = PathTransitionBuilder.create()
            .duration(Duration.millis(1500))
            .cycleCount(1)
            .node(n)
            .path(p)
            .build();
        Shape path = pathTransition.getPath();
        Timeline timeline = new Timeline();
        return pathTransition;
}

Similar Messages

  • Am I doing something really stupid?

    I can't understand why this won't compile, I must be doing something wrong, but I can't for the life of me figure out what:
    import java.applet.Applet;
    import java.awt.*;
    public class myApplet extends Applet{
         Isosceles triangle=new Isosceles(2,2,5);
         int perim=triangle.getPerimeter();
         System.out.println(perim);
    Errors:
    myApplet.java:8: <identifier> expected
    System.out.println(perim);
    ^
    myApplet.java:8: cannot resolve symbol
    symbol : class out
    location: class java.lang.System
    System.out.println(perim);
    ^
    2 errors
    Can anyone help?

    You can't have code within a class body like that, a class body can only have declarations. You need to write a method (or constructor, or initializer block) where to put those lines.
    Here's a popular way of doing it:
    public class myApplet {
    public static void main(String[] args) {
    Isosceles triangle=new Isosceles(2,2,5);
    int perim=triangle.getPerimeter();
    System.out.println(perim);
    (btw if you thought you are writing an applet where do you think the output from System.out.println will go?)

  • HELP! Desperate, All my shape tools are doing something very strange, must have changed a setting but cannot figure out how to change back!

    Hi Everyone,
    I am not sure how I changed the settings however whenever I go to draw a circle or line/shape, the below keeps happening. I have tried closing down and starting Illustrator up again, but it is still doing the same thing! 

    Ella,
    You may try to see whether your Tilde key ~ is stuck.

  • Problem doing something very simple...

    Hey guys.  I'm having some really weird issues RENAMING objects (iviews, worksets).
    With certain objects, when I go into it's properties, change the Name filed, and save it, it doesn't reflect the name change.
    See screenshot: http://i32.tinypic.com/1fx0l1.jpg
    I have saved it, logged out, logged back in, cleared my browser cache, restarted the java engine... nothing makes it take effect.  This is happening with an iview and a workset.
    Any idea?

    Hi Adam,
    Try this...
    If you are aware of the XML Export - Import functionality then you can download the iView and the Workset concerned in an XML file and then open it in any standard XML editor.
    Check the property for the language and see the text that is displayed. You can make the changes in the XML file itself and upload.
    Then open it and see if the changes have taken effect.
    Also, recommend you to check the language setting in your browser.
    It can be English, English(UK), English(US). These are different and can influence the text that you see on screen.
    Cheers
    Avik

  • Cant connect to wi-wi am i doing something very basic wrong ?

    My i-pad was just replaced today and i cant access my wi-fi network any ideas ????

    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    Additional things to try.
    Turn Off your iPad. Then turn Off the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    On your iPad go to Settings > General > Reset > Reset network settings and see if that enables you to connect.
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
     Cheers, Tom

  • JDesktopPane acts WEIRD when JOptionPane.showInternalInputDialog is called

    I have just tried to convert my program from using all JFrame's and JDialog's to using JInternalFrames with the JDesktopPane.
    I have been able to sucessfully change everything, unfortunately when I call JOptionPane.showInternalInputDialog it causes some very strange behaviour.
    Basically it appears to create another instance of the desktopPane and display portions of the original destopPane to the right of where it should be. I cannot understand what is causing the problem. I don't think it will help but the code is as following
            String userName = JOptionPane.showInternalInputDialog(
                MathChatterJFrame.getCurrentInstance(),
                "Choose a screen name:",
                "Screen name selection",
                JOptionPane.PLAIN_MESSAGE);where MathChatterJFrame is actually an InternalJFrame and its currentInstance is the object being displayed. If anyone has encountered this type of problem before or has any brainstorms, the help would be greatly appreciated!
    Will

    Nevermind, I figured it out myself. I was doing something rather stupid and not using my getCurrentInstance() stuff correctly.
    Thanks anyway,
    Will

  • When using Facebook with Firefox the pointer always has a little round circle by it rotating as if it is doing something. This happens when I play games on facebook and after I downloaded the new version of Firefox. How can I make this stop?

    Using Facebook the pointer on the screen has a circle by it that is rotating when I play games. Acts like it is doing something, I would like to know if there is a fix for this?

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    Do a malware check with some malware scanning programs on the Windows computer.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br /><br />
    *http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    *http://www.superantispyware.com/ - SuperAntispyware
    *http://www.microsoft.com/security/scanner/en-us/default.aspx - Microsoft Safety Scanner
    *http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    *http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    *http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • Does low disk space make my Macbook Pro act weird?

    Hi! I have an early 2011 15" MBP with a 750gb hard disk space. Just the other day, while I was using photoshop with my laptop, the screen went off so I had to reset it. My laptop acted weird after: doing a screen split (the right part goes to the left and vice versa), one time it had weird pixels that were scattered all over, recently, a blue striped screen. All of this froze my laptop by the way. And all of this happened after a few minutes of usage. And I noticed if I use photoshop, it would only take a little amount of time before it would act weird again compared to when I don't. All the times caused me to reset my laptop by holding the power button.
    Yesterday, it wouldn't boot past the gray screen after resetting about five times. But after it turned off by itself, I tried turning it on again and it booted normally. And I could use it normally again, but with extra care (using it beside an electric fan, checking the temperature with iStat pro).
    I tried the extended Apple Hardware Test but it told me no trouble was found.
    Another thing was, everytime my laptop froze and did the weird screen thingy, my laptop was hot.
    I tried to use it again yesterday to just surf the web, and after some minutes it was still functioning. But I remember one time I was only surfing the web, it did the split screen and froze after almost an hour or so.
    Also, my laptop heats up quickly compared before. And can stand being hot for a long time until now.
    I haven't used any heavy applications besides photoshop to test my laptop's weird behavior by the way.
    So I guess it's because of the laptop's heat. Because I can only use it for a very short time when using photoshop but I can use my laptop for a longer time when only surfing the web.
    I also noticed that if I was forced to reset my laptop and turn it on again, it would boot longer than normal. But if I was able to shut it down properly and turn it on again, it would boot normally.
    And, just a while ago, I remembered my laptop's disk space was only 14gb from 750gb (downloaded a lot of series since I bought my laptop). So maybe what's causing the heat was the low disk space. Just a guess.  So is it possible that my laptop is behaving weird because of the low disk space?

    The problem is back. But this time, it only happened when I used photoshop or played a 1080p video. I was using my laptop for almost 3 hours when i decided to use photoshop. It froze as soon as it started and made my screen display weird pixels. I restarted and tried to open photoshop again and this time, it froze. I did it the third time and after using PS for a minute, it did the split screen. After restarting yet again, I tried to play a 1080p video to just test my laptop. It froze as soon as VLC started. But when i only surf the web (which is the only thing I did before using PS), everything goes well. So I guess it really is the GPU and not the logic board or some other parts. I've decided to just have my laptop checked.

  • My computer has been acting weird lately.  Shuts itself off, the mouse goes off in all angles, does not go into sleep mode sometimes and instead shows on a gray screen definitions of words in 3" letters!  Do I have a virus?

    My computer has been acting weird lately. Shuts itself off, the mouse goes off in all directions, does not go into sleep mode sometimes, instead shows a gray screen with word definitions in large 3" letters that continuosly flows across the screen.  Do I have a virus?

    Doesn't really sound like a virus.
    See if the Disk is issuing any S.M.A.R.T errors in Disk Utility...
    http://support.apple.com/kb/PH7029
    How many of these you can answer...
    Open Activity Monitor in Applications>Utilities, select All Processes & sort on CPU%, any indications there?
    How much RAM & free space do you have also, click on the Memory & Disk Usage Tabs.
    Open Console in Utilities & see if there are any clues or repeating messages when this happens.
    In the Memory tab, are there a lot of Pageouts?

  • Apps acting weird and doing actions against my will.

    Hello I'm here to write about the latest issue I got on my iPhone 5c, while I was writing a message my app started acting weird. Successively I moved to another app and it did the same thing so I suppose it's a general problem.
    Ex: while I write my iPhone clicks and opens other options on the page by itself.
    While I scroll down on tumblr app it clicks other options by itself like unfollow, changes pages, as if I clicked those options but I didn't.
    Like on whatsapp for instance, while I write it opens the user id, the user info, shuts the keyboard down as if I did it but I didn't at all.
    Also now while I'm here writing this sometimes it acts as if I clicked on he top bar and opens the http:// of this page, but I didn't.
    While I'm on drafts/notes app it does the same, I wrote a long message last night hoping it would help being that out of an app which needs connection but it happen again; while I was about to finish it clicked the delete button by itself and everything disappeared.
    Also now again, I luckily copied this email line by line in order to prevent it from delete everything I wrote again.
    I just need to know if there's something I can do or if I should just take it back to an apple store since it's still pretty new..

    Hi there NellieKlash,
    I would recommend taking a look at the troubleshooting steps found in the article below.
    iPhone, iPad, iPod touch: Troubleshooting touchscreen response
    http://support.apple.com/kb/ts1827
    -Griff W.

  • My MacBook was acting weird so I restarted it and when I login a white screen flashes and goes back to the login page. Help?

    My MacBook was acting weird like sometimes I would log on and I wouldn't be able to type my password for a couple seconds,but it usually logged in after that. Then I left my computer open after installing the recent update after that all my applications were not responding. So I shut it down, when I turned it back on about an hour later it went to this loading screen and then to the login like usual. After I tried logging in a white screen flashed and it went back to the login/ password screen like nothing happened. Any ideas on what happened and what I can do to fix it?

    Reinstall OS X;
    Reinstalling Lion/Mountain Lion Without Erasing the Drive
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
    Reinstall Lion/Mountain Lion: Select Reinstall Lion/Mountain Lion and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.

  • Help with Spry, acting weird in Mac Os 10.5 10.6, 10.7 and Ios Devices

    I use Dreamweaver CS4 for designing our school website.  The url is http://www.stpiusxschool.org
    The menu bar on the left is built with a Spry Asset, it is to expand to different choices on some of the lines.  The issue started about a month ago, if I click on the first item that should expand out (Parent Resources) it will not expand out, then I choose the second one (Student Resources) it expands out, I go back to Parent Resources and it will expand....this happen on Mac 10.5 and Ios Devices (Ipad, and Iphone)
    On Mac 10.6 menu bars will never expand out.
    I have tried many things, I have ran the Spry Updater and uploaded those files.  I have built a page outside of my site, it appears to work ok, then copied that Spry Asset folder into the site, no luck. 
    I have built a second spry on a test page within the site, and tried it out, it doesn't seem to work correct either.  It can be accessed off the main page mentioned above, scroll to the bottom and click on test, that is just what it is a test page.
    School is starting soon and this site is used a lot for resources during the day.
    I have called Adobe and got no where with them but that even took hours.
    If someone could help me out that would be awesome.
    By the way, I know nothing about coding itself.
    Thanks

    You have got two problems
    The menu is acting weird in Mac as well as on PC
    The menu does not behave in IOS devices
    The solutions
    Add the DOCTYPE Declaration to your document(s)
    Replace the current SpryMenuBar for an IOS friendly MenuBar
    1. You can add the HTML5 document type as follows, making sure that there are no blank lines before <!DOCTYPE HTML>
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>St Pius X School des moines iowa</title>
    The title already existsin your document. I put it there so that it is easier to see where the rest goes.
    2. There is a Spry Menu Bar 2.0 available here http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=2141544
    Gramps

  • Lumia 720: Power and camera button act weird

    Hi,
    My Nokia Lumia 720 is acting weird.
    The camera button doesn't work and so does the power button.
    However if I press the volume down and the power button simultaneously the button does work.
    Does anyone know how to fix this?
    I've already brought the phone back to the default settings.
    I'm running the latest developer preview if that matters.
    -- Mathijs
    Solved!
    Go to Solution.

    That's great to hear, Mathijs. If you need further assistance in the future, don't hesitate to post again here in the forum and let our community help you. 
    Cheers! 

  • Webpage acts weird in Safari

    Hello,
    I have a webpage which acts weird in Safari and only in Safari. The PHP-Sessions are not working. Well I use AJAX to write values into the PHP-Sessions and I think it is AJAX who isn't working.
    But in general, AJAX DOES work with Safari, doesn't it?

    Hi Danielle,
    Some information here: http://forums.omnigroup.com/archive/index.php/t-608.html
    Carolyn

  • IBook G3 acts weird

    Hello, I'm new around here and I would like to ask some questions.
    I don't know why, but my iBook starts to act weird lately. When I put it in sleep mode and then reopen it later, it froze. It has been like this for a few days. Then yesterday, when I was doing surfing on the internet, everythign was lagging and then my laptop froze. So I shut it down but when I start it up, it takes a long time before it gets to the desktop and there's some piercing noise all the long.
    Can someone tells me what happens to my iBook and how to fix this?
    ibook G3 14 inch   Mac OS X (10.3.9)  

    Pendragon:
    Welcome to Apple Discussions. Hope you won't be new for long. It is a good place for Mac users to visit.
    Your computer probably needs a spot of maintenance. I would begin by booting from the install disk holding down the "C" key. Go to the installer menu and open Disk Utility. Select your HDD (manufacturer ID) in the let panel and First Aid in the main panel. click on Repair Disk. If DU reports errors, Repair again and again until DU reports no errors. If DU reports errors it cannot repair you will need to use a utility like Tech Tool Pro or Disk Warrior
    The next thing I would do is to run Unix Maintenance (CRON cleaning) using a utility like MacJanitor or Onyx.
    Here is a link to Gulliver's article on OS X Maintenance which I have found very helpful: http://discussions.apple.com/thread.jspa?messageID=607640&#607640
    Good luck.
    cornelius
    Message was edited by: cornelius

Maybe you are looking for