Write user interface controller with JavaFX

Source: Internet
Author: User
Tags comparable

In this article, we are concerned with the Bluebill mobile class, especially the controller that manages the logic behind all search species screens, so this article helps you understand JavaFX's language performance. And we will cite some examples to illustrate the techniques to be introduced and the pitfalls of a typical JAVAFX structure.

The author wants to embed an updated screen in the application. Video playback requires the use of quciktime.

The idea here is that when you type a query in the search box, the English function or scientific name function filters the list. In addition, when these are in effect, Bluebill Mobile can also perform AutoComplete input. For example, if you look closely at the video while typing the query, you will find that only "A-r-d-a-c" is entered to select "Ardea cinerea" or "Avocet p-i-e-<" for "Pied Space>-a". Bluebill Mobile will automatically supplement the remainder because in some cases there are no other choices. This is an important feature to improve the performance of mobile devices: You can achieve the same goal with fewer inputs.

According to the MVC pattern, it is very necessary to generalize this pattern in a separate controller, and it is easy to unit test this pattern.

First, let's look at the pattern classes that represent the taxa:

Package It.tidalwave.bluebillmfx.taxon.model; 
Import java.lang.Comparable;
public class taxon extends comparable
{
public-read protected var displayname:string;
Public-read protected Var scientificname:string;
Public-read protected Var id:string;
Override function CompareTo (Other:object)
{return Displayname.compareto ([other as
taxon). displayName); 
  }
override function ToString ()
{return
' {displayName} ({scientificname}) ({id})
}
Public
function Displaynamegetter (taxon:taxon): String
{return
taxon.displayname;
Public
function Scientificnamegetter (taxon:taxon): String
{return
taxon.scientificname;
Public
def namepropertygetters = [Displaynamegetter, Scientificnamegetter];

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.