@Override public void setSuccessor( DockableProperty successor ){ super.setSuccessor( successor ); if( backup != null ){ backup.setSuccessor( successor ); } }
public boolean equalsNoSuccessor( DockableProperty property ){ DockableProperty successor = this.successor; DockableProperty successorProperty = property.getSuccessor(); try{ this.successor = null; property.setSuccessor( null ); return equals( property ); } finally{ this.successor = successor; property.setSuccessor( successorProperty ); } }
/** * Creates a copy of <code>root</code> and sets <code>property</code> * as the successor of the very last element in the property chain beginning * at <code>root</code>. * @param root the root of the chain, can be <code>null</code> * @param property the new last element of the chain * @return the root of the new chain */ public static DockableProperty append( DockableProperty root, DockableProperty property ){ if( root == null ) return property; root = root.copy(); getLastProperty( root ).setSuccessor( property ); return root; }
property = temp; } else { property.setSuccessor( temp ); property = temp;
property = temp; } else { property.setSuccessor( temp ); property = temp;
temp.setSuccessor( property ); property = temp;
temp.setSuccessor( property ); property = temp;
/** * Reads a {@link DockableProperty} and its successors from an xml element. * @param element the element to read from * @return the property or <code>null</code> if <code>element</code> is empty * @throws IllegalArgumentException if a {@link DockablePropertyFactory} is missing. */ public DockableProperty readXML( XElement element ){ DockableProperty base = null; DockableProperty property = null; for (XElement xnode : element.getElements( "property" )) { DockablePropertyFactory factory = factories.get( xnode.getString( "factory" ) ); if (factory == null) throw new IllegalArgumentException( "Missing factory: " + xnode.getString( "factory" ) ); DockableProperty next = factory.createProperty(); next.load( xnode ); if (property == null) { property = next; base = next; } else { property.setSuccessor( next ); property = next; } } return base; } }
/** * Reads a {@link DockableProperty} and its successors from an xml element. * @param element the element to read from * @return the property or <code>null</code> if <code>element</code> is empty * @throws IllegalArgumentException if a {@link DockablePropertyFactory} is missing. */ public DockableProperty readXML( XElement element ){ DockableProperty base = null; DockableProperty property = null; for (XElement xnode : element.getElements( "property" )) { DockablePropertyFactory factory = factories.get( xnode.getString( "factory" ) ); if (factory == null) throw new IllegalArgumentException( "Missing factory: " + xnode.getString( "factory" ) ); DockableProperty next = factory.createProperty(); next.load( xnode ); if (property == null) { property = next; base = next; } else { property.setSuccessor( next ); property = next; } } return base; } }
public void finish( DockableProperty newParentLocation ){ if( valid ){ DockableProperty newLeafLocation = validLocation(); if( newLeafLocation == null && newParentLocation != null ){ newLeafLocation = newParentLocation.copy(); } if( newLeafLocation != null ){ newLeafLocation.setSuccessor( oldLocation ); composition.getLayout().setLocation( newLeafLocation ); } else{ invalidate(); } } }
private DockableProperty answerLocation( AsideAnswer successor ){ if( successor == null || successor.getLocation() == null ){ return resultingLocation; } if( resultingLocation == null ){ return successor.getLocation(); } DockableProperty last = resultingLocation; while( last.getSuccessor() != null ){ last = last.getSuccessor(); } last.setSuccessor( successor.getLocation() ); return resultingLocation; }
private DockableProperty answerLocation( AsideAnswer successor ){ if( successor == null || successor.getLocation() == null ){ return resultingLocation; } if( resultingLocation == null ){ return successor.getLocation(); } DockableProperty last = resultingLocation; while( last.getSuccessor() != null ){ last = last.getSuccessor(); } last.setSuccessor( successor.getLocation() ); return resultingLocation; }
private DockableProperty copyAndSetStackLocation( DockableProperty property, int delta ){ if( property == null ){ return null; } property = property.copy(); DockableProperty last = property; while( last.getSuccessor() != null ){ last = last.getSuccessor(); } if( last instanceof StackDockProperty ){ ((StackDockProperty)last).setIndex( ((StackDockProperty)last).getIndex() + delta ); } else{ StackDockProperty stack = new StackDockProperty( delta ); last.setSuccessor( stack ); } return property; } }
private DockableProperty copyAndSetStackLocation( DockableProperty property, int delta ){ if( property == null ){ return null; } property = property.copy(); DockableProperty last = property; while( last.getSuccessor() != null ){ last = last.getSuccessor(); } if( last instanceof StackDockProperty ){ ((StackDockProperty)last).setIndex( ((StackDockProperty)last).getIndex() + delta ); } else{ StackDockProperty stack = new StackDockProperty( delta ); last.setSuccessor( stack ); } return property; } }
last = last.getSuccessor(); last.setSuccessor( next ); last = next; DockableProperty successor = last.getSuccessor(); if( successor == null ){ last.setSuccessor( new StackDockProperty( Integer.MAX_VALUE, placeholder ) );
location.setSuccessor( null ); request.answer( location );
location.setSuccessor( null ); request.answer( location );