Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.ConstructionType


    super(managerRepository);
  }

  protected void addSketchImageToParameters(Transportable transportable,
      Map<String, Object> parameters) {
    ConstructionType constructionType = transportable.getConstructionType();
    InputStream iconStream = null;

    if (constructionType != null
        && constructionType.getSketchName() != null) {
      iconStream = getClass().getClassLoader().getResourceAsStream(
          "images/" + constructionType.getSketchName());
    }

    if (iconStream != null) {
      parameters.put("skisse_bilde", iconStream);
    }
View Full Code Here


  @Override
  public CheckObject checkSaveObject(ConstructionTypeModel object,
      PresentationModel presentationModel, WindowInterface window) {
    String errorString = null;

    ConstructionType constructionType = object.getObject();
    if (constructionType.getConstructionTypeId() == null
        && objectList.contains(constructionType)) {
      errorString = "Kan ikke lagre konstruksjonstype med et navn som finnes fra f�r";
    }

    if (constructionType.isMaster()) {
      ConstructionType type = ((ConstructionTypeManager) overviewManager)
          .findMaster(constructionType.getProductArea());
      if (type != null
          && !type.getName().equalsIgnoreCase(
              constructionType.getName())) {
        errorString = "Kan ikke v�re to mastere for samme produktomr�de";
      }
    }
View Full Code Here

  /**
   * @see no.ugland.utransprod.gui.handlers.AbstractViewHandler#getNewObject()
   */
  @Override
  public ConstructionType getNewObject() {
    ConstructionType newConstructionType;
    newConstructionType = new ConstructionType();
    if (isMasterOverview) {
      newConstructionType.setIsMaster(1);
    }
    return newConstructionType;
  }
View Full Code Here

  public void openArticleView(WindowInterface window,
      PresentationModel presentationModel) {
    List<ArticleType> articles = (List<ArticleType>) presentationModel
        .getValue(ConstructionTypeModel.PROPERTY_ARTICLES);

    ConstructionType currentConstructionType = (ConstructionType) presentationModel
        .getBufferedValue(AbstractModel.PROPERTY_OBJECT);

    ArticleTypeViewHandler articleTypeViewHandler = new ArticleTypeViewHandler(
        login, managerRepository, articles);
    ArticleTypeView articleTypeView = new ArticleTypeView(
View Full Code Here

      setArticleRefs(newArticleType, constructionTypeArticleMain);

      ConstructionTreeNode rootNode = (ConstructionTreeNode) constructionTreeTableModel
          .getRoot();
      ConstructionType constructionType = (ConstructionType) rootNode
          .getObject();

      if (constructionType.getConstructionTypeArticles() != null) {
        constructionType.getConstructionTypeArticles().add(
            constructionTypeArticleMain);
      } else {
        HashSet<ConstructionTypeArticle> set = new HashSet<ConstructionTypeArticle>();
        set.add(constructionTypeArticleMain);
        constructionType.setConstructionTypeArticles(set);
      }
      constructionTreeTableModel.fireChanged();

      if (masterDialog && useAsUniversal.equalsIgnoreCase("Ja")) {
        universalArticles.add(constructionTypeArticleMain);
      }

      BufferedValueModel bufferedArticles = presentationModel
          .getBufferedModel(ConstructionTypeModel.PROPERTY_CONSTRUCTION_TYPE_ARTICLES);
      bufferedArticles.setValue(new ArrayListModel(constructionType
          .getConstructionTypeArticles()));

    }
  }
View Full Code Here

          attribute.setDialogOrder(null);
        }
        if (masterDialog && useAsUniversal.equalsIgnoreCase("Ja")) {
          universalChangedArticleAttributes.add(attribute);
        }
        ConstructionType constructiontype = (ConstructionType) ((ConstructionTreeNode) constructionTreeTableModel
            .getRoot()).getObject();
        bufferedArticles.setValue(new ArrayListModel(constructiontype
            .getConstructionTypeArticles()));
      }
    } else if (selectedNode != null) {
      DecimalFormat decimalFormat = new DecimalFormat();
      decimalFormat.setDecimalSeparatorAlwaysShown(false);
      decimalFormat.setParseIntegerOnly(true);
      BufferedValueModel bufferedArticles = presentationModel
          .getBufferedModel(ConstructionTypeModel.PROPERTY_CONSTRUCTION_TYPE_ARTICLES);

      ConstructionTypeArticle article = (ConstructionTypeArticle) selectedNode
          .getObject();

      String numberOfValue = null;

      if (article.getNumberOfItems() != null) {
        numberOfValue = decimalFormat
            .format(article.getNumberOfItems());
      }

      numberOfValue = JOptionPane.showInputDialog(window.getComponent(),
          "Gi antall", numberOfValue);

      String orderValue = JOptionPane.showInputDialog(window
          .getComponent(), "Rekkef�lge", article.getDialogOrder());

      if (numberOfValue != null && numberOfValue.length() != 0) {
        article.setNumberOfItems(Integer.valueOf(numberOfValue.replace(
            ',', '.')));

      }
      if (orderValue != null) {
        if (orderValue.length() != 0) {
          article.setDialogOrder(Integer.valueOf(orderValue));
        } else {
          article.setDialogOrder(null);
        }
      }
      if (masterDialog && useAsUniversal.equalsIgnoreCase("Ja")) {
        universalChangedArticles.add(article);
      }

      ConstructionType constructiontype = (ConstructionType) ((ConstructionTreeNode) constructionTreeTableModel
          .getRoot()).getObject();
      bufferedArticles.setValue(new ArrayListModel(constructiontype
          .getConstructionTypeArticles()));
    }
  }
