Customizing the Icon in the Display

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

Customizing the Icon in the Display

Ilya Kovalenko
I'm trying to extend the DefaultStyleOGL2D using my own style class. I've been able to create the shapes I'd like, but they look very small in my space.

For example, I create the following space with dimension of 10x10:

int xdim = 10;
int ydim = 10;
ContinuousSpaceFactory spaceFactory = ContinuousSpaceFactoryFinder.createContinuousSpaceFactory(null);
ContinuousSpace<Object> space = spaceFactory.createContinuousSpace("floor", context, new SimpleCartesianAdder<Object>(),
new StrictBorders(), xdim, ydim);


Now let's say I want to place a rectangle that is 8x8 in the center of the space that represents a boundary for a type of agent. At the end of my Context Builder, I'll have:

space.moveTo(outline, 5, 5);
return context;

And in my own style class, I'll have:

@Override
public VSpatial getVSpatial(Object object, VSpatial spatial) {
if (spatial != null) {
return spatial;
}

spatial = shapeFactory.createRectangle(8,8);
return spatial;
}

When I do this, my rectangle is really small compared to my space. How can I fix this so that the VSpatial that is returned has my desired dimensions?

Thank you very much,

Ilya.

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
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: Customizing the Icon in the Display

srcnick
There’s two things you can do.

1. Increase the size of the shape you are creating (i.e. 15x15 rather 8x8).

or

2. Decrease the number of pixels per spatial unit in the space’s display. In the grid style panel of the wizard, you’ll see a unit size field. Change that to set the number of pixels per spatial unit.

Nick


> On Jul 14, 2016, at 4:39 PM, Ilya Kovalenko <[hidden email]> wrote:
>
> I'm trying to extend the DefaultStyleOGL2D using my own style class. I've been able to create the shapes I'd like, but they look very small in my space.
>
> For example, I create the following space with dimension of 10x10:
>
> int xdim = 10;
> int ydim = 10;
>
> ContinuousSpaceFactory spaceFactory = ContinuousSpaceFactoryFinder.createContinuousSpaceFactory(null);
> ContinuousSpace<Object> space = spaceFactory.createContinuousSpace("floor", context, new SimpleCartesianAdder<Object>(),
> new StrictBorders(), xdim, ydim);
>
>
> Now let's say I want to place a rectangle that is 8x8 in the center of the space that represents a boundary for a type of agent. At the end of my Context Builder, I'll have:
>
> space.moveTo(outline, 5, 5);
> return context;
>
> And in my own style class, I'll have:
>
> @Override
> public VSpatial getVSpatial(Object object, VSpatial spatial) {
> if (spatial != null) {
> return spatial;
> }
>
> spatial = shapeFactory.createRectangle(8,8);
>
> return spatial;
> }
>
> When I do this, my rectangle is really small compared to my space. How can I fix this so that the VSpatial that is returned has my desired dimensions?
>
> Thank you very much,
>
> Ilya.
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
> reports.http://sdm.link/zohodev2dev_______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Loading...