float[] llPoints4 = { 55.0f, -16.0f, 50.0f, -11.0f, 45.0f, -13.0f, 43.0f, -18.0f }; OMSpline spline3 = new OMDecoratedSpline(llPoints4, OMSpline.DECIMAL_DEGREES, OMSpline.LINETYPE_STRAIGHT) { protected void initDecorations() {  getDecorator().addDecoration(new TextShapeDecoration(" This one has a text ", new Font("arial", Font.PLAIN, 10), TextShapeDecoration.LEFT_TO_RIGHT + TextShapeDecoration.FOLLOW_POLY, TextShapeDecoration.CENTER)); } };
    public OMGraphicList init() {        // This layer keeps a pointer to an OMGraphicList that it uses        // for painting. It's initially set to null, which is used as        // a flag in prepare() to signal that the OMGraphcs need to be        // created. The list returned from prepare() gets set in the        // layer.        // This layer uses the StandardPCPolicy for new        // projections, which keeps the list intact and simply calls        // generate() on it with the new projection, and repaint()        // which calls paint().        OMGraphicList omList = new OMGraphicList();        //      Location loc = new        // URLRasterLocation(42.3583f,-71.06f,"Boston,Massachusetts,USA","http://javamap.bbn.com:4711/appletimages/city.gif");        //      //loc.setLocationColor(Color.blue);        //      loc.setShowLocation(true);        //      loc.setShowName(true);        //      //loc.setDetails("Details");        //      omList.add(loc);        int bytearrsize = (16 * 16) / 8;        byte[] bytearr = new byte[bytearrsize];        for (int i = 0; i < bytearr.length; i++) {            bytearr[i] = (byte) 0xffffffff;        }        OMBitmap omb = new OMBitmap(45.3583f, -71.06f, 16, 16, bytearr);        omb.setLinePaint(Color.red);        omb.setFillPaint(null);        omb.setSelectPaint(Color.blue);        omb.setRotationAngle(Math.PI / 2);        omList.add(omb);        OMPoint point = new OMPoint(42f, -72f, 14);        point.setFillPaint(Color.green);        point.setOval(true);        omList.add(point);        OMCircle circle = new OMCircle(40f, -70f, 50, 200);        circle.setRotationAngle(com.bbn.openmap.MoreMath.HALF_PI / 2f);        circle.putAttribute(OMGraphicConstants.LABEL,                new OMTextLabeler("Circle Label", OMText.JUSTIFY_CENTER));        omList.add(circle);        int[] llPointsx = new int[5];        int[] llPointsy = new int[5];        llPointsy[0] = 10;        llPointsx[0] = 170;        llPointsy[1] = 42;        llPointsx[1] = 273;        llPointsy[2] = 38;        llPointsx[2] = 374;        llPointsy[3] = 78;        llPointsx[3] = 468;        llPointsy[4] = 84;        llPointsx[4] = 369;        LabeledOMSpline spline = new LabeledOMSpline(40f, -72, llPointsx, llPointsy, OMPoly.COORDMODE_ORIGIN);        spline.setText("Testing");        spline.setLocateAtCenter(true);        //      spline.setIndex(2);        omList.add(spline);        OMSpline spline2 = new OMSpline(llPointsx, llPointsy);        spline2.putAttribute(OMGraphicConstants.LABEL,                new OMTextLabeler("Spline Label"));        spline2.setLinePaint(Color.green);        omList.add(spline2);        float[] llPoints = { 55.0f, -10.0f, 50.0f, -5.0f, 45.0f, -7.0f, 43.0f,                -12.0f, 55.0f, -10.0f };        OMDecoratedSpline omds = new OMDecoratedSpline(llPoints, OMSpline.DECIMAL_DEGREES, OMSpline.LINETYPE_STRAIGHT);        ShapeDecorator sd = new ShapeDecorator();        sd.addDecoration(new LineShapeDecoration(5, com.bbn.openmap.omGraphics.OMColor.clear));        sd.addDecoration(new IceAreaShapeDecoration(7, 7, IceAreaShapeDecoration.RIGHT));        omds.setDecorator(sd);        omList.add(omds);        llPoints = new float[] { 56.0f, -11.0f, 51.0f, -6.0f, 46.0f, -8.0f,                44.0f, -13.0f, 56.0f, -11.0f };        omds = new OMDecoratedSpline(llPoints, OMSpline.DECIMAL_DEGREES, OMSpline.LINETYPE_STRAIGHT);        sd = new ShapeDecorator();        sd.addDecoration(new LineShapeDecoration(3, com.bbn.openmap.omGraphics.OMColor.clear));        sd.addDecoration(new CircleShapeDecoration(5, 5, Color.blue));        omds.setDecorator(sd);        omList.add(omds);        llPoints = new float[] { 57.0f, -12.0f, 52.0f, -7.0f, 47.0f, -9.0f,                45.0f, -14.0f, 57.0f, -12.0f };        omds = new OMDecoratedSpline(llPoints, OMSpline.DECIMAL_DEGREES, OMSpline.LINETYPE_STRAIGHT);        sd = new ShapeDecorator();        sd.addDecoration(new LineShapeDecoration(2, com.bbn.openmap.omGraphics.OMColor.clear));        sd.addDecoration(new CircleShapeDecoration(5, 5, Color.red));        sd.addDecoration(new LineShapeDecoration(2, com.bbn.openmap.omGraphics.OMColor.clear));        sd.addDecoration(new LineShapeDecoration(15, Color.red));        omds.setDecorator(sd);        omList.add(omds);        float[] llPoints2 = { 55.0f, -12.0f, 50.0f, -7.0f, 45.0f, -9.0f, 43.0f,                -14.0f };        OMHotSurfaceFront hf = new OMHotSurfaceFront(llPoints2, OMSpline.DECIMAL_DEGREES, OMSpline.LINETYPE_STRAIGHT);        omList.add(hf);        float[] llPoints3 = { 55.0f, -14.0f, 50.0f, -9.0f, 45.0f, -11.0f,                43.0f, -16.0f };        OMOcclusion oc = new OMOcclusion(llPoints3, OMSpline.DECIMAL_DEGREES, OMSpline.LINETYPE_STRAIGHT);        omList.add(oc);        float[] llPoints4 = { 55.0f, -16.0f, 50.0f, -11.0f, 45.0f, -13.0f,                43.0f, -18.0f };        OMSpline spline3 = new OMDecoratedSpline(llPoints4,                OMSpline.DECIMAL_DEGREES, OMSpline.LINETYPE_STRAIGHT) {            protected void initDecorations() {                getDecorator().addDecoration(new TextShapeDecoration(" This one has a text ", new Font("arial", Font.PLAIN, 10), TextShapeDecoration.LEFT_TO_RIGHT                        + TextShapeDecoration.FOLLOW_POLY, TextShapeDecoration.CENTER));            }        };        //      omList.add(spline3);        OMLine line = new OMLine(40f, -75f, 42f, -70f, OMGraphic.LINETYPE_GREATCIRCLE);        //      line.addArrowHead(true);        line.addArrowHead(OMArrowHead.ARROWHEAD_DIRECTION_BOTH);        line.setStroke(new BasicStroke(2));        line.putAttribute(OMGraphicConstants.LABEL,                new OMTextLabeler("Line Label"));        omList.add(line);        OMGraphicList pointList = new OMGraphicList();        for (int i = 0; i < 100; i++) {            point = new OMPoint((float) (Math.random() * 89f), (float) (Math.random() * -179f), 3);            point.setSelectPaint(Color.yellow);            pointList.add(point);        }        omList.add(pointList);        OMEllipse ell = new OMEllipse(new LatLonPoint(60f, -110), 1000, 300, Length.NM, com.bbn.openmap.MoreMath.HALF_PI / 2.0);        ell.setLinePaint(Color.blue);        //      ell.setFillPaint(Color.yellow);        omList.add(ell);        ell = new OMEllipse(new LatLonPoint(40f, -75), 800, 250, Length.MILE, 0);        ell.setFillPaint(Color.yellow);        omList.add(ell);        float[] llp2 = new float[] { 0.41789755f, -1.435303f, 0.41813868f,                -1.3967744f };        OMPoly p2 = new OMPoly(llp2, OMGraphic.RADIANS, OMGraphic.LINETYPE_RHUMB);        p2.setLinePaint(Color.yellow);        omList.add(p2);        //      OMArc arc = new OMArc(40f, 65f, 750f, Length.MILE, 20f,        // 95f);        OMArc arc = new OMArc((float) 40.0, (float) 65.0, (float) 750.0, Length.MILE, (float) 20.0, (float) 95.0);        arc.setLinePaint(Color.red);        arc.setFillPaint(new Color(120, 0, 0, 128));        arc.setArcType(java.awt.geom.Arc2D.PIE);        arc.putAttribute(OMGraphicConstants.LABEL,                new OMTextLabeler("Arc Label", OMText.JUSTIFY_CENTER));        omList.add(arc);        OMAreaList combo = new OMAreaList();        combo.addOMGraphic(new OMLine((float) 50.453333, (float) 5.223889, (float) 50.375278, (float) 4.873889, 2));        combo.addOMGraphic(new OMLine((float) 50.375278, (float) 4.873889, (float) 50.436944, (float) 4.860556, 2));        //      combo.addOMGraphic(new OMLine((float) 50.436944, (float)        // 4.860556, (float) 50.436667, (float) 4.860833, 2));        //      combo.addOMGraphic(new OMLine((float) 50.436667, (float)        // 4.860833, (float) 50.490833, (float) 4.847778, 2));        //      combo.addOMGraphic(new OMLine((float) 50.491269, (float)        // 4.704239, (float) 50.490833, (float) 4.847778, 3));        combo.addOMGraphic(new OMArc((float) 50.491269, (float) 4.704239, (float) 0.09168520552327833, (float) (28.201865385183652 + 90.21758717585848), (float) -90.21758717585848));        combo.addOMGraphic(new OMLine((float) 50.534167, (float) 4.831111, (float) 50.640833, (float) 4.832222, 2));        combo.addOMGraphic(new OMLine((float) 50.640833, (float) 4.832222, (float) 50.547778, (float) 5.223889, 2));        combo.addOMGraphic(new OMLine((float) 50.547778, (float) 5.223889, (float) 50.453333, (float) 5.223889, 2));        //      combo.setConnectParts(true);        //      combo.addOMGraphic(new OMLine(30f, -125f, 30f, -100f,        // OMGraphic.LINETYPE_RHUMB));        //      combo.addOMGraphic(new OMLine(30f, -100f, 40f, -95f,        // OMGraphic.LINETYPE_GREATCIRCLE));        //      combo.addOMGraphic(new OMLine(40f, -95f, 50f, -145f,        // OMGraphic.LINETYPE_GREATCIRCLE));        //      combo.addOMGraphic(new OMLine(50f, -145f, 30f, -125f,        // OMGraphic.LINETYPE_STRAIGHT));        combo.setLinePaint(Color.blue);        combo.setFillPaint(Color.green);        omList.add(combo);        OMAreaList combo1 = new OMAreaList();        combo1.addOMGraphic(new OMLine(66.618519f, 141.563497f, 66.028244f, 140.193964f, OMGraphic.LINETYPE_GREATCIRCLE));        combo1.addOMGraphic(new OMLine(66.028244f, 140.193964f, 66.968058f, 137.611042f, OMGraphic.LINETYPE_RHUMB));        combo1.addOMGraphic(new OMLine(66.968058f, 137.611042f, 67.558261f, 139.033958f, OMGraphic.LINETYPE_GREATCIRCLE));        combo1.addOMGraphic(new OMLine(67.558261f, 139.033958f, 66.618519f, 141.563497f, OMGraphic.LINETYPE_RHUMB));        combo1.setLinePaint(Color.red);        combo1.setFillPaint(Color.blue);        omList.add(combo1);        combo1 = new OMAreaList();        combo1.addOMGraphic(new OMLine(65.495278f, 55.488889f, 65.022778f, 55.749167f, OMGraphic.LINETYPE_GREATCIRCLE));        combo1.addOMGraphic(new OMLine(65.022778f, 55.749167f, 64.970278f, 55.208611f, OMGraphic.LINETYPE_RHUMB));        combo1.addOMGraphic(new OMLine(64.970278f, 55.208611f, 65.442778f, 54.948889f, OMGraphic.LINETYPE_GREATCIRCLE));        combo1.addOMGraphic(new OMLine(65.442778f, 54.948889f, 65.495278f, 55.488889f, OMGraphic.LINETYPE_RHUMB));        combo1.setLinePaint(Color.blue);        combo1.setFillPaint(Color.red);        omList.add(combo1);        //         OMArc arc1 = new OMArc(100, 100, 200, 200, 0f, -45f);        //         arc1.setLinePaint(Color.blue);        //         arc1.setFillPaint(Color.yellow);        //         arc1.setArcType(java.awt.geom.Arc2D.PIE);        //         omList.add(arc1);        OMText text = new OMText(30f, 80f, "Testing FontSizer", OMText.JUSTIFY_CENTER);        text.setFontSizer(new FontSizer(30000000f, 1, 5, 40));        omList.add(text);        if (srl != null) {            ImageIcon ii = srl.getIcon("SFPPV-----*****",                    new Dimension(100, 100));            if (ii != null) {                OMScalingIcon omsi = new OMScalingIcon(20f, -50f, ii);                omsi.setBaseScale(1000000);                omsi.setMinScale(1000000);                omsi.setMaxScale(5000000);                omList.add(omsi);            } else {                Debug.output("DemoLayer: couldn't create symbol from SymbolReferenceLibrary");            }        }        return omList;    }