Ejemplo n.º 1
0
 public void initialize() {
   int idx = 0;
   while (idx < mContainer.count()) {
     GUIComponent cmp = mContainer.get(idx);
     if (GUIContainer.class.isInstance(cmp)
         && PrintPanelObject.class.isInstance(((GUIContainer) cmp).getObject()))
       mContainer.remove(idx);
     else idx++;
   }
   PrintArea area = getPrintArea();
   if (area != null)
     for (int index = 0; index < area.size(); index++)
       if (PrintContainer.class.isInstance(area.get(index))) {
         PrintPanelObject new_obj =
             new PrintPanelObject(
                 mObserver,
                 mContainer.createContainer(ContainerType.CT_NORMAL, new GUIParam(0, 0)));
         new_obj.setPrintContainer((PrintContainer) area.get(index));
         new_obj.setSizeEchelle(mEchelle);
       }
 }
Ejemplo n.º 2
0
 public void setSizeEchelle(int echelle) {
   super.setSizeEchelle(echelle);
   double width = 0;
   double height = 0;
   switch (mPrintType) {
     case CENTER:
       width =
           mPrintPage.page_width
               - mPrintPage.margin_left
               - mPrintPage.margin_right
               - mPrintPage.left.extent
               - mPrintPage.rigth.extent;
       height =
           mPrintPage.page_height
               - mPrintPage.margin_top
               - mPrintPage.margin_bottom
               - mPrintPage.header.extent
               - mPrintPage.bottom.extent;
       break;
     case NORTH:
       width = mPrintPage.page_width - mPrintPage.margin_left - mPrintPage.margin_right;
       height = mPrintPage.header.extent;
       break;
     case SOUTH:
       width = mPrintPage.page_width - mPrintPage.margin_left - mPrintPage.margin_right;
       height = mPrintPage.bottom.extent;
       break;
     case EAST:
       width = mPrintPage.rigth.extent;
       height =
           mPrintPage.page_height
               - mPrintPage.margin_top
               - mPrintPage.margin_bottom
               - mPrintPage.header.extent
               - mPrintPage.bottom.extent;
       break;
     case WEST:
       width = mPrintPage.left.extent;
       height =
           mPrintPage.page_height
               - mPrintPage.margin_top
               - mPrintPage.margin_bottom
               - mPrintPage.header.extent
               - mPrintPage.bottom.extent;
       break;
     case PAGE:
       mContainer.setBorder(
           (int) (mPrintPage.margin_top * echelle / Ratio),
           (int) (mPrintPage.margin_left * echelle / Ratio),
           (int) (mPrintPage.margin_bottom * echelle / Ratio),
           (int) (mPrintPage.margin_right * echelle / Ratio),
           0xFFFFFF);
       width = mPrintPage.page_width;
       height = mPrintPage.page_height;
       break;
     default:
       // TODO: Implement 'default' statement
       break;
   }
   mContainer.setSize((int) (width * echelle / Ratio), (int) (height * echelle / Ratio));
   mContainer.setMinimumSize((int) (width * echelle / Ratio), (int) (height * echelle / Ratio));
   mContainer.setMaximumSize((int) (width * echelle / Ratio), (int) (height * echelle / Ratio));
   for (int index = 0; index < mContainer.count(); index++) {
     GUIComponent cmp = mContainer.get(index);
     if (GUIContainer.class.isInstance(cmp)
         && PrintPanelObject.class.isInstance(((GUIContainer) cmp).getObject())) {
       PrintPanelObject current_obj = (PrintPanelObject) ((GUIContainer) cmp).getObject();
       current_obj.setSizeEchelle(echelle);
     }
   }
 }