Package com.sun.dtv.lwuit.geom

Examples of com.sun.dtv.lwuit.geom.Dimension


        int width = 0;
        int height = 0;
        int elements = Math.min(5, model.getSize());
        for(int iter = 0 ; iter < elements ; iter++) {
            Component cmp = renderer.getListCellRendererComponent(this, model.getItemAt(iter), iter, selected);
            Dimension d = cmp.getPreferredSize();
            width = Math.max(width, d.getWidth());
            height = Math.max(height, d.getHeight());
        }
        return new Dimension(width, height);
    }
View Full Code Here


        }
    }

    private int pointerSelect(int x, int y) {
        int selectedIndex = -1;
        Dimension elemSize = getElementSize(false);
        y = y - getAbsoluteY();
        x = x - getAbsoluteX();
        if (fixedSelection < FIXED_NONE_BOUNDRY) {
            if (orientation == VERTICAL) {
                selectedIndex = y / (elemSize.getHeight() + itemGap);
            } else {
                selectedIndex = x / (elemSize.getWidth() + itemGap);
            }
        } else {
            int numOfcomponents = getModel().getSize();
            Rectangle pos = new Rectangle();
            Style style = getStyle();
            int width = getWidth() - style.getPadding(RIGHT) - style.getPadding(LEFT) - getSideGap();
            if (isScrollableX()) {
                width = Math.max(width, getPreferredSize().getWidth() - style.getPadding(RIGHT) - style.getPadding(LEFT) - getSideGap());
            }
            Dimension rendererSize = getElementSize(false);
            Dimension selectedSize = getElementSize(true);
            for (int i = 0; i < numOfcomponents; i++) {
                calculateComponentPosition(i, width, pos, rendererSize, selectedSize, true);
                if (pos.contains(x, y)) {
                    selectedIndex = i;
                    break;
View Full Code Here

        // forms/dialogs are not visible by default
        setVisible(false);

        setWidth(Display.getInstance().getDisplayWidth());
        setHeight(Display.getInstance().getDisplayHeight());
        setPreferredSize(new Dimension(Display.getInstance().getDisplayWidth(),
                Display.getInstance().getDisplayHeight()));

        super.addComponent(BorderLayout.NORTH, title);
        super.addComponent(BorderLayout.CENTER, contentPane);
        super.addComponent(BorderLayout.SOUTH, menuBar);
View Full Code Here

     * This method will get the callback only if this Form is the Current Form
     * @param w the new width of the Form
     * @param h the new height of the Form
     */
    protected void sizeChanged(int w, int h) {
        setSize(new Dimension(w, h));
        setShouldCalcPreferredSize(true);
        doLayout();
        repaint();
    }
View Full Code Here

        // no need to scale
        if(srcWidth == width && srcHeight == height){
            return this;
        }
        Dimension d = new Dimension(width, height);
        Image i = getCachedImage(d);
        // currently we only support byte data...
        i = new IndexedImage(width, height, palette, scaleArray(imageDataByte, width, height));
        cacheImage(d, i);
        return i;
View Full Code Here

TOP

Related Classes of com.sun.dtv.lwuit.geom.Dimension

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.