Back to index

wims  3.65+svn20090927
Public Member Functions | Package Attributes
rene.gui.KeyboardPanel Class Reference

This is used as the display panel for the keyboard editor. More...

Inheritance diagram for rene.gui.KeyboardPanel:
Inheritance graph
[legend]
Collaboration diagram for rene.gui.KeyboardPanel:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 KeyboardPanel ()
void setItemEditor (ItemEditor e)
void makeCommandChoice ()
 Build a list of available command keys.
String commandShortcut (int i)
 The the command shortcut number i.
void keyPressed (KeyEvent e)
 Set the key, if one is pressed inside the CharKey textfield.
void keyTyped (KeyEvent e)
void keyReleased (KeyEvent e)
void display (ItemEditorElement e)
 Display this element on the panel.
ItemEditorElement getElement ()
 Create a new keyboard element from the panel entries.
String getName ()
void setName (String s)
void notifyChange (Vector v, int item)
 Test on doublicate keys, and undefine them.
void doAction (String o)
 React on the Default and None buttons.
boolean extra (Vector v)
 User wishes to clear all keyboard definitions.
void newElement ()
void help ()
void itemAction (String o, boolean flag)

Package Attributes

TextField MenuString
TextField ActionName
TextField CharKey
Checkbox Shift
Checkbox Control
Checkbox Alt
String Name = ""
Choice C
ItemEditor E

Detailed Description

This is used as the display panel for the keyboard editor.

It displays information about the selected keyboard item.

Definition at line 23 of file KeyboardPanel.java.


Constructor & Destructor Documentation

Definition at line 31 of file KeyboardPanel.java.

       {      setLayout(new BorderLayout());
              
              Panel center=new Panel();
              center.setLayout(new GridLayout(0,1));
              // the menu item
              center.add(MenuString=new MyTextField("",30));
              MenuString.setEditable(false);
              // the description
              center.add(ActionName=new MyTextField());
              ActionName.setEditable(false);
              // the key
              center.add(CharKey=new MyTextField());
              CharKey.setEditable(false);
              CharKey.addKeyListener(this);
              // modifiers
              center.add(Shift=new Checkbox(Global.name("keyeditor.shift")));
              center.add(Control=new Checkbox(Global.name("keyeditor.control")));
              center.add(Alt=new Checkbox(Global.name("keyeditor.alt")));
              add("Center",center);

              Panel south=new Panel();
              south.setLayout(new BorderLayout());
              Panel c=new Panel();
              // the choice of command keys
              C=new Choice();
              if (Global.NormalFont!=null) C.setFont(Global.NormalFont);
              c.add(C);
              C.add("-------------");
              south.add("Center",c);
              // default and undefine buttons
              Panel buttons=new Panel();
              buttons.add(new ButtonAction(this,
                     Global.name("keyeditor.default"),"Default"));
              buttons.add(new ButtonAction(this,
                     Global.name("keyeditor.none"),"None"));
              south.add("South",buttons);
              add("South",south);
       }

Here is the call graph for this function:


Member Function Documentation

String rene.gui.KeyboardPanel.commandShortcut ( int  i) [inline]

The the command shortcut number i.

