Search in sources :

Example 86 with Paint

use of com.codename1.charts.compat.Paint in project CodenameOne by codenameone.

the class BlackBerryCanvas method clipOnLWUITBounds.

/*public void subpaint(Graphics g) {
        paint(g);
    }*/
/**
 * Clips the RIM native graphics based on the component hierarchy within LWUIT
 * so the native RIM component doesn't paint itself above other components such
 * as the forms title.
 */
private int clipOnLWUITBounds(Component lwuitComponent, Graphics rimGraphics) {
    int result = 0;
    Component parent = lwuitComponent;
    while (parent != null) {
        int x = parent.getAbsoluteX() + parent.getScrollX();
        int y = parent.getAbsoluteY() + parent.getScrollY();
        rimGraphics.pushRegion(x, y, parent.getWidth(), parent.getHeight(), 0, 0);
        rimGraphics.translate(-rimGraphics.getTranslateX(), -rimGraphics.getTranslateY());
        parent = parent.getParent();
        result++;
    }
    return result;
}
Also used : Component(com.codename1.ui.Component) PeerComponent(com.codename1.ui.PeerComponent)

Aggregations

Paint (com.codename1.charts.compat.Paint)28 Component (com.codename1.ui.Component)16 Point (com.codename1.charts.models.Point)14 Style (com.codename1.ui.plaf.Style)13 Form (com.codename1.ui.Form)12 Image (com.codename1.ui.Image)11 Graphics (com.codename1.ui.Graphics)10 Animation (com.codename1.ui.animations.Animation)10 Rectangle (com.codename1.ui.geom.Rectangle)9 Dialog (com.codename1.ui.Dialog)7 GeneralPath (com.codename1.ui.geom.GeneralPath)6 Point (com.codename1.ui.geom.Point)6 Paint (android.graphics.Paint)5 ActionEvent (com.codename1.ui.events.ActionEvent)5 Rectangle2D (com.codename1.ui.geom.Rectangle2D)5 IOException (java.io.IOException)5 TextArea (com.codename1.ui.TextArea)4 ActionListener (com.codename1.ui.events.ActionListener)4 BorderLayout (com.codename1.ui.layouts.BorderLayout)4 Motion (com.codename1.ui.animations.Motion)3