Class NetEditorFrame

All Implemented Interfaces:
NetEditorListener, ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
ItlkEditor

public class NetEditorFrame extends JFrame implements NetEditorListener, ActionListener
A Frame for the NetEditor. This class is a good base class to create specific network editor. By default, It constructs all menus needed by the NetEditor and its toolbar.

All actions are handled by this frame. So you can override actionPerformed() to get the control on a menu item or a button. Ex: overriding the 'load' menu item action

 public void actionPerformed(ActionEvent evt) {

   if( evt.getSource() == getFileMenuItem(NetEditorFrame.FILE_LOAD) ) {
     ...
   } else {
     super.actionPerformed(evt);
   }

 }
 

You can also add or remove menu items or toolbar buttons. Here is an example of code that customize the option menu :

  traceMode = NetUtils.createMenuItem("Trace mode",0,0,this);
  editMode = NetUtils.createMenuItem("Edit mode",0,0,this);
  getOptionMenu().add(traceMode,0);
  getOptionMenu().add(editMode,1);
  getOptionMenu().add(new JSeparator(),2);
See Also: