congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
DockLayoutInfo
Code IndexAdd Tabnine to your IDE (free)

How to use
DockLayoutInfo
in
bibliothek.gui.dock.layout

Best Java code snippets using bibliothek.gui.dock.layout.DockLayoutInfo (Showing top 20 results out of 315)

origin: xyz.cofe/docking-frames-core

public void setLocation( int childIndex, DockableProperty location ){
  if( location != null ){	
    getChild( childIndex ).setLocation( location );
  }
}

origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

@SuppressWarnings("unchecked")
public PredefinedLayout getLayout( DockElement element, Map<Dockable, Integer> children ) {
  if( shouldLayout( element )){
    String factoryId = UNKNOWN + PredefinedDockSituation.super.getID( element );
    DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId );
    if( factory == null )
      throw new IllegalStateException( "Missing factory: " + factoryId );
    Object data = factory.getLayout( element, children );
    DockLayout<Object> layout = new DockLayout<Object>( factoryId, data );
    return new PredefinedLayout( elementToString.get( element ), new DockLayoutInfo( layout ));    
  }
  else{
    return new PredefinedLayout( elementToString.get( element ), new DockLayoutInfo() );
  }
}
origin: xyz.cofe/docking-frames-common

/**
 * Updates the contents of the internal {@link DockLayoutInfo} using <code>factory</code> to read
 * a byte array or an {@link XElement}.
 * @param factory the factory used to read the layout
 * @param placeholders the placeholders that may be used
 */
public void updateLayout( DockFactory<?, ?, Object> factory, PlaceholderStrategy placeholders ){
  try{
    Object data = null;
    
    switch( layout.getKind() ){
      case BYTE:
        data = factory.read( new DataInputStream( new ByteArrayInputStream( layout.getDataByte() ) ), placeholders );
        break;
      case XML:
        data = factory.read( layout.getDataXML(), placeholders );
        break;
    }
    
    if( data != null ){
      layout.setData( new DockLayout<Object>( factory.getID(), data ) );
    }
  }
  catch( IOException e ){
    // since a ByteArrayInputStream never throws an IOException this should never happen
    throw new IllegalStateException( e );
  }
}

origin: xyz.cofe/docking-frames-core

