Handling new Events.

I am curious as to how to go about creating new events. For instance: say I want to create a program that will be used with seismometors (earthquake detection). Each time the little needle starts twitchin' an event is triggered. Obviously there isn't an "EarthquakeEvent" in java. How do I go about creating a new event, assigning such an event, and using it to trigger a new listener? Any suggestions?
Any help would be greatly appreciated.
Eric

I guess my question was really this, how do you link the signal from the seismometor to the event? Creating the EarthquakeEvent class is a matter of extending and coding.. but how do you assign the signalled event as an EarthquakeEvent? IE: How does the computer know that the MouseEvent is triggered by the mouse and not the keyboard? More importantly, how does the programmer tell the computer to distinguish between the two? (The computer obviously must know that the MouseEvent is triggered by IO device in the "mouse-port", and a KeyEvent is triggered from the IO device in the "keyboard-port") So how is it that the programmers of the MouseEvent, and KeyEvent classes (basically) connect the hardware to the software?

Similar Messages

  • Publishing News & Events to business catalyst news and a newsletter

    Hi
    I have a problem that I hope you can advise on.
    We have a school website hosted in business catalyst with news & events, seperate to that we have a weekly newsletter created using word and published as a pdf.  Since going live with the web site I've found that the website news & events are duplicates of information in the weekly newsletter.
    My question is this.  In an effort to stop double handling news & events, is there a simple way of creating news & events once and publishing to both a newsletter and a news item in business catalyst.  I have a creative cloud subscription and hope that one of the many tools in the creative cloud suite will allow this.
    Thanks
    Amanda

    Ok, I can't seem to find a straight answer for this question anywhere online without something else I find contradicting it.
    PLEASE can someone tell me if my clients can edit text and images on Muse sites within Business catalyst, admin?
    Ido not care if it does not revert the changes to the muse application on my mac. I just want my clients to be able to maintain there text and images without contacting me.
    If and when the design needs to be changed on the original muse file, I will simply update the Muse file to correspond with the site online then make the further changes after that.
    I REALLY want to use Muse to create websites for my clients but if they can't update image/text content remotely then It's not going to work for me and 90% of freelance designers.
    Please can someone clear this up for me.
    Nathan

  • Event Handling - New Approach

    Hi,
    I have developed a BSP and implemented the way Brian described in the Apprach 3 of the weblog mentioned below. In the method of new class that handles the server event(method name is same as server event), How do I access the model instance that I used in my BSP?
    BSP Programming: Handling HTMLB Events
    /people/brian.mckellar/blog/2004/07/28/bsp-programming-handling-htmlb-events
    Thanks,
    Suresh

    Brian it's Good Idea to create in Controller Class or creating event handling methods within the model class. But I would like to create s separate class just for Even handling alone, so that I can use wherever I want(in different BSP Applications).
    1.I have created ZCL_EVENT_HANDLER_FORME.
    2.Created Method HANDLE_MYBUTTONCLICK and passed
      event_object as a parameter.
    3. I have ZCL_MY_CONTROLLER and ZCL_MODEL for BSP.
    4. Created instance of ZCL_MODEL and assigned it to the Controller Attribute.
    5. Successfully dispatced the event from DO_HANDLE_EVENT to HANDLE_MYBUTTONCLICK method of CL_EVENT_HANDLER_FORME.
    6. I don't know how to get the reference to the model in
    HANDLE_MYBUTTONCLICK method of CL_EVENT_HANDLER_FORME.
    Am I missing some thing....
    -Suresh

  • Handling new story event

    Hi everybody,
    I'm trying to handle an event for new created stores, I'm using the kNewStorySignalResponderService
    void GTTxtEdtResponder::Respond(ISignalMgr* signalMgr)
              do {
      // Get the service ID from the signal manager
                        ServiceID serviceTrigger = signalMgr->GetServiceID();
      // Take action based on the service ID
                        switch (serviceTrigger.Get())
    case kNewStorySignalResponderService:
    InterfacePtr<INewStorySignalData> data(signalMgr,UseDefaultIID());
        if(data == nil)
           break;
        UIDRef mod = data->GetTextModel();
        if(mod == nil)
            break;
        InterfacePtr<ITextModel> txt(mod,UseDefaultIID());
        if(txt == nil)
            break;
        int len = txt->TotalLength();
    break;
    default:
      break;
              } while (kFalse);
    I keep getting 0 for the length of the text event that when I drag the text it already contains some text.
    what am doing wrong
    Thanks.

    Works as intended.
    The signal is sent as soon as the story is created, before the new/placed text is inserted in a separate step.
    Dirk

  • How create & handle a new event

    Hi guy,
    i've to create and handle a new event.
    how can I do it ? what classes or interfaces have I to extend and create to do it ?
    where can I find something usefull?
    THX

    Please do not cross-post!

  • Is it possible to handle multiple events using Jscript for a button in Apex

    Hi,
    I've application wherein in one of the pages for a button, I need to trigger 2 events as: 1. redirect to a new page upon 'click' of the button
    2. display a set of values on 'mouse over' that button.
    I'm able to handle both separately, but not in one button. I would like to know if there is any limitation in Apex that we cant handle multiple events? Currently I've put a text item near the button, and called the Jscript for mouse over event in that as a temporary workaround. Can someone let me know if this is feasible? If not any other alternative to handle this?
    Thanks in advance,
    gsachidh

    Hi Gsachidh,
    well interesting problem you're facinng. Indeed, it can't be specified using the 'Button Attributes' So we have to come up with an workaround.
    A quick en dirty solution would be to specify it with the 'Optional URL Redirect options'. In a normal button, with processing on same page, this would be 'no target'. but in case of additional things to be done this can be used, using an target URL. I used this many times, in example with popUp windows for refreshing the caller object when changes are made. In your case we have to add next to the href an onmouseover event. this can be done with;
    Target set to => URL
    URL - target => javascript:doSubmit('<button_name>');" onMouseOver="javascript:showTooltip('tooltip');"
    Here the " is the key, letting ApEx know the target (href) is doSubmit('<button_name>'), just like when no target would be specified and adding a new javascript event; onMouseOver.
    Although this is a dirty solution in my opinion, it is the best i could come up with. I have another idea in how to do this, that is by adding this event dynamically with javascript with an addEvent. But i don't have an example at the moment for this scenario.
    Simon
    Message was edited by:
    S1M0N

  • Reg : Cross browser issue while handling LOV event on KeyFlexFeild

    Hi OA Gurus,
    We are encountering issues on R12.0.6, JDev 120Rup6.
    We have the following test case and code changes.
    Requirement:
    We have OA page where we have one KeyFlexFeild item and a normal LOV. Page items are part of one AM and LOV is in another AM.
    The requirement was to make LOV dependent on keyFlexfeild. Test case is mentioned as per following flow.
    1.     User changes cost center segment of Accounting Flex(Key flex) using Cost center LOV.
    2.     Another LOV in the same page should be dependent on new value of cost center as modified in step 1.
    Solution Implemented:
    Describing in the 3 steps
    1) Here the KeyFlexFeild is expense account. Whenever User changes any segment, we handle
    ‘lovValidate’ and ‘lovUpdate’ events on KeyFlexFeild in processFormRequest of controller.
    2) Retrieve the value of cost center segment using getSegmentsQualifiedBy(), Update corresponding VO attribute of the LOV query parameter.
    3) Forward the request to current page so that LOV will have modified value with updated query.
    4) Forwarding to current page is must because LOV is built with another AM and will loaded only when page is built.
    Issue:
    This works fine on internet explorer. When trying to run the same in Mozilla we have following issue
    1) User modifies one of the segments of expense account and make a tab – out
    2) Now the page refresh happens
    3) Now in the same page no other LOV or no other button works. He can’t click on any button for submit or cancel.
    LOVs will not open even after clicking on it.
    Code changes:
    //Step1 – Handle LOV events
    String source = pageContext.getParameter(SOURCE_PARAM);
    String eventType = pageContext.getParameter(EVENT_PARAM);
    if(source !=null && eventType != null) {
    if(source.startsWith("Acct") && eventType.equals("lovUpdate") || eventType.equals("lovValidate") ) {
    KeyFlexfield flex = (KeyFlexfield)lkff.getAttributeValue(OAWebBeanConstants.FLEXFIELD_REFERENCE);
    // Step -2 Updating the corresponding VO attribute for LOV to get the modified the value
    Segment[ ] segmentL = flex.getSegmentsQualifiedBy(FA_COST_CTR");
    CostCenterValue = segmentL[0].getValue().getValue();
    if(CostCenterValue != null ){
    sampleViewObject.getCurrentRow().setAttribute("ToCostCenter",CostCenterValue);
    OAFormValueBean formValueBean = (OAFormValueBean)webBean.findIndexedChildRecursive("ToCostCenter");
    if(formValueBean != null)
    formValueBean.setValue(pageContext, CostCenterValue);
    OAMessageLovInputBean formValueBean1 = (OAMessageLovInputBean)webBean.findIndexedChildRecursive("ReceivingApprover");
    if(formValueBean1 != null)
    formValueBean1.setValue(pageContext, null);
    else
    sampleViewObject.getCurrentRow().setAttribute("ToCostCenter",null);
    //Step 3 – Forward the request Current Page again
    pageContext.setForwardURLToCurrentPage(null, true, ADD_BREAD_CRUMB_YES, (byte)0);
    We have following questions.
    a)     Solution implemented by us is correct ? or we have to implement it in another way ?
    b)     Is OA version mentioned above supported on Mozilla browser version 3.x ? This issue is not occurring on Mozilla 1.x while running from JDev.
    Please let us know if any additional details required.
    Thanks for help in advance.
    Edited by: user774130 on Dec 15, 2009 2:27 AM

    Hi,
    It seems that you have not noticed that this forum is not for posting product-related questions/problems....
    So , this might be the correct forum....
    Java Server Pages (JSP)
    Sim

  • Handling Button Event

    Hi all,
    i am using a 'When-Validate-item' trigger in this i am doing a validation,
    when user try to enter amount greater than the given amount(This is needed validation)
    and also i am regenerating new lines(Creating new records when button pressed)
    when i am regenerating i should not validate.
    How to handle button event
    Thnx
    Raj

    Hi...
    The WHEN-VALIDATE-ITEM Trigger fires once you updated a field. Be sure you raise
    form_trigger_failure when amount is invalid. So, the cursor stays in field amount. You cant
    leave this field until the amount is not valid.

  • StoreEvents always creating new event?

    Hey all,
    Our university recently upgraded to the newest version of the calendar server and so I've been going back to some old code I wrote that should now function correctly. However, I'm having an issue. The part of my program I'm currently dealing with fetches all the unconfirmed appointments from a user's oracle calendar and then asks the user if they would like to accept/decline/ignore those events. It then writes the events back to the server accordingly. However, despite my best efforts, a new appointment is always created rather than the old one being updated to reflect the new participation status.
    Here is an example of an event received from the server:
    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//ORACLE//NONSGML CSDK 9.0.4.2//EN
    BEGIN:VEVENT
    X-ORACLE-IMEETING-SENDEMAILNOTIFICATION:TRUE
    X-ORACLE-EVENTINSTANCE-GUID:I1+611984+101+1+445722372
    X-ORACLE-EVENT-GUID:E1+611984+101+445722372
    X-ORACLE-EVENTTYPE:APPOINTMENT
    UID:20050214T194612Z-95690-65-589f-Oracle
    TRANSP:OPAQUE
    SUMMARY:Unconfirmed Number 1
    STATUS:CONFIRMED
    SEQUENCE:0
    PRIORITY:5
    ORGANIZER;CN=Derek Miller:mailto:[email protected]
    DTSTART:20050214T170000Z
    DTSTAMP:20050221T192636Z
    DTEND:20050214T173000Z
    CREATED:20050214T194612Z
    CLASS:PUBLIC
    ATTENDEE;CUTYPE=INDIVIDUAL;RSVP=FALSE;CN=Derek Miller;PARTSTAT=NEEDS-ACTIO
    N:mailto:[email protected]
    END:VEVENT
    END:VCALENDAR
    And here is what I send back to the server:
    Content-Class: urn:content-classes:calendarmessage
    Content-Type:text/calendar;
    method=REQUEST;
    charset="utf-8"
    Content-Transfer-Encoding: 7bit
    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//ORACLE//NONSGML CSDK 9.0.4.2//EN
    BEGIN:VEVENT
    X-ORACLE-IMEETING-SENDEMAILNOTIFICATION:TRUE
    X-ORACLE-EVENTINSTANCE-GUID:I1+611984+101+1+445722372
    X-ORACLE-EVENT-GUID:E1+611984+101+445722372
    X-ORACLE-EVENTTYPE:APPOINTMENT
    UID:20050214T194612Z-95690-65-589f-Oracle
    TRANSP:OPAQUE
    SUMMARY:Unconfirmed Number 1
    STATUS:CONFIRMED
    SEQUENCE:0
    PRIORITY:5
    ORGANIZER;CN=Derek Miller:mailto:[email protected]
    DTSTART:20050214T170000Z
    DTSTAMP:20050221T192636Z
    DTEND:20050214T173000Z
    CREATED:20050214T194612Z
    CLASS:PUBLIC
    ATTENDEE;CUTYPE=INDIVIDUAL;RSVP=FALSE;CN=Derek Miller;PARTSTAT=ACCEPTED:mailto:[email protected]
    END:VEVENT
    END:VCALENDAR
    The only thing that I see that could be different is that when I fetch the event from the server, there are some strange line breaks in the attendee property which somehow magically disappear in my processing of the string (my function only swaps the NEEDS-ACTION with ACCEPTED so I don't know how those other line breaks go away). But the fact that a new event is created and all the properties are set correctly, I have my doubts as to this being the cause.
    Also, I have tried both the CAPI_FLAG_STORE_MODPROPS and CSDK_FLAG_STORE_MODIFY flags but neither seem to change what happens.
    Anyone see any obvious mistakes that I'm making?
    Thanks in advance!

    Glad to be of help! I wouldn't have known either except for a forum thread a few pages back titled "jni source code available" (or something like that) where one of the replies stated that the CSDK and CAPI handled the UIDs differently. Then I compiled the C example and noticed the UIDs looked very different from the ones I was getting from the Java SDK. Then I used your original post to help figure out what I needed to send back to the server (other than the UID) to get my code to work... so we kind of helped each other! Thanks!
    --Ron D.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Handling button events in large app

    I'm currently examining a large swing app, and have observed the following with regard to action events.
    A number of listeners (for buttons, menu items, JLists etc.) are defined at the top of the app. These variously extend MouseAdapter or implement ActionListener, depending on the type of component whose actions they listen for.
    The ButtonListener definition is as follows :
    private class ButtonListener implements ActionListener
    public void actionPerformed(ActionEvent event)
    Object object = event.getSource();
    if (object == button1)
    // button1 actions
    else
    if (object == button2)
    // button2 actions
    .....etc
    One instance of this listener is created in the app, and is used as the actionlistener for each button. This means that the buttonlistener is quite large (as it contains the code for each button in the app).
    Is this the proper way to handle button events for an app with a large number of buttons?

    Thanks for the responses.
    In response to theDude : I agree that defining the action listener for each button can be useful when you can see the button definition and button action in one place; one could counter that by saying that grouping all the button actions makes it easier to examine all button actions in one place.
    Setting the action command isn't really an option because the application creates panels of buttons on the fly, e.g. when notification of a new customer is received, a new panel is created with a JTextPane (customer description) and a row of buttons for "Modify", "Delete" and "Print".
    Several customer panels could be in existence at the same time, so setting an action command of "Modify" would not enable one to uniquely identify which "Modify" button was pressed.
    This problem is currently handled by associating the panel instance with a "Customer" class instance in a hashtable. The "Customer" class consists of a JTextPane field, and a JButton for each function. When a button is pressed, the button listener traverses up the component's parents until it reaches the panel (i.e. it loops until the parent is a key on the hashtable, at which point it can retrieve the Customer instance and check which button was pressed).
    In response to KPSeal : If I understand you, I would define "ApplicationAction" separately from the main app and define extensions of it in the main app for each type of action. Would this add much value over merely defining a method for each type of action in the main app and just calling this method when the relevant button/menu item was pressed/selected?
    There doesn't seem to be a universal approach to event handling, but I thought there might have been one accepted strategy when an app has large numbers of buttons (some created on the fly, ruling out action commands).

  • Handling keyboard events in applets?! Possible?!

    Hello,
    I wrote a little game that uses keyboard handling events. It is an applet that can also standalone as an application. When i run the program as a standalone application, it handles keyboard inputs fine. ie...i can press the left and right arrow keys and something happens.
    But when i run my program as an applet in a web browser, the applet starts up correctly but does not handle any keyboard events. It only handles mouse events. For instance, if i press the up and down arrow keys, the browser window scrolls up and down!!! And the up and down arrow keys have a specific purpose in my applet.
    QUESTION: how do i get my applet to accept keyboard inputs such as UP,DOWN, LEFT, RIGHT?

    Hmm something went wrong w/ my post so i hope this doesnt show up twice.
    Hey thanks a lot for helping me out. The applet/application is large so here is the main() method and the keyboard event handling class code. My question is how come the keyboard events get properly handled when i run it as a standalone application, but keyboard events go to the browser when i run it as an applet? I would post my entire code but it's over 1000 lines and spread out over 8 files. hehehe.
    Here is main():
      public static void main(String[] args)
          MyProgram applet = new MyProgram();
          applet.isStandalone = true;
          JFrame frame = new JFrame();
          frame.setTitle("Physics: Kinematics");
          frame.getContentPane().add(applet, BorderLayout.CENTER);
          applet.init();                        // initialize the applet inside frame
          applet.addKeyListener(kbHandler);     // kbHandler is a keyboard handling object
          applet.start();
          frame.setSize(APPLETWIDTH,APPLETHEIGHT);
          Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
          frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2);
          frame.setVisible(true);
          // private inner class to terminate the Application when frame closes
          frame.addWindowListener(
            new WindowAdapter()
                public void windowClosing(WindowEvent e)
                    System.exit(0);
          frame.show();
       }"kbHandler" is the keyboard event handling object. It gets initialized in the applet.init() method.
    kbHandler = new BMkeyboardHandler();And here is the keyboard event handling code:
    // ===== keyboard event handler ===========
       private class BMkeyboardHandler implements KeyListener
            public void keyPressed(KeyEvent e)
                pushedKey = e.getKeyCode();
                // General administrative key actions
                if(pushedKey == KE.VK_H)
                    actionArea.toggleHelpMenu();
                    actionArea.repaint();
                else if(pushedKey == KE.VK_C)
                    actionArea.toggleCtrlMenu();
                    actionArea.repaint();
         }So there it is. Again, the program handles events fine as a standalone application. But running it as an applet in a browser (and even the appletviewer) doesnt let me handle keystrokes.

  • How to handle selection event in alv component

    Hi all,
        i am new to webdynpro abap. and i want to know how to handle selection event(such as select all / unselect ) in my simple alv application.
    Thanks very much

    Hi,
    By default when you use the selection mode for the ALV as Multi/Mutli No Lead then this option is enabled.
    Try to implement the event ONLEADSELECT and check wether this event is triggered or not.
    DATA: lo_value type ref to cl_salv_wd_config_table.
        CALL METHOD  lo_value->if_salv_wd_table_settings~set_selection_mode
          EXPORTING
            value = cl_wd_table=>e_selection_mode-multi_no_lead.
    Try to implement these event for ALV and put a break-point and test which event is getting triggered.
    ON_CLICK           
    ON_DATA_CHECK      
    ON_FUNCTION        
    ON_LEAD_SELECT     
    ON_STD_FUNCTION_AFTE
    ON_STD_FUNCTION_BEFO
    Please provide more inputs.
    Regards,
    Lekha.

  • Why is every new event I create automatically made into an all day event?

    Why is every new event I create on iCal automatically made into an all day event?

    Thank you for proving my point brilliantly. For the moment, I shall keep my rantings and the difficulties to myself because you obviously can not handle a bit of user's frustration. Too bad really, that you can not see it as an opportunity to make improvements and be a Hero in the process. I did say that Firefox works much faster, why did you not take that personally as well? ............. Another day, Slick ! ...........

  • How to create a New Event Window Pop up

    The program I want to develop has many layers.  I want to have a menu page, after clicking on one of the buttons, I would like to see data display on the new event pop-up.  I have checked the example : New Event Handler.vi however, it does not work when I put my own subvi into the Event Structure.  Can you tell me what is the property of the subvi that I need to set in order to have it as a pop-up window? 
    Thanks. 
    Ellynn

    Go to the File Menu - VI Properties.  Select Window Appearance in the Category box.  Then click on the Custom radio button and then click the Customize button.  Click on the Show front panel when called checkbox and the Close afterwards if originally closed checkbox.  Click OK.  Now when you call your subvi, it will be displayed and will close when the vi is done.
    - tbob
    Inventor of the WORM Global

  • Event registrati​on refnum breaks when new event added

    I am using dynamic event registration to handle events from my UI in another VI.  Whenever I add a new event, the event registration refnum breaks and I have to recursively go through the code and replace all instances.  Is there a method of passing event registration refnums so that this does not happen?  Should these be made a strict type def?
    Solved!
    Go to Solution.

    Hello,
    I have the same problem, but i have no solution...
    Why it don't works? I added an examble...
    I created a Cluster with an enum an variant. I edit the enum with a second item, then the wire brakes.
    But it is a type def.
    Can anyone help me?
    Attachments:
    Event_Reg_Refnum_main.vi ‏6 KB
    Event_Reg_Refnum_subvi.vi ‏6 KB
    Control 2.ctl ‏4 KB

Maybe you are looking for

  • Fair Usage - but how do you tell??

    Yesterday morning I had an automated email from BT saying that I was up to 80GB d/l for May, and that my speed would be throttled if I went over 100GB. I'm on Option 3, and this is the fair usage policy kicking in. This morning I had another email sa

  • Another update problem

    Received error message for today's update (1/16/13) Bridge update complete Photoshop with errors  Error Code: U44M1P6 What does this mean?

  • HT1338 Migration assistant problems setting up new Macbook pro.... System preferences will not open and Mozilla products do not open "profile missing"???

    Used migration assistant to set up new Macbook pro from old macbook pro. Many "profile" problems. Will not even open "System Preferences" for user whose profile info was transferred. (Will for "Administrator") Cannot use Firefox or Thunderbird, profi

  • Err when Create MM

    Hi all I already create all in Enterprise Structure   follow: OX15 – Define Company OKKP – Define Controlling Area OX02 – Define Company Code OBY6 - Enter Global Parameters for Company Code OX19 - Assign Company Code to Controlling Area OX16 - Assign

  • Restoring iPad 2

    I have a problem after resetting ipad, it stuck with apple logo n after i leave it in few hour its appear "dead", pressing home button doesn't do anything, so i try to connect it to itunes from pc, instead of itunes connected sign on ipad screen it s