Back to index

im-sdk  12.3.91
Classes | Public Member Functions | Static Package Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
sun.awt.im.iiimp.PCE Class Reference

Primary Composition Editor - configurable Light Weight Engine which accept LWESyntax as it's composition rule. More...

Collaboration diagram for sun.awt.im.iiimp.PCE:
Collaboration graph
[legend]

List of all members.

Classes

class  SyntaxOnOff

Public Member Functions

void dispatchEvent (IIIMEvent e)
String getName ()
IIIMEvent[] getTriggerEvent ()
IIIMEvent[] getTriggerOffEvent ()
String[] getEngineSctipt ()
 PCE ()
 Manager will create the instance of this class with default LWESyntax.
void pushSyntax (LWESyntax syntax)
LWESyntax popSyntax ()
Locale[] getSupportLocales ()
void dispatchEvent (IIIMEvent e)
String getName ()
IIIMEvent[] getTriggerEvent ()
IIIMEvent[] getTriggerOffEvent ()
String[] getEngineSctipt ()
 PCE ()
 Manager will create the instance of this class with default LWESyntax.
void pushSyntax (LWESyntax syntax)
LWESyntax popSyntax ()
Locale[] getSupportLocales ()

Static Package Attributes

static IIIMEvent[] triggerOffs

Private Member Functions

void debug (String str)
void debug (String str)

Static Private Member Functions

static void setupTriggerEvents ()
static IIIMEvent[] makeIIIMEvents (String triggers)
static void setupTriggerEvents ()
static IIIMEvent[] makeIIIMEvents (String triggers)

Private Attributes

Stack syntaxStack
Hashtable icTable
LWESyntax syntax

Static Private Attributes

static final String defaultTrigger = "key<Control+P>"
static IIIMEvent[] triggerOns
static boolean initTrigger = false

Detailed Description

Primary Composition Editor - configurable Light Weight Engine which accept LWESyntax as it's composition rule.

Definition at line 62 of file PCE.java.


Constructor & Destructor Documentation

Manager will create the instance of this class with default LWESyntax.

Definition at line 156 of file PCE.java.

                 {
       syntaxStack = new Stack();
       icTable = new Hashtable();
       if (!initTrigger) {
           setupTriggerEvents();
       }
    }

Here is the call graph for this function:

Manager will create the instance of this class with default LWESyntax.

Definition at line 156 of file PCE.java.

                 {
       syntaxStack = new Stack();
       icTable = new Hashtable();
       if (!initTrigger) {
           setupTriggerEvents();
       }
    }

Here is the call graph for this function:


Member Function Documentation

void sun.awt.im.iiimp.PCE.debug ( String  str) [inline, private]

Definition at line 287 of file PCE.java.

                                   {
       if (Manager.DEBUG) {
           System.err.println(str);
       }
    }

Here is the caller graph for this function:

void sun.awt.im.iiimp.PCE.debug ( String  str) [inline, private]

Definition at line 287 of file PCE.java.

                                   {
       if (Manager.DEBUG) {
           System.err.println(str);
       }
    }
void sun.awt.im.iiimp.PCE.dispatchEvent ( IIIMEvent  e) [inline]

Definition at line 68 of file PCE.java.

                                           {

       SyntaxOnOff syntaxOnOff = null;

       InputContext ic = getInputContext();
       if (ic == null) {
           return;
       }
       
       if (icTable.size() == 0) {
           syntax = (LWESyntax)syntaxStack.peek();
           if (syntax == null) {
              return;
           }
           syntaxOnOff = new SyntaxOnOff(syntax);
           icTable.put(ic, syntaxOnOff);
       } else {
           if (icTable.containsKey(ic)) {
              syntaxOnOff = (SyntaxOnOff)icTable.get(ic);
           } else {
              syntax = syntax.getCopy();
              syntaxOnOff = new SyntaxOnOff(syntax);
              icTable.put(ic, syntaxOnOff);
           }
       }

       if (!syntaxOnOff.willProcess(e)) {
           // Conversion Off Mode
           return;
       }
       if (e.isConsumed()) {
           // This e is trigger key
           return;
       }

       IIIMEvent[] events = null;
       try {
           events = syntax.getEventList(e);
       } catch(InvalidSyntaxException ex) {
           if (Manager.DEBUG) {
              ex.printStackTrace();
           }
       }

       e.consume();
       
       if (events != null) {
           for (int i = 0; i < events.length; i++) {
              markProcessedUpperListener(events[i], this);
              int id = events[i].getID();
              switch(id) {
                case IIIMEvent.ACTION:
                  debug(" action = " + ((IIIMActionEvent)events[i]).getAction());
                  dispatchActionEvent((IIIMActionEvent)events[i]);
                  break;
                case IIIMEvent.COMMITTED:
                  dispatchCommittedEvent((IIIMCommittedEvent)events[i]);
                  break;
                case IIIMEvent.PREEDIT:
                  dispatchPreeditEvent((IIIMPreeditEvent)events[i]);
                  break;
                default:
                  debug(" LWESyntax procudes unknown event...");
              }
           }
       }
    }

