Esempio n. 1
0
  @Override
  public void fillWithDimensionItem(Segment segment, DimensionItem dimensionItem) {
    StorageElementLink storageElementLink =
        ((SheetDimentionItem) dimensionItem).getStorageElementLink();
    Board board = (Board) storageElementLink.getStoreElement();
    segment.setMaterialLength(board.getLength());
    segment.setMaterialWidth(board.getWidth());

    int length =
        FacadeContext.getCutterFacade()
            .trim(dimensionItem.getDimension(), board.getBoardDef().getCutter())
            .getWidth();
    int width =
        FacadeContext.getCutterFacade()
            .trim(dimensionItem.getDimension(), board.getBoardDef().getCutter())
            .getHeight();

    if (storageElementLink.getStripsEntity() instanceof StripsEntity) {
      length -= board.getBoardDef().getReservedLength().intValue();
      width -= board.getBoardDef().getReservedLength().intValue();
    }

    segment.setLength(length);
    segment.setWidth(width);
  }
Esempio n. 2
0
  public static void main(String[] args) {
    new SpringConfiguration();
    FacadeContext.getBoardFacade().findBy(54621L);
    HibernateInterceptor hibernateInterceptor =
        (HibernateInterceptor)
            FacadeContext.getApplicationContext().getBean("hibernateInterceptor");
    Session session = hibernateInterceptor.getSessionFactory().openSession();
    updateBordersDef(session);
    updateBoardDef(session);

    updateTexture(session);
    updateService(session);

    updateFurnitureLink(session);
    updateAdditional(session);
    updateBOARD(session);
    updateBORDER(session);

    session.close();
  }
Esempio n. 3
0
  @Override
  protected void initChildren() {
    List<OrderItem> orderItems =
        FacadeContext.getOrderItemFacade().findBy(getOrder(), OrderItemType.first);
    for (OrderItem orderItem : orderItems) {
      AOrderNode node =
          nodeBuilder.build(
              OrderItemNode.class,
              MapUtils.putAll(
                  new HashMap<String, Object>(), new Object[] {"orderItem", orderItem}));
      add(node);
    }
    orderItems = FacadeContext.getOrderItemFacade().findBy(getOrder(), OrderItemType.common);
    for (OrderItem orderItem : orderItems) {
      if (orderItem.getSource() == null) {
        AOrderNode node =
            nodeBuilder.build(
                OrderItemNode.class,
                MapUtils.putAll(
                    new HashMap<String, Object>(), new Object[] {"orderItem", orderItem}));
        add(node);
      }
    }

    if (getOrder() instanceof Order) {
      add(
          nodeBuilder.build(
              TemplatesNode.class,
              MapUtils.putAll(
                  new HashMap<String, Object>(), new Object[] {"nodeBuilder", nodeBuilder})));
      add(nodeBuilder.build(AGTFacadeNode.class, MapUtils.EMPTY_MAP));
      add(nodeBuilder.build(ZFacadeNode.class, MapUtils.EMPTY_MAP));
    } else if (getOrder() instanceof TemplateOrder) {
      add(nodeBuilder.build(TemplateFacadeNode.class, MapUtils.EMPTY_MAP));
    }
  }
Esempio n. 4
0
 @Override
 public List<RestBoardDimension> getRestDimensions(Strips strips) {
   ArrayList<RestBoardDimension> dimensions = new ArrayList<RestBoardDimension>();
   for (Segment segment : strips.getItems()) {
     if (segment.getElements().length > 0) {
       StorageElementLink storageElementLink =
           FacadeContext.getBoardFacade().getStorageElementLinkBy(segment);
       Board board =
           storageElementLink != null
               ? (Board) storageElementLink.getStoreElement()
               : ((SheetDimentionItem) segment.getDimensionItem()).getBoard();
       dimensions.addAll(getFreeDimensions(board, segment));
     }
   }
   return dimensions;
 }
Esempio n. 5
0
 @Override
 public void newValue() {
   OrderGroup e = FacadeContext.getOrderGroupFacade().createOrderGroup();
   setSelectedElement(e);
   showWizard();
 }
Esempio n. 6
0
 private void initTableCellComponents() {
   for (int k = 0; k < getModel().getColumnCount(); k++) {
     OrderTableColumn column = OrderTableColumn.valuerOf(k);
     TableColumn tableColumn = getColumnModel().getColumn(k);
     ComplexCell cellComp;
     switch (column) {
       case boardDef:
         tableColumn.setCellEditor(new BoardDefCellEditor(this));
         tableColumn.setCellRenderer(new EntityTableRenderer<BoardDef>());
         break;
       case texture:
         tableColumn.setCellEditor(new TextureCellEditor(this));
         tableColumn.setCellRenderer(new EntityTableRenderer<TextureEntity>());
         break;
       case manufacturer:
         TableEditorsRenders.ItemsComboBox<Manufacturer> cb =
             new TableEditorsRenders.ItemsComboBox<Manufacturer>();
         cb.getItems().addAll(FacadeContext.getManufacturerFacade().loadAllSortedBy("name"));
         tableColumn.setCellEditor(new DefaultCellEditor(cb));
         tableColumn.setCellRenderer(new EntityTableRenderer<Manufacturer>());
         break;
       case length:
       case width:
       case count:
         final JTextField tf = new JTextField();
         tf.setDocument(new NumericDocument());
         tableColumn.setCellEditor(new DefaultCellEditor(tf));
         break;
       case glueing:
         cellComp = new ComplexCell();
         tableColumn.setCellEditor(cellComp);
         tableColumn.setCellRenderer(new ButtonCellRenderer(true));
         break;
       case milling:
         millingCellEditor = new MillingCellEditor();
         tableColumn.setCellEditor(millingCellEditor);
         tableColumn.setCellRenderer(new DefaultTableRenderer(new MillingCheckBoxProvider()));
         break;
       case drilling:
         DrillingCellEditor editor = new DrillingCellEditor();
         editor.setContext(context);
         tableColumn.setCellEditor(editor);
         tableColumn.setCellRenderer(new ButtonCellRenderer(false));
         break;
       case groove:
         cellComp = new CommonCellEditor();
         tableColumn.setCellEditor(cellComp);
         tableColumn.setCellRenderer(new ButtonCellRenderer(true));
         break;
       case a45:
         cellComp = new TextSideCellEditor();
         tableColumn.setCellEditor(cellComp);
         tableColumn.setCellRenderer(new ButtonCellRenderer(true));
         break;
       case cutoff:
         tableColumn.setCellEditor(new PopupEditor(new CutoffComponentProvider()));
         tableColumn.setCellRenderer(new DefaultTableRenderer(new CutoffCheckBoxProvider()));
         break;
     }
     if (tableColumn.getCellEditor() instanceof DefaultCellEditor) {
       ((DefaultCellEditor) tableColumn.getCellEditor()).setClickCountToStart(1);
     }
   }
 }