use of com.centurylink.mdw.designer.display.Graph in project mdw-designer by CenturyLinkCloud.
the class CanvasCommon method moveTextNote.
protected void moveTextNote(int ex, int ey) {
TextNote selected_note = (TextNote) selected_obj;
Graph graph = selected_note.graph;
int x = selected_note.x;
int y = selected_note.y;
int w = selected_note.w;
int h = selected_note.h;
x = ex - delta_x;
y = ey - delta_y;
if (x < graph.x)
x = graph.x;
else if (x + w > graph.x + graph.w)
x = graph.x + graph.w - w;
if (y < graph.y)
y = graph.y;
else if (y + h > graph.y + graph.h)
y = graph.y + graph.h - h;
selected_note.x = x;
selected_note.y = y;
if (!graph.isReadonly())
graph.setDirtyLevel(Graph.GEOCHANGE);
}
Aggregations