public void setHighlighted(boolean highlighted) { if (this.highlighted != highlighted) { this.highlighted = highlighted; arrowHead.setHighlighted(highlighted); invalidatePaint(); } }
/** * Returns the paint to use for the arc. Checks if the arc type has a color mapped to it, if so * that color/paint is returned. Otherwise the default arc color is returned. * @param arc the arc whose paint/color will be returned * @return the paint or color for the arc */ public Paint getPaint(GraphArc arc) { return getTypePaint(arc.getType()); }
/** * Sets the arc types - this is done to map a background color/gradient to each arc type. * @param arcTypes the node types to add */ public void setArcTypes(Collection<? extends Object> arcTypes) { for (Object type : arcTypes) { addArcType(type); } }
@Override public String toString() { GraphNode src = (isInverted() ? getDestination() : getSource()); GraphNode dest = (isInverted() ? getSource() : getDestination()); return src + " -- " + getType() + " --> " + dest; }
public Stroke getStroke(GraphArc arc) { float width = (arc.isSelected() && arc.isHighlighted() ? THICK_STROKE_WIDTH : (arc.isHighlighted() || arc.isSelected() ? MEDIUM_STROKE_WIDTH : THIN_STROKE_WIDTH)); return createStroke(width, isDashed); }
public void setSelected(boolean selected) { if (this.selected != selected) { this.selected = selected; arrowHead.setSelected(selected); invalidatePaint(); } }
public void setArcStyle(GraphArcStyle style) { if ((style != null) && (this.style != style)) { this.style = style; invalidateFullBounds(); invalidatePaint(); } }
public void setSelected(boolean selected) { if (this.selected != selected) { this.selected = selected; reset(); } }
private void updateArcLocations() { for (GraphArc arc : arcs) { arc.updateArcPath(); } }
/** * Sets the arc types - maps a color to each arc type. */ public void setTypes(Collection<? extends Object> types) { setArcTypes(types); }
public Shape getShape() { if (path == null) { path = createArrowHead(); } return path; }
@Override public Stroke getStroke() { return style.getStroke(this); }
@Override public Paint getStrokePaint() { return style.getPaint(this); }
public String getTooltip() { if (tooltip == null) { return toString(); } return tooltip; }
public boolean isVisible() { return getVisible(); }
public void setPointRight(boolean pointRight) { if (this.pointRight != pointRight) { this.pointRight = pointRight; reset(); } }
public void setClosePath(boolean closePath) { if (this.closePath != closePath) { this.closePath = closePath; reset(); } }
public void setSlope(double slope) { this.slope = slope; reset(); }
public void setPoint(Point2D point) { this.point = point; reset(); }
public void setHighlighted(boolean highlighted) { if (this.highlighted != highlighted) { this.highlighted = highlighted; reset(); } }