Source code: normal/packetui/PacketInfoUI.java
1
2 /**************************************************************************
3 * *
4 * Regina - A normal surface theory calculator *
5 * Java user interface *
6 * *
7 * Copyright (c) 1999-2000, Ben Burton *
8 * For further details contact Ben Burton (benb@acm.org). *
9 * *
10 * This program is free software; you can redistribute it and/or *
11 * modify it under the terms of the GNU General Public License as *
12 * published by the Free Software Foundation; either version 2 of the *
13 * License, or (at your option) any later version. *
14 * *
15 * This program is distributed in the hope that it will be useful, but *
16 * WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
18 * General Public License for more details. *
19 * *
20 * You should have received a copy of the GNU General Public *
21 * License along with this program; if not, write to the Free *
22 * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
23 * MA 02111-1307, USA. *
24 * *
25 **************************************************************************/
26
27 /* end stub */
28
29 package normal.packetui;
30
31 import java.awt.*;
32
33 /**
34 * An interface through which a user can interact with a specific set of
35 * details for a specific packet.
36 * Several <tt>PacketInfoUI</tt> interfaces may be open for the same
37 * packet simultaneously within a single <tt>PacketUI</tt>.
38 * An example is when a larger <tt>PacketUI</tt>
39 * uses a tabbed pane, each tab containing a single <tt>PacketInfoUI</tt>.
40 * <p>
41 * Only one <tt>PacketInfoUI</tt> within a single <tt>PacketUI</tt>
42 * should be editable at any given time. Preferably, when one such
43 * sub-interface is being edited, the others will blank out their
44 * details and disable editing accordingly until the initial editing has
45 * been cancelled or committed to the engine.
46 * <p>
47 * The parent <tt>PacketUI</tt> should listen to each sub-interface for
48 * <tt>UIHasChangesEvent</tt> events to know when editing has begun on
49 * an interface. It should notify all other sub-interfaces that editing
50 * has begun by calling <tt>editingElsewhere()</tt>, and should notify
51 * them that editing has finished by calling <tt>reflectPacket()</tt>.
52 * <p>
53 * Note however that a sub-interface should only be adjusted or
54 * refreshed when it becomes visible, to save unnecessary calculation.
55 * Thus such calls to <tt>editingElsewhere()</tt> or
56 * <tt>reflectPacket()</tt> should be delayed until the appropriate
57 * sub-interface becomes visible.
58 */
59 public interface PacketInfoUI extends PacketUI {
60 /**
61 * Update this sub-interface to reflect the fact that the corresponding
62 * packet is being edited elsewhere within the same overall
63 * <tt>PacketUI</tt> interface.
64 */
65 public void editingElsewhere();
66 }
67