Package org.evolizer.daforjava.polymetricviews.model

Examples of org.evolizer.daforjava.polymetricviews.model.PolymetricViewProfile


    public void onGraphEvent(GraphEvent graphEvent) {
        if (graphEvent.getType() == GraphEvent.POST_EVENT) {
            if (graphEvent.getData() != null
                    && graphEvent.getData() instanceof AbstractGraphEditCommand) {

                PolymetricViewProfile profile = fGraphPanel.getViewConfigModel().getProfile();
                List<AbstractPolymetricViewUpdater> polyViewUpdaters = new ArrayList<AbstractPolymetricViewUpdater>();
                polyViewUpdaters.add(new HeightUpdater(profile.getHeightMetric()));
                polyViewUpdaters.add(new WidthUpdater(profile.getWidthMetric()));
                polyViewUpdaters.add(new ColorUpdater(profile.getColorMetric()));

                try {
                    if (polyViewUpdaters.size() > 0) {
                        PolymetricViewDataContainer dataCollector = fGraphPanel.getPolymetricViewDataCollector();
                        for (AbstractPolymetricViewUpdater abstractPolymetricViewUpdater : polyViewUpdaters) {
View Full Code Here


     * {@inheritDoc}
     */
    public void propertyChange(PropertyChangeEvent event) {
        if (event.getPropertyName().equals(ViewConfigModel.POLYMETRIC_VIEW_CHANGE)) {
            List<AbstractPolymetricViewUpdater> polyViewUpdaters = new ArrayList<AbstractPolymetricViewUpdater>();
            PolymetricViewProfile profile = (PolymetricViewProfile) event.getNewValue();
   
            if (event.getOldValue().equals(ViewConfigModel.UPDATE_NODE_HEIGHTS)) {
                polyViewUpdaters.add(new HeightUpdater(profile.getHeightMetric()));
            } else if (event.getOldValue().equals(ViewConfigModel.UPDATE_NODE_WIDTHS)) {
                polyViewUpdaters.add(new WidthUpdater(profile.getWidthMetric()));
            } else if (event.getOldValue().equals(ViewConfigModel.UPDATE_NODE_COLORS)) {
                polyViewUpdaters.add(new ColorUpdater(profile.getColorMetric()));
            } else if (event.getOldValue().equals(ViewConfigModel.UPDATE_GRAPH_EVENT)) {
                polyViewUpdaters.add(new HeightUpdater(profile.getHeightMetric()));
                polyViewUpdaters.add(new WidthUpdater(profile.getWidthMetric()));
                polyViewUpdaters.add(new ColorUpdater(profile.getColorMetric()));
            }      
   
            try {
                if (polyViewUpdaters.size() > 0) {
                    PolymetricViewDataContainer dataCollector = fGraphPanel.getPolymetricViewDataCollector();
View Full Code Here

     * Update view.
     */
    public void updateView() {
        DAForJavaGraphEditor graphEditor = fPVControllerView.getGraphEditor();
        ViewConfigModel viewConfigModel = graphEditor.getPanel().getViewConfigModel();
        PolymetricViewProfile profile = viewConfigModel.getProfile();

        if (profile.getName() != null && profile.getName().length() > 0) {
            fPVControllerView.select(fProfileCombo, profile.getName());
        } else {
            sLogger.warn("Profile name of editor " + graphEditor.getPartName() + " is null!");
        }
    }
View Full Code Here

        String name = e.getAttribute("name");
        String heightMetric = getAttributeAsString(e, "heightMetric");
        String widthMetric = getAttributeAsString(e, "widthMetric");
        String colorMetric = getAttributeAsString(e, "colorMetric");

        fProfileMap.put(name, new PolymetricViewProfile(name, heightMetric, widthMetric, colorMetric));
    }
View Full Code Here

    /**
     * Sets the selected profile.
     */
    private void processLoadEvent() {
        String name = fProfileCombo.getText();
        PolymetricViewProfile profile = fProfileMap.get(name);
       
        // TODO: set the profile in the view config model, which then should notify the checkboxes to update
        fPVControllerView.select(fPVControllerView.getWidthMetricChooser(), profile.getWidthMetric());
        fPVControllerView.select(fPVControllerView.getHeightMetricChooser(), profile.getHeightMetric());
        fPVControllerView.select(fPVControllerView.getColorMetricChooser(), profile.getColorMetric());
       
        ViewConfigModel viewConfigModel = fPVControllerView.getGraphEditor().getPanel().getViewConfigModel();
        viewConfigModel.updatePolymetricViewsProfile(ViewConfigModel.UPDATE_GRAPH_EVENT, profile);
    }
View Full Code Here

    private void processSaveEvent() {
        String name = fProfileCombo.getText();
        String heightVal = fPVControllerView.getHeightMetricChooser().getText();
        String widthVal = fPVControllerView.getWidthMetricChooser().getText();
        String colorVal = fPVControllerView.getColorMetricChooser().getText();
        PolymetricViewProfile profile = new PolymetricViewProfile(name, heightVal, widthVal, colorVal);
       
        if (fProfileMap.containsKey(profile.getName())) {
            sLogger.info("Update profile " + profile.getName());
        } else {
            sLogger.info("Add new profile " + profile.getName());
            fProfileCombo.add(profile.getName());
        }
        fProfileMap.put(profile.getName(), profile);
       
        prepareDocToWriteToFile();
    }
View Full Code Here

    private void updateView() {
        if (fGraphEditor != null) {
            sLogger.info("Updating view to editor " + fGraphEditor.getPartName());

            ViewConfigModel viewConfigModel = fGraphEditor.getPanel().getViewConfigModel();
            PolymetricViewProfile profile = viewConfigModel.getProfile();

            fProfileChooser.updateView();
            select(fHeightMetricChooser, profile.getHeightMetric());
            select(fWidthMetricChooser, profile.getWidthMetric());
            select(fColorMetricChooser, profile.getColorMetric());
        }
    }
View Full Code Here

                fAssociationTypeVisibilityMap.put(associationType, true);
            }
        }

        fSelectedProfile = "";
        fPolyViewProfile = new PolymetricViewProfile("Default", "Uniform", "Uniform", "Uniform");
    }
View Full Code Here

                ViewConfigModel viewConfigModel = fGraphEditor.getPanel().getViewConfigModel();
                String name = fProfileChooser.getText();
                String height = fHeightMetricChooser.getText();
                String width = fWidthMetricChooser.getText();
                String color = fColorMetricChooser.getText();
                PolymetricViewProfile profile = new PolymetricViewProfile(name, height, width, color);

                viewConfigModel.updatePolymetricViewsProfile(fPropertyChangeType, profile);
            }
        }
View Full Code Here

TOP

Related Classes of org.evolizer.daforjava.polymetricviews.model.PolymetricViewProfile

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.