Here is the call graph for this function:

void sun.awt.im.iiimp.PCE.dispatchEvent ( IIIMEvent  e) [inline]

Definition at line 68 of file PCE.java.

                                           {

       SyntaxOnOff syntaxOnOff = null;

       InputContext ic = getInputContext();
       if (ic == null) {
           return;
       }
       
       if (icTable.size() == 0) {
           syntax = (LWESyntax)syntaxStack.peek();
           if (syntax == null) {
              return;
           }
           syntaxOnOff = new SyntaxOnOff(syntax);
           icTable.put(ic, syntaxOnOff);
       } else {
           if (icTable.containsKey(ic)) {
              syntaxOnOff = (SyntaxOnOff)icTable.get(ic);
           } else {
              syntax = syntax.getCopy();
              syntaxOnOff = new SyntaxOnOff(syntax);
              icTable.put(ic, syntaxOnOff);
           }
       }

       if (!syntaxOnOff.willProcess(e)) {
           // Conversion Off Mode
           return;
       }
       if (e.isConsumed()) {
           // This e is trigger key
           return;
       }

       IIIMEvent[] events = null;
       try {
           events = syntax.getEventList(e);
       } catch(InvalidSyntaxException ex) {
           if (Manager.DEBUG) {
              ex.printStackTrace();
           }
       }

       e.consume();
       
       if (events != null) {
           for (int i = 0; i < events.length; i++) {
              markProcessedUpperListener(events[i], this);
              int id = events[i].getID();
              switch(id) {
                case IIIMEvent.ACTION:
                  debug(" action = " + ((IIIMActionEvent)events[i]).getAction());
                  dispatchActionEvent((IIIMActionEvent)events[i]);
                  break;
                case IIIMEvent.COMMITTED:
                  dispatchCommittedEvent((IIIMCommittedEvent)events[i]);
                  break;
                case IIIMEvent.PREEDIT:
                  dispatchPreeditEvent((IIIMPreeditEvent)events[i]);
                  break;
                default:
                  debug(" LWESyntax procudes unknown event...");
              }
           }
       }
    }

Here is the call graph for this function:

String [] sun.awt.im.iiimp.PCE.getEngineSctipt ( ) [inline]

Definition at line 148 of file PCE.java.

                                      {
       return new String[] {"Japanese", "Chinese"};
    }
String [] sun.awt.im.iiimp.PCE.getEngineSctipt ( ) [inline]

Definition at line 148 of file PCE.java.

                                      {
       return new String[] {"Japanese", "Chinese"};
    }
String sun.awt.im.iiimp.PCE.getName ( ) [inline]

Definition at line 136 of file PCE.java.

                            {
       return "PCE";
    }
String sun.awt.im.iiimp.PCE.getName ( ) [inline]

Definition at line 136 of file PCE.java.

                            {
       return "PCE";
    }

Definition at line 283 of file PCE.java.

                                        {
       return null;
    }

Definition at line 283 of file PCE.java.

                                        {
       return null;
    }
IIIMEvent [] sun.awt.im.iiimp.PCE.getTriggerEvent ( ) [inline]

Definition at line 140 of file PCE.java.

                                         {
       return triggerOns;
    }
IIIMEvent [] sun.awt.im.iiimp.PCE.getTriggerEvent ( ) [inline]

Definition at line 140 of file PCE.java.

                                         {
       return triggerOns;
    }
IIIMEvent [] sun.awt.im.iiimp.PCE.getTriggerOffEvent ( ) [inline]

Definition at line 144 of file PCE.java.

                                            {
       return triggerOffs;
    }
IIIMEvent [] sun.awt.im.iiimp.PCE.getTriggerOffEvent ( ) [inline]

Definition at line 144 of file PCE.java.

                                            {
       return triggerOffs;
    }
static IIIMEvent [] sun.awt.im.iiimp.PCE.makeIIIMEvents ( String  triggers) [inline, static, private]

Definition at line 209 of file PCE.java.

                                                               {
       StringTokenizer ston = new StringTokenizer(triggers, ",:");
       Vector vector = new Vector();
       while(ston.hasMoreTokens()) {
           String trigger = ston.nextToken();
           int lastIndex = trigger.lastIndexOf('>');
           if (lastIndex < 4)
              // ignore wrong representation
              continue;
           if (trigger.startsWith("key<")) {
              String key = trigger.substring(4, lastIndex);
              vector.add(new IIIMKeyEvent(key));
           } else if (trigger.startsWith("action<")) {
              if (lastIndex <= 7)
                  continue;
              String action = trigger.substring(7, lastIndex);
              vector.add(new IIIMActionEvent(action));
           }
       }
       IIIMEvent[] iea = new IIIMEvent[vector.size()];
       for (int i = 0; i < iea.length; i++) {
           iea[i] = (IIIMEvent)vector.elementAt(i);
       }
       return iea;
    }

