Hover never turns off

Trying to create a new control and works with the triumvirate control/skin/behavior. So far, I think I understand how things work, but I have a problem that I can't decipher. On hover my order, I get the appropriate changes to the color, but out of the mouse, there is no return to the non-stationary State, and nothing I do seems to make a difference. Here are the relevant excerpts of my code, stolen mainly ChoiceBox and button as long (I'm working on a bit of a hybrid).
public class DropDownButton extends ButtonBase {

  public DropDownButton () {

    super();

    setSkinClassName(DropDownButtonSkin.class.getName());
    setFocusTraversable(true);
  }

  public DropDownButton (String text) {

    super(text);

    setSkinClassName(DropDownButtonSkin.class.getName());
    setFocusTraversable(true);
  }

  public DropDownButton (String text, Node image) {

    super(text, image);

    setSkinClassName(DropDownButtonSkin.class.getName());
    setFocusTraversable(true);
  }

  @Override
  public void fire () {

  }
}
public class DropDownButtonSkin extends SkinBase<DropDownButton, ButtonBehavior<DropDownButton>> {

  private final StackPane openButton;
  private final Label label;

  public DropDownButtonSkin (DropDownButton dropDownButton) {

    super(dropDownButton, new ButtonBehavior<DropDownButton>(dropDownButton));

    getStylesheets().add(DropDownButton.class.getResource("DropDownButton.css").toExternalForm());
    getStyleClass().add("drop-down-box");

    label = new Label("Foo Bar");
    label.getStyleClass().add("label");
    label.setMnemonicParsing(false);

    openButton = new StackPane();
    openButton.getStyleClass().add("open-button");

    StackPane region = new StackPane();
    region.getStyleClass().add("arrow");
    openButton.getChildren().addAll(region);

    getChildren().setAll(label, openButton);

    requestLayout();
  }

  @Override
  protected void layoutChildren () {

    label.resizeRelocate(getInsets().getLeft(), getInsets().getTop(), label.prefWidth(-1), label.prefHeight(-1));
    openButton.resizeRelocate(getInsets().getLeft() + getWidth() - (openButton.prefWidth(-1) + getInsets().getRight()), getInsets().getTop() + ((getHeight() - openButton.prefHeight(-1)) / 2), openButton.prefWidth(-1), openButton.prefHeight(-1));
  }

  @Override
  protected double computeMinWidth (double height) {

    return computePrefWidth(height);
  }

  @Override
  protected double computeMinHeight (double width) {

    return computePrefHeight(width);
  }

  @Override
  protected double computePrefWidth (double height) {

    return getInsets().getLeft() + label.prefWidth(height) + openButton.prefWidth(-1) + getInsets().getRight();
  }

  @Override
  protected double computePrefHeight (double width) {

    return getInsets().getTop() + label.prefHeight(width) + getInsets().getBottom();
  }

  @Override
  protected double computeMaxWidth (double height) {

    return computePrefWidth(height);
  }

  @Override
  protected double computeMaxHeight (double width) {

    return computePrefHeight(width);
  }
}
.drop-down-box {
  -fx-skin: "org.smallmind.javafx.popup.DropDownButtonSkin";
  -fx-background-color: -fx-shadow-highlight-color, -fx-outer-border, -fx-inner-border, -fx-body-color;
  -fx-background-insets: 0 0 -1 0, 0, 1, 2;
  -fx-background-radius: 5, 5, 4, 3;
  -fx-padding: 0.0em 0.5em 0.0em 0.0em; /* 0 6 0 0 */
  -fx-alignment: CENTER;
  -fx-content-display: LEFT;
}

.drop-down-box:focused {
  -fx-color: -fx-focused-base;
  -fx-background-color: -fx-focus-color, -fx-outer-border, -fx-inner-border, -fx-body-color;
  -fx-background-insets: -1.4, 0, 1, 2;
  -fx-background-radius: 6.4, 5, 4, 3;
}

.drop-down-box:hover {
  -fx-color: -fx-hover-base;
}

