Source code: com/fm/update/fmEvent.java
1 /****************************************************************************
2 * Copyright (c) 2003 Andrew Duka | aduka@users.sourceforge.net
3 * All right reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 ****************************************************************************/
11 package com.fm.update;
12
13 import java.awt.event.ActionEvent;
14
15 /**
16 * FeedMan events class.
17 *
18 * Entities of class represent events which occure during feedMan application
19 * work and supposed to indicate result status of the update/retreive operations.
20 *
21 */
22 public class fmEvent extends ActionEvent
23 {
24 /** Constant for fail status code */
25 public static final int FAIL_STATUS = 0;
26 /** Constant for success status code */
27 public static final int SUCCESS_STATUS = 1;
28
29 /** Constant for retreive start */
30 public static final String RETRIEVE_STARTED = "fm.evt.retr.started";
31 /** Constant for retreive finish */
32 public static final String RETRIEVE_FINISHED = "fm.evt.retr.finished";
33 /** Constant for update start */
34 public static final String UPDATE_STARTED = "fm.evt.update.started";
35 /** Constant for update finish */
36 public static final String UPDATE_FINISHED = "fm.evt.update.finished";
37
38 /** Counter for fmEvents */
39 private static int idSeq = 0;
40 private int status;
41
42
43 /**
44 *
45 * @param source Source object
46 * @param command Command string
47 * @param status indicates that operation defined by the result status of corresponing command
48 * (e.g. if Update operation is failed, it fires
49 * new fmEvent(object, "Update", fmEvent.STATUS_FAILED))
50 */
51 public fmEvent(Object source, String command, int status)
52 {
53 super(source, ++idSeq, command);
54 this.status = status;
55 }
56
57 /**
58 * Return Event status
59 */
60 public int getStatus()
61 {
62 return status;
63 }
64 }