コード例 #1
0
 public void refresh() {
   super.refresh();
   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.refresh();
     }
   }
 }
コード例 #2
0
 public void setVisitObject(PrintAbstract printObject) {
   if (mPrintType == PAGE) setActive(mPrintPage.equals(printObject));
   else setActive(getPrintArea().equals(printObject));
   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.setVisit(printObject);
     }
   }
 }
コード例 #3
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);
       }
 }
コード例 #4
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);
     }
   }
 }