Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic CustomDraw.Additional causing some problems (Read 3407 times)
koosala
Full Member
***
Offline


Java Happens

Posts: 136
Joined: May 13th, 2007
CustomDraw.Additional causing some problems
Oct 29th, 2007 at 12:02pm
Print Post  
Hi,

I was trying the following example:

[code]

private void testAdditional() {
flowChart = new FlowChart();
this.getContentPane().add(flowChart);

Box test = new Box(flowChart);
test.setBounds(10, 10, 20, 20);
test.setText("A very long text to test something in the application and elsewhere");

test.setShape(new Shape(new ElementTemplate[] {
new LineTemplate(0, 0, 100, 0),
new LineTemplate(100, 0, 100, 100),
new LineTemplate(100, 100, 0, 100),
new LineTemplate(0, 100, 0, 0) },

new ElementTemplate[] { new LineTemplate(0, 0, 100, 0),
new LineTemplate(100, 0, 100, 100),
new LineTemplate(100, 100, 0, 100),
new LineTemplate(0, 100, 0, 0) },

new ElementTemplate[] { new LineTemplate(0, 0, 100, 0),
new LineTemplate(100, 0, 100, 150),
new LineTemplate(100, 150, 0, 150),
new LineTemplate(0, 150, 0, 0) }, GeneralPath.WIND_NON_ZERO,
"GoopKey"
));

test.setCustomDraw(CustomDraw.Additional);

flowChart.add(test);
}

[/code]

I have set the text's template to spill more than the box.

If I have the custom draw off, the text is displayed.

If I have set it to additional, the text outside the box disappears.

This would be a bug?

Thanks,
Praveen
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: CustomDraw.Additional causing some problems
Reply #1 - Oct 29th, 2007 at 12:42pm
Print Post  
Hi,

The control sets the clip region before raising the drawItem event for custom-drawn items, but apparently does not clear it when drawing the text after that. Try clearing the clip region yourself from the drawItem() method by calling graphics.setClip(null).

Stoyan
  
Back to top
 
IP Logged
 
koosala
Full Member
***
Offline


Java Happens

Posts: 136
Joined: May 13th, 2007
Re: CustomDraw.Additional causing some problems
Reply #2 - Nov 5th, 2007 at 1:10am
Print Post  
Hi Stoyan,

Would it matter where I made the call in my drawItem method?

I tried it before the custom rendering and after the custom rendering and both seemed to work alright.


Thanks,
Praveen
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: CustomDraw.Additional causing some problems
Reply #3 - Nov 5th, 2007 at 10:20am
Print Post  
Hi Praveen,

It would matter only if you are drawing some graphics not entirely inside the shape outlines.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint