Package open.dolphin.infomodel

Examples of open.dolphin.infomodel.IStampTreeModel


                        StringBuilder sb = new StringBuilder();
                        while( (line = reader.readLine()) != null ) {
                            sb.append(line);
                        }
                        // Tree情報を設定し保存する
                        IStampTreeModel tm = new StampTreeModel();
                        tm.setUser(Project.getUserModel());
                        tm.setName(ClientContext.getString("stampTree.personal.box.name"));
                        tm.setDescription(ClientContext.getString("stampTree.personal.box.tooltip"));
                        FacilityModel facility = Project.getUserModel().getFacilityModel();
                        tm.setPartyName(facility.getFacilityName());
                        String url = facility.getUrl();
                        if (url != null) {
                            tm.setUrl(url);
                        }
                        tm.setTreeXml(sb.toString());
                        in.close();
                        reader.close();
                        // リストの先頭へ追加する
                        treeList.add(0, tm);
                    }
View Full Code Here


        DefaultStampTreeXmlBuilder builder = new DefaultStampTreeXmlBuilder();
        StampTreeXmlDirector director = new StampTreeXmlDirector(builder);
        String treeXml = director.build(list);
       
        // 個人用のStampTreeModelにXMLをセットする
        final IStampTreeModel treeM = userBox.getStampTreeModel();
        treeM.setTreeXml(treeXml);
       
        // StampTree を保存する Callable Object を生成する
        Callable<Boolean> longTask = new Callable<Boolean>() {
           
            @Override
View Full Code Here

        contentPane.add(gbl.getProduct(), BorderLayout.CENTER);
        contentPane.add(cmdPanel, BorderLayout.SOUTH);
        contentPane.setBorder(BorderFactory.createEmptyBorder(12, 12, 11, 11));
       
        // PublishState に応じて振り分ける
        IStampTreeModel stmpTree = stampBox.getUserStampBox().getStampTreeModel();
        FacilityModel facility = Project.getUserModel().getFacilityModel();
        String facilityId = facility.getFacilityId();
        long treeId = stmpTree.getId();
        String publishTypeStr = stmpTree.getPublishType();
       
        if (treeId == 0L && publishTypeStr == null) {
            //
            // Stamptree非保存(最初のログイン時)
            //
            publishState = PublishedState.NONE;
        } else if (treeId != 0L && publishTypeStr == null) {
            //
            // 保存されているStamptreeで非公開のケース
            //
            publishState = PublishedState.SAVED_NONE;
        } else if (treeId != 0L && publishTypeStr != null && publishTypeStr.equals(facilityId)) {
            //
            // publishType=facilityId ローカルに公開されている
            //
            publishState = PublishedState.LOCAL;
        } else if (treeId != 0L && publishTypeStr != null && publishTypeStr.equals(IInfoModel.PUBLISHED_TYPE_GLOBAL)) {
            //
            // publishType=global グローバルに公開されている
            //
            publishState = PublishedState.GLOBAL;
        }
       
        // GUIコンポーネントに初期値を入力する
        switch (publishState) {
           
            case NONE:
                instLabel.setText("このスタンプは公開されていません。");
                partyName.setText(facility.getFacilityName());
                String url = facility.getUrl();
                if (url != null) {
                    contact.setText(url);
                }
                String dateStr = ModelUtils.getDateAsString(new Date());
                publishedDate.setText(dateStr);
                publish.setText("公開する");
                break;
               
            case SAVED_NONE:
                instLabel.setText("このスタンプは公開されていません。");
                partyName.setText(stmpTree.getPartyName());
                url = facility.getUrl();
                if (url != null) {
                    contact.setText(url);
                }
                dateStr = ModelUtils.getDateAsString(new Date());
                publishedDate.setText(dateStr);
                publish.setText("公開する");
                break;
               
            case LOCAL:
                instLabel.setText("このスタンプは院内に公開されています。");
                stampBoxName.setText(stmpTree.getName());
                local.setSelected(true);
                publc.setSelected(false);
                publishType = TT_LOCAL;
               
                //
                // Publish している Entity をチェックする
                //
                String published = ((StampTreeModel) stmpTree).getPublished();
                if (published != null) {
                    StringTokenizer st = new StringTokenizer(published, ",");
                    while (st.hasMoreTokens()) {
                        String entity = st.nextToken();
                        for (int i = 0; i < IInfoModel.STAMP_ENTITIES.length; i++) {
                            if (entity.equals(IInfoModel.STAMP_ENTITIES[i])) {
                                entities[i].setSelected(true);
                                break;
                            }
                        }
                    }
                }
               
                category.setSelectedItem(stmpTree.getCategory());
                partyName.setText(stmpTree.getPartyName());
                contact.setText(stmpTree.getUrl());
                description.setText(stmpTree.getDescription());
                StringBuilder sb = new StringBuilder();
                sb.append(ModelUtils.getDateAsString(stmpTree.getPublishedDate()));
                sb.append("  最終更新日( ");
                sb.append(ModelUtils.getDateAsString(stmpTree.getLastUpdated()));
                sb.append(" )");
                publishedDate.setText(sb.toString());
                publish.setText("更新する");
                publish.setEnabled(true);
                cancelPublish.setEnabled(true);
                break;
               
            case GLOBAL:
                instLabel.setText("このスタンプはグローバルに公開されています。");
                stampBoxName.setText(stmpTree.getName());
                local.setSelected(false);
                publc.setSelected(true);
                category.setSelectedItem(stmpTree.getCategory());
                partyName.setText(stmpTree.getPartyName());
                contact.setText(stmpTree.getUrl());
                description.setText(stmpTree.getDescription());
                publishType = TT_PUBLIC;
               
                published = ((StampTreeModel) stmpTree).getPublished();
                if (published != null) {
                    StringTokenizer st = new StringTokenizer(published, ",");
                    while (st.hasMoreTokens()) {
                        String entity = st.nextToken();
                        for (int i = 0; i < IInfoModel.STAMP_ENTITIES.length; i++) {
                            if (entity.equals(IInfoModel.STAMP_ENTITIES[i])) {
                                entities[i].setSelected(true);
                                break;
                            }
                        }
                    }
                }
               
                sb = new StringBuilder();
                sb.append(ModelUtils.getDateAsString(stmpTree.getPublishedDate()));
                sb.append("  最終更新日( ");
                sb.append(ModelUtils.getDateAsString(stmpTree.getLastUpdated()));
                sb.append(" )");
                publishedDate.setText(sb.toString());
                publish.setText("更新する");
                publish.setEnabled(true);
                cancelPublish.setEnabled(true);
View Full Code Here

TOP

Related Classes of open.dolphin.infomodel.IStampTreeModel

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.