if( info.getKind() == DockLayoutInfo.Data.BYTE ){
  try{
    DataInputStream in = new DataInputStream( new ByteArrayInputStream( info.getDataByte() ));
    String result = in.readUTF();
    in.close();
if( info.getKind() == DockLayoutInfo.Data.XML ){
  return info.getDataXML().getString( "factory" );
if( info.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT ){
  return info.getDataLayout().getFactoryID();
origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

@SuppressWarnings("unchecked")
public void estimateLocations( PredefinedLayout layout, LocationEstimationMap children ){
  DockLayoutInfo delegate = layout.getDelegate();
  if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT ){
    String factoryId = delegate.getDataLayout().getFactoryID();
    DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId );
    if( factory != null ){
      factory.estimateLocations( delegate.getDataLayout().getData(), children );
    }
  }
}
origin: xyz.cofe/docking-frames-core

DockLayoutInfo original = info;
if( info.getKind() == DockLayoutInfo.Data.BYTE ){
  info = readEntry( info.getDataByte(), info.getPlaceholder() );
  if( info != null && info.getKind() == DockLayoutInfo.Data.BYTE ){
    info = original;
else if( info.getKind() == DockLayoutInfo.Data.XML ){
  info = readEntry( info.getDataXML() );
  if( info != null && info.getKind() == DockLayoutInfo.Data.XML ){
    info = original;
if( info.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT ){
  info = fillMissing( info );
  info.setLocation( original.getLocation() );
origin: xyz.cofe/docking-frames-core

  @Override
  public PlaceholderListItem<Dockable> convert( ConvertedPlaceholderListItem item ){
    int id = item.getInt( "id" );
    int index = item.getInt( "index" );
    Path placeholder = null;
    if( item.contains( "placeholder" )){
      placeholder = new Path( item.getString( "placeholder" ) );
    }
    StackDockProperty property = new StackDockProperty( index, placeholder );
    children.getChild( id ).setLocation( property );
    
    for( int i = 0, n = children.getSubChildCount( id ); i<n; i++ ){
      DockLayoutInfo info = children.getSubChild( id, i );
      info.setLocation( new StackDockProperty( index, info.getPlaceholder() ) );
    }
    return null;
  }
});
origin: xyz.cofe/docking-frames-common

DockLayout<?> layout = info.getDataLayout();
if( layout != null ){
  MultipleCDockable match = setting.findMatch( layout );
  if( match != null ){
    DockLayout<?> newLayout = new DockLayout<MultipleCDockable>( REPLACEMENT_FACTORY_ID, match );
    DockLayoutInfo newInfo = new DockLayoutInfo( newLayout );
    newInfo.setLocation( info.getLocation() );
    info = newInfo;
origin: xyz.cofe/docking-frames-core

Path placeholder = info.getPlaceholder();
out.writeBoolean( placeholder != null );
if( placeholder != null ){
if( info.getKind() == DockLayoutInfo.Data.BYTE ){
  out.write( info.getDataByte() );
else if( info.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT ){
  DockLayout<?> layout = info.getDataLayout();
  DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( layout.getFactoryID() );
  if( factory == null )
origin: xyz.cofe/docking-frames-core

@Override
protected DockLayoutInfo fillMissing( DockLayoutInfo info ) {
  DockLayout<?> layout = info.getDataLayout();
  if( KNOWN.equals( layout.getFactoryID() )){
    PredefinedLayout preloaded = (PredefinedLayout)layout.getData();
    DockLayoutInfo delegate = preloaded.getDelegate();
    DockLayoutInfo newDelegate = null;
    if( delegate.getKind() == DockLayoutInfo.Data.BYTE ){
      newDelegate = fillMissingStream( preloaded );
    }
    else if( delegate.getKind() == DockLayoutInfo.Data.XML ){
      newDelegate = fillMissingXML( preloaded );
    }
    if( newDelegate != null ){
      info = new DockLayoutInfo( new DockLayout<PredefinedLayout>( 
          KNOWN, new PredefinedLayout( preloaded.getPredefined(), newDelegate )));
    }
  }
  return info;
}

origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

@SuppressWarnings("unchecked")
public void write( PredefinedLayout layout, DataOutputStream out ) throws IOException {
  Version.write( out, Version.VERSION_1_0_7 );
  DockLayoutInfo info = layout.getDelegate();
  out.writeUTF( layout.getPredefined() );
  if( info.getKind() == DockLayoutInfo.Data.BYTE ){
    out.writeBoolean( true );
    out.write( info.getDataByte() );
  }
  else if( info.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT ){
    out.writeBoolean( true );
    DockLayout delegate = info.getDataLayout();
    String factoryId = delegate.getFactoryID();
    DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId );
    if( factory == null )
      throw new IOException( "Missing factory: " + factoryId );
    out.writeUTF( factoryId );
    factory.write( delegate.getData(), out );    
  }
  else if( info.getKind() == DockLayoutInfo.Data.NULL ){
    out.writeBoolean( false );
  }
  else{
    throw new IllegalArgumentException( "Cannot store information as byte[], it is not present as raw byte[] or in an understandable format" );
  }
}
origin: xyz.cofe/docking-frames-core

@SuppressWarnings("unchecked")
public void write( PredefinedLayout layout, XElement element ) {
  element.addElement( "replacement" ).addString( "id", layout.getPredefined() );
  DockLayoutInfo info = layout.getDelegate();
  if( info.getKind() == DockLayoutInfo.Data.XML ){
    element.addElement( info.getDataXML() );
  }
  else if( info.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT ){
    DockLayout<?> delegate = layout.getDelegate().getDataLayout();
    String factoryId = delegate.getFactoryID();
    DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId );
    if( factory == null )
      throw new XException( "Missing factory: " + factoryId );
    XElement xdelegate = element.addElement( "delegate" );
    xdelegate.addString( "id", factoryId );
    factory.write( delegate.getData(), xdelegate );    
  }
  else if( info.getKind() == DockLayoutInfo.Data.NULL ){
    // nothing to store
  }
  else{
    throw new IllegalArgumentException( "Cannot store information as xml, it is neither present as raw xml nor in an understandable format" );
  }
}
origin: xyz.cofe/docking-frames-core

public void writeCompositionXML( DockLayoutComposition composition, XElement element ){
  DockLayoutInfo info = composition.getLayout();
  if( info.getKind() == DockLayoutInfo.Data.XML ){
    element.addElement( info.getDataXML() );
  else if( info.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT ){
    DockLayout<?> layout = info.getDataLayout();
    Path placeholder = info.getPlaceholder();
    if( placeholder != null ){
      xfactory.addString( "placeholder", placeholder.toString() );
origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

/**
 * Creates a new info
 * @param data the data of this info
 */
public DockLayoutInfo( DockLayout<?> data ){
  setData( data );
}

origin: xyz.cofe/docking-frames-core

private void fillMissing( String root, DockLayoutComposition composition, DockFactory<?,?,?> factory, String factoryId ){
  DockLayoutInfo info = composition.getLayout();
  if( info.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT ){
    if( info.getDataLayout().getFactoryID().equals( factoryId )){
      DockableProperty location = info.getLocation();
      if( location != null ){
        DockFactory<DockElement,?,Object> normalizedFactory = (DockFactory<DockElement,?,Object>)factory;
        if( missingDockable.shouldCreate( normalizedFactory, info.getDataLayout().getData() ) ){
          DockElement element = normalizedFactory.layout( info.getDataLayout().getData(), layoutChangeStrategy.getPlaceholderStrategy( new Internals() ) );
          if( element != null ){
            Dockable dockable = element.asDockable();
origin: xyz.cofe/docking-frames-core

  info = new DockLayoutInfo( new DockLayout<Object>( factoryId, data ));
  info.setPlaceholder( placeholder );
info = new DockLayoutInfo( entry );
info.setPlaceholder( placeholder );
info = new DockLayoutInfo( new DockLayout<Object>( factoryId, data ) );
info.setPlaceholder( placeholder );
origin: xyz.cofe/docking-frames-common

  /**
   * Gets the layout information that was produced the {@link DockFactory} with id {@link #getFactoryId()}.
   * @return the layout information or <code>null</code> if not present in object format
   */
  public DockLayout<?> getLayout(){
    return layout.getDataLayout();
  }
}
origin: xyz.cofe/docking-frames-core

private void appendFirstOnEstimate( DockLayoutComposition composition, DockableProperty location ){
  DockLayoutInfo info = composition.getLayout();
  DockableProperty property = info.getLocation();
  if( property != null ){
    info.setLocation( DockUtilities.append( property, location ) );
  }
  for( DockLayoutComposition child : composition.getChildren() ){
    appendFirstOnEstimate( child, location );
  }
}

origin: xyz.cofe/docking-frames-core

/**
 * Tries to read the xml data in <code>layout</code>.
 * @param layout the layout to read
 * @return either a new info or <code>null</code> if the data could
 * not be read
 */
@SuppressWarnings("unchecked")
private DockLayoutInfo fillMissingXML( PredefinedLayout layout ){
  XElement xdelegate = layout.getDelegate().getDataXML();
  String factoryId = xdelegate.getString( "id" );
  Object delegate = null;
  DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId );
  if( factory == null ){
    DockFactory<?,?,BackupFactoryData<?>> backup = getBackup( factoryId );
    if( backup != null ){
      BackupFactoryData<Object> data = (BackupFactoryData<Object>)backup.read( xdelegate, getPlaceholderStrategy() );
      if( data != null )
        delegate = data.getData();
    }
  }
  else{
    delegate = factory.read( xdelegate, getPlaceholderStrategy() );
  }
  if( delegate == null ){
    return null;
  }
  
  return new DockLayoutInfo( new DockLayout<Object>( factoryId, delegate ) );
}

origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

byte[] bytes = layout.getDelegate().getDataByte();
      BackupFactoryData<Object> data = (BackupFactoryData<Object>)backup.read( in, getPlaceholderStrategy() );
      if( data != null && data.getData() != null ){
        info = new DockLayoutInfo( new DockLayout<Object>( factoryId, data.getData() ));
    Object delegate = factory.read( in, getPlaceholderStrategy() );
    if( delegate != null ){
      info = new DockLayoutInfo( new DockLayout<Object>( factoryId, delegate ));
bibliothek.gui.dock.layoutDockLayoutInfo

Javadoc

A DockLayoutInfo is a wrapper around a DockLayout. The DockLayout can either be stored as real object, as byte-stream or as part of an xml tree. This information is normally used by a DockConverter to create or store DockElements.

Most used methods

  • setLocation
    Sets the location of the Dockable ,represented by this info, on its parent station.
  • <init>
    Creates a new info.
  • getDataByte
    Gets the data of this info as byte array.
  • getDataLayout
    Gets the data of this info as DockLayout.
  • getDataXML
    Gets the data of this info formated as xml.
  • getKind
    Tells what kind of information can be found in this info.
  • getLocation
    Gets the location of of the Dockable on its parent station.
  • setData
    Sets the information of this info. The object data must either be null, or an instance of XElement,b
  • getPlaceholder
    Gets the representation of this element as placeholder.
  • setPlaceholder
    Sets a placeholder which represents this element.

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • getSystemService (Context)
  • getResourceAsStream (ClassLoader)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • JList (javax.swing)
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now