public static DbfTableModel createDefaultModel(EsriGraphicList list){
  if (logger.isLoggable(Level.FINE))   logger.fine("ESE: creating DbfTableModel");
  DbfTableModel _model=new DbfTableModel(7);
  _model.setLength(0,(byte)50);
  _model.setColumnName(0,SHAPE_DBF_DESCRIPTION);
  _model.setType(0,(byte)DbfTableModel.TYPE_CHARACTER);
  _model.setDecimalCount(0,(byte)0);
  _model.setLength(1,(byte)10);
  _model.setColumnName(1,SHAPE_DBF_LINECOLOR);
  _model.setType(1,(byte)DbfTableModel.TYPE_CHARACTER);
  _model.setDecimalCount(1,(byte)0);
  _model.setLength(2,(byte)10);
  _model.setColumnName(2,SHAPE_DBF_FILLCOLOR);
  _model.setType(2,(byte)DbfTableModel.TYPE_CHARACTER);
  _model.setDecimalCount(2,(byte)0);
  _model.setLength(3,(byte)10);
  _model.setColumnName(3,SHAPE_DBF_SELECTCOLOR);
  _model.setType(3,(byte)DbfTableModel.TYPE_CHARACTER);
  _model.setDecimalCount(3,(byte)0);
  _model.setLength(4,(byte)4);
  _model.setColumnName(4,SHAPE_DBF_LINEWIDTH);
  _model.setType(4,(byte)DbfTableModel.TYPE_NUMERIC);
  _model.setDecimalCount(4,(byte)0);
  _model.setLength(5,(byte)20);
  _model.setColumnName(5,SHAPE_DBF_DASHPATTERN);
  _model.setType(5,(byte)DbfTableModel.TYPE_CHARACTER);
  _model.setDecimalCount(5,(byte)0);
  _model.setLength(6,(byte)10);
  _model.setColumnName(6,SHAPE_DBF_DASHPHASE);
  _model.setType(6,(byte)DbfTableModel.TYPE_NUMERIC);
  _model.setDecimalCount(6,(byte)4);
  int count=0;
  for (  OMGraphic omg : list) {
    Object index=omg.getAttribute(SHAPE_INDEX_ATTRIBUTE);
    if (index == null) {
      index=new Integer(count);
      omg.putAttribute(SHAPE_INDEX_ATTRIBUTE,index);
    }
    count++;
    List<Object> record=new ArrayList<Object>();
    Object obj=omg.getAttribute(SHAPE_DBF_DESCRIPTION);
    if (obj instanceof String) {
      record.add(obj);
    }
 else {
      record.add("");
    }
    record.add(ColorFactory.getHexColorString(omg.getLineColor()));
    record.add(ColorFactory.getHexColorString(omg.getFillColor()));
    record.add(ColorFactory.getHexColorString(omg.getSelectColor()));
    BasicStroke bs=(BasicStroke)omg.getStroke();
    record.add(new Double(bs.getLineWidth()));
    String dp=BasicStrokeEditor.dashArrayToString(bs.getDashArray());
    if (dp == BasicStrokeEditor.NONE) {
      dp="";
    }
    record.add(dp);
    record.add(new Double(bs.getDashPhase()));
    _model.addRecord(record);
    if (logger.isLoggable(Level.FINER))     logger.finer("ESE: adding record: " + record);
  }
  return _model;
}

public static DbfTableModel createDefaultModel ( EsriGraphicList list ) { if ( logger . isLoggable ( Level . FINE ) ) logger . fine ( "ESE: creating DbfTableModel" ) ; DbfTableModel _model = new DbfTableModel ( 7 ) ; _model . setLength ( 0 , ( byte ) 50 ) ; _model . setColumnName ( 0 , SHAPE_DBF_DESCRIPTION ) ; _model . setType ( 0 , ( byte ) DbfTableModel . TYPE_CHARACTER ) ; _model . setDecimalCount ( 0 , ( byte ) 0 ) ; _model . setLength ( 1 , ( byte ) 10 ) ; _model . setColumnName ( 1 , SHAPE_DBF_LINECOLOR ) ; _model . setType ( 1 , ( byte ) DbfTableModel . TYPE_CHARACTER ) ; _model . setDecimalCount ( 1 , ( byte ) 0 ) ; _model . setLength ( 2 , ( byte ) 10 ) ; _model . setColumnName ( 2 , SHAPE_DBF_FILLCOLOR ) ; _model . setType ( 2 , ( byte ) DbfTableModel . TYPE_CHARACTER ) ; _model . setDecimalCount ( 2 , ( byte ) 0 ) ; _model . setLength ( 3 , ( byte ) 10 ) ; _model . setColumnName ( 3 , SHAPE_DBF_SELECTCOLOR ) ; _model . setType ( 3 , ( byte ) DbfTableModel . TYPE_CHARACTER ) ; _model . setDecimalCount ( 3 , ( byte ) 0 ) ; _model . setLength ( 4 , ( byte ) 4 ) ; _model . setColumnName ( 4 , SHAPE_DBF_LINEWIDTH ) ; _model . setType ( 4 , ( byte ) DbfTableModel . TYPE_NUMERIC ) ; _model . setDecimalCount ( 4 , ( byte ) 0 ) ; _model . setLength ( 5 , ( byte ) 20 ) ; _model . setColumnName ( 5 , SHAPE_DBF_DASHPATTERN ) ; _model . setType ( 5 , ( byte ) DbfTableModel . TYPE_CHARACTER ) ; _model . setDecimalCount ( 5 , ( byte ) 0 ) ; _model . setLength ( 6 , ( byte ) 10 ) ; _model . setColumnName ( 6 , SHAPE_DBF_DASHPHASE ) ; _model . setType ( 6 , ( byte ) DbfTableModel . TYPE_NUMERIC ) ; _model . setDecimalCount ( 6 , ( byte ) 4 ) ; int count = 0 ; for ( OMGraphic omg : list ) { Object index = omg . getAttribute ( SHAPE_INDEX_ATTRIBUTE ) ; if ( index == null ) { index = new Integer ( count ) ; omg . putAttribute ( SHAPE_INDEX_ATTRIBUTE , index ) ; } count ++ ; List < Object > record = new ArrayList < Object > ( ) ; Object obj = omg . getAttribute ( SHAPE_DBF_DESCRIPTION ) ; if ( obj instanceof String ) { record . add ( obj ) ; } else { record . add ( "" ) ; } record . add ( ColorFactory . getHexColorString ( omg . getLineColor ( ) ) ) ; record . add ( ColorFactory . getHexColorString ( omg . getFillColor ( ) ) ) ; record . add ( ColorFactory . getHexColorString ( omg . getSelectColor ( ) ) ) ; BasicStroke bs = ( BasicStroke ) omg . getStroke ( ) ; record . add ( new Double ( bs . getLineWidth ( ) ) ) ; String dp = BasicStrokeEditor . dashArrayToString ( bs . getDashArray ( ) ) ; if ( dp == BasicStrokeEditor . NONE ) { dp = "" ; } record . add ( dp ) ; record . add ( new Double ( bs . getDashPhase ( ) ) ) ; _model . addRecord ( record ) ; if ( logger . isLoggable ( Level . FINER ) ) logger . finer ( "ESE: adding record: " + record ) ; } return _model ; }
prepares and returns a 7 column dbftablemodel to accept input for columns of type_character . < br > < br > the default model used holds most of the drawingattributes of the omgraphics .
