Package org.itsnat.feashow.features.comp.shared

Examples of org.itsnat.feashow.features.comp.shared.Circle


        listComp.setItsNatListCellRenderer(new CircleListCellRenderer());
        listComp.setItsNatListCellEditor(null); // disables in-place editing

        DefaultListModel dataModel = (DefaultListModel)listComp.getListModel();
        dataModel.addElement(new Circle(20));
        dataModel.addElement(new Circle(30));
        dataModel.addElement(new Circle(40));
        dataModel.addElement(new Circle(50));
        dataModel.addElement(new Circle(60));

        ListSelectionModel selModel = listComp.getListSelectionModel();
        selModel.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
        selModel.setSelectionInterval(2,3);
View Full Code Here


            {
                int pos = Integer.parseInt(posComp.getText());
                DefaultListModel dataModel = (DefaultListModel)listComp.getListModel();
                if (currentTarget == updateButton.getHTMLInputElement())
                {
                    Circle circle = (Circle)dataModel.getElementAt(pos);
                    circle.setRadio(newRadio);
                    dataModel.setElementAt(circle,pos); // To notify this change
                }
                else
                    dataModel.insertElementAt(new Circle(newRadio),pos);
            }
            catch(NumberFormatException ex)
            {
                getItsNatDocument().addCodeToSend("alert('Bad Position');");
            }
View Full Code Here

        ListSelectionModel selModel = listComp.getListSelectionModel();

        int index = listComp.getSelectedIndex(); // First selected
        if (index != -1)
        {
            Circle circle = (Circle)listComp.getListModel().getElementAt(index);
            itemComp.setText(circle.toString());
            posComp.setText(Integer.toString(index));
        }

        for(int i = first; i <= last; i++)
        {
View Full Code Here

    {
    }

    public void renderListCell(ItsNatList list, int index, Object value, boolean isSelected, boolean cellHasFocus, Element cellElem,boolean isNew)
    {
        Circle circle = (Circle)value;

        int radio = circle.getRadio();
        int cx = index * radio + 2*radio;
        cellElem.setAttribute("cx",Integer.toString(cx));
        cellElem.setAttribute("r",Integer.toString(radio));
    }
View Full Code Here

        DefaultTableModel dataModel = (DefaultTableModel)tableComp.getTableModel();
        dataModel.addColumn("Column 1");
        dataModel.addColumn("Column 2");
        dataModel.addColumn("Column 3");
        dataModel.addColumn("Column 4");
        dataModel.addRow(new Circle[] {new Circle(20),new Circle(25),new Circle(30),new Circle(35)});
        dataModel.addRow(new Circle[] {new Circle(20),new Circle(25),new Circle(30),new Circle(35)});
        dataModel.addRow(new Circle[] {new Circle(20),new Circle(25),new Circle(30),new Circle(35)});

        ListSelectionModel rowSelModel = tableComp.getRowSelectionModel();
        //ListSelectionModel columnSelModel = tableComp.getColumnSelectionModel();

        rowSelModel.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
        // columnSelModel.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);

        tableComp.setRowSelectionAllowed(true);
        tableComp.setColumnSelectionAllowed(false);

        rowSelModel.addListSelectionListener(new SVGCircleTableRowSelectionDecoration(tableComp));

        rowSelModel.setSelectionInterval(1,1);

        dataModel.addTableModelListener(this);
        rowSelModel.addListSelectionListener(this);

        this.removeButton = (ItsNatHTMLInputButton)compMgr.createItsNatComponentById("removeId");
        removeButton.addEventListener("click",this);

        this.itemComp = new ItsNatHTMLInputText[dataModel.getColumnCount()];
        for(int i = 0; i < itemComp.length; i++)
        {
            this.itemComp[i] = (ItsNatHTMLInputText)compMgr.createItsNatComponentById("itemId" + i);
            Circle circle = (Circle)dataModel.getValueAt(rowSelModel.getMinSelectionIndex(), i);
            itemComp[i].setText(circle.toString());
        }

        this.posComp = (ItsNatHTMLInputText)compMgr.createItsNatComponentById("posId");
        posComp.setText(Integer.toString(rowSelModel.getMinSelectionIndex()));
View Full Code Here

                DefaultTableModel dataModel = (DefaultTableModel)tableComp.getTableModel();
                if (currentTarget == updateButton.getHTMLInputElement())
                {
                    for(int i = 0; i < itemComp.length; i++)
                    {
                        Circle circle = (Circle)dataModel.getValueAt(row,i);
                        circle.setRadio(newRadio[i]);
                        dataModel.setValueAt(circle,row,i);// To notify this change
                    }
                }
                else
                {
                    Circle[] circles = new Circle[newRadio.length];
                    for (int i = 0; i < newRadio.length; i++)
                        circles[i] = new Circle(newRadio[i]);
                    dataModel.insertRow(row,circles);
                }
            }
            catch(NumberFormatException ex)
            {
View Full Code Here

        int row = rowSelModel.getMinSelectionIndex(); // First selected
        if (row != -1)
        {
            for(int i = 0; i < itemComp.length; i++)
            {
                Circle circle = (Circle)tableComp.getTableModel().getValueAt(row,i);
                itemComp[i].setText(circle.toString());
            }
            posComp.setText(Integer.toString(row));
        }
    }
View Full Code Here

    {
    }

    public void renderTableCell(ItsNatTable table, int row, int column, Object value, boolean isSelected, boolean hasFocus, Element cellElem,boolean isNew)
    {
        Circle circle = (Circle)value;

        int radio = circle.getRadio();
        int cx = column * radio + 2*radio;
        int cy = row * 2 * radio + 2*radio;
        cellElem.setAttribute("cx",Integer.toString(cx));
        cellElem.setAttribute("cy",Integer.toString(cy));
        cellElem.setAttribute("r",Integer.toString(radio));
View Full Code Here

TOP

Related Classes of org.itsnat.feashow.features.comp.shared.Circle

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.