Package net.sf.mpxj

Examples of net.sf.mpxj.Column


      if (data != null)
      {
         int columnCount = MPPUtility.getShort(data, 4) + 1;
         int index = 12;
         Column column;
         int alignment;

         for (int loop = 0; loop < columnCount; loop++)
         {
            column = new Column(file);
            int fieldType = MPPUtility.getShort(data, index);
            if (table.getResourceFlag() == false)
            {
               column.setFieldType(MPPTaskField14.getInstance(fieldType));
            }
            else
            {
               column.setFieldType(MPPResourceField14.getInstance(fieldType));
            }

            //System.out.println(fieldType);

            //            if (column.getFieldType() == null)
            //            {
            //               System.out.println(loop + ": Unknown column type " + fieldType);
            //            }
            //            else
            //            {
            //               System.out.println(loop + ": " + column.getFieldType());
            //            }

            column.setWidth(MPPUtility.getByte(data, index + 4));

            String columnTitle = MPPUtility.getUnicodeString(data, index + 13);
            if (columnTitle.length() != 0)
            {
               column.setTitle(columnTitle);
            }

            alignment = MPPUtility.getByte(data, index + 5);
            if ((alignment & 0x0F) == 0x00)
            {
               column.setAlignTitle(Column.ALIGN_LEFT);
            }
            else
            {
               if ((alignment & 0x0F) == 0x01)
               {
                  column.setAlignTitle(Column.ALIGN_CENTER);
               }
               else
               {
                  column.setAlignTitle(Column.ALIGN_RIGHT);
               }
            }

            alignment = MPPUtility.getByte(data, index + 7);
            if ((alignment & 0x0F) == 0x00)
            {
               column.setAlignData(Column.ALIGN_LEFT);
            }
            else
            {
               if ((alignment & 0x0F) == 0x01)
               {
                  column.setAlignData(Column.ALIGN_CENTER);
               }
               else
               {
                  column.setAlignData(Column.ALIGN_RIGHT);
               }
            }

            table.addColumn(column);
            index += 115;
View Full Code Here


      if (data != null)
      {
         int columnCount = MPPUtility.getShort(data, 4) + 1;
         int index = 8;
         int columnTitleOffset;
         Column column;
         int alignment;

         for (int loop = 0; loop < columnCount; loop++)
         {
            column = new Column(file);
            int fieldType = MPPUtility.getShort(data, index);
            if (table.getResourceFlag() == false)
            {
               column.setFieldType(MPPTaskField.getInstance(fieldType));
            }
            else
            {
               column.setFieldType(MPPResourceField.getInstance(fieldType));
            }

            //                        if (column.getFieldType() == null)
            //                        {
            //                           System.out.println(loop + ": Unknown column type " + fieldType);
            //                        }
            //                        else
            //                        {
            //                           System.out.println(loop + ": " + column.getFieldType());
            //                        }

            column.setWidth(MPPUtility.getByte(data, index + 4));

            columnTitleOffset = MPPUtility.getShort(data, index + 6);
            if (columnTitleOffset != 0)
            {
               column.setTitle(MPPUtility.getUnicodeString(data, columnTitleOffset));
            }

            alignment = MPPUtility.getByte(data, index + 8);
            if ((alignment & 0x0F) == 0x00)
            {
               column.setAlignTitle(Column.ALIGN_LEFT);
            }
            else
            {
               if ((alignment & 0x0F) == 0x01)
               {
                  column.setAlignTitle(Column.ALIGN_CENTER);
               }
               else
               {
                  column.setAlignTitle(Column.ALIGN_RIGHT);
               }
            }

            alignment = MPPUtility.getByte(data, index + 10);
            if ((alignment & 0x0F) == 0x00)
            {
               column.setAlignData(Column.ALIGN_LEFT);
            }
            else
            {
               if ((alignment & 0x0F) == 0x01)
               {
                  column.setAlignData(Column.ALIGN_CENTER);
               }
               else
               {
                  column.setAlignData(Column.ALIGN_RIGHT);
               }
            }

            table.addColumn(column);
            index += 12;
View Full Code Here

   private void processColumnData(Table table, byte[] data)
   {
      int columnCount = MPPUtility.getShort(data, 4) + 1;
      int index = 8;
      int columnTitleOffset;
      Column column;
      int alignment;

      for (int loop = 0; loop < columnCount; loop++)
      {
         column = new Column(m_file);

         if (loop == 0)
         {
            if (MPPUtility.getShort(data, index) == 0)
            {
               table.setResourceFlag(true);
            }
            else
            {
               table.setResourceFlag(false);
            }
         }

         if (table.getResourceFlag() == false)
         {
            column.setFieldType(MPPTaskField.getInstance(MPPUtility.getShort(data, index)));
         }
         else
         {
            column.setFieldType(MPPResourceField.getInstance(MPPUtility.getShort(data, index)));
         }

         column.setWidth(MPPUtility.getByte(data, index + 4));

         columnTitleOffset = MPPUtility.getShort(data, index + 6);
         if (columnTitleOffset != 0)
         {
            column.setTitle(MPPUtility.getUnicodeString(data, columnTitleOffset));
         }

         alignment = MPPUtility.getByte(data, index + 8);
         if (alignment == 32)
         {
            column.setAlignTitle(Column.ALIGN_LEFT);
         }
         else
         {
            if (alignment == 33)
            {
               column.setAlignTitle(Column.ALIGN_CENTER);
            }
            else
            {
               column.setAlignTitle(Column.ALIGN_RIGHT);
            }
         }

         alignment = MPPUtility.getByte(data, index + 10);
         if (alignment == 32)
         {
            column.setAlignData(Column.ALIGN_LEFT);
         }
         else
         {
            if (alignment == 33)
            {
               column.setAlignData(Column.ALIGN_CENTER);
            }
            else
            {
               column.setAlignData(Column.ALIGN_RIGHT);
            }
         }

         table.addColumn(column);
         index += 12;
View Full Code Here

TOP

Related Classes of net.sf.mpxj.Column

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.