## org.apache.poi.hssf.record
Class WindowOneRecord

    java.lang.Object
      org.apache.poi.hssf.record.Record
          org.apache.poi.hssf.record.WindowOneRecord

public class WindowOneRecord
extends Record

Title: Window1 Record

Description: Stores the attributes of the workbook window. This is basically so the gui knows how big to make the window holding the spreadsheet document.

REFERENCE: PG 421 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)

Version:
  2.0-pre
Author:
  Andrew C. Oliver (acoliver at apache dot org)

Field Summary
`static short` `sid`

Constructor Summary
`WindowOneRecord()`
`WindowOneRecord(short id, short size, byte[] data)` Constructs a WindowOne record and sets its fields appropriately.
`WindowOneRecord(short id, short size, byte[] data, int offset)` Constructs a WindowOne record and sets its fields appropriately.

Method Summary
`protected void` `fillFields(byte[] data, short size, int offset)` called by the constructor, should set class level fields.
`short` `getDisplayedTab()` get the displayed tab number
`boolean` `getDisplayHorizontalScrollbar()` get whether to display the horizontal scrollbar or not
`boolean` `getDisplayTabs()` get whether to display the tabs or not
`boolean` `getDisplayVerticalScrollbar()` get whether to display the vertical scrollbar or not
`short` `getHeight()` get the height of the window
`boolean` `getHidden()` get whether the window is hidden or not
`short` `getHorizontalHold()` get the horizontal position of the window (in 1/20ths of a point)
`boolean` `getIconic()` get whether the window has been iconized or not
`short` `getNumSelectedTabs()` get the number of selected tabs
`short` `getOptions()` get the options bitmask (see bit setters)
`int` `getRecordSize()` gives the current serialized size of the record.
`short` `getSelectedTab()` get the selected tab number
`short` `getSid()` return the non static version of the id for this record.
`short` `getTabWidthRatio()` ratio of the width of the tabs to the horizontal scrollbar
`short` `getVerticalHold()` get the vertical position of the window (in 1/20ths of a point)
`short` `getWidth()` get the width of the window
`int` `serialize(int offset, byte[] data)` called by the class that is responsible for writing this sucker.
`void` `setDisplayedTab(short t)` set the displayed tab number
`void` `setDisplayHorizonalScrollbar(boolean scroll)` set whether to display the horizontal scrollbar or not
`void` `setDisplayTabs(boolean disptabs)` set whether to display the tabs or not
`void` `setDisplayVerticalScrollbar(boolean scroll)` set whether to display the vertical scrollbar or not
`void` `setHeight(short h)` set teh height of the window
`void` `setHidden(boolean ishidden)` set whether the window is hidden or not
`void` `setHorizontalHold(short h)` set the horizontal position of the window (in 1/20ths of a point)
`void` `setIconic(boolean isiconic)` set whether the window has been iconized or not
`void` `setNumSelectedTabs(short n)` set the number of selected tabs
`void` `setOptions(short o)` set the options bitmask (see bit setters)
`void` `setSelectedTab(short s)` set the selected tab number
`void` `setTabWidthRatio(short r)` ratio of the width of the tabs to the horizontal scrollbar
`void` `setVerticalHold(short v)` set the vertical position of the window (in 1/20ths of a point)
`void` `setWidth(short w)` set the width of the window
`java.lang.String` `toString()` get a string representation of the record (for biffview/debugging)
`protected void` `validateSid(short id)` called by constructor, should throw runtime exception in the event of a record passed with a differing ID.

Methods inherited from class org.apache.poi.hssf.record.Record
`clone, fillFields, isInValueSection, isValue, processContinueRecord, serialize`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### sid

    public static final short sid

See Also:
  Constant Field Values

Constructor Detail

### WindowOneRecord

    public WindowOneRecord()

### WindowOneRecord

    public WindowOneRecord(short id,
                           short size,
                           byte[] data)

  Constructs a WindowOne record and sets its fields appropriately.

Parameters:
  `id` - id must be 0x3d or an exception will be throw upon validation
  `size` - the size of the data area of the record
  `data` - data of the record (should not contain sid/len)

### WindowOneRecord

    public WindowOneRecord(short id,
                           short size,
                           byte[] data,
                           int offset)

  Constructs a WindowOne record and sets its fields appropriately.

Parameters:
  `id` - id must be 0x3d or an exception will be throw upon validation
  `size` - the size of the data area of the record
  `data` - data of the record (should not contain sid/len)

Method Detail

### validateSid

    protected void validateSid(short id)

  Description copied from class: `Record`
  called by constructor, should throw runtime exception in the event of a record passed with a differing ID.

  Specified by:
    `validateSid` in class `Record`
  Parameters:
    `id` - alleged id for this record

### fillFields

    protected void fillFields(byte[] data,
                              short size,
                              int offset)

  Description copied from class: `Record`
  called by the constructor, should set class level fields. Should throw runtime exception for bad/icomplete data.

  Specified by:
    `fillFields` in class `Record`
  Parameters:
    `data` - raw data
    `size` - size of data
    `offset` - of the record's data (provided a big array of the file)

