public void allignbottom() { if ( elements.isEmpty() ) { return; } GUIPositionInterface[] elemArray = elements.toArray( new GUIPositionInterface[elements.size()] ); Point[] before = new Point[elements.size()]; Point[] after = new Point[elements.size()]; int max = -99999; // First look for the maximum y coordinate... for ( int i = 0; i < elements.size(); i++ ) { GUIPositionInterface element = elements.get( i ); Point p = element.getLocation(); if ( p.y > max ) { max = p.y; } } // Then apply the coordinate... for ( int i = 0; i < elements.size(); i++ ) { GUIPositionInterface element = elements.get( i ); Point p = element.getLocation(); before[i] = new Point( p.x, p.y ); element.setLocation( p.x, max ); after[i] = new Point( p.x, max ); } if ( addUndoPositionInterface != null ) { addUndoPositionInterface.addUndoPosition( undoInterface, elemArray, indices, before, after ); } redrawable.redraw(); }
protected <T extends GUIPositionInterface> void doRightClickSelection( T clicked, List<T> selection ) { if ( selection.contains( clicked ) ) { return; } if ( !selection.isEmpty() ) { for ( GUIPositionInterface selected : selection ) { selected.setSelected( false ); } selection.clear(); } clicked.setSelected( true ); selection.add( clicked ); redraw(); }
public static void setLocation( GUIPositionInterface guiElement, int x, int y ) { if ( x < 0 ) { x = 0; } if ( y < 0 ) { y = 0; } guiElement.setLocation( calculateGridPosition( new Point( x, y ) ) ); }
GUIPositionInterface element = elements.get( i ); Point p = element.getLocation(); if ( p.x < min ) { min = p.x; Point p1 = ( elements.get( order[j] ) ).getLocation(); Point p2 = ( elements.get( order[j + 1] ) ).getLocation(); if ( p1.x > p2.x ) { // swap GUIPositionInterface element = elements.get( order[i] ); Point p = element.getLocation(); before[i] = new Point( p.x, p.y ); p.x = min + ( i * distance );
GUIPositionInterface element = elements.get( i ); Point p = element.getLocation(); if ( p.y < min ) { min = p.y; Point p1 = ( elements.get( order[j] ) ).getLocation(); Point p2 = ( elements.get( order[j + 1] ) ).getLocation(); if ( p1.y > p2.y ) { // swap GUIPositionInterface element = elements.get( order[i] ); Point p = element.getLocation(); before[i] = new Point( p.x, p.y ); p.y = min + ( i * distance );
public void allignleft() { if ( elements.isEmpty() ) { return; } GUIPositionInterface[] elemArray = elements.toArray( new GUIPositionInterface[elements.size()] ); Point[] before = new Point[elements.size()]; Point[] after = new Point[elements.size()]; int min = 99999; // First look for the minimum x coordinate... for ( int i = 0; i < elements.size(); i++ ) { GUIPositionInterface element = elements.get( i ); Point p = element.getLocation(); if ( p.x < min ) { min = p.x; } } // Then apply the coordinate... for ( int i = 0; i < elements.size(); i++ ) { GUIPositionInterface element = elements.get( i ); Point p = element.getLocation(); before[i] = new Point( p.x, p.y ); element.setLocation( min, p.y ); after[i] = new Point( min, p.y ); } if ( addUndoPositionInterface != null ) { addUndoPositionInterface.addUndoPosition( undoInterface, elemArray, indices, before, after ); } redrawable.redraw(); }
Point p = positionInterface.getLocation(); before[i] = new Point( p.x, p.y );
public void alligntop() { if ( elements.isEmpty() ) { return; } GUIPositionInterface[] elemArray = elements.toArray( new GUIPositionInterface[elements.size()] ); Point[] before = new Point[elements.size()]; Point[] after = new Point[elements.size()]; int min = 99999; // First look for the minimum y coordinate... for ( int i = 0; i < elements.size(); i++ ) { GUIPositionInterface element = elements.get( i ); Point p = element.getLocation(); if ( p.y < min ) { min = p.y; } } // Then apply the coordinate... for ( int i = 0; i < elements.size(); i++ ) { GUIPositionInterface element = elements.get( i ); Point p = element.getLocation(); before[i] = new Point( p.x, p.y ); element.setLocation( p.x, min ); after[i] = new Point( p.x, min ); } if ( addUndoPositionInterface != null ) { addUndoPositionInterface.addUndoPosition( undoInterface, elemArray, indices, before, after ); } redrawable.redraw(); }
public void allignright() { if ( elements.isEmpty() ) { return; } GUIPositionInterface[] elemArray = elements.toArray( new GUIPositionInterface[elements.size()] ); Point[] before = new Point[elements.size()]; Point[] after = new Point[elements.size()]; int max = -99999; // First look for the maximum x coordinate... for ( int i = 0; i < elements.size(); i++ ) { GUIPositionInterface element = elements.get( i ); Point p = element.getLocation(); if ( p.x > max ) { max = p.x; } } // Then apply the coordinate... for ( int i = 0; i < elements.size(); i++ ) { GUIPositionInterface stepMeta = elements.get( i ); Point p = stepMeta.getLocation(); before[i] = new Point( p.x, p.y ); stepMeta.setLocation( max, p.y ); after[i] = new Point( max, p.y ); } if ( addUndoPositionInterface != null ) { addUndoPositionInterface.addUndoPosition( undoInterface, elemArray, indices, before, after ); } redrawable.redraw(); }