Logo Search packages:      
Sourcecode: javamorph version File versions  Download package

void javamorph::CMeshDecorator::mouseClicked ( MouseEvent  e  )  [inline]

Due to Java API. Perform mesh point operation depending on edit state.

Definition at line 235 of file CMeshDecorator.java.

References javamorph::CFrame::getParent(), index, parent, and pos.

                                          {
        if(MouseEvent.BUTTON1 == e.getButton()){
            switch(CConfig.edit_state){
                /* Add one point. */
                case CConfig.EDIT_MESH_ADD:
                    CConfig.left_mesh.add(new Point(pos.x, pos.y));
                    CConfig.right_mesh.add(new Point(pos.x, pos.y));
                    break;
                /* Delete one point if there are enough remaining points. */
                case CConfig.EDIT_MESH_SUB:
                    if(CConfig.left_mesh.size() > 4){
                        CConfig.left_mesh.remove(index);
                        CConfig.right_mesh.remove(index);
                    }
                    break;
            }
        }
        parent.getParent().repaint();
    }


Generated by  Doxygen 1.6.0   Back to index