### setHorizontalHold

    public void setHorizontalHold(short h)

  set the horizontal position of the window (in 1/20ths of a point)

  Parameters:
    `h` - - horizontal location

### setVerticalHold

    public void setVerticalHold(short v)

  set the vertical position of the window (in 1/20ths of a point)

  Parameters:
    `v` - - vertical location

### setWidth

    public void setWidth(short w)

  set the width of the window

  Parameters:
    `w` - width

### setHeight

    public void setHeight(short h)

  set teh height of the window

  Parameters:
    `h` - height

### setOptions

    public void setOptions(short o)

  set the options bitmask (see bit setters)

  Parameters:
    `o` - - the bitmask

### setHidden

    public void setHidden(boolean ishidden)

  set whether the window is hidden or not

  Parameters:
    `ishidden` - or not

### setIconic

    public void setIconic(boolean isiconic)

  set whether the window has been iconized or not

  Parameters:
    `isiconic` - iconize or not

### setDisplayHorizonalScrollbar

    public void setDisplayHorizonalScrollbar(boolean scroll)

  set whether to display the horizontal scrollbar or not

  Parameters:
    `scroll` - display or not

### setDisplayVerticalScrollbar

    public void setDisplayVerticalScrollbar(boolean scroll)

  set whether to display the vertical scrollbar or not

  Parameters:
    `scroll` - display or not

### setDisplayTabs

    public void setDisplayTabs(boolean disptabs)

  set whether to display the tabs or not

  Parameters:
    `disptabs` - display or not

### setSelectedTab

    public void setSelectedTab(short s)

  set the selected tab number

  Parameters:
    `s` - tab number

### setDisplayedTab

    public void setDisplayedTab(short t)

  set the displayed tab number

  Parameters:
    `t` - tab number

### setNumSelectedTabs

    public void setNumSelectedTabs(short n)

  set the number of selected tabs

  Parameters:
    `n` - number of tabs

### setTabWidthRatio

    public void setTabWidthRatio(short r)

  ratio of the width of the tabs to the horizontal scrollbar

  Parameters:
    `r` - ratio

### getHorizontalHold

    public short getHorizontalHold()

  get the horizontal position of the window (in 1/20ths of a point)

  Returns:
    h - horizontal location

### getVerticalHold

    public short getVerticalHold()

  get the vertical position of the window (in 1/20ths of a point)

  Returns:
    v - vertical location

### getWidth

    public short getWidth()

  get the width of the window

  Returns:
    width

### getHeight

    public short getHeight()

  get the height of the window

  Returns:
    height

### getOptions

    public short getOptions()

  get the options bitmask (see bit setters)

  Returns:
    o - the bitmask

### getHidden

    public boolean getHidden()

  get whether the window is hidden or not

  Returns:
    ishidden or not

### getIconic

    public boolean getIconic()

  get whether the window has been iconized or not

  Returns:
    iconize or not

### getDisplayHorizontalScrollbar

    public boolean getDisplayHorizontalScrollbar()

  get whether to display the horizontal scrollbar or not

  Returns:
    display or not

### getDisplayVerticalScrollbar

    public boolean getDisplayVerticalScrollbar()

  get whether to display the vertical scrollbar or not

  Returns:
    display or not

### getDisplayTabs

    public boolean getDisplayTabs()

  get whether to display the tabs or not

  Returns:
    display or not

### getSelectedTab

    public short getSelectedTab()

  get the selected tab number

  Returns:
    Tab number

### getDisplayedTab

    public short getDisplayedTab()

  get the displayed tab number

  Returns:
    Tab number

### getNumSelectedTabs

    public short getNumSelectedTabs()

  get the number of selected tabs

  Returns:
    number of tabs

### getTabWidthRatio

    public short getTabWidthRatio()

  ratio of the width of the tabs to the horizontal scrollbar

  Returns:
    ratio

### toString

    public java.lang.String toString()

  Description copied from class: `Record`
  get a string representation of the record (for biffview/debugging)

  Overrides:
    `toString` in class `Record`

### serialize

    public int serialize(int offset,
                         byte[] data)

  Description copied from class: `Record`
  called by the class that is responsible for writing this sucker. Subclasses should implement this so that their data is passed back in a byte array.

  Specified by:
    `serialize` in class `Record`
  Parameters:
    `offset` - to begin writing at
    `data` - byte array containing instance data
  Returns:
    number of bytes written

### getRecordSize

    public int getRecordSize()

  Description copied from class: `Record`
  gives the current serialized size of the record. Should include the sid and reclength (4 bytes).

  Overrides:
    `getRecordSize` in class `Record`

### getSid

    public short getSid()

  Description copied from class: `Record`
  return the non static version of the id for this record.

  Specified by:
    `getSid` in class `Record`

Copyright © 2003 Apache Software Foundation.