With the help of QNX classes in a Flex library project

In order to deploy on multiple platforms, I'm building my application "headless"; changes of main application based on the OS class, I'm to deploy, but the underlying library remains the same. I have my classes of library in their own Flex library project and specific classes of Playbook in their own project. Currently I can not all classes of QNX to appear inside my library project, but they appear fine in my main application project. I have the main application and library using the Playbook SDK 0.9.1 projects.

Is there something special I need to do for a project of library in QNX classes, or am I missing something obvious? Thank you!

Hey,.

the screenshots that I showed you were from my application for flash builder 4.5 burrito. If the menus are a little different. It's my flash builder 4.0.1 application menu:

and with libraries extended:

from the looks of things, your SDK have not installed or is not read correctly. you follow and do all according to the start-up for windows guide? Good luck!

Tags: BlackBerry Developers

Similar Questions

  • With the help of several classes and create an object of a class and calling its method in a different class.

    Creating a new class, I need to move my main method class SaveDate DynamicTest class. Below I've listed the code of both classes. The goal is to be able to run my class DynamicTest program. I need help to understand the process of moving my main method of a different class and creating an object of a class and calling its method.

    public class {SaveData

    private public static final map < String, Object > myCachedTreeMap = new TreeMap < String, Object > ();

    public static final List < String > getLines (final String resourceParam, final Charset charset) throws IOException {}

    System.out.println ("please:" + resourceParam);

    If {(myCachedTreeMap.containsKey (resourceParam))

    Use the file cached, to avoid a further reading.

    System.out.println ("found in memory:" + resourceParam);

    }

    else {}

    Load the file from the disk

    System.out.println ("found in memory:" + resourceParam);

    }

    Returns a null value.

    }

    Public Shared Sub main (String [] args) throws IOException {}

    String target_dir = "C:\\myfiles\\config\\en";

    Line = "C:\\myfiles\\config\\en\\output.txt";

    File dir = new File (target_dir);

    File files [] = dir.listFiles ();

    If (file == null: files.length < 1) {}

    System.out.println ("file list is empty...");

    return;

    }

    Open the Printwriter

    PrintWriter OutputStream = new PrintWriter (output);

    try {}

    for (textFile file: files) {}

    If (textFile.isFile () & & textFile.getName () .endsWith (".txt")) {}

    readFromDisk (textFile);

    }

    }

    }

    {Finally

    outputStream.close ();

    }

    String fileNameFromCache = "en_synonyms.txt";

    Sheet1 = myCachedTreeMap.get (fileNameFromCache) object;

    System.out.println (fileNameFromCache + ": \n" + "Sheet1");

    }

    @SuppressWarnings ("resource")

    private static Sub readFromDisk(File textFile) throws FileNotFoundException, IOException {}

    BufferedReader InputStream;

    inputStream = null;

    String content = "";

    try {}

    inputStream = new BufferedReader (new FileReader (textFile));

    content = readFile (textFile);

    System.out.println ("bytes read =" + content.length ());

    Save the content

    FileContentsObject Sheet1 = new FileContentsObject (System.currentTimeMillis (),

    textFile.lastModified (), content,

    textFile.getName (),

    getLines (null, null));

    Add to the map

    myCachedTreeMap.put (textFile.getName (), Sheet1);

    }

    {Finally

    If (inputStream! = null) {}

    inputStream.close ();

    }

    }

    }

    private static String readFile(File f) throws FileNotFoundException, IOException, UnsupportedEncodingException {}

    Text of StringBuilder = new StringBuilder (1024);

    read int, N = 1024 * 1024;

    char [] buffer = new char [N];

    BufferedReader br = null;

    try {}

    BR = new BufferedReader)

    (new) InputStreamReader

    (new FileInputStream (f), 'UTF8'));

    While (true) {}

    read = br.read (buffer, 0, N);

    If (read > 0)

    Text.Append (new String (buffer, 0, read));

    if(Read < N) {}

    break;

    }

    }

    }

    {Finally

    If (br! = null)

    Br. Close();

    }

    Return text.toString ();

    }

    private static final class FileContentsObject {}

    private long cachedTime; currentTime

    private long lastModifiedTimestamp;

    private string content

    List < String > lines;

    private String fileName;

    public FileContentsObject (long cachedTime, long lastModifiedTimestamp,

    Content string, String fileName, List < String > lines) {}

    this.cachedTime = cachedTime;

    this.lastModifiedTimestamp = lastModifiedTimestamp;

    This.contents = content;

    this.fileName = filename;

    This.Lines = lines;

    SimpleDateFormat sdf = new SimpleDateFormat ("MM/dd/yy hh: mm :"); ")

    System.out.println ("time & Date:" + sdf.format (cachedTime));

    System.out.println ("' last modification timestamp:" ")

    + sdf.format (lastModifiedTimestamp));

    }

    /**

    *

    * @return the lines of the file

    */

    List < String > getLines() {}

    Return this.lines;

    }

    public String toString() {}

    "return"Sheet1 {}"+" fileName =' ' + filename + '------"+", content = "" "

    + content + "\"+ ", lastModifiedTimestamp ="

    + lastModifiedTimestamp + ', CurrentTime & Date ='

    {+ cachedTime + '}';

    }

    }

    }

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    public class DynamicTest {}

    Public Shared Sub main (String [] args) {}

    Game characters charset = Charset.forName("UTF-8");

    try {}

    List < String > = CacheData.getLines lines ("en_synonyms", character set);

    If (rows! = null) {}

    System.out.println ("number of rows:" + lines.size ());

    for {(String ligne: lines)}

    System.out.println ("DynamicTest:" + line);

    }

    }

    } catch (IOException e) {}

    e.printStackTrace ();

    }

    try {}

    List < String > = CacheData.getLines lines ("en_stopwords", character set);

    If (rows! = null) {}

    System.out.println ("number of rows:" + lines.size ());

    for {(String ligne: lines)}

    System.out.println ("DynamicTest:" + line);

    }

    }

    } catch (IOException e) {}

    e.printStackTrace ();

    }

    }

    }

    I have read and watched videos about the creation of an object of a class and calling its method in a different class. I'm still confused on how to do it properly. By using the code below if someone can explain how to properly call the method of objects from my hand.

    Huh? You have NOT posted any 'hand' or any 'method of objects '.

    If you need help with the code, you need to view the code.

    The Java tutorials has dozens of trails "Classes and objects": what they are, how to create and how to use them.

    https://docs.Oracle.com/javase/tutorial/Java/javaOO/classes.html

    1. create an instance of a class

    2. call to one or more of the public methods of this class

    If the class has public static methods, you don't need to create an instance first.

    I suggest that you work your way through these tutorials. They include the WORKING example code.

  • With the help of my classes with OptimisticNamedCache

    Hello

    I learn to use the framework of the Transaction, and I'm stuck on a problem. When I add entries consisting of Java to a NamedOptimisticCache types everything works as expected. If I try to use my own classes as the keys and the values for the entries, it seems that each of my key points to a value zero.

    I wrote a simple program with two classes of support and a stripped down in the cache configuration file to illustrate the problem. Their text appears under my signature.

    Here is the result of an execution. Note the line that reads: MyKey@fa39d7=null

    2011-07-22 19:20:19.949/1.325 Oracle coherence 3.7.0.0 < Info > (thread = main Member, = n/a): responsible operational configuration of "jar:file:/C:/Users/Dan/coherence/lib/coherence.jar!/tangosol-coherence.xml".
    2011-07-22 19:20:20.084/1.460 Oracle coherence 3.7.0.0 < Info > (thread = main Member, = n/a): responsible for operational substitutions of "jar:file:/C:/Users/Dan/coherence/lib/coherence.jar!/tangosol-coherence-override-dev.xml".
    2011-07-22 19:20:20.085/1.461 Oracle coherence 3.7.0.0 < D5 > (thread = main Member, = n/a): configuration optional override ' / tangosol-coherence - override.xml ' is not specified
    2011-07-22 19:20:20.096/1.472 Oracle coherence 3.7.0.0 < D5 > (thread = main Member, = n/a): configuration optional override "/ custom - mbeans.xml ' is not specified

    Oracle Version 3.7.0.0 Build 23397 consistency
    Grid edition: development Mode
    Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

    2011-07-22 19:20:20.524/1.900 Oracle coherence GE 3.7.0.0 < Info > (thread = main Member, = n/a): configuration of the loaded cache of 'jar:file:/C:/Users/Dan/coherence/lib/coherence.jar!/internal-txn-cache-config.xml '.
    2011-07-22 19:20:20.541/1.917 Oracle coherence GE 3.7.0.0 < Info > (thread = main Member, = n/a): configuration of the loaded cache of 'file:/C:/Users/Dan/diceWorkspace/coherenceTxnFwork/config/cacheConfig.xml '.
    2011-07-22 19:20:22.411/3.787 Oracle coherence GE 3.7.0.0 < D4 > (thread = main Member, = n/a): TCMP linked to /192.168.15.2:8088 using SystemSocketProvider
    2011-07-22 19:20:26.763/8.139 Oracle coherence GE 3.7.0.0 < Info > (thread = Cluster, Member = n/a): created a new cluster "cluster: 0x96AB ' with members (Id = 1, Timestamp is 2011-07-22 19:20:22.449, address = 192.168.15.2:8088, MachineId = 26370, location = machine: in-laptop, process: 8704, role = DemoDemo, edition = Grid Edition, Mode = development, CpuCount = 2, SocketCount = 2) UID = 0xC0A80F02000001315313A83167021F98
    2011-07-22 19:20:26.775/8.151 Oracle coherence GE 3.7.0.0 < Info > (thread = main Member, = n/a): started cluster name = cluster: 0x96AB

    Group {address = 224.3.7.0, Port = 37000, TTL = 4}

    MasterMemberSet
    (
    ThisMember = member (Id = 1, Timestamp is 2011-07-22 19:20:22.449, address = 192.168.15.2:8088, MachineId = 26370, location = machine: in-laptop, process: 8704, role = DemoDemo)
    OldestMember = member (Id = 1, Timestamp is 2011-07-22 19:20:22.449, address = 192.168.15.2:8088, MachineId = 26370, location = machine: in-laptop, process: 8704, role = DemoDemo)
    ActualMemberSet = set of members (size = 1, BitSetCount = 2.
    Member (Id = 1, Timestamp is 2011-07-22 19:20:22.449, address = 192.168.15.2:8088, MachineId = 26370, location = machine: in-laptop, process: 8704, role = DemoDemo)
    )
    RecycleMillis = 1200000
    RecycleSet = member (size = 0, BitSetCount = 0 set
    )
    )

    TcpRing {connection = []}
    IpMonitor {AddressListSize = 0}

    2011-07-22 19:20:26.846/8.222 Oracle coherence GE 3.7.0.0 < D5 > (thread = Invocation: management, Member = 1): service management joined the cluster with the senior members of the service 1
    2011-07-22 19:20:26.947/8.323 Oracle coherence GE 3.7.0.0 < Info > (thread = main, Member = 1): configuration of the loaded cache of 'jar:file:/C:/Users/Dan/coherence/lib/coherence.jar!/internal-txn-cache-config.xml '.
    2011-07-22 19:20:27.544/8.920 Oracle coherence GE 3.7.0.0 < Info > (thread = main, Member = 1): configuration of the loaded cache of 'jar:file:/C:/Users/Dan/coherence/lib/coherence.jar!/internal-txn-cache-config.xml '.
    2011-07-22 19:20:27.581/8.957 Oracle coherence GE 3.7.0.0 < D5 > (thread = DistributedCache:TransactionalCache, Member = 1): Service TransactionalCache joined the cluster with the senior members of the service 1
    2011-07-22 19:20:27.790/9.167 Oracle coherence GE 3.7.0.0 < Info > (thread = TransactionFrameworkThread, Member = 1): version Manager started
    2011-07-22 19:20:28.178/9.554 Oracle coherence GE 3.7.0.0 < D5 > (thread = DistributedCache:TransactionalCache, Member = 1): transactional high cabinets: 10 M
    1 = dog
    2011-07-22 19:20:28.935/10.311 Oracle coherence GE 3.7.0.0 < D5 > (thread = DistributedCache:TransactionalCache, Member = 1): transactional high cabinets: 10 M
    MyKey@fa39d7=null
    2011-07-22 19:20:29.319/10.695 Oracle coherence GE 3.7.0.0 < D4 > (= ShutdownHook thread, Member = 1): ShutdownHook: cluster node to stop
    2011-07-22 19:20:29.323/10.699 Oracle coherence GE 3.7.0.0 < D5 > (thread = Cluster, Member = 1): Service de Cluster in the cluster on the left
    2011-07-22 19:20:29.339/10.715 Oracle coherence GE 3.7.0.0 < D5 > (thread = DistributedCache:TransactionalCache, Member = 1): Service TransactionalCache left in the cluster
    2011-07-22 19:20:29.340/10.716 Oracle coherence GE 3.7.0.0 < D5 > (thread = TransactionFrameworkThread member = 1): repeat AggregateAllRequest for 257 of 257 points due to the redistribution of PartitionSet {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215 216 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256}
    2011-07-22 19:20:29.345/10.721 Oracle coherence GE 3.7.0.0 < D5 > (thread = Invocation: management, Member = 1): service management left the cluster


    Thank you.

    -Dan

    Demo program illustrates the problem

    to import java.util.Set;
    java.util.Map.Entry import;
    import com.tangosol.coherence.transaction.Connection;
    import com.tangosol.coherence.transaction.DefaultConnectionFactory;
    import com.tangosol.coherence.transaction.OptimisticNamedCache;

    public class Demo {}

    /**
    @param args
    */
    Public Shared Sub main (String [] args) {}

    This block of code shows Java native types work ok.
    Connection con = DefaultConnectionFactory() new
    .createConnection ("TransactionalCache");
    OptimisticNamedCache txCache = con.getNamedCache("txCache");
    txCache.put (1, "dog");
    con. Close;
    The value < entry > tCacheEnts = txCache.entrySet ();
    for (entry e: tCacheEnts) {}
    System.out.println (e);

    }

    This block of code illustrates the problem I have with my own types.
    Con1 connection = new DefaultConnectionFactory()
    .createConnection ("TransactionalCache");
    OptimisticNamedCache txCache1 = con1.getNamedCache("txCache1");
    Key MyKey = new MyKey();
    Value of MyValue = new MyValue();
    key.setId (1);
    value.setStrValue ("ONC1");
    txCache1.put (key, value);
    Con1.close ();
    The value < entry > t1CacheEnts = txCache1.entrySet ();
    for (entry e: t1CacheEnts) {}
    System.out.println (e);

    }
    }
    }

    My custom key class
    import java.io.Serializable;


    MyKey/public class implements Serializable {}
    Whole ID;

    public Integer getId() {}
    return the id;
    }

    {} public void setId (Integer id)
    This.ID = id;
    }

    public MyKey() {}
    }
    }

    My custom value class

    import java.io.Serializable;


    MyValue/public class implements Serializable {}
    String strValue;

    public String getStrValue() {}
    return strValue;
    }

    public void setStrValue (String value) {}
    this.strValue = value;
    }

    public MyValue() {}
    }

    }



    My config of cache

    <? XML version = "1.0"? >

    <! SYSTEM cache-config DOCTYPE "cache - config.dtd" >

    <>cache-config

    < cache-system-mapping >

    <>cache-mapping
    < name of the cache - > * < / cache-name >
    < scheme name > example distributed < / system-name >
    < / cache-mapping >

    <>cache-mapping
    < name-cache > tx * < / cache-name >
    < scheme name > transactional example < / system-name >
    < / cache-mapping >

    < / cache-system-mapping >


    <>- cached patterns
    <!--
    Distributed caching scheme.
    ->
    < distributed plan >
    < scheme name > example distributed < / system-name >
    < service name > DistributedCache < / service-name >
    thread < lease-granularity > < / lease-granularity >
    thread < number > 100 < / thread count >

    < support-map-plan >
    < local plan >
    <>plan-unlimited-support-map Ref < / plan-ref >
    < / local plan >
    < / support-map-plan >

    < autostart > true < / autostart >
    < / distributed plan >

    < transactional system >
    < scheme name > transactional example < / system-name >
    < number > 10 threads < / thread count >
    < service name > TransactionalCache < / service-name >
    < request-timeout > 30000 < / timeout request >
    < support-map-plan >
    < local plan >
    <>plan-unlimited-support-map Ref < / plan-ref >
    < / local plan >
    < / support-map-plan >
    < autostart > true < / autostart >
    < / transactional system >
    <!--
    Card support schema definition used by all caches that are not
    require expulsion policies
    ->
    < local plan >
    < scheme name > unlimited-support-map < / system-name >
    < / local plan >

    < / cache-plans >
    < / cache-config >

    Published by: dan_at_scapps on July 22, 2011 11:14

    Hi Dan,.

    Your key should implement equals() and hashCode(). Something like...

    
           public int hashCode()
                {
                return id;
                }
    
            public boolean equals(Object o)
                {
                if (o instanceof MyKey)
                    {
                    MyKey that = (MyKey) o;
    
                    return id.equals(that.id);
                    }
    
                return false;
                }
    

    Thank you
    Tom

  • Problems of libraries Java build path. With the help of an external CONTAINER as a library in a BlackBerry app.

    Hello

    I have two codes, the application code and the code of the library.

    The application should use the jar as a library file.

    Application-> App

    Library-> AppLib

    I work with Eclipse and JRE 5.0. I have a problem. I'm trying the AppLib.ja the Java Build Path of the application code, as in a normal Java application. Copy "AppLib.jar" in my project and select Java Build Path libraries does not work. Browser files doen't show me the new file. Therefore, I can select the library project folder as external JAR, but when I test the app on BlackBerry I get an error do not find the module:

    > App starting error: Module 'AppLib' not found

    To export my application for BlackBerry I only select the file "App.alx" with the Desktop Manager. I should also add, somehow, the Jar file?

    What I am doing wrong?

    I think if I could include 'AppLib.jar' because no JAR external to compile the project would be expected for that library properly in the "App.alx" but as I have said, for example, if I put the "AppLib.jar" in the folder "App\ lib\" file path browser version does not show me the file and I can't select it. I can only do so if I select in the AppLib\deliverables\Standard\5.0.0\, but not found problem occurs then.

    Can someone help me?

    I won't put my library code in the application code. It is not very comfortable. And it would be a bit dodgy.

    Thank you very much.

    Greetings.

    ibarrera, that is not the problem.

    First, when copying a file to your project via the OS Explorer, you must refresh the project in Eclipse in order to get visible. otherwise, if the Eclipse do not see, the .jar file is not going to join your project. But I know that's not the problem.

    In the second place, to get this .jar file be included in your project as non-external, you must add as first external, close this wizard properties re-open; Then select the .jar file, you just added and click on "Migrate JAR file" button. Find the .jar file in the project and click Finish.

    This is done, your project will be ready to be built and executed.

    I hope this helps. Good luck to all.

  • With the help of the stationary state how can w/XP, I enable Spanish keyboard for the user?

    My daughter has a Spanish class this is why we have installed a panel of Spanish key for that topic.  I loaded Microsoft steady state to control what she uses, changes, etc... make his story on the computer.  With the help of most all the restrictions that she does not see its Spanish keyboard.  How to activate the Spanish keyboard while steady state is to limit what she can get.  We want only that she go to his school work, loaded on the hard disk and not much more.  The Spanish keyboard is essential for this class.

    Microsoft SteadyState has been abandoned and is no longer supported.

  • With the help of 1.7.0_07 - b11 version JRE Java hotspot Client VM

    I can't use by net cooking system indicates error java and java download does not work with my system with windows 7 giant premium 64 bit computer laptop.

    REPRT ERROR:

    Java plug-in 10.7.2.11
    With the help of 1.7.0_07 - b11 version JRE Java hotspot Client VM
    Home Directory user = C:\Users/
    ----------------------------------------------------
    c: clear console window
    f: finalize objects on the finalization queue
    g: garbage collection
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: Hide console
    r: reload the policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: delete the cache of class loaders
    0-5: set the trace level

    Hello

    1 are you facing this problem with a specific Web site?
    2 are you having the same problem on other browsers as well?
    Please follow the links below to solve the problem.
    Method 1
    How to troubleshoot script errors in Internet Explorer
    Note: follow the steps as troubleshooting applies to JAVA issues.
    Step 2
    How to enable Java in my web browser?
    Method 2
    If you still face problems, please uninstall and reinstall JAVA
    Remove all traces of the failure of the Java installation by uninstalling Java:
    Install Java
    I hope this helps.
  • With the help of AMPA on non - WS Data Controls

    Hello community MAF .

    I'm developing an Application of MAF that consumes the REST API of WebCenter portal (which is based on the model of HATEOAS).

    I want to make powerful from scratch, including the following:

    -Offline mode (using the SQLite).

    -Persistence, of setting cache and synchronization using AMPA.

    Looks like it's not easier to apply directly on the REST API of WCP AMPA.

    The REST API of WCP is the result of a call of two steps:

    1) authenticate using BASIC authentication against http://Host/repos/api/resourceIndex for the utoken

    (2) use utoken as the URL parameter for the next call of REST for the specific service.

    I know that the Bus Service could be a possibility on the creation of a more simple REST on the WCP REST API, but is not an option right now because that is not easy to map.

    My questions are:

    (1) can we use AMPA on data controls in Java that will call internally to (DB in case of offline mode, REST by program in the case of online mode).

    (2) can define us manually in the persistenceMapping.xml?

    (3) is there anything else more easy to use wizards with HATEOAS base based Services?

    Thanks in advance

    Kind regards.

    Daniel,

    Why is it not service bus an option? You say 'not easy to map', but do the mapping in the MAF makes it not easier, it? the REST API of pressurization is not very easy to mobile, so this transformation to a more usable by using bus service API cost as a good idea for me. See also this article from the A-team.

    Answers to your questions:

    (1) Yes, this is the added value of nucleus of AMPA. You get a service generated the DTC Assistant classes, then you turn this class in a bean data control and use this data control bean for the construction of your user interface. The service class will access local DB and the service REMAINS remote. By default, AMPA will directly show the current data of the local DB, and then in the background call the REST service (online) and refresh the UI, once the REST call has been processed. But this behavior is very configurable and can be changed as you wish.

    (2) Yes, of course, you can manually create data objects, classes of service and persistence mappings, but the wizard is generally much faster.

    (3) HATEOAS logical not for the dynamics of UI where the next action is determined by a link returned in the payload. It is a different model from the static of the UI we build in general with MAF. What is your problem with the help of the wizard of the AMPA?

    Steven Davelaar,

    Oracle Mobile & Cloud A-team.

  • with respect to an application to turn with the help of a global static variable

    Hello. I've read a few articles on JavaFX competition, and as a beginner, so I have to practice on this subject. Now, I'm trying to implement a turn-based application which can be played between 3 to 6 players. Furthermore, I use a scene from a .fxml file and I need to update it properly depends on certain calculations of each thread (in other word players). My main problem is, I don't want to use a while loop that checks the status of similar game;

    While (GameState! = State.GAME_OVER) {}

    currentPlayer = GameBoard.getNextPlayer ();

    perform certain actions, calculations, etc.

    }

    So, I want to use threads to work instead while loop. I guess only with the help of the Service used to iterate class and assign the next player will be adapted to instead of using the while loop and the tasks for the calculation of each player, or waiting for a few responses of human players on the UI account, however, I am faced with two problems.

    1. It has a global static variable (like the GameState which is an Enumarator) determines the State of the game, so it should be updated and must be verified by each round. Is it possible to do this?
    2. How can I get rid off this while loop?

    I would like for each answer. Thanks anyway.

    It shouldn't make too much difference. The basic idea is that you have a model class that represents your state of the game (the class of game in example jsmith). When a player makes a move, you update the game state. Because this will result in changes to the user interface, this update must be performed on the Thread of the FX Application.

    If the player makes the passage is a human player, the move would be done by a user action (mouse click or press button, etc.); This will be handled on the FX Application thread in any case.

    When the State of the game changes so it is in an "artificial" player's turn to move, have the object representing the artificial player calculate his next move and then update the game state. Since it is a response to the evolution of the game state (it is the artificial player's turn), it will also be on the Thread of the FX Application.

    The only (slight) complexity comes if the calculation of displacement for the artificial player takes a long time. You don't want to perform this calculation of long duration on the Thread of the FX Application. To handle this, the cleaner is to start a task that computes the desired pass and then updates the status of the game when travel is ready. So, something like this:

    GameState game = ... ;
    // UI is bound to the game state.
    ExecutorService executorService = ... ;
    // ...
    
    final Player currentPlayer = game.getCurrentPlayer() ;
    final Task calculateMoveTask = new Task() {
         @Override
         public Move call() {
              Move move = // compute next move...
              return move ;
         }
    };
    
    calculateMoveTask.setOnSucceeded(new EventHandler() {
         @Override
         public void handle(WorkerStateEvent event) {
              gameState.makeMove(currentPlayer, calculateMoveTask.getValue());
         }
    });
    
    executorService.submit(calculateMoveTask);
    

    If you make a thread more than that, you're probably do badly... Also, there should be no need anything it either, will be held in a "global" static variable (the idea above is the only structural change you the example posted by jsmith).

  • My AirPort Extreme end not implemented with the help of AirPort Utility

    Bought a used AirPort Extreme (Genesis 4) of a person who showed me that he worked at home. When I try to set up as a Wireless extender to my last existing AirPort Extreme, he will not carry out synchronization upward with AirPort Utility. It appears as a new extreme, but get a message 'unexpected error' before or after the name. Have you tried to reset the two while it is powered and turning the as explained in the help.

    When I try to set up as a Wireless extender...

    Gen 4 airport will connect to your existing AirPort Extreme wireless... or... it will connect using wired Ethernet wired, Permanent?

    .. .it will not accomplish the synchronization upward with AirPort Utility.

    Which version of AirPort Utility?  If it's on your Mac... and you don't know what version you have...

    Open AirPort Utility

    Click the AirPort Utility menu in the upper left corner of the screen

    Click on about AirPort Utility

    Report on the version number you see here

    You have an iPhone or a handy iPad that could be used to implement the 4th Gen airport if the problems continue with the help of your Mac?

  • With the help of iPhone 6 s. try to copy the text message with a tap double and get a bubble with icons. How can I copy the message to paste in another?

    Try to copy a text to paste in another. When I double tap, as I always have, all I get is a bubble with icons on it. With the help of OS 10.0.2.

    maryml wrote:

    Try to copy a text to paste in another. When I double tap, as I always have, all I get is a bubble with icons on it. With the help of OS 10.0.2.

    Press and hold on the text and wait for the copy/more pop up.

  • With the help of Club running on the Nike watch +.

    Hello

    This is something I have tried to work for a while and have not yet been able to find an answer. At the moment I use Nike + management club on my iPhone to follow the tracks that I find that gps is better than just using the application of the workout on my watch. However, something that really bothers me is that I start the race on my phone, but I can't then view my stats while running without having to press on and tap the watch and wait for the application to load, very irritating to race. I want to be able to lift my wrist and live stats are there to watch me, not listening and not get my phone out of my pocket. Surely this is something that can make the original watch?

    As a separate issue with the new app, Nike +, it does not recognize the songs I downloaded on my phone of Apple music in my playlists, then I have to play the separatelay of music through the application of music as opposed to go with Nike +? The ides on how to fix or is this a known problem with the latest Nike + app?

    Hello

    You may find it useful to consult the support resources of Nike and/or contact Nike for assistance with the help of their application:

    More information:

    https://iTunes.Apple.com/us/app/Nike+-run-Club/id387771637?Mt=8

  • With the help of old gear series noon on El Capitan

    I have a Vox Tonelab SE effects audio Board (around 2004), there the old serial midi on the back ports. I hung with the help of a USB MIDI interface cable. While the USB Midi interface to the show in Audio / Midi set upward and also in the profile system for USB port it does not detect the Vox Tonelab so no communication lunch.

    There is a POWERPC application called ToneLabSE SoundEditor which I downloaded and installed in the hope he would install a driver but I guess that this obviously doesn't work on INTEL in any case. Using Wine I can run the PC version, but still no communication via midi.

    Someone at - it ideas, would like to get this Panel communicating effects via MIDI.

    Thank you

    Solved! Using the WINE app I've run the version of the PC of ToneLab SE editor application. So pretty unintuitively by changing the serial midi to USB, SERIAL interface cables that went to the and out on the Tonelab SE. Now of the Se ToneLab editor I can write banks of programs to hardware Tonelab, but unable to empty the banks since the material Tonelab to software. My main desire was to use Expression pedals on the Tonelab as Midi Ableton controllers and some of the switches to the control of the Looper stomp. Now I can do it all. Hooray!

  • With the help of Yosemite, I like Photos app in general; have big Aperture library, although I use rarely opening Tools. Advantages, disadvantages and pitfalls related to the migration of Photos?

    With the help of Yosemite, I like Photos app in general; have big Aperture library, although I use rarely opening Tools. Advantages, disadvantages and pitfalls related to the migration of Photos?

    Opening was a pro the Pro amateur-oriented or serious app, usually shooting Raw, probably on a digital SLR.

    If that's you then pictures will miss a lot for you.

    If this isn't the case, then opening was probably overkill for your needs.

    If you like the pictures then this is the way to go.

  • Thunderbird will only connect if stop then reopened. (With the help of Mac 10.9.4)

    With the help of Mac 10.9.4
    If I open Thunderbird, I can connect to my e-mail address and download the messages. If I select "Get Mail" once again, Thunderbird crashes and fails to connect to my emails. If I then close Thunderbird and re-open it, I'm able to immediately connect to my mail.

    It seems to have sorted itself after a few days. (Fingers crossed). Until today it worked properly. Will keep an eye on things for the next week and the report does so again.

  • Install OSX 10.11.4 I do cleaning but R command will not work. With the help of USB keyboard so not wifi issues to to worry. Help?

    Install OSX 10.11.4 I do cleaning but R command will not work. With the help of USB keyboard so not wifi issues to to worry. Help?

    Would you like to share why you must do a clean install?

    You can try the recovery of the internet (which will work if your older model has been updated to enable of): hold command + Option + R until you see a progress bar (take a while). It will connect you to the Apple servers. When you see the utility window, choose disk utility to erase your disk and when you're done, choose to reinstall OS X.

    Computers that can be upgraded to use OS X Internet Recovery - Apple Support

    PS: Correction: I think not yours can be updated; in this case, you will need the original installation disks to wipe the drive and reinstall.

Maybe you are looking for