B
Bernd1983
Gast
Hallo ich soll bis Montag ein Programm realisieren. Nur ist mir leider die Grundstruktur nicht klar.
Angabe:
Write a program which is capable of painting different figures, at least quad,
circle and triangle.
Painting shall be possible through draging the mouse. The first click defines the
start position, then while holding the mouse button and moving the mouse the
extent of the figure is set.
Furthermore a pull-down-menu shall be arranged in order to provide a method
for choosing the current figure (as long as one figure is chosen all new figures
have the same shape). Therefor provide radio buttons in the menu
(JRadioButtonMenuItem).
Define for each figure different colors (lines and figure-background) and line
sizes.
This whole functionality shall be put in a Swing component. This component
creates the figures by means of design patterns (see part A and B), so you will
have to be careful that these figures are independet from the component.
Implement the assignment with the factory method (part A) as well as with the
prototype (part B). So two different swing applications have to be handed in (in
two different packages) The base classes (quad, circle…) can be used in both in
both cases.
Hints:
• Perhaps some of these methods might be useful:
mousePressed() and mouseReleased() from the class MouseListener,
mouseDragged() from the class MouseMotionListener
• The menu can be designed by using JMenuBar, JMenu, JMenuItem,
JRadioGroupMenuItem and RadioGroup
Hmm also meine Überlegungen dazu:
- als erstes abstrakte Klasse Figur und daraufhin die drei Konkretisierungen
- welche Methoden beinhalten meine Konkretisierungen? paint wie realisieren?
- weiters wird man eine swing klasse benötigen und eine Fabriklasse .???
bitte gebt mir tipps, wie ich das Programm aufbaue. Habe leider wenig Erfahrung mit guis
grüsse
bernd
Angabe:
Write a program which is capable of painting different figures, at least quad,
circle and triangle.
Painting shall be possible through draging the mouse. The first click defines the
start position, then while holding the mouse button and moving the mouse the
extent of the figure is set.
Furthermore a pull-down-menu shall be arranged in order to provide a method
for choosing the current figure (as long as one figure is chosen all new figures
have the same shape). Therefor provide radio buttons in the menu
(JRadioButtonMenuItem).
Define for each figure different colors (lines and figure-background) and line
sizes.
This whole functionality shall be put in a Swing component. This component
creates the figures by means of design patterns (see part A and B), so you will
have to be careful that these figures are independet from the component.
Implement the assignment with the factory method (part A) as well as with the
prototype (part B). So two different swing applications have to be handed in (in
two different packages) The base classes (quad, circle…) can be used in both in
both cases.
Hints:
• Perhaps some of these methods might be useful:
mousePressed() and mouseReleased() from the class MouseListener,
mouseDragged() from the class MouseMotionListener
• The menu can be designed by using JMenuBar, JMenu, JMenuItem,
JRadioGroupMenuItem and RadioGroup
Hmm also meine Überlegungen dazu:
- als erstes abstrakte Klasse Figur und daraufhin die drei Konkretisierungen
- welche Methoden beinhalten meine Konkretisierungen? paint wie realisieren?
- weiters wird man eine swing klasse benötigen und eine Fabriklasse .???
bitte gebt mir tipps, wie ich das Programm aufbaue. Habe leider wenig Erfahrung mit guis
grüsse
bernd