Examples of GLink


Examples of net.sourceforge.gedapi.view.GLink

          throw new RuntimeException("SEND MSG TO BROWSER: In the GEDCOM file '"+gedcomURL.getGedcomURL()+"' there is a GLink event/attribute that does not have a PLAC tag!!");
        }
        else
        {
          //individual.glinks.add(placProp.getValue());
          GLink newGLink = new GLink();
          newGLink.setToURLName(propValue);
          newGLink.setToURL(placProp.getValue());

          // DONE: get the date of the glink from prop.getProperty("DATE", false).getValue().trim()
          // and look for a corresponding GLink-Relation EVEN tag whose PLAC tag is the same as placProp.getValue()
          // if one is found then add in the newGLink.setFromRelation() and newGLink.setToRelation()
          Property dateProp = prop.getProperty("DATE", false);
          if(dateProp != null)
          {
            newGLink.setDate(dateProp.getValue().trim());
          }
          String glinkRelation = getGLinkRelation(propList, newGLink.getToURL());
          if(glinkRelation != null)
          {
            String[] glinkRelations = GLinkPattern.splitRelation(glinkRelation);
            newGLink.setFromRelation(glinkRelations[0]);
            newGLink.setToRelation(glinkRelations[1]);
          }
          individual.glinks.add(newGLink);
        }
       
        LOG.finer("The property is: "+placProp);
View Full Code Here

Examples of net.sourceforge.gedapi.view.GLink

            if(toURLName == null || toURLName.trim().equals(""))
            {
              toURLName = NOT_NAMED;
            }
           
        GLink newGLink = new GLink();
        //LOG.finest("The toURLName is: "+toURLName);
        newGLink.setToURLName(toURLName);
        Node glinkNode = nextNodeWithName(firstChild, "g:glink");
            //LOG.finest("The toURL node name is: "+glinkNode.getNodeName());
        newGLink.setToURL(glinkNode.getTextContent());
        //LOG.finest("The toURL is: "+newGLink.getToURL());
       
        // DONE: get the date of the glink from ????
        // and get the fromRelation and toRelation from ???? and set them
        // with newGLink.setFromRelation() and newGLink.setToRelation()
        Node relationNode = nextNodeWithName(firstChild, "g:relation");
            //LOG.finest("The relation node name is: "+relationNode.getNodeName());
        if(relationNode != null && "g:relation".equals(relationNode.getNodeName()))
        {
          String[] glinkRelations = GLinkPattern.splitRelation(relationNode.getTextContent());
          newGLink.setFromRelation(glinkRelations[0]);
          newGLink.setToRelation(glinkRelations[1]);
        }
        //LOG.finest("The fromRelation is: "+newGLink.getFromRelation());
        //LOG.finest("The toRelation is: "+newGLink.getToRelation());
       
        if(relationNode != null)
        {
          //nextSibling = nextSibling.getNextSibling();
          Node dateNode = nextNodeWithName(firstChild, "g:lastChangeDate");
              //LOG.finest("The date node name is: "+dateNode.getNodeName());
          if(dateNode != null && "g:lastChangeDate".equals(dateNode.getNodeName()))
          {
            newGLink.setDate(dateNode.getTextContent());
          }
        }
        //LOG.finest("The lastChangeDate is: "+newGLink.getDate());
        individual.glinks.add(newGLink);
          }
View Full Code Here