Definition at line 91 of file KeyboardPanel.java.

       {      String s="command."+i;
              Enumeration e=E.getElements().elements();
              while (e.hasMoreElements())
              {      KeyboardItem k=(KeyboardItem)e.nextElement();
                     if (k.getMenuString().equals(s))
                     {      return k.shortcut();
                     }
              }
              return "";
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Display this element on the panel.

Reimplemented from rene.dialogs.ItemPanel.

Definition at line 124 of file KeyboardPanel.java.

       {      KeyboardItem k=(KeyboardItem)e;
              Name=k.getName();
              MenuString.setText(k.getMenuString());
              ActionName.setText(k.getActionName());
              CharKey.setText(k.getCharKey());
              MenuString.setText(k.getMenuString());
              Shift.setState(k.isShift());
              Control.setState(k.isControl());
              Alt.setState(k.isAlt());
              C.select(k.getCommandType());
       }

Here is the call graph for this function:

void rene.gui.KeyboardPanel.doAction ( String  o) [inline]

React on the Default and None buttons.

Reimplemented from rene.dialogs.ItemPanel.

Definition at line 177 of file KeyboardPanel.java.

       {      if (o.equals("Default"))
              {      String s=MenuString.getText();
                     KeyboardItem k=new KeyboardItem(s,Global.name("key."+s));
                     CharKey.setText(k.getCharKey());
                     Shift.setState(k.isShift());
                     Control.setState(k.isControl());
                     Alt.setState(k.isAlt());
              }
              else if (o.equals("None"))
              {      CharKey.setText("none");
                     Shift.setState(false);
                     Control.setState(false);
                     Alt.setState(false);
              }
              else super.doAction(o);
       }

Here is the call graph for this function:

boolean rene.gui.KeyboardPanel.extra ( Vector  v) [inline]

User wishes to clear all keyboard definitions.

Reimplemented from rene.dialogs.ItemPanel.

Definition at line 198 of file KeyboardPanel.java.

       {      v.removeAllElements();
              return true;
       }

Create a new keyboard element from the panel entries.

Reimplemented from rene.dialogs.ItemPanel.

Definition at line 140 of file KeyboardPanel.java.

       {      int type=C.getSelectedIndex();
              return new KeyboardItem(CharKey.getText(),
                     MenuString.getText(),ActionName.getText(),
                     Shift.getState(),Control.getState(),Alt.getState(),type);
       }
String rene.gui.KeyboardPanel.getName ( ) [inline]

Reimplemented from rene.dialogs.ItemPanel.

Definition at line 147 of file KeyboardPanel.java.

       {      return Name;
       }
void rene.dialogs.ItemPanel.help ( ) [inline, inherited]

Definition at line 25 of file ItemPanel.java.

       {
       }

Here is the caller graph for this function:

void rene.dialogs.ItemPanel.itemAction ( String  o,
boolean  flag 
) [inline, inherited]

Implements rene.gui.DoActionListener.

Definition at line 31 of file ItemPanel.java.

       {
       }
void rene.gui.KeyboardPanel.keyPressed ( KeyEvent  e) [inline]

Set the key, if one is pressed inside the CharKey textfield.

Definition at line 106 of file KeyboardPanel.java.

       {      Shift.setState(e.isShiftDown());
              Control.setState(e.isControlDown());
              Alt.setState(e.isAltDown());
              CharKey.setText(
                     KeyDictionary.translate(e.getKeyCode()).toLowerCase());
              C.select(0);
       }

Here is the call graph for this function:

void rene.gui.KeyboardPanel.keyReleased ( KeyEvent  e) [inline]

Definition at line 115 of file KeyboardPanel.java.

{}
void rene.gui.KeyboardPanel.keyTyped ( KeyEvent  e) [inline]

Definition at line 114 of file KeyboardPanel.java.

{}

Build a list of available command keys.

Definition at line 78 of file KeyboardPanel.java.

       {      C.removeAll();
              C.add("");
              for (int i=1; i<=5; i++)
              {      String s=commandShortcut(i);
                     C.add(i+": "+s);
              }
              C.select(0);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.dialogs.ItemPanel.newElement ( ) [inline, inherited]

Definition at line 22 of file ItemPanel.java.

       {
       }

Here is the caller graph for this function:

void rene.gui.KeyboardPanel.notifyChange ( Vector  v,
int  item 
) [inline]

Test on doublicate keys, and undefine them.

Reimplemented from rene.dialogs.ItemPanel.

Definition at line 159 of file KeyboardPanel.java.

       {      KeyboardItem changed=(KeyboardItem)v.elementAt(item);
              String descr=changed.keyDescription();
              for (int i=0; i<v.size(); i++)
              {      if (i==item) continue;
                     KeyboardItem k=(KeyboardItem)v.elementAt(i);
                     if (k.keyDescription().equals(descr))
                     {      v.setElementAt(new KeyboardItem(k.getMenuString(),"none"),i);
                     }
              }
              if (changed.getMenuString().startsWith("command."))
              {      makeCommandChoice();
              }
       }

Here is the call graph for this function:

Definition at line 71 of file KeyboardPanel.java.

       {      E=e;
       }

Here is the caller graph for this function:

void rene.gui.KeyboardPanel.setName ( String  s) [inline]

Reimplemented from rene.dialogs.ItemPanel.

Definition at line 151 of file KeyboardPanel.java.

       {      Name=s;
              MenuString.setText(s);
       }

Member Data Documentation

TextField rene.gui.KeyboardPanel.ActionName [package]

Definition at line 25 of file KeyboardPanel.java.

Checkbox rene.gui.KeyboardPanel.Alt [package]

Definition at line 26 of file KeyboardPanel.java.

Choice rene.gui.KeyboardPanel.C [package]

Definition at line 28 of file KeyboardPanel.java.

TextField rene.gui.KeyboardPanel.CharKey [package]

Definition at line 25 of file KeyboardPanel.java.

Checkbox rene.gui.KeyboardPanel.Control [package]

Definition at line 26 of file KeyboardPanel.java.

Definition at line 29 of file KeyboardPanel.java.

TextField rene.gui.KeyboardPanel.MenuString [package]

Definition at line 25 of file KeyboardPanel.java.

String rene.gui.KeyboardPanel.Name = "" [package]

Definition at line 27 of file KeyboardPanel.java.

Checkbox rene.gui.KeyboardPanel.Shift [package]

Definition at line 26 of file KeyboardPanel.java.


The documentation for this class was generated from the following file: