public OMGraphicList init(){
  OMGraphicList omList=new OMGraphicList();
  OMLine line=new OMLine(40f,-75f,42f,-70f,OMGraphic.LINETYPE_GREATCIRCLE);
  line.setStroke(new BasicStroke(2));
  line.putAttribute(OMGraphicConstants.LABEL,new OMTextLabeler("Line Label"));
  line.setLinePaint(Color.red);
  line.setSelectPaint(Color.blue);
  line.putAttribute(OMGraphicConstants.TOOLTIP,"This is an OMLine.");
  omList.add(line);
  OMGraphicList pointList=new OMGraphicList();
  for (int i=0; i < 100; i++) {
    OMPoint point=new OMPoint((float)(Math.random() * 89f),(float)(Math.random() * -179f),3);
    point.putAttribute(OMGraphicConstants.TOOLTIP,"This is OMPoint #" + i);
    point.setLinePaint(Color.green);
    point.setSelectPaint(Color.yellow);
    pointList.add(point);
  }
  omList.add(pointList);
  return omList;
}

public OMGraphicList init ( ) { OMGraphicList omList = new OMGraphicList ( ) ; OMLine line = new OMLine ( 40f , - 75f , 42f , - 70f , OMGraphic . LINETYPE_GREATCIRCLE ) ; line . setStroke ( new BasicStroke ( 2 ) ) ; line . putAttribute ( OMGraphicConstants . LABEL , new OMTextLabeler ( "Line Label" ) ) ; line . setLinePaint ( Color . red ) ; line . setSelectPaint ( Color . blue ) ; line . putAttribute ( OMGraphicConstants . TOOLTIP , "This is an OMLine." ) ; omList . add ( line ) ; OMGraphicList pointList = new OMGraphicList ( ) ; for ( int i = 0 ; i < 100 ; i ++ ) { OMPoint point = new OMPoint ( ( float ) ( Math . random ( ) * 89f ) , ( float ) ( Math . random ( ) * - 179f ) , 3 ) ; point . putAttribute ( OMGraphicConstants . TOOLTIP , "This is OMPoint #" + i ) ; point . setLinePaint ( Color . green ) ; point . setSelectPaint ( Color . yellow ) ; pointList . add ( point ) ; } omList . add ( pointList ) ; return omList ; }
called from the prepare ( ) method if the layer discovers that its omgraphiclist is null . this method is being overridden so that tooltips can be set as attributes on the omgraphics , and retrieved later in the gesturing queries .
