Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.NoteRecord


                               new HashMap<Integer, TextObjectRecord>();
        int i = 0;
        for (Iterator<RecordBase> it = sheet.getRecords().iterator(); it.hasNext();) {
            RecordBase rec = it.next();
            if (rec instanceof NoteRecord) {
                NoteRecord note = (NoteRecord) rec;
                if (note.getRow() == row && note.getColumn() == column) {
                    if(i < noteTxo.size()) {
                        TextObjectRecord txo = noteTxo.get(note.getShapeId());
                        if(txo != null){
                            comment = new HSSFComment(note, txo);
                            comment.setRow(note.getRow());
                            comment.setColumn(note.getColumn());
                            comment.setAuthor(note.getAuthor());
                            comment.setVisible(note.getFlags() == NoteRecord.NOTE_VISIBLE);
                            comment.setString(txo.getStr());    
                        } else{
                            log.log(POILogger.WARN, "Failed to match NoteRecord and TextObjectRecord, row: " + row + ", column: " + column);
                         }
                    } else {
View Full Code Here


          // Exand this out into multiple regular number cells
          MulRKRecord mrk = (MulRKRecord)record;
          expandedRecords = RecordFactory.convertRKRecords(mrk);
          break;
        case NoteRecord.sid:
          NoteRecord nrec = (NoteRecord) record;
          thisRow = nrec.getRow();
          thisColumn = nrec.getColumn();
          break;
      }
    }
   
    // First part of expanded record handling
View Full Code Here

                               new HashMap<Integer, TextObjectRecord>();
        int i = 0;
        for (Iterator<RecordBase> it = sheet.getRecords().iterator(); it.hasNext();) {
            RecordBase rec = it.next();
            if (rec instanceof NoteRecord) {
                NoteRecord note = (NoteRecord) rec;
                if (note.getRow() == row && note.getColumn() == column) {
                    if(i < noteTxo.size()) {
                        TextObjectRecord txo = noteTxo.get(note.getShapeId());
                        comment = new HSSFComment(note, txo);
                        comment.setRow(note.getRow());
                        comment.setColumn((short) note.getColumn());
                        comment.setAuthor(note.getAuthor());
                        comment.setVisible(note.getFlags() == NoteRecord.NOTE_VISIBLE);
                        comment.setString(txo.getStr());
                    } else {
                        log.log(POILogger.WARN, "Failed to match NoteRecord and TextObjectRecord, row: " + row + ", column: " + column);
                    }
                    break;
View Full Code Here

            //  destination row. Note that comments can
            //  exist for cells which are null
            if(moveComments) {
                // This code would get simpler if NoteRecords could be organised by HSSFRow.
                for(int i=noteRecs.length-1; i>=0; i--) {
                    NoteRecord nr = noteRecs[i];
                    if (nr.getRow() != rowNum) {
                        continue;
                    }
                    HSSFComment comment = getCellComment(rowNum, nr.getColumn());
                    if (comment != null) {
                       comment.setRow(rowNum + n);
                    }
                }
            }
View Full Code Here

                    value = value.equals("") ? " " : value;
                    rowList.add(index, value);
                }
                break;
            case NoteRecord.sid:// 备注记录
                NoteRecord nrec = (NoteRecord) record;

                thisRow = nrec.getRow();
                thisColumn = nrec.getColumn();
                // TODO: Find object to match nrec.getShapeId()
                thisStr = '"' + "(TODO)" + '"';
                break;
            case NumberRecord.sid:  // 数值记录
                NumberRecord numrec = (NumberRecord) record;
View Full Code Here

          throw new IllegalStateException("No SST record found");
        }
        thisText = sstRecord.getString(lsrec.getSSTIndex()).toString();
        break;
      case NoteRecord.sid:
        NoteRecord nrec = (NoteRecord) record;
        thisRow = nrec.getRow();
        // TODO: Find object to match nrec.getShapeId()
        break;
      case NumberRecord.sid:
        NumberRecord numrec = (NumberRecord) record;
        thisRow = numrec.getRow();
View Full Code Here

        ArrayList<TextObjectRecord> noteTxo = new ArrayList<TextObjectRecord>();
        int i = 0;
        for (Iterator<RecordBase> it = sheet.getRecords().iterator(); it.hasNext();) {
            RecordBase rec = it.next();
            if (rec instanceof NoteRecord) {
                NoteRecord note = (NoteRecord) rec;
                if (note.getRow() == row && note.getColumn() == column) {
                    if(i < noteTxo.size()) {
                        TextObjectRecord txo = noteTxo.get(i);
                        comment = new HSSFComment(note, txo);
                        comment.setRow(note.getRow());
                        comment.setColumn((short) note.getColumn());
                        comment.setAuthor(note.getAuthor());
                        comment.setVisible(note.getFlags() == NoteRecord.NOTE_VISIBLE);
                        comment.setString(txo.getStr());
                    } else {
                        log.log(POILogger.WARN, "Failed to match NoteRecord and TextObjectRecord, row: " + row + ", column: " + column);
                    }
                    break;
View Full Code Here

            //  destination row. Note that comments can
            //  exist for cells which are null
            if(moveComments) {
                // This code would get simpler if NoteRecords could be organised by HSSFRow.
                for(int i=noteRecs.length-1; i>=0; i--) {
                    NoteRecord nr = noteRecs[i];
                    if (nr.getRow() != rowNum) {
                        continue;
                    }
                    HSSFComment comment = getCellComment(rowNum, nr.getColumn());
                    if (comment != null) {
                       comment.setRow(rowNum + n);
                    }
                }
            }
View Full Code Here

                               new HashMap<Integer, TextObjectRecord>();
        int i = 0;
        for (Iterator<RecordBase> it = sheet.getRecords().iterator(); it.hasNext();) {
            RecordBase rec = it.next();
            if (rec instanceof NoteRecord) {
                NoteRecord note = (NoteRecord) rec;
                if (note.getRow() == row && note.getColumn() == column) {
                    if(i < noteTxo.size()) {
                        TextObjectRecord txo = noteTxo.get(note.getShapeId());
                        if(txo != null){
                            comment = new HSSFComment(note, txo);
                            comment.setRow(note.getRow());
                            comment.setColumn(note.getColumn());
                            comment.setAuthor(note.getAuthor());
                            comment.setVisible(note.getFlags() == NoteRecord.NOTE_VISIBLE);
                            comment.setString(txo.getStr());    
                        } else{
                            log.log(POILogger.WARN, "Failed to match NoteRecord and TextObjectRecord, row: " + row + ", column: " + column);
                         }
                    } else {
View Full Code Here

     * Creates the low level <code>NoteRecord</code>
     *  which holds the comment attributes.
     */
     private NoteRecord createNoteRecord( HSSFComment shape, int shapeId )
    {
        NoteRecord note = new NoteRecord();
        note.setColumn(shape.getColumn());
        note.setRow(shape.getRow());
        note.setFlags(shape.isVisible() ? NoteRecord.NOTE_VISIBLE : NoteRecord.NOTE_HIDDEN);
        note.setShapeId(shapeId);
        note.setAuthor(shape.getAuthor() == null ? "" : shape.getAuthor());
        return note;
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.NoteRecord

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.