Custom StyleOGL2D and closed shapes?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Custom StyleOGL2D and closed shapes?

Jonas Andersen
Hi,

I have a custom implementation of StyleOGL2D, inheriting from DefaultStyleOGL2D. This implementation creates a VSpatial through the ShapeFactory2D.createShape(SimpleMarkFactory.getMark("X"), true);  (instances replaced with class names).
My style implementation overrides the getColor but not the getBorderColor. The color changing works as expected.

The challenge is getting the displayed icon to be filled. The "X" is only displayed as an outline. A simple search did not reveal any obvious method or parameter to instruct the ShapeFactory2D or SimpleMarkFactory to produce a filled polygon.

Any hints on getting the icon filled?

Best regards,

Jonas Andersen



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Custom StyleOGL2D and closed shapes?

srcnick
Looking at the ShapeFactory2D code, it looks like “X” will be rendered as lines if the path of the Shape is not closed. You could try:

Shape shape = SimpleMarkFactory.getMark(“X”);
GeneralPath path = new GeneralPath(shape);
path.closePath();
ShapeFactory2D.createShape(path, true);

If that doesn’t work, you could try making your own closed X shape using the GeneralPath.

Nick
 

> On May 2, 2016, at 5:26 AM, Jonas Andersen <[hidden email]> wrote:
>
> Hi,
>
> I have a custom implementation of StyleOGL2D, inheriting from DefaultStyleOGL2D. This implementation creates a VSpatial through the ShapeFactory2D.createShape(SimpleMarkFactory.getMark("X"), true);  (instances replaced with class names).
> My style implementation overrides the getColor but not the getBorderColor. The color changing works as expected.
>
> The challenge is getting the displayed icon to be filled. The "X" is only displayed as an outline. A simple search did not reveal any obvious method or parameter to instruct the ShapeFactory2D or SimpleMarkFactory to produce a filled polygon.
>
> Any hints on getting the icon filled?
>
> Best regards,
>
> Jonas Andersen
>
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Custom StyleOGL2D and closed shapes?

Jonas Andersen
Hi Nick,

That worked perfectly! Thanks.

Best regards,

Jonas Andersen


On 3 May 2016 at 15:37, Nick Collier <[hidden email]> wrote:
Looking at the ShapeFactory2D code, it looks like “X” will be rendered as lines if the path of the Shape is not closed. You could try:

Shape shape = SimpleMarkFactory.getMark(“X”);
GeneralPath path = new GeneralPath(shape);
path.closePath();
ShapeFactory2D.createShape(path, true);

If that doesn’t work, you could try making your own closed X shape using the GeneralPath.

Nick

> On May 2, 2016, at 5:26 AM, Jonas Andersen <[hidden email]> wrote:
>
> Hi,
>
> I have a custom implementation of StyleOGL2D, inheriting from DefaultStyleOGL2D. This implementation creates a VSpatial through the ShapeFactory2D.createShape(SimpleMarkFactory.getMark("X"), true);  (instances replaced with class names).
> My style implementation overrides the getColor but not the getBorderColor. The color changing works as expected.
>
> The challenge is getting the displayed icon to be filled. The "X" is only displayed as an outline. A simple search did not reveal any obvious method or parameter to instruct the ShapeFactory2D or SimpleMarkFactory to produce a filled polygon.
>
> Any hints on getting the icon filled?
>
> Best regards,
>
> Jonas Andersen
>
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Loading...