Problems with toString()

This is probably a strange question, but how do this program to return the result using toString()? This is a duty...

import java.util.Scanner;

public class LED_Digit {
     
     private int myTop, myTopBothSides, myTopLeft, myTopRight, myMiddle, myBottomBothSides, myBottomLeft, myBottomRight, myBottom;
     
     public void drawLED_Digit(int top, int topBothSides, int topLeft, int topRight, int middle, int bottomBothSides, int bottomLeft,
               int bottomRight, int bottom) {
     for (int t = 1; t <= top; t++) {
          System.out.print(" - "); }
          System.out.println();
     for (int tbth = 1; tbth <= topBothSides; tbth++) {
          System.out.println("|   |");}
     for (int tl =1; tl <= topLeft; tl++) {
               System.out.println("|   "); }
     for (int tr = 1; tr <= topRight; tr++) {
               System.out.println("    |"); }
     for (int m = 1; m <= middle; m++) {
               System.out.print(" - "); }
     for (int bbth = 1; bbth <= bottomBothSides; bbth++) {
               System.out.println();
               System.out.println("|   |");}
     for (int bl = 1; bl <= bottomLeft; bl++) {
               System.out.println();
               System.out.println("|   "); }
     for (int br = 1; br <= bottomRight; br++) {
               System.out.println();
               System.out.println("    |"); }
     for (int b = 1; b <= bottom; b++) {
               System.out.print(" - "); }
     
     myTop = top;
     myTopBothSides = topBothSides;
     myTopLeft = topLeft;
     myTopRight = topRight;
     myMiddle = middle;
     myBottomBothSides = bottomBothSides;
     myBottomLeft = bottomLeft;
     myBottomRight = bottomRight;
     myBottom = bottom;
     
     }
      
     
     public static void main(String[] args) {
          Scanner keyboard = new Scanner(System.in);
          System.out.print("What is the number? " );
          int num = keyboard.nextInt();
          findDig(num);
          
     }
          
     public static void findDig(int num) {
     if (num == 0) {
          LED_Digit zero = new LED_Digit();
          zero.drawLED_Digit(2, 3, 0, 0, 0, 0, 0, 0, 2);
          System.out.println(); }
     else if (num == 1){
          LED_Digit one = new LED_Digit();
          one.drawLED_Digit(0, 0, 0, 4, 0, 0, 0, 0, 0);
          System.out.println(); }
     else if (num == 2) {
          LED_Digit two = new LED_Digit();
          two.drawLED_Digit(2, 0, 0, 1, 2, 0, 1, 0, 2);
          System.out.println(); }
     else if (num == 3) {
          LED_Digit three = new LED_Digit();
          three.drawLED_Digit(2, 0, 0, 1, 2, 0, 0, 1, 2);
          System.out.println(); }
     else if (num == 4) {
          LED_Digit four = new LED_Digit();
          four.drawLED_Digit(0, 1, 0, 0, 2, 0, 0, 1, 0);
          System.out.println(); }
     else if (num == 5) {
          LED_Digit five = new LED_Digit();
          five.drawLED_Digit(2, 0, 1, 0, 2, 0, 0, 1, 2);
          System.out.println(); }
     else if (num == 6) {
          LED_Digit six = new LED_Digit();
          six.drawLED_Digit(2, 0, 1, 0, 2, 1, 0, 0, 2);
          System.out.println(); }
     else if (num == 7) {
          LED_Digit seven = new LED_Digit();
          seven.drawLED_Digit(2, 0, 0, 1, 0, 0, 0, 1, 0);
          System.out.println(); }
     else if (num == 8) {
          LED_Digit eight = new LED_Digit();
          eight.drawLED_Digit(2, 1, 0, 0, 2, 1, 0, 0, 2);
          System.out.println(); }
     else if (num == 9) {
          LED_Digit nine = new LED_Digit();
          nine.drawLED_Digit(2, 1, 0, 0, 2, 0, 0, 1, 2); }
     else {
          System.err.println("Not a valid digit"); }
     }
}

It does not appear that understand how something back from a method. Your OE is the result of this. Consider the following simple example:

class SomeClass {
   int a;
   String b;

   public String toString() {
      String returnValue = "a=" + a + ", b=" + b;
      return returnValue;
   }

   public static void main( String[] args )
   {
      SomeClass sc = new SomeClass();
      sc.a = 5;
      sc.b = "Test";
      System.out.println( sc );
   }
}

Using a StringBuilder or StringBuffer would also apply in this case, but the concept is the same.

Also, I suggest looking at the use of a switch statement in your code.

Tags: Java

