Package de.FeatureModellingTool.FeatureModel

Examples of de.FeatureModellingTool.FeatureModel.ResourceComponent


                }

            }

            Feature feature = null;
            ResourceComponent rc = null;

            feature = featureModel.getFeature(id);
            if (feature == null)
                rc = interactionModel.getResourceComponent(id);


            if ((feature == null) && (rc == null)) {
                dtde.dropComplete(false);
                return;
            }

            dtde.dropComplete(true);

            DropTarget dropTarget = (DropTarget) dtde.getSource();

            DrawingView drawingView = (DrawingView) dropTarget.getComponent();

            if (feature != null) {
                FeatureFigure ff = new FeatureFigure();
                ff.setAttribute("id", id);
                ff.setAttribute(FeatureFigure.IS_A_LINK, Boolean.TRUE);
                ff.setAttribute("text", feature.getName());
                ff.setAttribute(FeatureProperties.VARIABILITY, feature.getVariability().getName());
                ff.setAttribute(FeatureProperties.BINDINGTIME, feature.getBindingTime().getName());

                Point location = dtde.getLocation();
                double scale = drawingView.getScale();
                int realX = (int) (location.getX() / scale + 0.5);
                int realY = (int) (location.getY() / scale + 0.5);

                ff.basicDisplayBox(new Point(realX, realY), null);

                idToFigureMap.add(id, ff);
                drawingView.add(ff);
            } else if (rc != null) {
                ResourceComponentFigure rcf = new ResourceComponentFigure();
                rcf.setAttribute("id", id);
                rcf.setAttribute(FeatureFigure.IS_A_LINK, Boolean.TRUE);
                rcf.setAttribute("text", rc.getName());
                rcf.setAttribute(FeatureProperties.VARIABILITY, rc.getVariability().getName());

                Point location = dtde.getLocation();
                double scale = drawingView.getScale();
                int realX = (int) (location.getX() / scale + 0.5);
                int realY = (int) (location.getY() / scale + 0.5);
View Full Code Here


                        fig.setAttribute("text", target.getType() + ":" + target.getName());
                        fig.invalidate();
                    }
                }
            } else if (src instanceof ResourceComponent) {
                ResourceComponent rc = (ResourceComponent) src;
                String propertyName = evt.getPropertyName();
                if (propertyName.equals(ResourceComponentProperties.NAME)) {
                    Set set = idToFigureMap.get(rc.getID());

                    if (set == null) return;

                    //update the figure's display
                    Iterator iterator = set.iterator();
                    while (iterator.hasNext()) {
                        Figure fig = (Figure) iterator.next();
                        fig.setAttribute("text", rc.getName());
                        fig.invalidate();
                    }
                }
            }
View Full Code Here

                }

            }

            Feature feature = null;
            ResourceComponent rc = null;

            feature = featureModel.getFeature(id);
            if (feature == null)
                rc = interactionModel.getResourceComponent(id);


            if ((feature == null) && (rc == null)) {
                dtde.dropComplete(false);
                return;
            }

            dtde.dropComplete(true);

            DropTarget dropTarget = (DropTarget) dtde.getSource();

            DrawingView drawingView = (DrawingView) dropTarget.getComponent();

            if (feature != null) {
                FeatureFigure ff = new FeatureFigure();
                ff.setAttribute("id", id);
                ff.setAttribute(FeatureFigure.IS_A_LINK, Boolean.TRUE);
                ff.setAttribute("text", feature.getName());
                ff.setAttribute(FeatureProperties.VARIABILITY, feature.getVariability().getName());
                ff.setAttribute(FeatureProperties.BINDINGTIME, feature.getBindingTime().getName());

                Point location = dtde.getLocation();
                double scale = drawingView.getScale();
                int realX = (int) (location.getX() / scale + 0.5);
                int realY = (int) (location.getY() / scale + 0.5);

                ff.basicDisplayBox(new Point(realX, realY), null);

                idToFigureMap.add(id, ff);
                drawingView.add(ff);
            } else if (rc != null) {
                ResourceComponentFigure rcf = new ResourceComponentFigure();
                rcf.setAttribute("id", id);
                rcf.setAttribute(FeatureFigure.IS_A_LINK, Boolean.TRUE);
                rcf.setAttribute("text", rc.getName());
                rcf.setAttribute(FeatureProperties.VARIABILITY, rc.getVariability().getName());

                Point location = dtde.getLocation();
                double scale = drawingView.getScale();
                int realX = (int) (location.getX() / scale + 0.5);
                int realY = (int) (location.getY() / scale + 0.5);
View Full Code Here

                        fig.setAttribute("text", target.getType() + ":" + target.getName());
                        fig.invalidate();
                    }
                }
            } else if (src instanceof ResourceComponent) {
                ResourceComponent rc = (ResourceComponent) src;
                String propertyName = evt.getPropertyName();
                if (propertyName.equals(ResourceComponentProperties.NAME)) {
                    Set set = idToFigureMap.get(rc.getID());

                    if (set == null) return;

                    //update the figure's display
                    Iterator iterator = set.iterator();
                    while (iterator.hasNext()) {
                        Figure fig = (Figure) iterator.next();
                        fig.setAttribute("text", rc.getName());
                        fig.invalidate();
                    }
                }
            }
View Full Code Here

TOP

Related Classes of de.FeatureModellingTool.FeatureModel.ResourceComponent

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.