View unanswered posts | View active topics It is currently Thu Mar 23, 2017 11:01 pm



Reply to topic  [ 2 posts ] 
 How can I recognize the end of a actitity change? 
Author Message

Joined: Wed Jul 11, 2012 6:20 pm
Posts: 1
Post How can I recognize the end of a actitity change?
Hello,

I have the problem to find out when the change (move,change of starttime/ endtime, ) of a activity is ready.

When I use a ActivityInteractionListener, I cannot find out the end of user action only the beginning.
I would like to store the changed data to database.

Code:
  private class ActivityInteractionListener implements InteractionListener {
        public void interactionOccured(InteractionEvent e) {
            final Object o = e.getInteractor().getInteracted();

            System.out.println("CMD: " +e.getCommand().getValue());
            if (o instanceof ActivityView && e.getSourceEvent() instanceof MouseEvent) {
                final ActivityView actView = (ActivityView) o;
                final DefaultDateArea dateArea = (DefaultDateArea) actView.getContainer();

                JPopupMenu pop = new JPopupMenu();
                final Point p = ((MouseEvent) e.getSourceEvent()).getPoint();
                Object commandValue = e.getCommand().getValue();
                if (DefaultDateArea.AE_POPUP_TRIGGER.equals(commandValue)) {
                    boolean hasTime = actView.getModel().getBaseDateRange().getHasTime();
                    String menuText = hasTime ? "Make All Day Event" : "Make Regular Event";
                    pop.add(menuText).addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            Activity act = ((ActivityView) o).getModel();
                            MutableDateRange dr = act.getDateRangeClone();
                            dr.setHasTime(!dr.getHasTime());

                            try {
                                act.setBaseDateRange(dr.getImmutable());
                            } catch (PropertyVetoException e1) {
                            }

                            monthDateArea.getDateArea().recreateActivityViews();
                            dayDateArea.getDateArea().recreateActivityViews();
                            topDayArea.getDateArea().recreateActivityViews();
                        }
                    });

                    pop.show(actView.getContainer(), p.x, p.y);

                }
        }


Thank you for the helb.

Greetings olaf


Wed Jul 11, 2012 6:36 pm
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: How can I recognize the end of a actitity change?
Hello Olaf,

Please submit a support ticket from migcalendar.com


Wed Jul 11, 2012 6:41 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.