View Full Code Here

   *
   * @param presentationModel
   * @return tretabell
   */
  public JXTreeTable getTreeTable(PresentationModel presentationModel) {
    ConstructionType tmpType = (ConstructionType) presentationModel
        .getBufferedValue(AbstractModel.PROPERTY_OBJECT);

    ConstructionType clonedType = ConstructionTypeModel
        .cloneConstructionType(tmpType);
    constructionTreeTableModel = new ConstructionTreeTableModel(clonedType);
    treeTable = new JXTreeTable(constructionTreeTableModel);
    return treeTable;
  }
View Full Code Here

   */
  void doCopyMaster(PresentationModel presentationModel,
      WindowInterface window) {
    ConstructionTreeNode rootNode = (ConstructionTreeNode) constructionTreeTableModel
        .getRoot();
    ConstructionType constructionType = (ConstructionType) rootNode
        .getObject();

    if (constructionType.getProductArea() == null) {
      Util.showErrorDialog(window, "Ikke definert produktomr�de",
          "Det er ikke satt noe produktomr�de");
      return;
    }
    ConstructionType master = ((ConstructionTypeManager) overviewManager)
        .findMaster(constructionType.getProductArea());

    if (master != null) {

      ConstructionTypeModel constructionTypeModel = (ConstructionTypeModel) presentationModel
          .getBean();
      ConstructionType currentConstructionType = constructionTypeModel
          .getObject();

      ((ConstructionTypeManager) overviewManager).lazyLoadTree(master);
      Set<ConstructionTypeArticle> articles = ConstructionTypeModel
          .copyConstructionTypeArticles(currentConstructionType,
View Full Code Here

     * @param rowIndex
     * @param columnIndex
     * @return verdi
     */
    public Object getValueAt(int rowIndex, int columnIndex) {
      ConstructionType constructionType = (ConstructionType) getRow(rowIndex);
      switch (columnIndex) {
      case 0:
        return constructionType.getName();
      case 1:
        return constructionType.getDescription();
      case 2:
        return constructionType.getProductArea();
      default:
        throw new IllegalStateException("Unknown column");
      }

    }
View Full Code Here

          Util
              .showErrorDialog(window, "Feil",
                  "Kan ikke slette artikkel som er referert til av en ordre");
        } else {

          ConstructionType constructionType = (ConstructionType) ((ConstructionTreeNode) constructionTreeTableModel
              .getRoot()).getObject();
          constructionType.getConstructionTypeArticles().remove(
              article);
          article.setConstructionType(null);

          presentationModel
              .setBufferedValue(
                  ConstructionTypeModel.PROPERTY_CONSTRUCTION_TYPE_ARTICLES,
                  new ArrayListModel(
                      ConstructionTypeModel
                          .clonedConstructionTypeArticles(constructionType
                              .getConstructionTypeArticles())));

          constructionTreeTableModel.fireChanged();
        }
      } else {
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.model.ConstructionType

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.