Back to index

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

List of all members.

Public Member Functions

 PreeditPane ()
 Default, no arg constructor.
void paint (Graphics g)
 PreeditPane ()
 Default, no arg constructor.
void paint (Graphics g)

Package Functions

void handleEvent (IIIMPreeditEvent e)
int width ()
int height ()
void handleEvent (IIIMPreeditEvent e)
int width ()
int height ()

Package Attributes

int height
FontMetrics metrics

Private Member Functions

Rectangle getCaretRectangle ()
Rectangle getCaretRectangle ()

Private Attributes

String composedString
int caret
int width

Static Private Attributes

static final int TEXT_ORIGIN_X = 5
static final int TEXT_ORIGIN_Y = 15

Detailed Description

Definition at line 50 of file PreeditPane.java.


Constructor & Destructor Documentation

Default, no arg constructor.

Definition at line 62 of file PreeditPane.java.

                         {
    }

Default, no arg constructor.

Definition at line 62 of file PreeditPane.java.

                         {
    }

Member Function Documentation

Rectangle sun.awt.im.iiimp.PreeditPane.getCaretRectangle ( ) [inline, private]

Definition at line 77 of file PreeditPane.java.

                                          {
        int width = 0;
        
        if (caret > 0) {
            char chars[] = new char[caret];
            // can't call getChars() if composedText.length() == 0
            composedString.getChars(0, caret, chars, 0);
            width = metrics.charsWidth(chars, 0, caret);
        }
        return new Rectangle(TEXT_ORIGIN_X + width,
                             TEXT_ORIGIN_Y - metrics.getAscent(),
                             0, metrics.getAscent() + metrics.getDescent());    
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Rectangle sun.awt.im.iiimp.PreeditPane.getCaretRectangle ( ) [inline, private]

Definition at line 77 of file PreeditPane.java.

                                          {
        int width = 0;
        
        if (caret > 0) {
            char chars[] = new char[caret];
            // can't call getChars() if composedText.length() == 0
            composedString.getChars(0, caret, chars, 0);
            width = metrics.charsWidth(chars, 0, caret);
        }
        return new Rectangle(TEXT_ORIGIN_X + width,
                             TEXT_ORIGIN_Y - metrics.getAscent(),
                             0, metrics.getAscent() + metrics.getDescent());    
    }

Here is the call graph for this function:

void sun.awt.im.iiimp.PreeditPane.handleEvent ( IIIMPreeditEvent  e) [inline, package]

Definition at line 91 of file PreeditPane.java.

                                         {
        if(metrics == null) metrics = getGraphics().getFontMetrics();

        composedString = new String();
        AttributedCharacterIterator str = e.getIterator();
        for(char c = str.first(); c != CharacterIterator.DONE; 
            c = str.next()) {
            composedString += c;
        }

        width = metrics.stringWidth(composedString);
        height = metrics.getHeight();
        caret = e.getCaret();
        
        repaint();
    }

Here is the call graph for this function:

void sun.awt.im.iiimp.PreeditPane.handleEvent ( IIIMPreeditEvent  e) [inline, package]

Definition at line 91 of file PreeditPane.java.

                                         {
        if(metrics == null) metrics = getGraphics().getFontMetrics();

        composedString = new String();
        AttributedCharacterIterator str = e.getIterator();
        for(char c = str.first(); c != CharacterIterator.DONE; 
            c = str.next()) {
            composedString += c;
        }

        width = metrics.stringWidth(composedString);
        height = metrics.getHeight();
        caret = e.getCaret();
        
        repaint();
    }

Here is the call graph for this function:

Here is the caller graph for this function:

int sun.awt.im.iiimp.PreeditPane.height ( ) [inline, package]

Definition at line 112 of file PreeditPane.java.

                 {
        return height;
    }

Here is the caller graph for this function:

int sun.awt.im.iiimp.PreeditPane.height ( ) [inline, package]

Definition at line 112 of file PreeditPane.java.

                 {
        return height;
    }

Here is the call graph for this function:

void sun.awt.im.iiimp.PreeditPane.paint ( Graphics  g) [inline]

Definition at line 65 of file PreeditPane.java.

                                  {
        super.paint(g);
        
        if(composedString.length() > 0) {
            g.setColor(getForeground());
            g.drawString(composedString, TEXT_ORIGIN_X, TEXT_ORIGIN_Y);
        }
        Rectangle rect = getCaretRectangle();
        
        g.fillRect(rect.x, rect.y, 1, rect.height);
    }

Here is the call graph for this function:

void sun.awt.im.iiimp.PreeditPane.paint ( Graphics  g) [inline]

Definition at line 65 of file PreeditPane.java.

                                  {
        super.paint(g);
        
        if(composedString.length() > 0) {
            g.setColor(getForeground());
            g.drawString(composedString, TEXT_ORIGIN_X, TEXT_ORIGIN_Y);
        }
        Rectangle rect = getCaretRectangle();
        
        g.fillRect(rect.x, rect.y, 1, rect.height);
    }

Here is the call graph for this function:

int sun.awt.im.iiimp.PreeditPane.width ( ) [inline, package]

Definition at line 108 of file PreeditPane.java.

                {
        return width;
    }

Here is the call graph for this function:

int sun.awt.im.iiimp.PreeditPane.width ( ) [inline, package]

Definition at line 108 of file PreeditPane.java.

                {
        return width;
    }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 52 of file PreeditPane.java.

Definition at line 51 of file PreeditPane.java.

Definition at line 56 of file PreeditPane.java.

FontMetrics sun.awt.im.iiimp.PreeditPane.metrics [package]

Definition at line 57 of file PreeditPane.java.

static final int sun.awt.im.iiimp.PreeditPane.TEXT_ORIGIN_X = 5 [static, private]

Definition at line 53 of file PreeditPane.java.

static final int sun.awt.im.iiimp.PreeditPane.TEXT_ORIGIN_Y = 15 [static, private]

Definition at line 54 of file PreeditPane.java.

Definition at line 56 of file PreeditPane.java.


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