Package com.sun.dtv.lwuit

Examples of com.sun.dtv.lwuit.Label


        dayStyle.setFgColor(mv.getStyle().getFgSelectionColor());
        dayStyle.setPadding(0, 0, 0, 0);
        dayStyle.setMargin(0, 0, 0, 0);
        dayStyle.setBgTransparency(0);
       
        Label tmp = new Label();
        tmp.setStyle(dayStyle);
        tmp.setAlignment(Label.CENTER);
        tmp.setPreferredSize(new Dimension(dayWidth, dayHeight));
        for (int i = 0; i < labels.length; i++) {
            String day = UIManager.getInstance().localize(days[i], labels[i]);
            tmp.setText(day);
            int dx = (dayWidth * i);
            tmp.setX(mv.getX() + dx);
            tmp.setY(mv.getY());
            tmp.setSize(tmp.getPreferredSize());
            drawLabel(g, tmp);
        }
        paintDates(g, date, mv, sd, f, dayWidth, dayHeight,
                labelH, fix, fh, sd);

View Full Code Here


            final Style tabbedPaneStyle, final int cellOffsetX,
            final int cellOffsetY, final Dimension cellsPreferredSize,
            final Dimension contentPaneSize) {


        Label cell = new Label(text) {

            public void paint(Graphics g) {
                int tPBorder = tp.getTabbedPaneBorderWidth();
                int focusMarkWidth = tPBorder * 2;
                int tabP = tp.getTabPlacement();
                // Initialize forground colors before calling to super.paint()
                if (isSelected && cellHasFocus) {
                    focusMarkWidth = tPBorder * 3;
                    this.getStyle().setFgSelectionColor(cellStyle.getFgSelectionColor());
                } else {
                    this.getStyle().setFgColor(cellStyle.getFgColor());
                }

                super.paint(g);

                if (!isSelected) {
                    g.setColor(0);
                    g.fillRect(getX(), getY(), getWidth(), getHeight(), (byte) 0x2f);
                }
                // coloring back the focus mark line
                g.setColor(getStyle().getFgColor());
                if (tabP == tp.TOP || tabP == tp.BOTTOM) {
                    if (tabP == tp.TOP) {
                        if (isSelected) {
                            g.fillRect(getX(), getY() + tPBorder, getWidth(), focusMarkWidth);// north

                        }
                        g.setColor(tabbedPaneStyle.getFgColor());
                        g.fillRect(getX(), getY(), getWidth(), tPBorder);//north line

                        g.fillRect(getX(), getY(), tPBorder, getHeight());// west line

                    } else {
                        if (isSelected) {
                            g.fillRect(getX(), getY() + getHeight() - focusMarkWidth, getWidth(), focusMarkWidth);// south

                        }
                        g.setColor(tabbedPaneStyle.getFgColor());
                        g.fillRect(getX(), getY() + getHeight() - tPBorder, getWidth(), tPBorder);//south line

                        g.fillRect(getX(), getY(), tPBorder, getHeight());// west line

                    }
                    int x = getX() - cellOffsetX + getWidth();
                    if (x == contentPaneSize.getWidth()) {
                        g.fillRect(x + cellOffsetX - tPBorder, getY(), tPBorder, getHeight());// east line

                    }
                    if (cellsPreferredSize.getWidth() < contentPaneSize.getWidth() && (getX() + getWidth() == cellsPreferredSize.getWidth())) {
                        g.fillRect(getX() + getWidth() - tPBorder, getY(), tPBorder, getHeight());
                    }
                } else { // LEFT or RIGHT

                    if (isSelected) {
                        g.fillRect(getX(), getY() + tPBorder, getWidth(), focusMarkWidth);// north

                    }
                    g.setColor(tabbedPaneStyle.getFgColor());
                    g.fillRect(getX(), getY(), getWidth(), tPBorder);
                    int y = getY() - cellOffsetY + getHeight();
                    if (y == contentPaneSize.getHeight()) {
                        g.fillRect(getX(), y + cellOffsetY - tPBorder, getWidth(), tPBorder);
                    }
                    if (cellsPreferredSize.getHeight() < contentPaneSize.getHeight() && (getY() + getHeight() == cellsPreferredSize.getHeight())) {
                        g.fillRect(getX(), getY() + getHeight() - tPBorder, getWidth(), tPBorder);//south line

                    }
                    if (tabP == tp.LEFT) {
                        g.fillRect(getX(), getY(), tPBorder, getHeight());// west border

                    } else {
                        g.fillRect(getX() + getWidth() - tPBorder, getY(), tPBorder, getHeight());// east border

                    }
                }
            }
        };

        cell.setCellRenderer(true);
        cell.getStyle().setBorder(null);
        cell.setIcon(icon);
        updateCellLook(tp, (Component) cell, isSelected);
        if (isSelected) {
            cellStyle.setBgSelectionColor(cellStyle.getBgColor());
        }

        cell.setAlignment(Label.CENTER);
        return cell;
    }
View Full Code Here

    /**
     * @inheritDoc
     */
    public void focusGained(Component cmp) {
        if(cmp instanceof Label) {
            Label l = (Label) cmp;
            Style style = l.getStyle();
            int txtW = style.getFont().stringWidth(l.getText());
            int textSpaceW = getAvaliableSpaceForText(l);
            if (txtW > textSpaceW && textSpaceW > 0) {
                ((Label) cmp).startTicker(tickerSpeed, true);
            }
        }
View Full Code Here

        final Button btnSair = new Button("Sair");
        btnSair.setX(5);
        btnSair.setY(70);
        btnSair.setWidth(150);

        final Label lblIP = new Label("Voce pode conectar por ssh usando: root@" + Info.getIpAddress());
        lblIP.setX(40);
        lblIP.setY(305);
        lblIP.setWidth(150);

        // Criando actionListener
        ActionListener listener = new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
               
View Full Code Here

        //loadForm.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
        //loadForm.setHeight(200);
        loadForm.setX(230);
        loadForm.setY(130);
        loadForm.setStyle(style);
        Label lblStatus = new Label("Escolha qual jar voce vai carregar:");
        lblStatus.setY(0);

        final List list = new List();
        String[] arquivos = File.getAllFilesWithExtensions("/home/mos/xlets/", new String[] {"jar"});
        if (arquivos != null){
            for (int i=0;i<arquivos.length;i++)
View Full Code Here

        videoForm = new Form();
        videoForm.setLayout(new CoordinateLayout(510, 250));
        videoForm.setX(230);
        videoForm.setY(130);
        videoForm.setStyle(style);
        Label lblStatus = new Label("Escolha um video para tocar:");
        lblStatus.setY(0);

        final List list = new List();
        String[] arquivos = File.getAllFilesWithExtensions("/home/mos/zvideos/", new String[] {"avi","mpg","ts"});
        if (arquivos != null){
            for (int i=0;i<arquivos.length;i++){
View Full Code Here

        //Sair
        final Button btnSair = new Button("Sair");
        btnSair.setX(0);
        btnSair.setY(22);
        // Create buttons in the main form
        final Label lblHello = new Label("Hello LWUIT");

        ActionListener listener = new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                    if (evt.getSource() == btnSair) {
                    exit();
View Full Code Here

TOP

Related Classes of com.sun.dtv.lwuit.Label

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.