Package org.evolizer.famix.model.entities

Examples of org.evolizer.famix.model.entities.AbstractFamixEntity


     * @return the entities that should be added to the graph
     */
    public List<AbstractFamixEntity> getListOfNotContainedEntities(List<? extends FamixAssociation> associations) {
        Set<AbstractFamixEntity> notContainedEntities = new HashSet<AbstractFamixEntity>();
        for (FamixAssociation association : associations) {
            AbstractFamixEntity from = association.getFrom();
            AbstractFamixEntity to = association.getTo();
            if (!fGraph.contains(from)) {
                notContainedEntities.add(from);
            }

            if (!fGraph.contains(to)) {
View Full Code Here


     * @param hide Enforce hiding of child nodes.
     */
    private void updateEntityTypeVisibility(NodeCursor parentNodes, boolean hide) {
        for (NodeCursor nc = parentNodes; nc.ok(); nc.next()) {
            Node parentNode = nc.node();
            AbstractFamixEntity entity = fPanel.getGraph().getFamixEntity(parentNode);
            if (!hide && fPanel.getViewConfigModel().getEntityTypeVisibility().get(entity.getClass()).booleanValue()) {
                NodeRealizer parentRealizer = fPanel.getGraph().getRealizer(parentNode);
                parentRealizer.setVisible(true);
                updateEntityTypeVisibility(fPanel.getHierarchyManager().getChildren(parentNode), false);
            } else {
                // hide all descendant nodes and edges
View Full Code Here

        SnapshotAnalyzer snapshotAnalyzer = fGraphPanel.getGraphLoader().getSnapshotAnalyzer();
        DependencyGraph graph = fGraphPanel.getGraph();
        NodeMap map = graph.getRegisteredNodeMaps()[0];
        Node[] nodes = graph.getNodeArray();
        for (int i = 0; i < nodes.length; i++) {
            AbstractFamixEntity entity = (AbstractFamixEntity) map.get(nodes[i]);
            // check if entity is already processed
            // entities ending with <clinit>() or <oinit>() must be ignored to
            // get suitable visual data
            Set<String> possibleMetrics = MetricStore.listMetricsFor(entity);
            if (!metricIdentifier.equalsIgnoreCase(PolymetricViewControllerView.METRIC_UNIFORM)) {
                if (possibleMetrics.contains(metricIdentifier)) {
                    CompositeKey<AbstractFamixEntity, String> key = new CompositeKey<AbstractFamixEntity, String>(entity, metricIdentifier);
                    if (!fFamixEntityMetricToValueMap.containsKey(key
                            && !(entity.getUniqueName().endsWith(AbstractFamixEntity.CLASS_INIT_METHOD)
                                    || entity.getUniqueName().endsWith(AbstractFamixEntity.OBJECT_INIT_METHOD))) {
                        Float value = 0f;
                        value = new Float(MetricStore.calculateMetricValue(entity, metricIdentifier, snapshotAnalyzer.getEvolizerSession()));
                        fFamixEntityMetricToValueMap.put(key, value);

                        if (fMaxMetricValues.get(metricIdentifier).get(entity.getClass()) < value) {
                            fMaxMetricValues.get(metricIdentifier).put(entity.getClass(), value);
                        }
                    }
                }
            }
        }
View Full Code Here

   
    fail("Hey dude, you should really implement a real test!");
 

  private void createModel() {
    AbstractFamixEntity e1 = new FamixDummy();
    e1.setUniqueName("org.test.Foo");
   
    testEntities.add(e1);
  }
View Full Code Here

       
        DependencyGraph graph = fGraphPanel.getGraph();
        NodeMap map = graph.getRegisteredNodeMaps()[0];
        Node[] nodes = graph.getNodeArray();
        for (int i = 0; i < nodes.length; i++) {
            AbstractFamixEntity entity = (AbstractFamixEntity) map.get(nodes[i]);
            for (AbstractPolymetricViewUpdater updater : polyViewUpdater) {
                NodeRealizer realizer = graph.getRealizer(nodes[i]);
                String metricIdentifier = updater.getMetricToRepresent();
//                if(!metricIdentifier.equalsIgnoreCase(PolymetricViewControllerView.METRIC_UNIFORM)) {
                    if (dataCollector.containsEntry(entity, metricIdentifier)) {
                        float value = dataCollector.getValue(entity, metricIdentifier);
                        INormalizer normalizer = updater.getNormalizer();

                        float normalizedVal = normalizer.normalize(value, dataCollector.getMaxValue(metricIdentifier, entity.getClass()));
                        if (!(entity instanceof AbstractFamixVariable)) {
                            updater.updateNodeRealizer(realizer, normalizedVal);
                        }
                    } else {
//                        sLogger.error("No metric data found for metric: " + updater.getAttributeToRepresent());
View Full Code Here

     *
     * @return The graph in which the entity is.
     */
    private Graph2D getGraph(AbstractFamixEntity entity) {
        Graph2D graph = null;
        AbstractFamixEntity parent = entity.getParent();
        if (parent == null) {
            // no parent -> return root graph
            graph = this;
        } else {
            if (!this.contains(parent)) {
View Full Code Here

     * @param node the node
     *
     * @return the node info
     */
    public String getNodeInfo(Node node) {
        AbstractFamixEntity entity = (AbstractFamixEntity) getNodeToFamixMap().get(node);
        String result = "Name: " + entity.getUniqueName();
        if (entity instanceof FamixPackage) {
            FamixPackage famixPackage = (FamixPackage) entity;
            // int nop = famixPackage.getPackages().size();
            // result = result + "\nSubpackages: " + nop;
            int noc = famixPackage.getClasses().size();
View Full Code Here

     *
     * @return the node tip
     */
    public String getNodeTip(Node node) {
        String tip = "";
        AbstractFamixEntity entity = this.getFamixEntity(node);
        if (entity != null) {
            tip = entity.getUniqueName();
        } else {
            sLogger.error("Could not determine FAMIX entity of node " + node);
            tip = "Error determing FAMIX entity of node " + node;
        }

View Full Code Here

public abstract class McCabeFamixEntitiesStrategy extends McCabeStrategy {

  protected AbstractMeasurement measurement;

  public double calculateValue(Object entity, IEvolizerSession session) throws EvolizerRuntimeException {
      AbstractFamixEntity fEntity = (AbstractFamixEntity) entity;
    String query = "from FamixMeasurement as fm where fm.identifier='McCabe' and fm.entity.id = '"
        + fEntity.getId() + "'";
    measurement = session.uniqueResult(query, FamixMeasurement.class);
    if (measurement == null) {
      FamixMeasurement fMeasurement = new FamixMeasurement(fEntity, "McCabe");
      fMeasurement.setValue(calculateValue(fEntity));
      measurement = fMeasurement;
View Full Code Here

                ProjectParser currentParser = FamixImporterPlugin.getDefault().getParser();
                IJavaProject parsedProject = JavaSelectionHelper.getProject(currentParser.getSelection().iterator().next());
                if (javaProject.equals(parsedProject)) {
                    if ((currentParser.getModel() != null)
                            && (currentParser.getModel().getFamixEntities().size() > 0)) {
                        AbstractFamixEntity firstEntity = currentParser.getModel().getFamixEntities().iterator().next();
                        if (firstEntity.getId() == null) {
                            EvolizerSessionHandler.getHandler().initSessionFactory(javaProject.getProject());

                            String dbUrl = EvolizerSessionHandler.getDBUrl(javaProject.getProject());
                            Job mainJob = new FamixStoreModelJob(dbUrl, currentParser.getModel());
                            mainJob.setUser(true);
View Full Code Here

TOP

Related Classes of org.evolizer.famix.model.entities.AbstractFamixEntity

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.