public boolean equals(Object object) { if (!(object instanceof ShapeEdge)) return false; ShapeEdge edge = (ShapeEdge) object; if (startPoint.equals(edge.getStartPoint()) && endPoint.equals(edge.getEndPoint())) return true; if (startPoint.equals(edge.getEndPoint()) && endPoint.equals(edge.getStartPoint())) return true; return false; }
/** * Returns the type of the edge * (<code>TYPE_HORIZONTAL, TYPE_VERTICAL, TYPE_SLOPED). * * @return */ private int getType() { if (startPoint.isHorizontallyInLineWith(endPoint)) return TYPE_VERTICAL; if (startPoint.isVerticallyInLineWith(endPoint)) return TYPE_HORIZONTAL; return TYPE_SLOPED; }
public void translate(float dx, float dy) { startPoint.x += dx; startPoint.y += dy; endPoint.x += dx; endPoint.y += dy; }
public boolean isVertical() { if (startPoint.isVerticallyInLineWith(endPoint)) return true; return false; }