.drop-down-box:armed {
  -fx-color: -fx-pressed-base;
}

.drop-down-box:showing {
  -fx-color: -fx-pressed-base;
}

.drop-down-box .label {
  -fx-padding: 0.166667em 0.333333em 0.25em 0.5em; /* 2 4 3 6 */
  -fx-text-fill: -fx-text-base-color;
}

.drop-down-box .open-button {
  -fx-background-color: null;
  -fx-padding: 0.083333em 0.0em 0.0em 0.666667em; /* 1 0 0 8 */
}

.drop-down-box .arrow {
  -fx-background-color: -fx-mark-highlight-color, -fx-mark-color;
  -fx-background-insets: 1 0 -1 0, 0;
  /* padding determines the size of the arrow;
this should match the design size in the SVG */
  -fx-padding: 0.166667em 0.333333em 0.166667em 0.333333em; /* 2 3.5 2 3.5 */
  -fx-shape: "M 0 0 h 7 l -3.5 4 z";
}

.drop-down-box:disabled {
  -fx-opacity: -fx-disabled-opacity;
}
What is the mechanism that causes the return to a non-stationary State? What Miss me?

Any help appreciated.

I don't know what that release or build you are using. All I can say is that it works on my machine. I run something close to b66 JavaFX 8.0. I had to make some adjustments. I moved


    getStylesheets().add(DropDownButton.class.getResource("DropDownButton.css").toExternalForm());
    getStyleClass().add("drop-down-box");

DropDownButton's administration and I got rid of the calls to methods that did not exist. My test program looks like this:

    @Override
    public void start(Stage stage) throws Exception {

        DropDownButton btn = new DropDownButton("Test");
        btn.setSkin(new DropDownButtonSkin(btn));

        StackPane pane = new StackPane();
        pane.setPrefSize(100, 100);
        pane.getChildren().add(btn);

        Scene scene = new Scene(pane);
        stage.setScene(scene);
        stage.show();

    }

I changed the color of overview to red just to be certain that the style has been applied.

Tags: Java

