Manipulate the size of the network element

Article ID: 2125
Last updated: 29 May, 2018
Article ID: 2125
Last updated: 29 May, 2018
Revision: 3
Views: 631
Posted: 11 Aug, 2003
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

Can I change the size of my network element?

Answer

There are many ways to change the size of an IltNetworkElement.

You can:

  • collapse it
  • apply a transformer on its base
  • use the network element drawer

  1. Collapse the Network Element

    The first solution consists in using the collapse feature of the network element.

    When the network element is collapsed, its size is reduced to 53.5% of the normal size, which corresponds to the small size listed in the table at the end of this page.

    Use the CSS property collapsed as listed in the IltNetworkElement.IsCollapsed Javadocs.

    Here is a CSS extract to illustrate this point:

    #nodeID {

    collapsed: true;

    }

  2. Use a Transformer

    Use the CSS property sizeRatio as listed in the IltNetworkElement.SizeRatio Javadocs.

    Here is a CSS extract to illustrate this point:

    #nodeID {

    sizeRatio: "0.8, 0, 0, 0.8, 0, 0";

    }

  3. Use the Network Element Drawer

    The last solution is to customize the network element, as explained in the paragraph Styling / Customizing network elements / Customizing Network Element Types / Customizing Existing Network Element Types of the JTGO User's Manual.

    This solution consists in changing the mapping of an existing type of network element, or creating a new type of network element.

    This has to be done before creating the network element.

    Here is a method to change the mapping of an existing type (NE in the sample):

    public static void ChangeTypeMapping () {

    IltNetworkElement.SetTypeMapping(IltNetworkElement.Type.NE,

    new IltNEDrawerFactory() {

    public IltNEDrawer create (IltObject object,

    IltcCompositeGraphic graphic) {

    return new IltNetworkElement.NEDrawer() {

    public Dimension getPreferredSize (boolean collapsed) {

    if (collapsed)

    // small Size

    return new Dimension(27, 27);

    else

    // Normal Size

    return new Dimension(50, 50);

    }

    };

    }

    });

    Here is how to create a new type of network element:

    // declare the new type

    public static IltNetworkElement.Type SmallNetwork = new IltNetworkElement.Type("smallNetwork");

    // set the mapping

    IltNetworkElement.SetTypeMapping(SmallNetwork,

    new IltNEDrawerFactory() {

    public IltNEDrawer create (IltObject object,

    IltcCompositeGraphic graphic) {

    return new IltNetworkElement.NEDrawer() {

    public Dimension getPreferredSize (boolean collapsed) {

    if (collapsed)

    // small Size

    return new Dimension(13, 13);

    else

    // Normal Size

    return new Dimension(24, 24);

    }

    };

    }

    });

    // create a new network element with the new type

    IltNetworkElement paris =

    new IltNetworkElement("Paris", SmallNetwork,

    IltNetworkElement.Function.SwitchCrossConnect,

    null,

    new IltOSIObjectState());

The following table lists the sizes for each network element type:

Type Normal Size Small

Size

width height width height
NEDrawer 40 40 21 21

MDDrawer 36 29 19 16

ServerDrawer 13 21 25 40

NMWDrawer 31 36 17 19

BSCDrawer 25 39 13 19

MSCDrawer 34 38 17 18

BTSDrawer 36 42 18 21

TransportShapeDrawer 41 41 21

21

SwitchShapeDrawer 43 43 21 21

StationShapeDrawer 42 42 22

22

MuxShapeDrawer 34 40 18 21

EquipmentShapeDrawer 60 40 30

20

NetworkShapeDrawer 40 40 21

21

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2125
Last updated: 29 May, 2018
Revision: 3
Views: 631
Posted: 11 Aug, 2003 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also listed in


Others in this category