Examples of org.antlr.works.visualization.graphics.shape.GLink

        GDimension firstAlternativeDimension = null;

        for(int t=0; t<state.getNumberOfTransitions(); t++) {
            FATransition transition = state.transition(t);
            GLink link = getNode(state).getLink(transition);

            if(t == 0) {
                // We remember here the size of the first transition because if we find later
                // a "loop" transition, we will have to offset this "loop" by the size of the first
                // transition (because the "loop" is always drawed above the first transition).
View Full Code Here

Examples of org.antlr.works.visualization.graphics.shape.GLink

                // ... then create the target node...
                state = transition.target;
                GNode n2 = createNode(state);

                // ... and create the link between these two states
                GLink link = new GLink();
                link.transition = transition;
                link.target = n2;
                n1.addLink(link);

                if(state == endState) {
                    // If we have reached the end of an alternative, we must set the "last" flag
                    // to the SDLink in order for it to be correctly rendered on screen.
                    EOAInfo eoa = endOfAlternativeInfoMap.get(state);
                    if(eoa != null) {
                        link.setLast(eoa.last);
                    }
                }
            } else {
                dimension.addWidth(GContext.NODE_WIDTH);
                state = null;
View Full Code Here

Examples of org.antlr.works.visualization.graphics.shape.GLink

        GDimension firstTransitionDimension = null;

        for(int t=0; t<state.getNumberOfTransitions(); t++) {
            FATransition transition = state.transition(t);

            GLink link = new GLink();
            link.transition = transition;
            link.target = createNode(transition.target);
            norigin.addLink(link);

            boolean last = t == state.getNumberOfTransitions()-1;
            if(t == state.getNumberOfTransitions()-2 && state.transition(t+1).loop) {
                // If the last alternative is a loop, consider the last-1 alternative as the last one:
                // the loop will be displayed above the first transition (up) in order to see it easily
                // from the other transition(s).
                last = true;
            }

            link.setLast(last);

            if(transition.target == alternativeEndState) {
                GDimension transitionDimension = new GDimension();
                transitionDimension.addUp(GContext.EPSILON_UP);
                transitionDimension.addDown(GContext.EPSILON_DOWN);
                if(transition.loop)
                    transitionDimension.addDown(GContext.LINE_SPACE);

                if(transition.loop) {
                    link.setBranchDimension(transitionDimension);
                    dimension.maxUp(firstTransitionDimension.up+transitionDimension.up+transitionDimension.down);
                } else {
                    link.setBranchDimension(transitionDimension);
                    if(t == 0) {
                        firstTransitionDimension = transitionDimension;                       
                    }
                    dimension.addDown(transitionDimension.up);
                    dimension.addDown(transitionDimension.down);
                }
            } else {
                endOfAlternativeInfoMap.put(alternativeEndState, new EOAInfo(last));
                GDimension transitionDimension = recursiveRenderSizeSingle(transition.target, alternativeEndState);

                if(((t > 0) || (t == 0 && !state.transition(1).loop)) && !last)
                    dimension.addDown(GContext.LINE_SPACE);

                link.setBranchDimension(transitionDimension);

                transitionDimension.addWidth(GContext.EPSILON_WIDTH);
                dimension.maxWidth(transitionDimension.width);
                if(t == 0) {
                    // Remember the size of the first transition
View Full Code Here

Examples of org.antlr.works.visualization.graphics.shape.GLink

        if(source instanceof GNode) {
            GNode node = (GNode)source;
            x0 = node.getCenterX();
            y0 = node.getCenterY();
        } else {
            GLink link = (GLink)source;
            x0 = link.target.getBeginX();
            y0 = link.target.getBeginY();
        }
        return new Point2D.Float(x0, y0);
    }
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.object.GLink

        /** Set the child position */
        child.setPositionOfUpperLeftCorner(x, parent.getBottom()+VERTICAL_GAP);

        /** Create the link from the parent to this child */
        GLink link = new GLink(parent, GLink.ANCHOR_BOTTOM,
                child, GLink.ANCHOR_TOP,
                GLink.SHAPE_ELBOW, "", 0);
        link.setDraggable(DRAGGABLE);

        /** Configure the link geometry */
        SLinkElbow l = (SLinkElbow)link.getLink();
        l.setOutOffsetLength(10);
        l.getArrow().setLength(6);

        /** Add the link and the child */
        parent.addElement(link);
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.object.GLink

        }

        GElement source = graph.findElementWithLabel(tokens[1]);
        GElement target = graph.findElementWithLabel(tokens[2]);

        GLink link = new GLink(source, GElementCircle.ANCHOR_CENTER,
                target, GElementCircle.ANCHOR_CENTER,
                GLink.SHAPE_BEZIER, label, 0);

        link.setBezierControlPoints(points);
        link.setBezierLabelPosition(labelPosition);

        return link;
    }
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.object.GLink

        }

        GElement source = graph.findElementWithLabel(sourceName);
        GElement target = graph.findElementWithLabel(targetName);

        GLink link = new GLink(source, GElementCircle.ANCHOR_CENTER,
                target, GElementCircle.ANCHOR_CENTER,
                GLink.SHAPE_BEZIER, labelName, 0);

        if(points == null) {
            System.err.println("No points for "+sourceName+", "+targetName+", "+tokens.length);
            for (int i = 0; i < tokens.length; i++) {
                String token = tokens[i];
                System.out.println(token);
            }
        }

        link.setBezierControlPoints(points);
        link.setBezierLabelPosition(labelPosition);

        return link;
    }
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.object.GLink

    public double eventLinkFlateness() {
        return DEFAULT_LINK_FLATENESS;
    }

    public void eventCreateLink(GElement source, String sourceAnchorKey, GElement target, String targetAnchorKey, int shape, Point p) {
        rootElement.addElement(new GLink(source, sourceAnchorKey, target, targetAnchorKey, shape, "", p, GView.DEFAULT_LINK_FLATENESS));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.