package lectures.composite.objects_shapes;
import util.annotations.WebDocuments;
import bus.uigen.OEFrame;
import bus.uigen.ObjectEditor;
@WebDocuments({"Lectures/CompositeObjectsShapes.pptx", "Lectures/CompositeObjectsShapes.pdf", "Videos/CompositeObjectsShapes.avi"})
public class APlottedShuttle implements PlottedShuttle {
static protected final int ORIGIN_X = 200, ORIGIN_Y = 200;
static protected final int AXES_LENGTH = 300;
int shuttleX = 0, shuttleY = 0;
protected CartesianPlane cartesianPlane;
protected ShuttleImage shuttleImage;
public APlottedShuttle(int anX, int aY) {
cartesianPlane = new ACartesianPlane (AXES_LENGTH, ORIGIN_X, ORIGIN_Y);
shuttleImage = new AShuttleImage();
setShuttleX(anX);
setShuttleY(aY);
}
public CartesianPlane getCartesianPlane() {return cartesianPlane;}
public ShuttleImage getShuttleImage() {return shuttleImage;}
public int getShuttleX() {return shuttleX;}
public void setShuttleX(int newVal) {
shuttleX = newVal;
shuttleImage.setX(toWindowX());
}
public int getShuttleY() {return shuttleY;}
public void setShuttleY(int newVal) {
shuttleY = newVal;
shuttleImage.setY(toWindowY());
}
int toWindowX() {
return ORIGIN_X + shuttleX;
}
int toWindowY() {
return ORIGIN_Y - shuttleY - shuttleImage.getHeight();
}
public static void main (String[] args) {
PlottedShuttle shuttle = new APlottedShuttle(0, 0);
OEFrame oeFrame = ObjectEditor.edit(shuttle);
oeFrame.hideMainPanel();
oeFrame.showTreePanel();
}
}