Similar Questions

  • problem with loopback test base with NOR-6008

    I recently started to use DAQmx in c# .NET 4.0 with NOR-6008 USB DAQ. I tried a loopback test by connecting output to an analog input analog and tried readign the signal from the output to the entrance but did not send the signal (or maybe a problem with the code). The analog input readign reads a random value rather than the value entered by the user for the output. I connected ao0 and ai3 on data acquisition. Here's the code.

    private void button1_Click (object sender, EventArgs e)

    {

    Task analogOutTask = newTask();

    AOChannel myAOChannel = analogOutTask.AOChannels.CreateVoltageChannel ("Dev1/ao0", "myAOChannel", 0, 5, AOVoltageUnits.Volts);

    AnalogSingleChannelWriter writer = newAnalogSingleChannelWriter (analogOutTask.Stream);

    Double analogDataOut;

    analogDataOut = Convert.ToDouble (AnalogOut.Text);

    writer. WriteSingleSample (analogDataOut, true);

    }

    Private Sub button2_Click (ByVal sender As Object, EventArgs e)

    {

    Task analogInTask = newTask();

    AIChannel myAIChannel = analogInTask.AIChannels.CreateVoltageChannel ("Dev1/ai3", "myAIChannel", AITerminalConfiguration.Differential, 0, 5, AIVoltageUnits.Volts);

    AnalogSingleChannelReader reader = newAnalogSingleChannelReader (analogInTask.Stream);

    Double analogDataIn is reader. ReadSingleSample();

    AnalogIn.Text = analogDataIn.ToString ();

    }

    Hello

    I built an application using your code (with task.verify) and it works beautifully.

    Have you tried different channels of inputs/outputs?

    Curt

  • Problem with the ObjectListField

    Hello

    I have problems with the method getSelectedIndex() ObjectListField.
    Supposedly, when there is no index selected, it returns-1. But how come it always returns the index of the last element?

    To illustrate, I created my own dialog that has similar functionality to the "device window select" Bluetooth BB application. I have an ObjectListField and a Cancel button. What I did simply, is to change the label of the button to show the selected index. I have attached my sample code below.

    public class MyDialog extends dialog
    {
    private ObjectListField m_list;
    private ButtonField m_btn;

    public MyDialog)
    {
    Super ("Select Device:", null, null, 0, Bitmap.getBitmapResource ("bluetoothIcon.PNG"), Manager.FOCUSABLE);

    m_List = new ObjectListField();
    m_btn = new ButtonField ("Cancel", Field.FIELD_HCENTER);
    m_List.set (new String [] {"first", "second"});

    Add (m_List);
    Add (m_btn);
    }

    protected boolean navigationClick (int status, int time)
    {
    m_btn.setLabel (Integer.ToString (m_List.getSelectedIndex ()));

    Returns true;
    }
    }

    Can someone help me on this problem? Is there something wrong with my code, or is the buggy API? All I want to do is to return an index of-1 if there is no selected item in the list.

    Also, I tried the isFocus() method to check if the list is being concentrated, it always returns false even if the list is OBVIOUSLY being focused. I'm running out of options on how to determine the solution to this problem. Help, please!

    Thank you very much.

    @jacylan - I do not use isFocus() to determine if the ListField is net.  Take a look at the following code, I think that with this, you can force-1 when the ListField is not the point.

        protected boolean navigationClick(int status, int time)
        {
            int selectedIndex = m_list.getSelectedIndex();
            boolean listInFocusOption1 = false;
            if ( this.getLeafFieldWithFocus() == m_list ) {
                listInFocusOption1 = true;
            }
            boolean listInFocusOption2 = false;
            if ( m_list.isFocus() ) {
                listInFocusOption2 = true;
            }
            m_btn.setLabel(Integer.toString(selectedIndex) + ":" + listInFocusOption1 + ":" +listInFocusOption2);
    
            return true;
        }
    
  • Problems with Connector.open

    I'm having a problem with the re-login to a HttpsConnection once a failure has occurred. I send a message to a php site that works 100% OK. However, if I drop the receipt when sending at the reception is retrieved Connector.open no reconnect not (even after a long wait). and gives a "java.io.InterruptedIOException: connection Local has expired" exception. The issue is not corrected until the phone is rebooted.

    I use MDS to transport and endpoint certificate has a valid certificate (does not Self-signed). Before I drop the front desk, a message is sent correctly and using the console creates the following log entries:

    [0,0] * start sending:

    [0,0] SSL :-> CH

    [0,0] SSL:<>

    [0,0] SSL:<>

    [0,0] SSL:<>

    [0,0] SSL:<>

    [0,0] SSL :-> CKE

    [0,0] SSL :-> CCS

    [0,0] TLS :-> F

    [0,0] TLS:<>

    [0,0] VMISVt = 0, h = 1a7b, id = d15a33128dfbb5d9

    [0,0] VM:LNTDa = validation, t = 1, p = D8Mobile

    [0,0] * open Stream:

    [0,0] * sending data:

    [0,0] * server response: 200

    [0,0] * Flushing bos

    [0,0] * input stream of Flushing

    [0,0] * Flushing DOUT

    [0,0] * Flushing HC

    [0,0] TLS:<-Alert -="" level="1" description="">

    [0,0] * emptied all

    Once the reception has been abandoned and valued, the connection begins to open the SSL session and shows the following:

    [0,0] * start sending:

    [0,0] SSL :-> CH

    He gets Nevers to: SSL [0,0]:<>

    After the time-out period, it then returns the exception

    IO exception: java.io.InterruptedIOException: Local connection timed out after ~ 15000

    [0,0] * Flushing bos

    [0,0] * emptied all

    Of course the connection is instantiated is no longer so I can't even try his end on the connector at this stage. I also see the following in the MDS newspapers - although I'm not sure its related:

    <2012-01-18 10:42:03.921="" gmt="">:[528]:::

    What follows is a version of my code. All this code runs since a thread to work constantly in the loop.

    HttpsConnection hc =null;

    InputStream is =null;

    Dout OutputStream =null;

    ByteArrayOutputStream Bos =newByteArrayOutputStream();

    byte [] res = null;

    VR;

    {

    System.

    HC = (HttpsConnection) Connector.open (url + ";" ConnectionTimeout = 15000; deviceside = false');

    "Credentials of string = this._username +": "+this._password;"

    byte [] encodedAuthorization = Base64OutputStream.encode (credentials.getBytes (), 0, credentials.length (),false,false);

    () hc.setRequestProperty

    "Authorization", "basic" +newString (encodedAuthorization));

    () hc.setRequestProperty

    'Content-Type', ' multipart/form-data; Boundary = "+ getBoundaryString());

    dout = hc.openOutputStream ();

    dout. Write (postBytes);

    dout. Flush();

    this._responseCode = hc.getResponseCode ();

    dout. Close();

    is = hc.openInputStream ();

    int ch;

    while ((ch = is.read (())! = - 1).

    {

    Bos.Write (ch);

    }

    RES = bos.toByteArray ();

    }

    catch (IOException ioe) {

    System.out.println ("* IO Exception:" + ioe.toString ());

    this._responseCode = 0;

    RES = null;

    }

    catch (Exception e)

    {

    System.out.println ("* send the Message of the Exception:" + try ());

    this._responseCode = 0;

    RES = null;

    }

    Finally

    {

    VR;

    {

    if (bos! = null) {

    Bos.Close ();

    }

    if (is! = null) {

    is. Close();

    }

    if (dout! = null) {

    dout. Close();

    }

    if (hc! = null) {

    HC. Close();

    }

    }

    catch (Exception e2)

    {

    System.out.println ("* Message send Exception 2:" + e2.toString ());

    }

    }

    of return ;

    }

    I tried on 8700,8900 and 9700 device simulators. I am running JRE 5.0.0 and MDS v4.1.4

    Any help or suggestions will be appreciate - I spent nearly a week debugging it and its slowly driving me crazy!

    Thank you

    Andy

    Try to use the factory connections if you are targettin devices in 5.0 or above, it might solve the prob.

  • Problems with Knockoutjs &amp; webworks?

    I have a piece I've been debugging for the whole weekend and I just can't understand what is wrong with it. As far as I can see everything is as it should be. The HTML code I have is

    div class = 'networkItem' x-blackberry-Focus='true'=onmouseover "this.style.backgroundColor ='#444444 '; '=onmouseout" this.style.backgroundColor =' #010101 ";

    x onUp-blackberry-=' netNavUp ($index ()) ' x-blackberry-onDown=' netNavDown ($index ()).

    bind data = ' click: changeNetwork.bind ($data, no()), attr: {'id': 'nIf' + $index ()} ">".

    It is part of a foreach knockoutjs model. $index () is the index number 0 -? list

    the attr section creates an ID of this item to the nli0 format, nli1, nli2 etc. depends on County look.

    I can inspect the HTML code that it creates in the debugger chome and IDS are set correctly. And I suppose, at this stage, which is irrelevant in any case, as I have commented little bits in the code that woud use anyway. It seems that the call to netNavUP and netNavDown are causeing the exception.

    My js code is as follows:-

    function netNavDown ()tmp( )

    {

    goID var ="";

    blackberry.ui.dialog.standardAskAsync ("to:" + goID, blackberry.ui.dialog.D_OK, tmp);

    tmp ++;

        if (tmp is appViewArray.network.length)

    {

    goID = "nliEnd";

    }

    on the other

    {

    goID = "NIF" + tmp.toString ()";

    }

    blackberry.focus.setFocus (goID);

    }

    As you can see the standardAskAync should give me some information, but never gets fired. No, I know it's asynchronous if she fell into the code. That's why I removed the call to set the focus. So indeed it would fulfil this function and return control to the html code.

    The error I get in the Simulator is - App error 104 - Eception RuntimeException

    I tried to lose the $index () and replace it with a number directly I can see if that was the problem, but no, I still get exactly the same error. Then there is a problem with X-blackberry-onDown? and onUp than also causes the crash. Note that I use navigation everywhere else without too much problem, but it's the only place where I "force" of a specific focal point, setting the focus is also not a problem I put emphasis in the code when it starts first, and that works. The fixed focus is commented, so it hangs a little on the call of the function as the first line of the function is an alert (of sorts)

    I solved this by sending not anything to the function, but rather when I get to the function to get the item currently developed. not the best solution, but it works.

    var id = blackberry.focus.getFocus ();

  • What is the problem with my http code?

    I have a problem with the following code on the Bold 9700.  The code works on the Simulator and other devices, but some users have problems.  It seems that nothing is returned when getting the html page.

        static String get_page(String url)
        {
    
            StreamConnection s = null;
            InputStream input = null;
    
            try
            {
    
                s = (StreamConnection)Connector.open(url);
    
                input = s.openInputStream();
                byte[] data = new byte[4096];
                int len;
                StringBuffer raw = new StringBuffer();
                long startTime = System.currentTimeMillis();
    
                while ( -1 != (len = input.read(data)) )
                {
    
                    if (len > 0) {
                        raw.append(new String(data, 0, len));
                    }
    
                    // check for timeout waiting for server; or
                    // what if page never closes...
                    if (System.currentTimeMillis() - startTime >  30000)
                    {
                        s.close();
                        return("ERR2");
                    }
                }
                s.close();
    
                return(raw.toString());
            }
            catch (Exception e)
            {
                return("ERR3");
            }
    
            finally
            {
                try
                {
                    if (input != null)
                        input.close();
                }
                catch (Exception e)
                {
                }
            }
        }
    

    Y does it have that none of the Options application settings must be defined? for example: TCP/IP

    The Thread I pointed you to and the various "required reading" material, describes how the different network paths are selected by changing the suffix of the URL used connection.  The standard demo does not add a suffix, by default, choose BES connection, so will be.  Unless of course, the carrier has provided a different default value for a feature not BIS, for example, I understand that Vodafone UK will send it via WAP.

    According to the treatment of suffix / default connection, the request will be routed through a number of "gateways" like BES/MDS or the carrier's WAP gateway.  If any of them could give the 500.

    Assuming that it makes actually to your server (I assume this is a URL that you control), then the 500 from the treatment of your Web.  For example, this could be because your processing wait some headers in the http request which are not provided.  Or, that demand has been sent by a gateway changing the headers in a way that is not pregnant with your web server.

    With same URL work on the browser is unfortunately not much of a test as it can be routed through a method of communication that you do not use (for example, on Vodafone BIS devices I think the default browser will use BIS - B) and, in addition, it could provide some headers for the http connection that you do not provide.

    The point really is that there are many places that could break this code.  And there are number of variables, including what method of connection is used (and in the case of Vodafone, effectively forced to use), which carrier is used and which headers were provided.

    But I think the first thing we do is to know who is giving you the 500.  If you can follow the application to your own server, so much the better.  If you can not, in the headers that come back with 500, you should some server information.  The dump out., empty the suffix of connection you use and if possible, get the log records from at the time this was done (which confirms the method of connection actually used).

    I also search this forum for more information on issues people have had with the carriers.  I know that there is some information on Vodafone UK.  According to me, that there is still something at least another carrier.

    Sorry, comms on the BB is not as simple as that...

  • problem with tabs and filter the lines of memory cache

    Dear all I have a problem with the oaf page has two tabs under two of them consists of a table and add the button to the row. Second tab, it's a detail of the first tab, which means that each line in the first tab may refer to one or more lines in the second tab, my problem is when I add the line in the first tab and go to the second tab to add lines to this line of the display of the page added all lines not only the matching lines.

    my code:

    1 - controller

    When press Tab of Lot lines (partial action)
    If (goLotsTab".equals (pageContext.getParameter (OAWebBeanConstants.EVENT_PARAM))) {" "}

    String trxLineId = "38";//row.getAttribute("TrxLineId").toString(); "
    AddLotParam serializable [] = {trxLineId};
    am.invokeMethod ("getTrxLot", addLotParam);
    }
    What press Add button lines of lots (partial action)
    If (addLot".equals (pageContext.getParameter (OAWebBeanConstants.EVENT_PARAM))) {" "}
    String trxLineId = "38"; row.getAttribute("TrxLineId").toString ();
    AddLotParam serializable [] = {trxLineId};
    am.invokeMethod ("addTrxLot", addLotParam);
    }

    When press Add a tab line (partial action)
    If (addLine".equals (pageContext.getParameter (OAWebBeanConstants.EVENT_PARAM))) {" "}
    am.invokeMethod ("addLine", params);
    }

    Methods 2 - am

    public void getTrxLot (String pTrxLineId)
    {
    OAViewObject vo = (OAViewObject) getXXSiteLotsVO1 ();
    LinVo OAViewObject = (OAViewObject) getXXSiteLineVO2 ();

    Line linRow = linVo.getFirstFilteredRow ("SelectLineFlag", "Y");
    pTrxLineId = linRow.getAttribute("TrxLineId").toString ();

    If (!) VO.isPreparedForExecution ())
    //{
    try {}
    String existringWhereClause = vo.getWhereClause ();
    vo.setWhereClauseParams (null);
    vo.setWhereClause("trx_line_id=:1");
    vo.setWhereClauseParam (0, (pTrxLineId) Number);
    vo.executeQuery ();
    vo.setWhereClauseParams (null);
    vo.setWhereClause (existringWhereClause);
    }
    catch (Exception exceptionl)
    {
    throw OAException.wrapperException (exceptionl);
    }

    // }
    following line is commented, but I think that it will contribute to the memory of the filter
    cached data to be mapped.

    Rank [] lotRows = vo.getFilteredRows ("TrxLineId1", pTrxLineId);
    }

    /////////////////////////////////////////////////////////////////
    public void addTrxLot (String pTrxLineId)
    {
    OAViewObject vo = (OAViewObject) getXXSiteLotsVO1 ();
    LinVo OAViewObject = (OAViewObject) getXXSiteLineVO2 ();

    Line linRow = linVo.getFirstFilteredRow ("SelectLineFlag", "Y");
    pTrxLineId = linRow.getAttribute("TrxLineId").toString ();

    If (vo.getFetchedRowCount () == 0) {}
    vo.setMaxFetchSize (0);
    // }

    VO. Last();
    VO. Next();
    Line = vo.createRow ();
    row.setAttribute ("TrxLineId", pTrxLineId);
    vo.insertRow (row);
    row.setNewRowState (Row.STATUS_INITIALIZED);
    }

    OK, I'll share my latest code using other

    public void createTransaction() {}

    OAViewObjectImpl vo = getXXSiteHeaderVO1();

    If (! vo.isPreparedForExecution ()) {}

    vo.executeQuery ();

    }

    If (vo.getFetchedRowCount () == 0)

    {

    vo.setMaxFetchSize (0);

    }

    String status = "incomplete."

    OADBTransaction txn = (OADBTransaction) getOADBTransaction ();

    • oracle.jbo.domain.Date currentDate = txn.getCurrentUserDate ();

    Line = vo.createRow ();

    row.setAttribute ("TrxStatus", status);

    1. row.setAttribute ("TrxDate", currentDate);

    vo.insertRow (row);

    row.setNewRowState (Row.STATUS_INITIALIZED);

    }

    {} public void addLine (String pTrxHeeaderId)

    OAViewObject vo = (OAViewObject) this.getXXSiteTrxVL1 () .getDestination ();

    VO. Last();

    VO. Next();

    Line = vo.createRow ();

    int linNum = vo.getFetchedRowCount () + 1;

    row.setAttribute ("TrxHeaderId", pTrxHeeaderId);

    row.setAttribute ("LineNum", String.valueOf (linNum));

    row.setAttribute ("SelectLineFlag", "Y");

    vo.insertRow (row);

    row.setNewRowState (Row.STATUS_INITIALIZED);

    }

    Public Sub getTrxLot()

    {

    LinVo OAViewObject = (OAViewObject) this.getXXSiteTrxVL1 () .getDestination ();

    Line linRow = linVo.getFirstFilteredRow ("SelectLineFlag", "Y");

    String pTrxLineId = linRow.getAttribute("TrxLineId").toString ();

    linVo.setCurrentRow (linRow);

    OAViewObject vo = (OAViewObject) this.getXXSiteLineLotsVL1 () .getDestination ();

    }

    Public Sub addTrxLot()

    {

    LinVo OAViewObject = (OAViewObject) this.getXXSiteTrxVL1 () .getDestination ();

    Line linRow = linVo.getFirstFilteredRow ("SelectLineFlag", "Y");

    String pTrxLineId = linRow.getAttribute("TrxLineId").toString ();

    linVo.setCurrentRow (linRow);

    OAViewObject vo = (OAViewObject) this.getXXSiteLineLotsVL1 () .getDestination ();

    VO. Last();

    VO. Next();

    Line = vo.createRow ();

    row.setAttribute ("TrxLineId", pTrxLineId);

    row.setAttribute ("RowKey", new oracle.jbo.domain.Number (1));

    vo.insertRow (row);

    row.setNewRowState (Row.STATUS_INITIALIZED);

    }

  • Problem with the Paging in VO tuning range

    Hi all

    I am having some problems with the Range Paging in VO tuning. My VO questions about 5000 + lines. So I'm going to the range of paging that is the recommended method for managing large data. Here I must also get the current row of the table (which shows the desired result). But when I use the getCurrentRow() method, it results in a value zero. Why this happens?

    code
    FacesContext fc = FacesContext.getCurrentInstance ();
    Object returnObject1 = null, fc.getELContext () .getELResolver () .getValue (fc.getELContext (), "links");
    DCBindingContainer bindingsIte = returnObject1 (DCBindingContainer);
    DCIteratorBinding dciter = bindingsIte.findIteratorBinding("ClientsVO1Iterator");
    Line rowClient = dciter.getCurrentRow ();
    String sDisposaltype = rowClient.getAttribute("DividendDispType").toString ();

    This method works very well with the scrollable access mode.
    Is there a special way to get the current line with the range Paging?

    Thank you
    Danesh

    Danesh,

    I have not checked this version or the most recent 11.1.2.1, but in 11.1.1.4, we had this problem and we use workaround:
    1. remove the current selectionlistener in the table (#{... makecurrent}).
    2. set a new headset selection (using the small arrow to the right) in a bean of your choice. The scope of the bean must be seen or pageflow depending on where you need access to the selected line.
    3. in the new selectionListener you get the selected line of the event, get the key in the line and store in an attribute of bean
    4. to the point you need the selected line, you use the stored line button and work with that. If you need attributes from the line you must ask for the line, once again, that you only the key. In our case only pass us the key to a service in the module of the application method, so this works very well for us.

    Here is an example of such a selection listener

        public void singleSelectionListener(SelectionEvent selectionEvent)
        {
            RowKeySet rksAdd = selectionEvent.getAddedSet();
            if (rksAdd.isEmpty())
                return;  // no selection
    
            Object[] it = rksAdd.toArray();
            // as this is for single selection there should only be one, but...
            for (Object obj: (List) it[0])
            {
                mLogger.fine("Selected :" + obj);  // log selected row
                Key k = (Key) obj;   // the object is the row key
                Object[] kv = k.getKeyValues();  // get the key value for later
                // strore the key value in a bean attribute
                mLastSelectedOID = (Integer) kv[0]; // store the key value (if the key has multiple parts you need to store them all)
            }
        }
    

    Timo

  • Problems with matrix

    Hi all

    I have some problems with the transformation matrices.

    matrix.jpg

    To test this, I use a matrix to identity as shown below:

    <? XML version = "1.0" encoding = "utf-8"? >

    " < = xmlns:fx s:Application ' http://ns.Adobe.com/MXML/2009 "

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" minHeight

    creationComplete = "init_app ()" >

    < fx:Script >

    <! [CDATA]

    Import 12345678910111213import;

    import flash.display.BitmapData;

    internal function init_app (): void {}

    larg_start. Text = image.width.toString ();

    alt_start. Text = image.height.toString ();

    var bd:Bitmap = Bitmap (image.content);

    var m:Matrix new matrix());

    m.Identity ();

    m.Rotate (0);

    m.Scale (1,1);

    m.TX = 0;

    m.Ty = 0;

    var bd2:BitmapData = new BitmapData (image.content.height, image.content.width);

    BD2. Draw (bd, m);

    var bitmap: Bitmap = new Bitmap (bd2);

    Image2.source = bitmap;

    larg_stop. Text = image2.width.toString ();

    alt_stop. Text = image2.height.toString ();

    }

    []] >

    < / fx:Script >

    "< mx:Image id ="image"="56"x ="105"source="file:/D:/Malletto/Sistema/Desktop/eolico1.jpg "width ="217"height ="290"/ >

    < s:Label = "60" x y = '492' text = 'Start W:' / >

    < s:Label id = "larg_start" x = "173" y = "492" / >

    < s:Label = "60" x = "526" text = "Start H:" / >

    < s:Label id = "alt_start" x = "173" y = "526" / >

    < s:Label "411" = x y = '492' text = 'Stop W:' / >

    < s:Label id = "larg_stop" x = "540" y = "492" / >

    < s:Label "411" = x y = "526" text = "Stop H:" / >

    < s:Label id = "alt_stop" x = "540" y = "526" / >

    < mx:Image id = "image2" x = "411" y = "96" width = "217" height = "310" / >

    < / s:Application >

    Why does not work? :-(

    Please help... any help will be appreciated!

    var bd2:BitmapData = new BitmapData (image.content.width,

    image. Content.Height);

  • problem with resizing and remove

    I have a problem with resizing images after loading, not all of the images has the scale ratio 0.75... so for the most part, I just stretch the images having the ratio...

    is there a good method of resizing/scalling? for example enjoyed.

    and once I've loaded images, I add in the imageContainer.

    I couldn't find a way, if I click on the next thumbnail, she remove the last child (image) of the imageContainer...

    I'm confuse ATM please point me in the right direction...

    Thank you

    Load the image clicked

    function mouseClickThumb (e: Event): void {}

    var thumb: thumbnail2 = e.target as thumbnail2;

    var linkName:String = e.currentTarget.name.toString (); get the name of the link

    var imageLoader:Loader = new Loader();

    var urlRequest:URLRequest = new URLRequest (linkName);

    imageLoader.load (urlRequest);

    imageLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, imageLoaded);

    function imageLoaded(e:Event):void {}

    var image: Bitmap = (e.target.content) Bitmap image;

    image.x = 0;

    image.y = 0;

    somehow if I resized the images here, it didn't turn right for all...

         }

    imageContainer.addChild (imageLoader);  / / How can I delete the last image? if click on the following icon?

    }

    If you want to remove the last (highest in the display list) child of a container, you can do this way:

    var numChild = imageContainer.numChildren ();

    imageContainer.removeChildAt (numChild - 1);

    don't forget display lists starts with 0, not 1, so you must always subtract 1 to get the level number of the child in the foreground

  • Problem with TextConverter.importToFlow

    Hello!

    I am better thanks to Richard's first response on my first post. And now format and applying the format is no longer a problem for me !

    But now I have a little problem with the TextConverter.importToFlow

    The goal: a user create his own text editing and pasting and changing the style. Can he save it. I have therefore to convert my textflow into an xml file and save an XML file.

    Then open this file. So I have to convert the xml into a TextFlow type to display it in my AIR application.

    My XML: (details)

    < Note >
    " < TextFlow columnCount ="inherit"columnGap ="inherit"columnWidth ="inherit"lineBreak ="inherit"paddingBottom ="inherit"paddingLeft ="inherit"paddingRight ="inherit"paddingTop ="inherit"verticalAlign ="inherit"whiteSpaceCollapse ="preserve"xmlns =" http://ns.Adobe.com/TextLayout/2008 ">
    < p >

    < span > any animal (including human) who just ate expense in the hours following a </span > energy
    < span textDecoration = "highlight" > important dedicated </span >
    < span > a stomach digestion. </span >
    < /p >
    < / TextFlow >
    < / note >

    My problem is:

    I don't know why, but I can't do

    myXML.TextFlow

    or

    myXML.child ("TextFlow").

    A mix of error appears (null reference).

    ' After a few tries, I found that xmlns = " http://ns.Adobe.com/TextLayout/2008 "Argument of TextFlow is the source of the error of compil. "

    But I must give only the < TextFlow > tag to the importToFlow of the method without the note <>. What am I supposed to do? I can't access the tag < TextFlow >...

    public void updateDetails (details: XML): void
    {
    If (details! = null)
    {
    var loadTextFlow:TextFlow is TextConverter.importToFlow (details.toString (), TextConverter.TEXT_LAYOUT_FORMAT);.
    _textFlow = loadTextFlow;
    _textFlow.interactionManager = new EditManager (new UndoManager());
    _textFlow.interactionManager.selectRange (0,0);
    _textFlow.flowComposer.updateAllControllers ();
    _textFlow.interactionManager.SetFocus ();
    }
    }

    Thank you for your help

    It works:

    static public const = noteXML:XML
          http://ns.Adobe.com/TextLayout/2008">
           

    Any animal (including human) who just ate expense in the hours following an energy
              important dedicated
              a stomach digestion.
           


         
      
               
    private void importIt (): TextFlow
    {
    var textFlowXML:XML = noteXML... *: TextFlow [0];
    var textFlow:TextFlow = TextConverter.importToFlow (textFlowXML, TextConverter.TEXT_LAYOUT_FORMAT);
    return textFlow;
    }

    Can read the E4X docs if you plan do a lot of handling XML. Here is a good starting point:

    http://help.Adobe.com/en_US/AS3LCR/Flash_10.0/XML.html

    Could be added - it is a matter of namespace - it seems it should be simpler that what I wrote above, but I was not able to simplify.

    Hope that helps,

    Richard

  • problems with, phone, 6, Bluetooth kit, Nissan, after update, for, Rios, 1.0.2

    After the update to ios 10.0.2 - trying to use bluetooth to call my vehicle, it says: "this article is not in your phone book." How can I solve this problem?

    Greetings, joybelino1!

    Thank you for joining the communities Support from Apple! I can't wait to see that you are having problems with your Bluetooth in your car! The good news is that Apple has a great article that will help you with measures to try to resolve the problem. Read this article to gethelp to connect your iPhone, iPad, or iPod touch with your car radio. Even though he talks about problems with the connection, it also has the steps for other questions you may have once connected.

    If you use Bluetooth

    1. Consult the user manual of your car stereo to get the procedure to a Bluetooth device.
    2. On your iOS device, drag up to open Control Center, then press ontwice to turn on Bluetooth and turn it back on.
    3. Restart your iOS device.
    4. On your iOS device, Cancel the twinning of your car radio. On the screen of your car désapparier your iOS device and any other device. Restart your car and your iOS device, then pair and connect again.
    5. Update your iOS device.
    6. Install the updates to the firmware of your car radio.
    7. If you still not connect, contact Apple technical support.

    Have a great day!

  • Anyone having problems with WiFi connectivity after upgrade to Sierra?

    I was wondering if anyone else knows issues with WiFi connectivity since the upgrade to Sierra 10.12? I have not had any problems with connectivity WiFi previously on El Capitan. Now I have regular randomly loose connectivity. My internet is cable and when it is connected I have a 100% connection. My details of iMac and I have used only 10% of my storage.

    No problem with my iphone 6.

    Hello AspDesigns,

    I understand that, since the upgrade to Mac OS Sierra, your Mac seems to have trouble staying connected to Wi - Fi. Fortunately the diagnosis built-in wireless can help identify the source of so much trouble.

    Search for Wi - Fi using your Mac problems

    See you soon!

  • Problems with mail after switching to macOS Sierra

    Hey all

    After having recently upgraded to macOS Sierra, I am unable to read my mail.

    I get the following error every time I check on "Get Mail".

    There may be a problem with the mail server or the network. Check the account settings "*" or try again.

    The server returned the error: Mail could not connect to the server 'pop1.tribcsp.com' using SSL on the default ports. Verify that this server supports SSL and that your account settings are correct.

    What does this error message mean and how can I solve this problem.

    Thank you

    Hi Michael,

    I see your message that you get an error in the mail indicating that there is a problem with the mail server or the network.  To help get this problem resolved, I suggest that you follow the steps below:

    If mail refers to a problem with the mail server, or the network

    Mail will say that it is impossible to connect due to a problem with the mail server or the network. For example, the message may refer to a connection that has expired, or too many simultaneous connections:

    If you are connected to the Internet, but the connection has expired, your email provider might be affected by a discontinuance of service. Contact them or see their status Web page to ensure that their e-mail service is online. Examples of status pages:

    If the message indicates the number of simultaneous connections, too many of your devices is check your e-mail account at the same time. Quit Mail on one or more of your other devices.

    If you are still unable to send or receive e-mails

    1. Make sure that you have installed latest version of the Mac software updates, especially if the problem occurred immediately after the installation of a previous update.
    2. In OS X El Capitan or later version, you can see a status icon and the short error message in the upper right of the Mail window, under the search box. The message may indicate 'Network offline' or 'Connection failed', for example. Click the message to see more details on the issue.
    3. Check your connection to the Mail connection doctor. It might be able to say more on the issue.

    If you cannot send or receive e-mail on your Mac.

    Take care.

  • iMac 27 "mid-2011 - Intermittent problem with CPU fan running at full speed and sleep mode.

    Hello!

    My iMac 27 "has an intermittent problem with the CPU fan runs at full speed. Sometimes it happens at the time when I start it, sometimes only in my session, and sometimes only after a certain time. So does seem to be a problem of "heating".

    Second issue is with the mode 'sleep'. It may occur also at any time, at the start of the iMac, session, or after a certain time. But once he starts to go in mode 'sleep', when I wake up, it goes right back in mode after a few seconds and that it will continue indefinitely until I restart the computer.

    What could be?

    Please help me!

    4ntoine

    Here is my model of iMac:

    iMac 27 "mid-2011 model 12.2

    Intel Core i7 3.4 GHz

    AMD Radeon HD 6970M 1024 MB

    OS X El Capitan 10.11.6
    SMC 1.72f2

    Boot ROM IM121.0047.B23

    reset the SMC

    Reset the management system (SCM) controller on your Mac - Apple Support

Maybe you are looking for

  • Tips to add a VPN router to my current network configuration

    Dear all My apologies if the answer to this question already exists, however, I searched in many situations and none seem to match what I'm after. I currently have an ISP modem/router in Bridge mode connected to a TC of Apple which is my wireless rou

  • Plot of vs - time - value

    Hi all I have a problem with the graphic calculator function on the latest version of the numbers. My goal to get a value vs. time curve to show a (potential) relationship between a fluctuation in the value in the time of the day. The problem is that

  • Do not connect?

    I tried all the stupid solutions here.I'm not running ANY security software. I have no need, so please do not ask me to remove it or disable it.I'm not running Windows Firewall, however; Having never been, I had problems with WF and Skype. Everything

  • Expression of the user to specify the file

    When editing the Source of the property loader tab there is an option for "Expression user to specify a file. That's what I want to build: 'C:\_views\AutomatedTests\' + FileGlobals.BoardType + '.txt '. How would this make up one in a usable expressio

  • Using PLX9054 PCI resource conflict

    We use a PLX9054 PCI chip in our designs PXI. We found that for some computers, only four modules can be used by PCI bus segment - the fifth module indicates a resource conflict. Looking at the use of detailed resources, it seems not be conflict in t