public void recalculateArcStyles() { for (GraphArc arc: arcs.values()) { arc.getArcStyle().setTypes(arcTypes); } }
protected void addGraphArc(GraphArc arc) { // copy the default arc style into the arc if ((getGraphArcStyle() != null) && !getGraphArcStyle().equals(arc.getArcStyle())) { arc.setArcStyle(getGraphArcStyle()); } // check if this arc is filtered // add the arc to the canvas if (arc instanceof PNode) { addArc((PNode) arc); } }
/** * @see javax.swing.JComponent#getToolTipText(java.awt.event.MouseEvent) */ public String getToolTipText(MouseEvent e) { String tooltipText = ""; if (e != null) { PNode pnode = getCamera().pick(e.getX(), e.getY(), 1).getPickedNode(); if (pnode.getVisible()) { if (pnode instanceof GraphNode && isShowNodeTooltips()) { GraphNode node = (GraphNode) pnode; tooltipText = node.getTooltip(); ttBackground = node.getNodeStyle().getTooltipBackgroundColor(); ttTextColor = node.getNodeStyle().getTooltipTextColor(); ttFont = node.getNodeStyle().getTooltipFont(); } else if (pnode instanceof GraphArc) { GraphArc arc = (GraphArc) pnode; tooltipText = arc.getTooltip(); if (tooltipText == null || tooltipText.equals("")) { tooltipText = arc.getSource().getText() + " ---" + arc.getType() + "---> " + arc.getDestination().getText(); } ttBackground = arc.getArcStyle().getTooltipBackgroundColor(); ttTextColor = arc.getArcStyle().getTooltipTextColor(); ttFont = arc.getArcStyle().getTooltipFont(); } } } return (tooltipText.length() > 0 ? " " + tooltipText + " " : ""); }