package lectures.mvc.graphics;
import util.annotations.WebDocuments;
import java.awt.Component;
import java.beans.PropertyChangeListener;
import javax.swing.JFrame;
import lectures.mvc.properties.AnObservableCartesianPlane;
import lectures.mvc.properties.ObservableCartesianPlane;
import lectures.mvc.properties.ObservableStringShape;
import lectures.mvc.properties.atomic.ObservableLine;
import bus.uigen.ObjectEditor;
@WebDocuments({"Lectures/MvcGraphics.pptx", "Lectures/MvcGraphics.pdf", "Videos/MvcGraphics.avi"})
public class CartesianPlaneComposer {
public static void main(String[] args) {
ObservableCartesianPlane cartesianPlane = new AnObservableCartesianPlane(50, 100, 100);
PropertyChangeListener view = new ACartesianPlaneView(cartesianPlane);
cartesianPlane.addPropertyChangeListener(view);
((ObservableLine) cartesianPlane.getXAxis()).addPropertyChangeListener(view);
((ObservableLine) cartesianPlane.getYAxis()).addPropertyChangeListener(view);
((ObservableStringShape) cartesianPlane.getXLabel()).addPropertyChangeListener(view);
((ObservableStringShape) cartesianPlane.getYLabel()).addPropertyChangeListener(view);
JFrame frame = new JFrame("Cartesian Plane");
frame.add((Component) view);
frame.setSize(300, 300);
frame.setVisible(true);
ObjectEditor.edit(cartesianPlane);
}
}