Here is the caller graph for this function:

static IIIMEvent [] sun.awt.im.iiimp.PCE.makeIIIMEvents ( String  triggers) [inline, static, private]

Definition at line 209 of file PCE.java.

                                                               {
       StringTokenizer ston = new StringTokenizer(triggers, ",:");
       Vector vector = new Vector();
       while(ston.hasMoreTokens()) {
           String trigger = ston.nextToken();
           int lastIndex = trigger.lastIndexOf('>');
           if (lastIndex < 4)
              // ignore wrong representation
              continue;
           if (trigger.startsWith("key<")) {
              String key = trigger.substring(4, lastIndex);
              vector.add(new IIIMKeyEvent(key));
           } else if (trigger.startsWith("action<")) {
              if (lastIndex <= 7)
                  continue;
              String action = trigger.substring(7, lastIndex);
              vector.add(new IIIMActionEvent(action));
           }
       }
       IIIMEvent[] iea = new IIIMEvent[vector.size()];
       for (int i = 0; i < iea.length; i++) {
           iea[i] = (IIIMEvent)vector.elementAt(i);
       }
       return iea;
    }

Definition at line 169 of file PCE.java.

                                 {
       LWESyntax syntax = (LWESyntax)syntaxStack.pop();

       return syntax;
    }

Definition at line 169 of file PCE.java.

                                 {
       LWESyntax syntax = (LWESyntax)syntaxStack.pop();

       return syntax;
    }
void sun.awt.im.iiimp.PCE.pushSyntax ( LWESyntax  syntax) [inline]

Definition at line 164 of file PCE.java.

                                             {
       syntaxStack.push(syntax);
       icTable.clear();
    }
void sun.awt.im.iiimp.PCE.pushSyntax ( LWESyntax  syntax) [inline]

Definition at line 164 of file PCE.java.

                                             {
       syntaxStack.push(syntax);
       icTable.clear();
    }

Here is the caller graph for this function:

static void sun.awt.im.iiimp.PCE.setupTriggerEvents ( ) [inline, static, private]

Definition at line 186 of file PCE.java.

                                             {
       initTrigger = true;

       String trigger =
           Manager.getProperty("iiimf.pce.trigger", defaultTrigger);
       String triggerOn =
           Manager.getProperty("iiimf.pce.trigger.on", defaultTrigger);
       String triggerOff
           = Manager.getProperty("iiimf.pce.trigger.off", defaultTrigger);
       
       String onString = trigger.equals(triggerOn) ?
           trigger : trigger + "," + triggerOn;
       triggerOns = makeIIIMEvents(onString);

       if (triggerOn.equals(triggerOff)) {
           triggerOffs = triggerOns;
       } else {
           String offString = trigger.equals(triggerOff) ?
              trigger : trigger + "," + triggerOff;
           triggerOffs = makeIIIMEvents(offString);
       }
    }

Here is the call graph for this function:

static void sun.awt.im.iiimp.PCE.setupTriggerEvents ( ) [inline, static, private]

Definition at line 186 of file PCE.java.

                                             {
       initTrigger = true;

       String trigger =
           Manager.getProperty("iiimf.pce.trigger", defaultTrigger);
       String triggerOn =
           Manager.getProperty("iiimf.pce.trigger.on", defaultTrigger);
       String triggerOff
           = Manager.getProperty("iiimf.pce.trigger.off", defaultTrigger);
       
       String onString = trigger.equals(triggerOn) ?
           trigger : trigger + "," + triggerOn;
       triggerOns = makeIIIMEvents(onString);

       if (triggerOn.equals(triggerOff)) {
           triggerOffs = triggerOns;
       } else {
           String offString = trigger.equals(triggerOff) ?
              trigger : trigger + "," + triggerOff;
           triggerOffs = makeIIIMEvents(offString);
       }
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

static final String sun.awt.im.iiimp.PCE.defaultTrigger = "key<Control+P>" [static, private]

Definition at line 175 of file PCE.java.

Hashtable sun.awt.im.iiimp.PCE.icTable [private]

Definition at line 65 of file PCE.java.

static boolean sun.awt.im.iiimp.PCE.initTrigger = false [static, private]

Definition at line 177 of file PCE.java.

Definition at line 66 of file PCE.java.

Definition at line 64 of file PCE.java.

IIIMEvent [] sun.awt.im.iiimp.PCE.triggerOffs [static, package]

Definition at line 176 of file PCE.java.

IIIMEvent [] sun.awt.im.iiimp.PCE.triggerOns [static, private]

Definition at line 176 of file PCE.java.


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