Issue related with Text SHAPE of gwt graphics library {Importance High}

30 views
Skip to first unread message

sunil

unread,
Nov 30, 2011, 6:09:25 AM11/30/11
to GWT Graphics
Hi,

Importance- High


Requirement-Currently i am trying to add the two or more text shape in
gwt canvas(these text object are movable in whole canvas) . When i add
new object of "Text shape " , so previous shape doesn't move over a
canvas . I don't know what is the exact problem because i am
implementing the same thing with Rectangle Shape and it's working
fine . But it's not working with " Text Shape ".

Please HELP ME ON THIS , I'll be very thankful to you.

Below one is the code of that class.


public class TextView {
Text label;

DrawingArea canvas;

int xMovRec = 10;
int yMovRec = 10;

int x = 70;
int y = 70;


LinkedList<Integer> totalObjects;

LinkedList<VectorObject> objRecord;

String typedValue;
MessageBox box;

boolean labelMDFlag=false;
boolean canvasOutFlag=false;
boolean pointrectFlag = false;

Rectangle pointRect;

HashMap<String,Integer> map;


int i=0;


public TextView(DrawingArea canvass,LinkedList<VectorObject>
objRecord,LinkedList<Integer> totalObjects) {


this.canvas=canvass;
this.objRecord=objRecord;
this.totalObjects=totalObjects;

map=new HashMap<String,Integer>();

if(objRecord!=null)
{ objRecord.removeAll(objRecord);
objRecord.clear();
}


}


public Text GetText(){

label=new Text(x, y, "text");
canvas.add(label);
objRecord.add(label);


System.out.println("TextView.getText()!!!!!!!!!!!!!!!"+objRecord.size());

label.addClickHandler(new ClickHandler() {

@Override
public void onClick(ClickEvent event) {

canvasOutFlag=false;
}
});


label.addMouseDownHandler(new MouseDownHandler() {

@Override
public void onMouseDown(MouseDownEvent event) {

labelMDFlag=true;

}
});

label.addMouseUpHandler(new MouseUpHandler() {

@Override
public void onMouseUp(MouseUpEvent event) {
labelMDFlag=false;

}
});

canvas.addMouseOutHandler(new MouseOutHandler() {

@Override
public void onMouseOut(MouseOutEvent event) {
canvasOutFlag=true;

}
});

canvas.addMouseMoveHandler(new MouseMoveHandler() {

@Override
public void onMouseMove(MouseMoveEvent event) {

if(labelMDFlag==true && canvasOutFlag==false){

xMovRec=event.getX();
yMovRec=event.getY();

label.setX(xMovRec);
label.setY(yMovRec);

}


}
});


return label;
}

sunil

unread,
Nov 30, 2011, 6:28:06 AM11/30/11
to GWT Graphics
FIXED

Henri Kerola

unread,
Nov 30, 2011, 8:44:10 AM11/30/11
to gwt-gr...@googlegroups.com
Would be great if you could tell the community what the problem was and the solution.

Cheers,

-Henri
Reply all
Reply to author
Forward
0 new messages