Back to index

im-sdk  12.3.91
Public Member Functions | Package Functions | Private Member Functions | Private Attributes | Static Private Attributes
sun.awt.im.iiimp.LookupPane Class Reference
Collaboration diagram for sun.awt.im.iiimp.LookupPane:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LookupPane ()
 LookupPane ()

Package Functions

void handleEvent (IIIMLookupEvent e)
void forwardEvent (AWTEvent e)
void changeFocus (int index)
void clicked (int index)
void setTarget (java.awt.Component target)
void setLookupWindow (LookupWindow window)
void handleEvent (IIIMLookupEvent e)
void forwardEvent (AWTEvent e)
void changeFocus (int index)
void clicked (int index)
void setTarget (java.awt.Component target)
void setLookupWindow (LookupWindow window)

Private Member Functions

void checkCache (int size)
boolean same (String[] sa1, String[] sa2)
boolean same (CharacterIterator[] it1, CharacterIterator[] it2)
void start (IIIMLookupEvent e)
void draw (IIIMLookupEvent e)
void draw2 (IIIMLookupEvent e)
void process (IIIMLookupEvent e)
void checkCache (int size)
boolean same (String[] sa1, String[] sa2)
boolean same (CharacterIterator[] it1, CharacterIterator[] it2)
void start (IIIMLookupEvent e)
void draw (IIIMLookupEvent e)
void draw2 (IIIMLookupEvent e)
void process (IIIMLookupEvent e)

Private Attributes

int master
int choicePerWindow
Dimension rowColumn
int direction
int labelOwner
int firstCandidate
int lastCandidate
int currentCandidate
String[] candidates
String[] labelList
int processType
int indexPage
String title
FocusLabel[] awtLabels
int cacheSize = 32
int oldCandidate
String[] oldCandidates
AttributedCharacterIterator[] candidateIterator
AttributedCharacterIterator[] labelIterator
AttributedCharacterIterator[] oldCandidateIterator
java.awt.Component target
LookupWindow window

Static Private Attributes

static final int CANDIDATE_GAP = 5

Detailed Description

Definition at line 53 of file LookupPane.java.


Constructor & Destructor Documentation

Definition at line 79 of file LookupPane.java.

                        {
       awtLabels = new FocusLabel[cacheSize];
       for (int i = 0; i < awtLabels.length; i++) {
           awtLabels[i] = new FocusLabel();
       }

        enableInputMethods(false);
    }

Definition at line 79 of file LookupPane.java.

                        {
       awtLabels = new FocusLabel[cacheSize];
       for (int i = 0; i < awtLabels.length; i++) {
           awtLabels[i] = new FocusLabel();
       }

        enableInputMethods(false);
    }

Member Function Documentation

void sun.awt.im.iiimp.LookupPane.changeFocus ( int  index) [inline, package]

Definition at line 265 of file LookupPane.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void sun.awt.im.iiimp.LookupPane.changeFocus ( int  index) [inline, package]

Definition at line 267 of file LookupPane.java.

Here is the call graph for this function:

void sun.awt.im.iiimp.LookupPane.checkCache ( int  size) [inline, private]

Definition at line 88 of file LookupPane.java.

                                      {
       if (size > cacheSize) {
           FocusLabel[] tmp = new FocusLabel[size];
           System.arraycopy(awtLabels, 0, tmp, 0, cacheSize);
           for (int i = cacheSize; i < size; i++) {
              tmp[i] = new FocusLabel();
           }
           awtLabels = tmp;
           cacheSize = size;
       }
    }

Here is the caller graph for this function:

void sun.awt.im.iiimp.LookupPane.checkCache ( int  size) [inline, private]

Definition at line 88 of file LookupPane.java.

                                      {
       if (size > cacheSize) {
           FocusLabel[] tmp = new FocusLabel[size];
           System.arraycopy(awtLabels, 0, tmp, 0, cacheSize);
           for (int i = cacheSize; i < size; i++) {
              tmp[i] = new FocusLabel();
           }
           awtLabels = tmp;
           cacheSize = size;
       }
    }
