public override void Compute()
        {

            Logger.Trace("Start component UserFeedbackGUI");
       
            TLArtifactsCollection originalSrcList = (TLArtifactsCollection)Workspace.Load("originalSourceArtifacts");
            TLArtifactsCollection originalTrgList = (TLArtifactsCollection)Workspace.Load("originalTargetArtifacts");
            var matrix = (TLSimilarityMatrix)Workspace.Load("similarityMatrix");
            if (matrix == null)
                throw new ComponentException("Received matrix is null.");
           if (originalSrcList == null)
               throw new ComponentException("Received source artifacts list is null.");
           if (originalTrgList == null)
               throw new ComponentException("Received target artifacts list is null.");

            extendedSimMatrix = matrix as SimilarityMatrixUserFeedback;
            if (extendedSimMatrix == null)
            {    
                extendedSimMatrix = new SimilarityMatrixUserFeedback(matrix);
            }

            GUIForm theForm = new GUIForm(originalSrcList, originalTrgList, extendedSimMatrix, config);
            theForm.ShowDialog();

            Workspace.Store("OutpuySimilarityMatrixUserFeedback", theForm.ExtendedSimilarityMatrix);

            if (config.OutSavePath != null)
            {
                saveToFile();
            }
        }
        public override void  Compute()
        {
            Logger.Trace("Start Export of SimilarityMatrixUserFeedback");

            SimilarityMatrixUserFeedback SimMatrUserFeedback = (SimilarityMatrixUserFeedback)Workspace.Load("SimilaritymatrixUserFeedback");

            //get file name
            // use xml serializer to write to file
            // close file
            //done
        }
Exemple #3
0
        public GUIForm(TLArtifactsCollection orgSourceArt, TLArtifactsCollection orgTargetArt, SimilarityMatrixUserFeedback in_extendedSimilarityMatrix, Config config_in)
        {
            InitializeComponent();

            originalSourceArtifacts  = orgSourceArt;
            originalTargetAfacts     = orgTargetArt;
            extendedSimilarityMatrix = in_extendedSimilarityMatrix;
            config = config_in;

            if (config.OutSavePath != null) // do we have the path set
            {
                cbx_saveWork.Checked = true;
                cbx_saveWork.Enabled = true;
                cbx_saveWork.Text    = "Save my work to file (" + config.OutSavePath + ")";
            }
            else
            {
                cbx_saveWork.Checked = false;
                cbx_saveWork.Enabled = false;
                cbx_saveWork.Text    = "Save my work to file (Incorrect configuration property)";
            }

            // load the source artifacts to gui:
            lsv_originalSourceArtifacts.BeginUpdate();

            ListViewItem[] linksList = new ListViewItem[originalSourceArtifacts.Count];

            int i = 0;

            foreach (KeyValuePair <string, TLArtifact> kvp in originalSourceArtifacts)
            {
                linksList[i++] = new ListViewItem(kvp.Key);
            }

            lsv_originalSourceArtifacts.Items.AddRange(linksList);
            lsv_originalSourceArtifacts.EndUpdate();


            if (lsv_originalSourceArtifacts.Items.Count > 0)
            {
                lsv_originalSourceArtifacts.Items[0].Selected = true;
            }

            //set the sorter for the target artifacts:
            lsv_originalTargetArtifacts.ListViewItemSorter = new WeightsSorter();
        }
        public GUIForm(TLArtifactsCollection orgSourceArt, TLArtifactsCollection orgTargetArt, SimilarityMatrixUserFeedback in_extendedSimilarityMatrix, Config config_in)
        {
            InitializeComponent();

            originalSourceArtifacts = orgSourceArt;
            originalTargetAfacts = orgTargetArt;
            extendedSimilarityMatrix = in_extendedSimilarityMatrix;
            config = config_in;

            if (config.OutSavePath != null) // do we have the path set
            {
                cbx_saveWork.Checked = true;
                cbx_saveWork.Enabled = true;
                cbx_saveWork.Text = "Save my work to file (" + config.OutSavePath + ")";
            }
            else
            {
                cbx_saveWork.Checked = false;
                cbx_saveWork.Enabled = false;
                cbx_saveWork.Text = "Save my work to file (Incorrect configuration property)";
            }

            // load the source artifacts to gui:
            lsv_originalSourceArtifacts.BeginUpdate();

            ListViewItem[] linksList = new ListViewItem[originalSourceArtifacts.Count];

            int i = 0;
            foreach (KeyValuePair<string, TLArtifact> kvp in originalSourceArtifacts)
            {
                linksList[i++] = new ListViewItem(kvp.Key); 
            }

            lsv_originalSourceArtifacts.Items.AddRange(linksList);
            lsv_originalSourceArtifacts.EndUpdate();
            

            if (lsv_originalSourceArtifacts.Items.Count > 0)
                lsv_originalSourceArtifacts.Items[0].Selected = true;

            //set the sorter for the target artifacts:
            lsv_originalTargetArtifacts.ListViewItemSorter = new WeightsSorter();
        
        }
Exemple #5
0
        public override void Compute()
        {
            Logger.Trace("Start component UserFeedbackGUI");

            TLArtifactsCollection originalSrcList = (TLArtifactsCollection)Workspace.Load("originalSourceArtifacts");
            TLArtifactsCollection originalTrgList = (TLArtifactsCollection)Workspace.Load("originalTargetArtifacts");
            var matrix = (TLSimilarityMatrix)Workspace.Load("similarityMatrix");

            if (matrix == null)
            {
                throw new ComponentException("Received matrix is null.");
            }
            if (originalSrcList == null)
            {
                throw new ComponentException("Received source artifacts list is null.");
            }
            if (originalTrgList == null)
            {
                throw new ComponentException("Received target artifacts list is null.");
            }

            extendedSimMatrix = matrix as SimilarityMatrixUserFeedback;
            if (extendedSimMatrix == null)
            {
                extendedSimMatrix = new SimilarityMatrixUserFeedback(matrix);
            }

            GUIForm theForm = new GUIForm(originalSrcList, originalTrgList, extendedSimMatrix, config);

            theForm.ShowDialog();

            Workspace.Store("OutpuySimilarityMatrixUserFeedback", theForm.ExtendedSimilarityMatrix);

            if (config.OutSavePath != null)
            {
                saveToFile();
            }
        }