Logo Search packages:      
Sourcecode: wims version File versions

void fr::ove::openmath::jome::ctrlview::bidim::AbstractStringDisplay::paint ( Graphics  g  )  [inline, inherited]

Paints the display.

Parameters:
g where we paint the display.

Reimplemented from fr::ove::openmath::jome::ctrlview::bidim::BidimDisplay.

Definition at line 98 of file AbstractStringDisplay.java.

References fr::ove::openmath::jome::ctrlview::bidim::Display::getAscent(), fr::ove::openmath::jome::ctrlview::bidim::Display::getBackgroundColor(), fr::ove::openmath::jome::ctrlview::bidim::Display::getDescent(), fr::ove::openmath::jome::ctrlview::bidim::Display::getForegroundColor(), fr::ove::openmath::jome::ctrlview::bidim::Display::getHeight(), fr::ove::openmath::jome::ctrlview::bidim::Display::getSelectionColor(), fr::ove::openmath::jome::ctrlview::bidim::Display::isSelected(), and fr::ove::openmath::jome::ctrlview::bidim::Display::weDrawBounds().

                                  {
        super.paint(g);
        
        Color old = g.getColor();
        Font oldFont = g.getFont();
        Rectangle bounds = getBounds();
        
        if (isSelected())
            g.setColor(getSelectionColor());
        else
            g.setColor(getBackgroundColor());
            
        g.fillRect(0, 0, bounds.width /*- 1*/, bounds.height /*- 1*/);
        
        g.setColor(getForegroundColor());
        g.setFont(getFont());
        
        if (weDrawBounds())
            g.drawRect(0, 0, bounds.width - 1, bounds.height - 1);
        
        
        if ( string.equals("*") )
            g.drawString(string, 1, getHeight());
        else if ( string.equals("-") )
            g.drawString(string, 1, getAscent() - (int) Math.round(getDescent()*(40.0f/100.0f)));
        else
            g.drawString(string, 1, getAscent());
        
        /*
        // on trace la baseline
        g.setColor(Color.red);
        g.drawLine(0, getAscent(), bounds.width, getAscent());
        */
        
        g.setColor(old);
        g.setFont(oldFont);
    }


Generated by  Doxygen 1.6.0   Back to index