public BoundingBox(Point center, int width, int height) { m_left = (int)center.getX() - width /2 ; m_top = (int)center.getY() - height /2; m_right = m_left + width; m_bottom = m_top + height; }
public BoundingBox(Point center, int width, int height) { m_left = (int)center.getX() - width /2 ; m_top = (int)center.getY() - height /2; m_right = m_left + width; m_bottom = m_top + height; }
public BoundingBox(Point center, int width, int height) { m_left = (int)center.getX() - width /2 ; m_top = (int)center.getY() - height /2; m_right = m_left + width; m_bottom = m_top + height; }
@Override public Point2D transform(VertexRef v) { if (v == null) { LOG.warn("Algorithm tried to layout a null vertex"); return new Point(0,0); } org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX(), location.getY()); } };
@Override public Point2D transform(VertexRef v) { org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX()-xOffset, location.getY()-yOffset); } };
@Override public Point2D transform(VertexRef v) { org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX()+xOffset, location.getY()+yOffset); } };
@Override public Point2D transform(VertexRef v) { org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX()+xOffset, location.getY()+yOffset); } };
@Override public Point2D transform(VertexRef v) { org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX()-xOffset, location.getY()-yOffset); } };
@Override public Point2D transform(VertexRef v) { org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX()+xOffset, location.getY()+yOffset); } };
@Override public Point2D transform(VertexRef v) { org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX()+xOffset, location.getY()+yOffset); } };
public void setCenter(Point center) { //TODO cast to int for now m_left = (int)center.getX() - getWidth()/2; m_top = (int)center.getY() - getHeight()/2; }
public void setCenter(Point center) { //TODO cast to int for now m_left = (int)center.getX() - getWidth()/2; m_top = (int)center.getY() - getHeight()/2; }
public void setCenter(Point center) { //TODO cast to int for now m_left = (int)center.getX() - getWidth()/2; m_top = (int)center.getY() - getHeight()/2; }
public void setCenter(Point center) { m_left = center.getX() - getWidth()/2; m_top = center.getY() - getHeight()/2; }
public BoundingBox computeWithAspectRatio(double R) { double r = getAspectRatio(); int width = (int) (r < R ? Math.round(getHeight() * R ): getWidth()); int height = (int) (r < R ? getHeight() : Math.round(getWidth() / R)); Point center = getCenter(); //TODO cast to int for now int x = (int)center.getX() - width/2; int y = (int)center.getY() - height/2; return new BoundingBox(x, y, width, height); }
public BoundingBox computeWithAspectRatio(double R) { double r = getAspectRatio(); int width = (int) (r < R ? Math.round(getHeight() * R ): getWidth()); int height = (int) (r < R ? getHeight() : Math.round(getWidth() / R)); Point center = getCenter(); //TODO cast to int for now int x = (int)center.getX() - width/2; int y = (int)center.getY() - height/2; return new BoundingBox(x, y, width, height); }
public BoundingBox computeWithAspectRatio(double R) { double r = getAspectRatio(); int width = (int) (r < R ? Math.round(getHeight() * R ): getWidth()); int height = (int) (r < R ? getHeight() : Math.round(getWidth() / R)); Point center = getCenter(); //TODO cast to int for now int x = (int)center.getX() - width/2; int y = (int)center.getY() - height/2; return new BoundingBox(x, y, width, height); }