Package main.components

Examples of main.components.Rectangle


                    panel.addShape(new Oval(x, y, _x - x, _y - y));
                }
            }
            if(jRadioButtonRectangle.isSelected()){
                if(x > _x && y > _y){
                    panel.addShape(new Rectangle(_x, _y, x - _x, y - _y));
                }
                else if(x > _x && y < _y){
                    panel.addShape(new Rectangle(_x, y, x - _x, _y - y));
                }
                else if(x < _x && y > _y){
                    panel.addShape(new Rectangle(x, _y, _x - x, y - _y));
                }
                else{
                    panel.addShape(new Rectangle(x, y, _x - x, _y - y));
                }
            }
                x = y = _x = _y = 0;
                jButtonUndoShape.setEnabled(true);
        }
View Full Code Here


                     tmpOval = (Oval) shape;
                     save.write(tmpOval.getWidth()+ "\n");
                     save.write(tmpOval.getHeight()+ "\n");
                }
                if(shape instanceof Rectangle){
                     Rectangle tmpRect = new Rectangle();
                     tmpRect = (Rectangle) shape;
                     save.write(tmpRect.getWidth()+ "\n");
                     save.write(tmpRect.getHeight()+ "\n");
                }
            }
            save.flush();
            save.close();
        } catch (IOException ex) {
View Full Code Here

                    case "main.components.Rectangle":
                        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 Rectangle(tmp_x, tmp_y, tmp_width, tmp_height));
                        break;
                    case "main.components.Oval":
                        tmp_x = Integer.parseInt(reader.readLine());
                        tmp_y = Integer.parseInt(reader.readLine());
                        tmp_width = Integer.parseInt(reader.readLine());
View Full Code Here

TOP

Related Classes of main.components.Rectangle

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.