Package main.components

Examples of main.components.Line


        } else {
            _x = evt.getX();
            _y = evt.getY();
            this.setTitle(String.format("x_first: %s, y_first: %s, x_second: %s, y_second: %s", x, y, _x, _y));
            if(jRadioButtonLine.isSelected()){
                panel.addShape(new Line(x, y, _x, _y));
            }
            if(jRadioButtonOval.isSelected()){
                if(x > _x && y > _y){
                    panel.addShape(new Oval(_x, _y, x - _x, y - _y));
                }
View Full Code Here


            for(Shape shape : MyPanel.shapes){
                save.write(shape.getClass().getName() + "\n");
                save.write(shape.getX() + "\n");
                save.write(shape.getY() + "\n");
                if(shape instanceof Line){
                     Line tmpLine = new Line();
                     tmpLine = (Line) shape;
                     save.write(tmpLine.getX_() + "\n");
                     save.write(tmpLine.getY_() + "\n");
                }
                if(shape instanceof Oval){
                     Oval tmpOval = new Oval();
                     tmpOval = (Oval) shape;
                     save.write(tmpOval.getWidth()+ "\n");
View Full Code Here

                    case "main.components.Line":
                        tmp_x = Integer.parseInt(reader.readLine());
                        tmp_y = Integer.parseInt(reader.readLine());
                        tmp_width = Integer.parseInt(reader.readLine());
                        tmp_height = (Integer.parseInt(reader.readLine()));
                        panel.addShape(new Line(tmp_x, tmp_y, tmp_width, tmp_height));
                        break;
                }
            }
        } catch (FileNotFoundException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here

TOP

Related Classes of main.components.Line

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.