Package org.woped.qualanalysis.reachabilitygraph.data

Examples of org.woped.qualanalysis.reachabilitygraph.data.ReachabilityPlaceModel


        e.consume();
    }

    private void doSingleClick(DefaultGraphCell cell) {
        if (cell != null && cell instanceof ReachabilityPlaceModel) {
            ReachabilityPlaceModel place = (ReachabilityPlaceModel) cell;
            if (!place.getHighlight()) {
                // remove all highlights and virtual tokens
                deHighlightModel(false);
                deHighlightEdges();
                // highlight the edges
                highlightEdges(place);
                // set the virtual tokens for the current place(marking)
                setTokens(place);
                // highlight the transitions in the petrinet for the current marking
                highlightTransitions(place);
                // highlight the place/marking in the RG
                place.setHighlight(true);
                rgp.setUnselectButtonEnabled(true);
                editor.setReadOnly(false);
                // repaint the instance of the editor
                editor.getGraph().repaint();
                // repaint the graph
                graph.clearSelection();
                graph.getGraphLayoutCache().reload();
            }
        } else
            if (cell != null && cell instanceof ReachabilityEdgeModel) {
                deHighlightModel(false);
                ReachabilityEdgeModel edge = (ReachabilityEdgeModel) cell;
                ReachabilityPlaceModel place = (ReachabilityPlaceModel) ((ReachabilityPortModel) edge.getTarget())
                        .getParent();
                deHighlightEdges();
                highlightEdges(place);
                // set the virtual tokens for the current place(marking)
                setTokens(place);
                // set color of clicked place
                highlightTransitions(place);
                place.setHighlight(true);
                this.lastHighlighted = place;
                rgp.setUnselectButtonEnabled(true);
                editor.setReadOnly(false);
                // repaint the instance of the editor
                editor.getGraph().repaint();
View Full Code Here


        deHighlight();
        GraphModel model = getModel();
        for (int j = 0; j < model.getRootCount(); j++) {
            if (model.getRootAt(j) instanceof ReachabilityPlaceModel) {

                ReachabilityPlaceModel rpm = (ReachabilityPlaceModel) model.getRootAt(j);
                if (mark.toString().equals(((IMarking) rpm.getUserObject()).toString())) {
                    rpm.setHighlight(true);
                    Rectangle2D re = GraphConstants.getBounds(rpm.getAttributes());
                    this.getVisibleRect();
                    JScrollBar scb = ((JScrollPane) getParent().getParent()).getVerticalScrollBar();
                    if (scb.isVisible()) {
                        // autoscroll down
                        while ((re.getMaxY() * this.scale) > (scb.getValue() + scb.getBounds().height)) {
View Full Code Here

    this.renderer = new ReachabilityPlaceRenderer();
    setBackgroundColor(cell)
  }
 
  public void setBackgroundColor(Object cell){
    ReachabilityPlaceModel place = (ReachabilityPlaceModel) cell;
    if(place.getGrayscaled()){
        if(place.getHighlight())
          GraphConstants.setBackground(place.getAttributes(), grayscaledHighlightedColor);       
        else if (((IMarking) place.getUserObject()).isInitial())
          GraphConstants.setBackground(place.getAttributes(), grayscaledRootColor);
        else
          GraphConstants.setBackground(place.getAttributes(), grayscaledNormalColor);
      }
      else{
        if(place.getHighlight())
          GraphConstants.setBackground(place.getAttributes(), coloredHighlightedColor);       
        else if (((IMarking) place.getUserObject()).isInitial())
          GraphConstants.setBackground(place.getAttributes(), coloredRootColor);
        else
          GraphConstants.setBackground(place.getAttributes(), coloredNormalColor);       
      }   
  }
View Full Code Here

TOP

Related Classes of org.woped.qualanalysis.reachabilitygraph.data.ReachabilityPlaceModel

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.