Similar Questions

  • Never turn off display

    my screen automatically goes on standby every 1 minute. I tried to go to control panel (change power settings).  I went t maintenanace of system in Control Panel. He always does.  Can anyone help.  I want my screen to be open 24/7.  He falls asleep all 1 minute while I watch a movie.  I have to scrible wake him mouse. can anyone help please

    Hi Ron21,

    1 when was the last time it was working fine?
    2. did you of recent changes on the computer?
    3. the problem occur only while watching a movie?
     

    Follow the steps mentioned below:

    Sleep and extended: frequently asked questions
    http://Windows.Microsoft.com/en-us/Windows7/sleep-and-hibernation-frequently-asked-questions

    First, see if the problem occurs after Disabling the screen saver (by selecting the screen saver 'None'). If the problem persists, please turn off the sleep in the BIOS. To check the BIOS settings, please consult the user manual or contact the manufacturer of the motherboard.

    In addition, please set the following group policy and see if the problem can be solved.

    (1) please click Start, type group policy in the search box and press ENTER.
    Expand the following item: Computer Configuration-> administrative templates-> system-> power management-> video and display settings

    (2) double click on "turn off the display (plugged).

    (3) change the setting to "Disabled".

    4) click OK.

    (5) repeat step 4 or 5 to disable "turn off the display (on battery).

    In addition, you can test clean boot and see if the problem occurs. If the problem goes away in the boot environment, we can use a 50/50 to quickly refine approach which entry is causing the problem.

    Reference:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-performance/power-options-set-power-options-to-never-turn-off/f784ed6f-A594-496a-A850-553f3e18d00c

    Reply back with the results

    Referring to the link: http://social.technet.microsoft.com/Forums/en/w7itproperf/thread/b769d9b4-300e-4066-b071-da54926112d2

  • Windows 7 - screen goes to sleep when the parameters of plan of power has never turn off

    Looking for some advice - we have screens that display information for visitors so that they must be all the time. The computers to which they are connected are on the network but connected with local accounts. We applied a number of parameters for the management of food, namely:

    Turn the hard drive off - never

    Sleep after - never

    Allow hybrid sleep - never

    Hibernate after - never

    Selective suspension of USB - disabled

    Turn off the display after - never

    Despite the settings above the screens go blank and I have to move the mouse or press any key to wake up. It doesn't seem to be any obvious either pattern. Sometimes they remain turned on for 1-2 hours then go to sleep, other times maybe every 20-30 minutes.

    I looked at several articles but could not find a solution that works for us. We tried to apply a GPO that defines power management in case something else might override the settings, but it did not work either.

    The computers are running Windows 7 SP1.

    Now I'm out of ideas. Any advice would be greatly appreciated.

    Hi Gary,.

    Thanks for posting your query in Microsoft Community.

    I understand that you have problems with power settings across computers connected to a network.

    The computers are connected to a domain network, it would be better suited to the TechNet community.

    Please visit the link below to find a community that will provide the support you want.

    http://social.technet.Microsoft.com/forums/en/category/w7itpro

    Hope it will be useful. If you still have questions, please reply and we will be happy to help you.

  • Power management: screen never turns off when it should

    I have two satellites, and two of them, the screen turns off ever after the scheduled time. They did before. Any help here?

    Hello

    You said it worked in the past is the resettlement of the Toshiba power saver?
    Have you tried it?
    If Toshiba energy saver has been installed, then this application should controls display on/off function.

    There must be something wrong with some files or registry keys...

  • Analysis the message. The printer display never turns off

    I have photosmart all-in-one B211A..., Cq761A.  My computer is the computer, and I use windows XP.

    I get a message in the toolbar of the background screen where the scanner appears with a red x and saying that he could not be contacted.

    I'm trying to get out and it is so fast and another pop-up screen appears which has nothing to do with it.

    In addition, on the print screen will not 'sleep' mode.  He did in a first time has since ceased when this thingee message began.

    Hello debalas

    Is the printer connected by USB or via the network? Have you tried to run the utilities diagnosis HP or HP print and Scan Doctor? If this isn't the case, you can find them on the link below.

  • Y450 screen turns off after 5 minutes, set to never power settings

    The display on my Y450 turns off after 5 minutes if it is connected or not. I changed the power settings on all levels of the power to never turn off the display, but he keeps doing. I thought that maybe it had something to do with windows is not fully updated so I did it earlier today, but it has not changed. It doesn't matter whether the system is energy saving, balanced or a custom.

    I don't know what to do to stop it, but it's annoying when I play videos and turn the screen on every 5 minutes. Is there another program I'm missing that somehow overrides the power settings?

    You may also need to change the power settings for the windows power management and lenovo power management.

    We also know, that the problem persists only watch movies?

  • M6 n010dx - Beat Audio never really turns off, terrible audio compression

    I have re-installed audio drivers several times.

    Beats Audio never turns off.

    I can uncheck the box, and if the sound is less full, adjusting the sliders on the rockers in the Beats Audio effects the sound.

    In addition, the sound is very compressed no matter what. Listen to a song file FLAC with headphones on my phone without equalizers and listen to them on my laptop with headphones, the difference is obvious. I have no idea why this would happen or how to turn off.

    product name: HP Envy m6

    Product number: n010dx

    OS: Windows 8.1

    Hello

    To completely remove the Beats Audio, I would like to direct you to this post: http://h30434.www3.hp.com/t5/Notebook-PC-Sound-and-Audio/REMOVE-BEATS-AUDIO-LOAD-GENERIC-SOUND-DRIVE-MAINTAIN-OR/m-p/4477060/highlight/true#M58671 by @Great-Christine-Tree

    Read his post and follow the given steps it should accomplish removing the beats. After that, test you the audio again, you will need to repeat the steps I provided earlier to improve the quality.

    I hope this helps.

  • XP VM never automatically "turns off".

    I had a problem with VMware 2 where my VM ended up hanging after a heavy net traffic through Office Communicator.  After that, my VM has never 'turned' off automatically when I stopped.  It just goes to the screen that says "It is now turn off your system" or whatever it says...

    No idea how can I fix? And PLEASE don't say 're-create your VM.  That tech IT involved tickets and the pain... a lot of pain...

    codethought wrote:

    When I uncheck "device compatible to see the ' no other material presents itself.

    Any suggestions?

    Since you do not have the driver ACPI hardware abstraction layer (HAL) available and technically not starting above zero, your safest option is to perform a repair of Windows installation.  This when you repeat the installation process of Windows, but Windows detects you have an existing copy of Windows and offers to fix it.  You will be asked your product license key and you need to reapply your fixes Windows Update, but your machine will change during an ACPI power management mode which allows to properly shut down your virtual machine.  All your applications and your documents are kept in the process.

  • Equium A200 - screen turns off

    Hi, I'm having a problem with my Toshiba laptop, the screen turns off randomly and the computer still seems to work, but when I use a VGA cable to connect to a TV it does not display anything.

    Here are pictures of when it fires
    http://Tinypic.com/r/vr9d7d/7 yellow on the disc tray is turned on
    http://Tinypic.com/r/2d9poya/7 that the front turned on lights and computer sounds like its operation.

    This led me to believe it's a hardware problem, but when I turn on the computer in Mode safe it never turns off. I also got the fixed ups this year because the screen was losing power.

    Can anyone help I can't really afford a new laptop at the moment

    Hi David,

    It's a little confusing, it doesn't always happen when you shut down the computer, or just sometimes?
    What do you do to get rid of this? Always remove the battery and the AC adapter or what exactly?

    I think that it s a hardware malfunction, usually has nothing to do with the software. What you can try is a BIOS update from the official website of Toshiba.

  • HP Pavilion Notebook 15-p045tx: wireless capability is turned off, the Wi - Fi button on / off Greyed Out

    Hello

    I was faced with this problem for a lot of time.

    The Network Diagnostics, it gives this error:

    WiFi is disabled

    I don't have any hardware button that can wifi device off / turn on my keyboard, see the example image below:

    I never turned off the device physics wifi directly or from the BIOS.

    Tried the "f12" also, airplane Mode which also did not help.

    in any case, I tried on things until now, nothing helps:

    (1) reset BIOS HP using HP Usb Disk

    2) update drivers wireless Broadcom using HP Support Assistant

    (3) re - install the Broadcom drivers

    (4) install the Realtek drivers

    (5) Restroing 8.1 full disk recovery Windows.

    (6) installed Linux (Ubuntu/Fedora), but that also free WiFi does not appear.

    Please guide me what can be the possible cause of this problem.

    The issue seems to be with my wifi chip.

    Eventualy I had to take the laptop to the Service Center. The guy tried everything I did once again.

    Finally, the issue is resolved, he plugged into the smart wifi, cleaned both ends, a little with the help of an eraser and reinserted and voila, it has detected. He said it could be the issue of carbon deposited on the ends of the chip connection.

    Since then, I've encountered same question several times, and everything I do is open my laptop, plug out a smart WiFi card mother, clean up a bit and plug it again.

    And he started working like a charm.

    Maybe it is loose or I don't know what the exact problem is.

    But he still has a problem with the antenna, I get very low my wifi signal, even if I'm in the right range of wifi router.

  • Lenovo G400s optimize battery health auto turn off display

    Hello

    I rarely use my laptop outside the power adapter, so I decide to try the 'optimize battery health '.

    To my surprise it drain the battery of 60% and he stopped there without discharge or charge, which is good.

    But it has a few side effects, it turned off my screen every minute which is annoying, in my power Option, my screen is set to never turn when I plug in, I even try to define each presets/profiles of never turn off screen when the plug-in or battery, it helps not at all.

    This could get really annoying when I read an article when my keyboard and mouse is not in use.

    Thank you for your attention, the hope for a solution soon.

    Details of the laptop:
    Lenovo G400s

    Core i5 - 3230 m

    Windows 8

    8 GB RAM

    128 GB SSD

    1 TB HARD DRIVE

    All the drivers/software updated

    Energy management: high power Performance management, optimize the battery, drive energy-saving hard.

    p/s: Please let me know if need more information, I will provide as much as possible to fix this.

    Okay, my bad, it was my stupid screen saver settings that enable the return to the logon screen after 1 minute.

    He was supposed to turn off when I set to (none) but I guess that I was wrong, in any case, this has been solved by "human error."

  • Should I turn off the keyboard and mouse after use or leave?

    I find it annoying to switch the keyboard power continually because of the password on and off.   Wouldn't be much difference to the life of the battery to let both mouse and keyboard lights permanently?

    I have never turned off the mouse or the keyboard. The batteries have been used for about a month, with the mouse to 60% and the keyboard to 90%.

  • HP t610 turn off the monitor

    Hi all!

    We have a series of WES 610 thin, agent image 5.1.983, 4.5.3660.161180 version.

    We leave tour monitor forever in power with an administrator account management options. But when connected with the client user account shut down the monitor after 15 minutes (factory settings). With the user account, it is not possible to set power options and the system not inherit the settings of the administrator account. Any suggesttions to set never turn off the screen to also with the user account?

    TKS, Carmelo

    TKS for the tip!

    We have tried all your suggestions, but the second and third didn't work.

    Only the first seems to be applicable.

    We have copyed the powercfg on the client and then run the command window by using the credentials of the user, in this way, we were able to change the right key in the active power scheme.
    .

  • Laptop cannot turn off

    Repeat "Logout" and never turned off. Also, I can not all programs when you try to go to uninstall programs. Help!

    Hello

    What version of Windows XP and service pack are you running?

    http://www.Microsoft.com/download/en/details.aspx?displaylang=en&ID=6676

    You can try the troubleshooting provided in the link below steps to fix the problem.

    Advanced Troubleshooting for shutdown problems in Windows XP

    http://support.Microsoft.com/kb/308029

    I would also like to launch a full scan with your antivirus/malware removal.

    Microsoft Security Essentials:

    http://Windows.Microsoft.com/en-us/Windows/products/security-essentials

    Malware

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-security/malware-called-antivirus-Pro-has-taken-over-my/3cb4a36a-6134-448C-A134-151d03fbd968

  • Two questions. (1) RIP in media player 11 problems. (2) portable speakers do not turn off when the headset is plugged...

    Hey all. I desperately need help. I have a laptop "Durabook" with Windows XP meidand service pack 3 update.  The internal speakers have never turned off when I plug a headset or headphone cable of the adapter into the outlet. It is an option that I have figured out. All my other laptops have silenced the computer speakers when headphones are connected.

    The most frustrating problem I have is in Media Player when you use the tab OUT, when I insert a cd Ripper in the computer, it is not recognized.  If I close and reopen WMP (Windows Media Player) cd, the cover and all the info of the cd is here and ready to be torn APART. Once the cd ends and ejects I insert another cd and nothing happens. Once again, I've closed and reopened WMP and evrything is ready to be torn APART again.

    Please please help.  I can't be the only one who had this problem.  I removed all anti-virus programs, removed and reinstalled WMP, twice.

    I'd appreciate any help.

    Thank you all

    Carl aka theSTUNG1

    Hi Carl,

    1. don't you make changes before the show?

    Try these steps and check the result.
    Step 1: Check if a parameter to extract music select "Always".
    a. open Windows Media Player 11.
    b. click Extract, click more options.
    c. click the rip music and make sure 'Always' is selection in accordance with article "Rip CD when inserted.
    d. click ok to apply the changes and restart the media player.
    e. check if the problem persists.

    See songs Rip (copy) from a CD to your computer

    Step 2: Make sure the headset is plugged into the socket on the right
    a. connect the headphones to the right sleeve and check the result.
    b. you can also right click on the volume icon and adjust the sound settings.

    See adjust the Volume of the computer

    Visit our Microsoft answers feedback Forum and let us know what you think.

Maybe you are looking for