void sun.awt.im.iiimp.LookupPane.clicked ( int  index) [inline, package]

Definition at line 273 of file LookupPane.java.

                            {
       IIIMActionEvent e =
           new IIIMActionEvent(IIIMActionEvent.LOOKUP_PROCESSED,
                            awtLabels[index].getText());
       window.dispatchActionEvent(e);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void sun.awt.im.iiimp.LookupPane.clicked ( int  index) [inline, package]

Definition at line 275 of file LookupPane.java.

                            {
       IIIMActionEvent e =
           new IIIMActionEvent(IIIMActionEvent.LOOKUP_PROCESSED,
                            awtLabels[index].getText());
       window.dispatchActionEvent(e);
    }

Here is the call graph for this function:

void sun.awt.im.iiimp.LookupPane.draw ( IIIMLookupEvent  e) [inline, private]

Definition at line 166 of file LookupPane.java.

                                         {
       currentCandidate = e.getCurrentCandidate();
       if (currentCandidate < 0) currentCandidate = 0;

       candidates = e.getCandidates();
       labelList = e.getLabelList();

       if (candidates.length != labelList.length) {
           throw new IllegalArgumentException(" Lookup Error.");
       }
       
       if (master == IIIMLookupEvent.SERVER_MASTER) {
           if (!same(candidates, oldCandidates)) {
              removeAll();
              checkCache(candidates.length);
              for (int i = 0; i < candidates.length; i++) {
                  FocusLabel fl = awtLabels[i];
                  fl.setText(labelList[i] + " : " + candidates[i]);
                  add(fl);
                  fl.setTarget(this, i);
                  if (i == currentCandidate) {
                     fl.setFocus(true);
                  }
              }
              repaint();
              awtLabels[currentCandidate].requestFocus();
           } else if (currentCandidate != oldCandidate) {
              awtLabels[currentCandidate].setFocus(true);
              awtLabels[currentCandidate].repaint();
              if (oldCandidate >= 0) { 
                  awtLabels[oldCandidate].setFocus(false);
                  awtLabels[oldCandidate].repaint();
              }
           }
              
       } else {
           // CLIENT_MASTER
           firstCandidate = e.getFirstCandidate();
           lastCandidate = e.getLastCandidate();
           checkCache(lastCandidate - firstCandidate);
           for (int i = firstCandidate; i < lastCandidate; i++) {
              awtLabels[i - firstCandidate].setText(labelList[i] +
                                                " : " + candidates[i]);
              add(awtLabels[i - firstCandidate]);
              awtLabels[i - firstCandidate].setTarget(this, i);
           }
       }

       oldCandidate = currentCandidate;
       oldCandidates = candidates;
    }

Here is the call graph for this function:

void sun.awt.im.iiimp.LookupPane.draw ( IIIMLookupEvent  e) [inline, private]

Definition at line 166 of file LookupPane.java.

                                         {
       currentCandidate = e.getCurrentCandidate();
       candidates = e.getCandidates();
       labelList = e.getLabelList();

       if (candidates.length != labelList.length) {
           throw new IllegalArgumentException(" Lookup Error.");
       }
       
       if (master == IIIMLookupEvent.SERVER_MASTER) {
           if (!same(candidates, oldCandidates)) {
              removeAll();
              checkCache(candidates.length);
              for (int i = 0; i < candidates.length; i++) {
                  FocusLabel fl = awtLabels[i];
                  fl.setText(labelList[i] + " : " + candidates[i]);
                  add(fl);
                  fl.setTarget(this, i);
                  if (i == currentCandidate) {
                     fl.setFocus(true);
                  }
              }
              repaint();
              awtLabels[currentCandidate].requestFocus();
           } else if (currentCandidate != oldCandidate) {
              awtLabels[currentCandidate].setFocus(true);
              awtLabels[currentCandidate].repaint();
              if (oldCandidate >= 0) { 
                  awtLabels[oldCandidate].setFocus(false);
                  awtLabels[oldCandidate].repaint();
              }
           }
              
       } else {
           // CLIENT_MASTER
           firstCandidate = e.getFirstCandidate();
           lastCandidate = e.getLastCandidate();
           checkCache(lastCandidate - firstCandidate);
           for (int i = firstCandidate; i < lastCandidate; i++) {
              awtLabels[i - firstCandidate].setText(labelList[i] +
                                                " : " + candidates[i]);
              add(awtLabels[i - firstCandidate]);
              awtLabels[i - firstCandidate].setTarget(this, i);
           }
       }

       oldCandidate = currentCandidate;
       oldCandidates = candidates;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void sun.awt.im.iiimp.LookupPane.draw2 ( IIIMLookupEvent  e) [inline, private]

Definition at line 220 of file LookupPane.java.

                                          {
       candidateIterator = e.getCandidateIterator();
       labelIterator = e.getLabelIterator();
       if (candidateIterator.length != labelIterator.length ||
           master != IIIMLookupEvent.SERVER_MASTER) {
           throw new IllegalArgumentException(" Lookup Error.");
       }

       if (!same(candidateIterator, oldCandidateIterator)) {
           checkCache(candidateIterator.length);
           for (int i = 0; i < candidateIterator.length; i++) {
              FocusLabel fl = awtLabels[i];
              fl.setIterator(labelIterator[i], candidateIterator[i]);
              add(fl);
              fl.setTarget(this, i);
              if (i == currentCandidate) {
                  fl.setFocus(true);
              }
              repaint();
              awtLabels[currentCandidate].requestFocus();
           }
       } else {
           awtLabels[currentCandidate].setFocus(true);
           awtLabels[currentCandidate].repaint();
           if (oldCandidate >= 0) {
              awtLabels[oldCandidate].setFocus(false);
              awtLabels[oldCandidate].repaint();
           }
       }
       oldCandidate = currentCandidate;
       oldCandidateIterator = candidateIterator;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void sun.awt.im.iiimp.LookupPane.draw2 ( IIIMLookupEvent  e) [inline, private]

Definition at line 222 of file LookupPane.java.

                                          {
       candidateIterator = e.getCandidateIterator();
       labelIterator = e.getLabelIterator();
       if (candidateIterator.length != labelIterator.length ||
           master != IIIMLookupEvent.SERVER_MASTER) {
           throw new IllegalArgumentException(" Lookup Error.");
       }

       if (!same(candidateIterator, oldCandidateIterator)) {
           checkCache(candidateIterator.length);
           for (int i = 0; i < candidateIterator.length; i++) {
              FocusLabel fl = awtLabels[i];
              fl.setIterator(labelIterator[i], candidateIterator[i]);
              add(fl);
              fl.setTarget(this, i);
              if (i == currentCandidate) {
                  fl.setFocus(true);
              }
              repaint();
              awtLabels[currentCandidate].requestFocus();
           }
       } else {
           awtLabels[currentCandidate].setFocus(true);
           awtLabels[currentCandidate].repaint();
           if (oldCandidate >= 0) {
              awtLabels[oldCandidate].setFocus(false);
              awtLabels[oldCandidate].repaint();
           }
       }
       oldCandidate = currentCandidate;
       oldCandidateIterator = candidateIterator;
    }

Here is the call graph for this function:

void sun.awt.im.iiimp.LookupPane.forwardEvent ( AWTEvent  e) [inline, package]

Definition at line 261 of file LookupPane.java.

                                  {
       target.dispatchEvent(e);
    }

Here is the caller graph for this function:

void sun.awt.im.iiimp.LookupPane.forwardEvent ( AWTEvent  e) [inline, package]

Definition at line 263 of file LookupPane.java.

                                  {
       target.dispatchEvent(e);
    }
void sun.awt.im.iiimp.LookupPane.handleEvent ( IIIMLookupEvent  e) [inline, package]

Definition at line 130 of file LookupPane.java.

                                        {
       switch(e.getType()) {
         case IIIMLookupEvent.START:
           start(e);
           break;
         case IIIMLookupEvent.DRAW:
           if (Manager.COLOR_SUPPORT) {
              draw2(e);
           } else {
              draw(e);
           }
           break;
         case IIIMLookupEvent.PROCESS:
           process(e);
           break;
         default:
           break;
        }
    }

Here is the call graph for this function:

void sun.awt.im.iiimp.LookupPane.handleEvent ( IIIMLookupEvent  e) [inline, package]

Definition at line 130 of file LookupPane.java.

                                        {
       switch(e.getType()) {
         case IIIMLookupEvent.START:
           start(e);
           break;
         case IIIMLookupEvent.DRAW:
           if (Manager.COLOR_SUPPORT) {
              draw2(e);
           } else {
              draw(e);
           }
           break;
         case IIIMLookupEvent.PROCESS:
           process(e);
           break;
         default:
           break;
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void sun.awt.im.iiimp.LookupPane.process ( IIIMLookupEvent  e) [inline, private]

Definition at line 253 of file LookupPane.java.

                                            {
       processType = e.getProcessType();
       indexPage = e.getProcessIndexPage();

       // currently this protocol never used....
       repaint();
    }

Here is the caller graph for this function:

void sun.awt.im.iiimp.LookupPane.process ( IIIMLookupEvent  e) [inline, private]

Definition at line 255 of file LookupPane.java.

                                            {
       processType = e.getProcessType();
       indexPage = e.getProcessIndexPage();

       // currently this protocol never used....
       repaint();
    }
boolean sun.awt.im.iiimp.LookupPane.same ( String[]  sa1,
String[]  sa2 
) [inline, private]

Definition at line 100 of file LookupPane.java.

                                                     {
       if (sa1 == null || sa2 == null || sa1.length != sa2.length) {
           return false;
       }

       for (int i = 0; i < sa1.length; i++) {
           if (!sa1[i].equals(sa2[i])) {
              return false;
           }
       }
       return true;
    }

Here is the caller graph for this function:

boolean sun.awt.im.iiimp.LookupPane.same ( String[]  sa1,
String[]  sa2 
) [inline, private]

Definition at line 100 of file LookupPane.java.

                                                     {
       if (sa1 == null || sa2 == null || sa1.length != sa2.length) {
           return false;
       }

       for (int i = 0; i < sa1.length; i++) {
           if (!sa1[i].equals(sa2[i])) {
              return false;
           }
       }
       return true;
    }
boolean sun.awt.im.iiimp.LookupPane.same ( CharacterIterator[]  it1,
CharacterIterator[]  it2 
) [inline, private]

Definition at line 113 of file LookupPane.java.

                                                                           {
       if (it1 == null || it2 == null || it1.length != it2.length) {
           return false;
       }

       for (int i = 0; i < it1.length; i++) {
           for (char c1 = it1[i].first(), c2 = it2[i].first();
               c1 != CharacterIterator.DONE;
               c1 = it1[i].next(), c2 = it2[i].next()) {
              if (c1 != c2) {
                  return false;
              }
           }
       }
       return true;
    }
boolean sun.awt.im.iiimp.LookupPane.same ( CharacterIterator[]  it1,
CharacterIterator[]  it2 
) [inline, private]

Definition at line 113 of file LookupPane.java.

                                                                           {
       if (it1 == null || it2 == null || it1.length != it2.length) {
           return false;
       }

       for (int i = 0; i < it1.length; i++) {
           for (char c1 = it1[i].first(), c2 = it2[i].first();
               c1 != CharacterIterator.DONE;
               c1 = it1[i].next(), c2 = it2[i].next()) {
              if (c1 != c2) {
                  return false;
              }
           }
       }
       return true;
    }
void sun.awt.im.iiimp.LookupPane.setLookupWindow ( LookupWindow  window) [inline, package]

Definition at line 286 of file LookupPane.java.

                                              {
       this.window = window;
    }

Here is the caller graph for this function:

void sun.awt.im.iiimp.LookupPane.setLookupWindow ( LookupWindow  window) [inline, package]

Definition at line 288 of file LookupPane.java.

                                              {
       this.window = window;
    }
void sun.awt.im.iiimp.LookupPane.setTarget ( java.awt.Component  target) [inline, package]

Definition at line 281 of file LookupPane.java.

                                              {
       this.target = target;
    }

Here is the caller graph for this function:

void sun.awt.im.iiimp.LookupPane.setTarget ( java.awt.Component  target) [inline, package]

Definition at line 283 of file LookupPane.java.

                                              {
       this.target = target;
    }
void sun.awt.im.iiimp.LookupPane.start ( IIIMLookupEvent  e) [inline, private]

Definition at line 150 of file LookupPane.java.

                                          {
       // For now, only SERVER_MASTER is supported
       // master = e.getMaster();
       master = IIIMLookupEvent.SERVER_MASTER;
       choicePerWindow = e.getChoicePerWindow();
       rowColumn = e.getRowColum();
       direction = e.getDirection();
       labelOwner = e.getLabelOwner();

       oldCandidates = null;
       oldCandidate = -1;
       GridLayout gl = new GridLayout(rowColumn.width, rowColumn.height);
       gl.setHgap(CANDIDATE_GAP);
       setLayout(gl);
    }

Here is the caller graph for this function:

void sun.awt.im.iiimp.LookupPane.start ( IIIMLookupEvent  e) [inline, private]

Definition at line 150 of file LookupPane.java.

                                          {
       // For now, only SERVER_MASTER is supported
       // master = e.getMaster();
       master = IIIMLookupEvent.SERVER_MASTER;
       choicePerWindow = e.getChoicePerWindow();
       rowColumn = e.getRowColum();
       direction = e.getDirection();
       labelOwner = e.getLabelOwner();

       oldCandidates = null;
       oldCandidate = -1;
       GridLayout gl = new GridLayout(rowColumn.width, rowColumn.height);
       gl.setHgap(CANDIDATE_GAP);
       setLayout(gl);
    }

Member Data Documentation

Definition at line 73 of file LookupPane.java.

Definition at line 74 of file LookupPane.java.

static final int sun.awt.im.iiimp.LookupPane.CANDIDATE_GAP = 5 [static, private]

Definition at line 75 of file LookupPane.java.

AttributedCharacterIterator [] sun.awt.im.iiimp.LookupPane.candidateIterator [private]

Definition at line 216 of file LookupPane.java.

Definition at line 66 of file LookupPane.java.

Definition at line 57 of file LookupPane.java.

Definition at line 65 of file LookupPane.java.

Definition at line 59 of file LookupPane.java.

Definition at line 63 of file LookupPane.java.

Definition at line 69 of file LookupPane.java.

AttributedCharacterIterator [] sun.awt.im.iiimp.LookupPane.labelIterator [private]

Definition at line 217 of file LookupPane.java.

Definition at line 67 of file LookupPane.java.

Definition at line 60 of file LookupPane.java.

Definition at line 64 of file LookupPane.java.

Definition at line 56 of file LookupPane.java.

Definition at line 76 of file LookupPane.java.

AttributedCharacterIterator [] sun.awt.im.iiimp.LookupPane.oldCandidateIterator [private]

Definition at line 218 of file LookupPane.java.

Definition at line 77 of file LookupPane.java.

Definition at line 68 of file LookupPane.java.

Definition at line 58 of file LookupPane.java.

java awt Component sun.awt.im.iiimp.LookupPane.target [private]

Definition at line 280 of file LookupPane.java.

Definition at line 70 of file LookupPane.java.

Definition at line 285 of file LookupPane.java.


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