@Override public BoundingBox getCurrentBoundingBox() { if(m_viewPortWidth < 0 || m_mapBounds == null) { //return m_mapBounds; //throw new IllegalStateException("View port and maps bounds must be set"); } BoundingBox mPrime = m_mapBounds.computeWithAspectRatio(getViewPortAspectRatio()); int width = (int)Math.round(Math.pow((double)mPrime.getWidth(), 1.0 - m_scale) * Math.pow((double)m_viewPortWidth/2.0, m_scale)); int height = (int)Math.round(Math.pow((double)mPrime.getHeight(), 1.0 - m_scale) * Math.pow((double)m_viewPortHeight/2.0, m_scale)); return new BoundingBox(m_center, width, height); }
@Override public BoundingBox getCurrentBoundingBox() { if(m_viewPortWidth < 0 || m_mapBounds == null) { //return m_mapBounds; //throw new IllegalStateException("View port and maps bounds must be set"); } BoundingBox mPrime = m_mapBounds.computeWithAspectRatio(getViewPortAspectRatio()); int width = (int)Math.round(Math.pow((double)mPrime.getWidth(), 1.0 - m_scale) * Math.pow((double)m_viewPortWidth/2.0, m_scale)); int height = (int)Math.round(Math.pow((double)mPrime.getHeight(), 1.0 - m_scale) * Math.pow((double)m_viewPortHeight/2.0, m_scale)); return new BoundingBox(m_center, 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); }
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 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; }
@Override public String toString() { return "x: " + getX() + " y: " + getY() + " width: " + getWidth() + " height: " + getHeight(); }
public String fragment() { return "(" + getX() + "," + getY() + "," + getWidth() + "," + getHeight() + ")"; }
@Override public String toString() { return "x: " + getX() + " y: " + getY() + " width: " + getWidth() + " height: " + getHeight(); }
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 String fragment() { return "(" + getX() + "," + getY() + "," + getWidth() + "," + getHeight() + ")"; }
@Override public String toString() { return "x: " + getX() + " y: " + getY() + " width: " + getWidth() + " height: " + getHeight(); }
public String fragment() { return "(" + getX() + "," + getY() + "," + getWidth() + "," + getHeight() + ")"; }
@Override public BoundingBoxAdapter.JaxbBoundingBox marshal(BoundingBox v) throws Exception { JaxbBoundingBox retval = new JaxbBoundingBox(); retval.x = v.getX(); retval.y = v.getY(); retval.height = v.getHeight(); retval.width = v.getWidth(); return retval; }
@Override public BoundingBoxAdapter.JaxbBoundingBox marshal(BoundingBox v) throws Exception { JaxbBoundingBox retval = new JaxbBoundingBox(); retval.x = v.getX(); retval.y = v.getY(); retval.height = v.getHeight(); retval.width = v.getWidth(); return retval; }
@Override public BoundingBoxAdapter.JaxbBoundingBox marshal(BoundingBox v) throws Exception { JaxbBoundingBox retval = new JaxbBoundingBox(); retval.x = v.getX(); retval.y = v.getY(); retval.height = v.getHeight(); retval.width = v.getWidth(); return retval; }
public Point getCenter() { return new Point(getX() + (getWidth()/2), getY() + (getHeight()/2)); }
public void updateGraph() { BoundingBox boundingBox = getBoundingBox(); getState().setBoundX(boundingBox.getX()); getState().setBoundY(boundingBox.getY()); getState().setBoundWidth(boundingBox.getWidth()); getState().setBoundHeight(boundingBox.getHeight()); getState().setActiveTool(m_activeTool); Graph graph = getGraph(); GraphVisitor painter = new GraphPainter(m_graphContainer, graph.getLayout(), m_iconRepoManager, getState()); try { graph.visit(painter); } catch (Exception e) { LoggerFactory.getLogger(getClass()).error(e.getMessage(), e); } }