|
|||||||||
| Home >> All >> normal >> [ packetui overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
normal.packetui
Class DefaultPacketEditor

java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
normal.packetui.DefaultPacketEditor
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, PacketUI, java.io.Serializable
- public abstract class DefaultPacketEditor
- extends javax.swing.JPanel
- implements PacketUI
- extends javax.swing.JPanel
A skeleton PacketUI that is capable of both viewing and editing packets. The decision as to whether packets are allowed to be edited must be made when the constructor is called.
This interface will be an empty panel. Note that some routines from the PacketUI interface are not implemented.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
private boolean |
editor
Is this interface allowed to edit packets? |
private boolean |
hasChanged
Have there been changes to the interface that have not yet been applied to the underlying packet in the engine? |
private boolean |
shouldIgnoreSetChanged
Should we ignore all calls to setChanged()? |
private java.util.Vector |
UIHasChangesListeners
The list of listeners that will receive UIHasChangesEvent events fired by this interface. |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
DefaultPacketEditor(boolean editor)
Creates a new empty panel. |
|
| Method Summary | |
void |
addUIHasChangesListener(UIHasChangesListener l)
Adds the given listener to the list of listeners that will receive UIHasChangesEvent events fired by this interface. |
abstract void |
applyChanges(normal.engine.Engine engine)
Take any changes made in the interface and apply them to the underlying packet. |
void |
cleanUp()
This will be called when the interface is about to be destroyed. |
private void |
fireUIHasChangesEvent()
Sends a UIHasChangesEvent event to all listeners. |
java.awt.Component |
getInterface()
Returns the component that forms the interface through which the user can interact with the packet. |
abstract normal.engine.packet.NPacket |
getPacket()
Returns the individual packet for which we are providing an interface. |
boolean |
hasChanges()
Have changes been made in the interface that have yet to be applied to the underlying packet in the engine? |
void |
ignoreSetChanged(boolean shouldIgnore)
Sets whether to ignore all calls to setChanged() By default such calls will be attended to. |
boolean |
isEditor()
Is this interface capable of editing the packet? |
boolean |
isIgnoringSetChanged()
Determines if all calls to setChanged() are being ignored. |
void |
packetWasChanged(normal.engine.packet.NPacket packet,
PacketUI ui,
java.awt.Frame owner)
This will be called whenever any packet's contents have changed. |
void |
packetWasRenamed(normal.engine.packet.NPacket packet,
PacketUI ui,
java.awt.Frame owner)
This will be called whenever any packet has been renamed. |
abstract void |
reflectPacket()
Update the component to reflect the underlying packet in the engine in its current state. |
void |
removeUIHasChangesListener(UIHasChangesListener l)
Removes the given listener from the list of listeners that will receive UIHasChangesEvent events fired by this interface. |
void |
setChanged(boolean hasChanged)
Sets whether there have been changes to the interface that have not yet been applied to the underlying packet in the engine. |
void |
subtreeHasChanged(normal.engine.packet.NPacket subtree,
PacketUI ui,
java.awt.Frame owner)
This will be called whenever packets have been inserted and/or renamed and/or moved in the given subtree but more specific details about the alterations are not available. |
void |
subtreeToBeDeleted(normal.engine.packet.NPacket packet,
PacketUI ui,
java.awt.Frame owner)
This will be called whenever a packet subtree is about to be deleted. |
void |
subtreeWasInserted(normal.engine.packet.NPacket subtree,
PacketUI ui,
java.awt.Frame owner)
This will be called whenever a packet subtree has been inserted into the overall tree. |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
editor
private boolean editor
- Is this interface allowed to edit packets?
hasChanged
private boolean hasChanged
- Have there been changes to the interface that have not yet been
applied to the underlying packet in the engine?
shouldIgnoreSetChanged
private boolean shouldIgnoreSetChanged
- Should we ignore all calls to setChanged()?
UIHasChangesListeners
private java.util.Vector UIHasChangesListeners
- The list of listeners that will receive
UIHasChangesEvent events fired by this interface.
| Constructor Detail |
DefaultPacketEditor
public DefaultPacketEditor(boolean editor)
- Creates a new empty panel.
| Method Detail |
addUIHasChangesListener
public void addUIHasChangesListener(UIHasChangesListener l)
- Description copied from interface:
PacketUI - Adds the given listener to the list of listeners that will
receive UIHasChangesEvent events fired by this
interface.
Precondition: The given listener is not already in this list.
- Specified by:
addUIHasChangesListenerin interfacePacketUI
removeUIHasChangesListener
public void removeUIHasChangesListener(UIHasChangesListener l)
- Description copied from interface:
PacketUI - Removes the given listener from the list of listeners that will
receive UIHasChangesEvent events fired by this
interface.
Precondition: The given listener is currently in this list.
- Specified by:
removeUIHasChangesListenerin interfacePacketUI
fireUIHasChangesEvent
private void fireUIHasChangesEvent()
- Sends a UIHasChangesEvent event to all listeners.
getPacket
public abstract normal.engine.packet.NPacket getPacket()
- Description copied from interface:
PacketUI - Returns the individual packet for which we are providing an interface.
getInterface
public java.awt.Component getInterface()
- Description copied from interface:
PacketUI - Returns the component that forms the interface through which the user
can interact with the packet.
- Specified by:
getInterfacein interfacePacketUI
reflectPacket
public abstract void reflectPacket()
- Description copied from interface:
PacketUI - Update the component to reflect the underlying packet in the engine
in its current state. This can be used for instance when the
underlying packet has been changed elsewhere.
- Specified by:
reflectPacketin interfacePacketUI
isEditor
public boolean isEditor()
- Description copied from interface:
PacketUI - Is this interface capable of editing the packet?
setChanged
public void setChanged(boolean hasChanged)
- Sets whether there have been changes to the interface that have
not yet been applied to the underlying packet in the engine.
The internal flag that stores this value is set to false
when this interface is initially created.
This routine should be called whenever this status changes; this will handle any necessary consequences such as notifying other components that the status has changed. Note in particular that it will probably need to be called from both reflectPacket() and applyChanges().
If ignoreSetChanged(true) is called, subsequent calls to this routine will do nothing and will be ignored completely until ignoreSetChanged(false) is called. This feature is useful when a component is being updated and various event listeners will call setChanged() when you don't want them to. By default calls to this routine will be attended to.
hasChanges
public boolean hasChanges()
- Description copied from interface:
PacketUI - Have changes been made in the interface that have yet to be
applied to the underlying packet in the engine?
- Specified by:
hasChangesin interfacePacketUI
ignoreSetChanged
public void ignoreSetChanged(boolean shouldIgnore)
- Sets whether to ignore all calls to setChanged()
By default such calls will be attended to.
isIgnoringSetChanged
public boolean isIgnoringSetChanged()
- Determines if all calls to setChanged() are being
ignored.
applyChanges
public abstract void applyChanges(normal.engine.Engine engine)
- Description copied from interface:
PacketUI - Take any changes made in the interface and apply them to the
underlying packet.
- Specified by:
applyChangesin interfacePacketUI
packetWasChanged
public void packetWasChanged(normal.engine.packet.NPacket packet, PacketUI ui, java.awt.Frame owner)
- Description copied from interface:
PacketUI - This will be called whenever any packet's contents have changed.
Often the UI will not be interested unless the packet changed
was the specific packet that this UI is reflecting.
- Specified by:
packetWasChangedin interfacePacketUI
packetWasRenamed
public void packetWasRenamed(normal.engine.packet.NPacket packet, PacketUI ui, java.awt.Frame owner)
- Description copied from interface:
PacketUI - This will be called whenever any packet has been renamed.
Note that the renaming of packets might cause subtreeHasChanged() to be called instead of this routine if specific details are not available.
- Specified by:
packetWasRenamedin interfacePacketUI
subtreeToBeDeleted
public void subtreeToBeDeleted(normal.engine.packet.NPacket packet, PacketUI ui, java.awt.Frame owner)
- Description copied from interface:
PacketUI - This will be called whenever a packet subtree is about to
be deleted. Note that this routine
will only be called using the root packet of that subtree and
will not be called again using its descendants.
The only exception is when the packet in this interface belongs to the subtree to be deleted, in which case this routine will not be called at all and this interface will instead be forcibly closed through other means.
Precondition: The packet in this interface does not belong to the subtree about to be deleted.
- Specified by:
subtreeToBeDeletedin interfacePacketUI
subtreeWasInserted
public void subtreeWasInserted(normal.engine.packet.NPacket subtree, PacketUI ui, java.awt.Frame owner)
- Description copied from interface:
PacketUI - This will be called whenever a packet subtree has been inserted
into the overall tree. Note that this routine will only be
called using the root packet of that subtree and will not be
called again using its descendants.
Note that the insertion of packets might cause subtreeHasChanged() to be called instead of this routine if specific details are not available.
- Specified by:
subtreeWasInsertedin interfacePacketUI
subtreeHasChanged
public void subtreeHasChanged(normal.engine.packet.NPacket subtree, PacketUI ui, java.awt.Frame owner)
- Description copied from interface:
PacketUI - This will be called whenever packets have been inserted and/or
renamed and/or moved in the given subtree but more specific details
about the alterations are not available. Multiple
packets may have been operated upon.
Note that this routine does not cater for packet deletions.
Precondition: The root of the given subtree was not one of the newly inserted packets.
- Specified by:
subtreeHasChangedin interfacePacketUI
cleanUp
public void cleanUp()
- Description copied from interface:
PacketUI - This will be called when the interface is about to be destroyed.
|
|||||||||
| Home >> All >> normal >> [ packetui overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC