Codota Logo
DockLayoutInfo.getKind
Code IndexAdd Codota to your IDE (free)

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

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

  • Common ways to obtain DockLayoutInfo
private void myMethod () {
DockLayoutInfo d =
  • Codota IconDockLayoutComposition composition;composition.getLayout()
  • Codota IconDockLayout data;new DockLayoutInfo(data)
  • Codota IconLocationEstimationMap locationEstimationMap;locationEstimationMap.getSubChild(childIndex, subChildIndex)
  • Smart code suggestions by Codota
}
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

/**
 * Gets the name of element which is represented by <code>composition</code>.
 * @param composition the composition whose element key is searched
 * @param missingOnly if set, then the key will only be returned if <code>composition</code>
 * is not fully loaded
 * @return the key or <code>null</code>
 */
private String getKey( DockLayoutComposition composition, boolean missingOnly ){
  DockLayoutInfo layout = composition.getLayout();
  if( layout.getKind() != DockLayoutInfo.Data.DOCK_LAYOUT )
    return null;
  
  if( !KNOWN.equals( layout.getDataLayout().getFactoryID() ))
    return null;
  
  PredefinedLayout preloaded = (PredefinedLayout)layout.getDataLayout().getData();
  if( missingOnly && preloaded.getDelegate().getKind() == DockLayoutInfo.Data.DOCK_LAYOUT ){
    // if there is such a Dockable registered then it is not missing...
    if( stringToElement.containsKey( preloaded.getPredefined() )){
      return null;
    }
  }
  
  String key = preloaded.getPredefined();
  return key;
}
origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

/**
 * Gets the name of element which is represented by <code>composition</code>.
 * @param composition the composition whose element key is searched
 * @param missingOnly if set, then the key will only be returned if <code>composition</code>
 * is not fully loaded
 * @return the key or <code>null</code>
 */
private String getKey( DockLayoutComposition composition, boolean missingOnly ){
  DockLayoutInfo layout = composition.getLayout();
  if( layout.getKind() != DockLayoutInfo.Data.DOCK_LAYOUT )
    return null;
  
  if( !KNOWN.equals( layout.getDataLayout().getFactoryID() ))
    return null;
  
  PredefinedLayout preloaded = (PredefinedLayout)layout.getDataLayout().getData();
  if( missingOnly && preloaded.getDelegate().getKind() == DockLayoutInfo.Data.DOCK_LAYOUT ){
    // if there is such a Dockable registered then it is not missing...
    if( stringToElement.containsKey( preloaded.getPredefined() )){
      return null;
    }
  }
  
  String key = preloaded.getPredefined();
  return key;
}
origin: xyz.cofe/docking-frames-core

public DockElement layout( PredefinedLayout layout, Map<Integer, Dockable> children, PlaceholderStrategy placeholders ) {
  DockLayoutInfo delegate = layout.getDelegate();
  boolean isLayout = delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT;
  boolean isNull =  delegate.getKind() == DockLayoutInfo.Data.NULL;
  if( !isLayout && !isNull ){
    return null;
  }
  
  DockElement element = stringToElement.get( layout.getPredefined() );
  if( element == null && isLayout ){
    String factoryId = delegate.getDataLayout().getFactoryID();
    DockFactory<?, ?, BackupFactoryData<?>> factory = getBackup( factoryId );
    if( factory != null ){
      return factory.layout( new BackupFactoryData<Object>(
          layout.getPredefined(), 
          delegate.getDataLayout().getData()), children,
          placeholders );
    }
    return null;
  }
  setLayout( element, layout, children, placeholders );
  return element;
}
origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

public DockElement layout( PredefinedLayout layout, Map<Integer, Dockable> children, PlaceholderStrategy placeholders ) {
  DockLayoutInfo delegate = layout.getDelegate();
  boolean isLayout = delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT;
  boolean isNull =  delegate.getKind() == DockLayoutInfo.Data.NULL;
  if( !isLayout && !isNull ){
    return null;
  }
  
  DockElement element = stringToElement.get( layout.getPredefined() );
  if( element == null && isLayout ){
    String factoryId = delegate.getDataLayout().getFactoryID();
    DockFactory<?, ?, BackupFactoryData<?>> factory = getBackup( factoryId );
    if( factory != null ){
      return factory.layout( new BackupFactoryData<Object>(
          layout.getPredefined(), 
          delegate.getDataLayout().getData()), children,
          placeholders );
    }
    return null;
  }
  setLayout( element, layout, children, placeholders );
  return element;
}
origin: org.opentcs.thirdparty.dockingframes/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

@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

@SuppressWarnings("unchecked")
public PerspectiveElement layoutPerspective( PredefinedLayout layout, Map<Integer, PerspectiveDockable> children ){
  if( perspective == null ){
    throw new IllegalStateException( "the perspective of this factory is not set, meaning this factory cannot be used handling perspective dependent tasks" );
  }
  DockLayoutInfo delegate = layout.getDelegate();
  boolean isLayout = delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT;
  boolean isNull =  delegate.getKind() == DockLayoutInfo.Data.NULL;
  if( !isLayout && !isNull ){
    return null;
  }
  
  PerspectiveElement element = perspective.get( layout.getPredefined() );
  if( element == null && isLayout ){
    String factoryId = delegate.getDataLayout().getFactoryID();
    DockFactory factory = getBackup( factoryId );
    if( factory != null ){
      return factory.layoutPerspective(new BackupFactoryData<Object>( layout.getPredefined(), delegate.getDataLayout().getData()), children );
    }
    return null;
  }
  layoutPerspective( element, layout, children );
  return element;
}

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

@SuppressWarnings("unchecked")
public PerspectiveElement layoutPerspective( PredefinedLayout layout, Map<Integer, PerspectiveDockable> children ){
  if( perspective == null ){
    throw new IllegalStateException( "the perspective of this factory is not set, meaning this factory cannot be used handling perspective dependent tasks" );
  }
  DockLayoutInfo delegate = layout.getDelegate();
  boolean isLayout = delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT;
  boolean isNull =  delegate.getKind() == DockLayoutInfo.Data.NULL;
  if( !isLayout && !isNull ){
    return null;
  }
  
  PerspectiveElement element = perspective.get( layout.getPredefined() );
  if( element == null && isLayout ){
    String factoryId = delegate.getDataLayout().getFactoryID();
    DockFactory factory = getBackup( factoryId );
    if( factory != null ){
      return factory.layoutPerspective(new BackupFactoryData<Object>( layout.getPredefined(), delegate.getDataLayout().getData()), children );
    }
    return null;
  }
  layoutPerspective( element, layout, children );
  return element;
}

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

@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: xyz.cofe/docking-frames-core

public DockElement layout( PredefinedLayout layout, PlaceholderStrategy placeholders ) {
  DockLayoutInfo delegate = layout.getDelegate();
  
  boolean isLayout = delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT;
  boolean isNull =  delegate.getKind() == DockLayoutInfo.Data.NULL;
  if( !isLayout && !isNull ){
    return null;
  }
  DockElement element = stringToElement.get( layout.getPredefined() );
  if( element == null && isLayout ){
    if( layout.getDelegate() == null )
      return null;
    String factoryId = delegate.getDataLayout().getFactoryID();
    DockFactory<?, ?, BackupFactoryData<?>> factory = getBackup( factoryId );
    if( factory != null ){
      return factory.layout( new BackupFactoryData<Object>( 
          layout.getPredefined(),
          delegate.getDataLayout().getData()),
          placeholders);
    }
    return null;
  }
  setLayout( element, layout, placeholders );
  return element;
}

origin: xyz.cofe/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: org.opentcs.thirdparty.dockingframes/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 layoutPerspective( PerspectiveElement element, PredefinedLayout layout, Map<Integer, PerspectiveDockable> children ){
  DockLayoutInfo delegate = layout.getDelegate();
  if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT && shouldLayout( element, perspective )){
    String factoryId = delegate.getDataLayout().getFactoryID();
    DockFactory factory = getFactory( factoryId );
    if( factory != null ){
      factory.layoutPerspective( element, delegate.getDataLayout().getData(), children );
    }
  }
}

origin: xyz.cofe/docking-frames-core

@SuppressWarnings("unchecked")
public void layoutPerspective( PerspectiveElement element, PredefinedLayout layout, Map<Integer, PerspectiveDockable> children ){
  DockLayoutInfo delegate = layout.getDelegate();
  if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT && shouldLayout( element, perspective )){
    String factoryId = delegate.getDataLayout().getFactoryID();
    DockFactory factory = getFactory( factoryId );
    if( factory != null ){
      factory.layoutPerspective( element, delegate.getDataLayout().getData(), children );
    }
  }
}

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

@SuppressWarnings("unchecked")
public void setLayout( DockElement element, PredefinedLayout layout, Map<Integer, Dockable> children, PlaceholderStrategy placeholders ) {
  DockLayoutInfo delegate = layout.getDelegate();
  if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT && shouldLayout( element )){
    String factoryId = delegate.getDataLayout().getFactoryID();
    DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId );
    if( factory != null ){
      DockController controller = element.getController();
      try{
        if( controller != null )
          controller.freezeLayout();
        
        factory.setLayout( element, delegate.getDataLayout().getData(), children, placeholders );
      }
      finally{
        if( controller != null )
          controller.meltLayout();
      }
    }
  }
}
origin: xyz.cofe/docking-frames-core

@SuppressWarnings("unchecked")
public void setLayout( DockElement element, PredefinedLayout layout, PlaceholderStrategy placeholders ) {
  DockLayoutInfo delegate = layout.getDelegate();
  if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT && shouldLayout( element )){
    String factoryId = delegate.getDataLayout().getFactoryID();
    DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId );
    if( factory != null ){
      DockController controller = element.getController();
      try{
        if( controller != null )
          controller.freezeLayout();
        
        factory.setLayout( element, delegate.getDataLayout().getData(), placeholders );
      }
      finally{
        if( controller != null )
          controller.meltLayout();
      }
    }
  }
}
origin: xyz.cofe/docking-frames-core

@SuppressWarnings("unchecked")
public void setLayout( DockElement element, PredefinedLayout layout, Map<Integer, Dockable> children, PlaceholderStrategy placeholders ) {
  DockLayoutInfo delegate = layout.getDelegate();
  if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT && shouldLayout( element )){
    String factoryId = delegate.getDataLayout().getFactoryID();
    DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId );
    if( factory != null ){
      DockController controller = element.getController();
      try{
        if( controller != null )
          controller.freezeLayout();
        
        factory.setLayout( element, delegate.getDataLayout().getData(), children, placeholders );
      }
      finally{
        if( controller != null )
          controller.meltLayout();
      }
    }
  }
}
origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

@SuppressWarnings("unchecked")
public void setLayout( DockElement element, PredefinedLayout layout, PlaceholderStrategy placeholders ) {
  DockLayoutInfo delegate = layout.getDelegate();
  if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT && shouldLayout( element )){
    String factoryId = delegate.getDataLayout().getFactoryID();
    DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId );
    if( factory != null ){
      DockController controller = element.getController();
      try{
        if( controller != null )
          controller.freezeLayout();
        
        factory.setLayout( element, delegate.getDataLayout().getData(), placeholders );
      }
      finally{
        if( controller != null )
          controller.meltLayout();
      }
    }
  }
}
bibliothek.gui.dock.layoutDockLayoutInfogetKind

Javadoc

Tells what kind of information can be found in this info.

Popular methods of DockLayoutInfo

  • 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.
  • 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 post requests using okhttp
  • putExtra (Intent)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • onRequestPermissionsResult (Fragment)
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now