2 Replies Latest reply: Aug 8, 2012 10:55 AM by 954328 RSS

    'NoteSpec' markup entity

    954328
      Hello,

      I am writting a java application, using the VueBean API, that will add AutoVue markups to a document.

      I wish to use the 'NoteSpec' markup entity, which we have not used before, but it is unclear in the JavaDocs, what value should be passed in the 'icon' parameter, eg:

      NoteSpec(MarkupEntitySpec spec, PAN_CtlPoint ipt, java.lang.String icon, byte[] data)

      I believe the standard AutoVue note icon is 'com/cimmetry/vueframe/images/71_note_entity_small.png'

      But if I use this value I get the following exception when calling 'v_vueBean.getMarkupBean().writeMarkup(os);'
      Which suggests that the icon cannot be found and thus the 'convert' fails.

      java.lang.NullPointerException
           at com.cimmetry.markupbean.convert.p.a(Unknown Source)
           at com.cimmetry.markupbean.MarkupShape.b(Unknown Source)
           at com.cimmetry.markupbean.MarkupNote.write(Unknown Source)
           at com.cimmetry.markupbean.MarkupImpl.a(Unknown Source)
           at com.cimmetry.markupbean.MarkupImpl.e(Unknown Source)
           at com.cimmetry.markupbean.MarkupImpl.write(Unknown Source)
           at com.cimmetry.markupbean.MarkupBean.writeMarkup(Unknown Source)


      Would it be possible for someone to confirm the 'icon' value that we should be using.
      Or provide example code for this markup entity type.

      Best Regards, Richard
        • 1. Re: 'NoteSpec' markup entity
          ArtashesGamarian
          If you just want the default icon then you can pass null as icon parameter.

          Generally 'icon' parameter takes anything you can pass to java.awt.Toolkit.createImage(String) method.

          If you want to use the icon you mentioned then you'll need to add / in the beginning of path.

          However I don't think your exception is thrown because of the icon, I think you don't have the font set properly on the spec.

          You can either create font explicitly and set it on the spec through spec.setFont() or initialize to profile value through spec.loadProfile().
          • 2. Re: 'NoteSpec' markup entity
            954328
            Artash, thankyou for identifying the cause of the problem, it was indeed the missing font, that was the issue.