Tabnine Logo
DockLayoutInfo.getDataByte
Code IndexAdd Tabnine to your IDE (free)

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

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

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

/**
 * Gets the layout information as byte array, assuming that the layout information is stored
 * as byte array.
 * @return the layout information or <code>null</code> if not stored in byte array format
 */
public byte[] getLayoutBytes(){
  return layout.getDataByte();
}

origin: xyz.cofe/docking-frames-common

/**
 * Gets the layout information as byte array, assuming that the layout information is stored
 * as byte array.
 * @return the layout information or <code>null</code> if not stored in byte array format
 */
public byte[] getLayoutBytes(){
  return layout.getDataByte();
}

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();
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, 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-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: org.opentcs.thirdparty.dockingframes/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

out.write( info.getDataByte() );
origin: xyz.cofe/docking-frames-core

byte[] bytes = layout.getDelegate().getDataByte();
origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

byte[] bytes = layout.getDelegate().getDataByte();
origin: xyz.cofe/docking-frames-core

info = readEntry( info.getDataByte(), info.getPlaceholder() );
if( info != null && info.getKind() == DockLayoutInfo.Data.BYTE ){
  info = original;
bibliothek.gui.dock.layoutDockLayoutInfogetDataByte

Javadoc

Gets the data of this info as byte array.

Popular methods of DockLayoutInfo

  • setLocation
    Sets the location of the Dockable ,represented by this info, on its parent station.
  • <init>
    Creates a new info.
  • 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

  • Start an intent from android
  • putExtra (Intent)
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • JComboBox (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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