|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--jade.gui.AclGui
The AclGui class extends the Swing JPanel class by adding all the controls required to properly edit/show the fields of an an ACL message compliant to the FIPA 97 specs.
There are basically two ways of using the AclGui class.
.....
AclGui acl;
.....
JFrame agentGui = new JFrame();
agentGui.getContentPane().setLayout(new BorderLayout());
acl = new AclGui();
acl.setEnabled(false);
agentGui.getContentPane().add("West", acl);
.....
Each time a new message is received (assuming the message has been stored
in the msg variable of type ACLMessage)
acl.setMsg(msg);
.....
ACLMessage msg;
.....
JButton b = new JButton("edit");
b.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
msg = AclGui.editMsgInDialog(new ACLMessage("", null);
}
} );
ACLMessage
, Serialized FormInner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
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.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
AclGui(java.awt.Component owner)
Ordinary AclGui constructor. |
Method Summary | |
static ACLMessage |
editMsgInDialog(ACLMessage msg,
java.awt.Frame parent)
Pops up a dialog window including an editing-enabled AclGui panel and displays the specified ACL message in it. |
ACLMessage |
getMsg()
Get the ACL message currently displayed by the AclGui panel |
void |
paint(java.awt.Graphics g)
Paint the AclGui panel |
void |
setEnabled(boolean enabledFlag)
Enables/disables the editability of all the controls in an AclGui panel (default is enabled) |
void |
setMsg(ACLMessage msg)
Displays the specified ACL message into the AclGui panel |
void |
setSenderEnabled(boolean enabledFlag)
Enables/disables the editability of the sender field of an AclGui panel (default is enabled) |
static void |
showMsgInDialog(ACLMessage msg,
java.awt.Frame parent)
Pops up a dialog window including an editing-disabled AclGui panel and displays the specified ACL message in it. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
paramString,
updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public AclGui(java.awt.Component owner)
AclGui
constructor.ACLMessage.ACLMessage(int)
Method Detail |
public void setMsg(ACLMessage msg)
msg
- The ACL message to be displayedgetMsg()
public ACLMessage getMsg()
setMsg(ACLMessage msg)
public void setEnabled(boolean enabledFlag)
enabledFlag
- If true enables editabilitysetSenderEnabled(boolean enabledFlag)
public void setSenderEnabled(boolean enabledFlag)
enabledFlag
- If true enables editabilitysetEnabled(boolean enabledFlag)
public void paint(java.awt.Graphics g)
public static void showMsgInDialog(ACLMessage msg, java.awt.Frame parent)
m
- The ACL message to be displayedparent
- The parent window of the dialog windoweditMsgInDialog(ACLMessage msg, Frame parent)
public static ACLMessage editMsgInDialog(ACLMessage msg, java.awt.Frame parent)
m
- The ACL message to be initially displayedparent
- The parent window of the dialog windowshowMsgInDialog(ACLMessage msg, Frame parent)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |