Have a colored background of your liking. I have used Color.getHSBColor(0.8f, 0.2f, 0.9f). • Two lines that divide the frame into 4 equal parts, that are x and y axes. • A triangle that is filled with a color. (You can use fillPolygon() function) • Add a control panel. • Add 6 buttons to the panel called “Translate Up”, “Translate Down”,“Translate Right”, “Translate Left”, “Reflect X” and “Reflect Y”. • Menubar of this program should have an item called “Set Default”which will reset the values of x and y to the values they had initially. • Modify the action listener according to the buttons and menu item. • Set the title to “Transformations” in the constructor and add your WindowListener. • Modify your paint method to draw 1 triangle and 2 lines with different colors. • The main method should create and display an instance of Transformations(). • The frame should be set to the size 800 by 800. • You can use a grid layout which is pretty straightforward. • Submit only one file called Transformations.java
• Have a colored background of your liking. I have used Color.getHSBColor(0.8f, 0.2f, 0.9f).
• Two lines that divide the frame into 4 equal parts, that are x and y axes.
• A triangle that is filled with a color. (You can use fillPolygon() function)
• Add a control panel.
• Add 6 buttons to the panel called “Translate Up”, “Translate Down”,“Translate Right”,
“Translate Left”, “Reflect X” and “Reflect Y”.
• Menubar of this
values of x and y to the values they had initially.
• Modify the action listener according to the buttons and menu item.
• Set the title to “Transformations” in the constructor and add your WindowListener.
• Modify your paint method to draw 1 triangle and 2 lines with different colors.
• The main method should create and display an instance of Transformations().
• The frame should be set to the size 800 by 800.
• You can use a grid layout which is pretty straightforward.
• Submit only one file called Transformations.java
Step by step
Solved in 2 steps