Changed so it extends XML generated type

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352588 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Said Ryan Ackley 2002-05-03 01:53:51 +00:00
parent 36bd0eaf60
commit d58cc30447
6 changed files with 470 additions and 578 deletions

View File

@ -55,162 +55,41 @@
package org.apache.poi.hdf.model.hdftypes;
import org.apache.poi.hdf.model.hdftypes.definitions.CHPAbstractType;
/**
* Comment me
* Properties for character runs.
*
* @author Ryan Ackley
*/
public class CharacterProperties implements Cloneable, HDFType
public class CharacterProperties extends CHPAbstractType implements Cloneable
{
public boolean _bold;
public boolean _italic;
public boolean _fRMarkDel;
public boolean _fOutline;
public boolean _fSmallCaps;
public boolean _fCaps;
public boolean _fVanish;
public boolean _fRMark;
public boolean _fSpec;
public boolean _fStrike;
public boolean _fObj;
public boolean _fShadow;
public boolean _fLowerCase;
public boolean _fData;
public boolean _fOle2;
public boolean _fEmboss;
public boolean _fImprint;
public boolean _fDStrike;
public short _ftcAscii;
public short _ftcFE;
public short _ftcOther;
public short _ftc;
public int _hps;//font size in half points
public int _dxaSpace;//space following each character in the run expressed in twip units
public byte _iss;//superscript/subscript indices 0 means no super/subscripting 1 means text in run is superscripted 2 means text in run is subscripted
public byte _kul;//underline code see spec
public byte _ico;//color of text see spec
public short _hpsPos;//super/subscript position in half points; positive means text is raised; negative means text is lowered
public short _lidDefault;//language for non-Far East text
public short _lidFE;//language for Far East text
public byte _idctHint;
public int _wCharScale;
public short _chse;
public int _specialFC;//varies depending on whether this is a special char
public short _ibstRMark;//index to author IDs stored in hsttbfRMark. used when text in run was newly typed when revision marking was enabled
public short _ibstRMarkDel;//index to author IDs stored in hsttbfRMark. used when text in run was newly typed when revision marking was enabled
public int[] _dttmRMark = new int[2];//Date/time at which this run of text was
public int[] _dttmRMarkDel = new int[2];//entered/modified by the author. (Only
//recorded when revision marking is on.)Date/time at which this run of text was deleted by the author. (Only recorded when revision marking is on.)
public int _istd;
public int _baseIstd = -1;
public int _fcPic;
public short _ftcSym;// see spec
public short _xchSym;//see spec
public byte _ysr;//hyphenation rules
public byte _chYsr;//used for hyphenation see spec
public int _hpsKern;//kerning distance for characters in run recorded in half points
public int _fcObj;
public byte _icoHighlight;//highlight color
public boolean _fChsDiff;
public boolean _highlighted;//when true characters are highlighted with color specified by chp.icoHighlight
public boolean _fPropMark;//when true, properties have been changed with revision marking on
public short _ibstPropRMark;//index to author IDs stored in hsttbfRMark. used when properties have been changed when revision marking was enabled
public int _dttmPropRMark;//Date/time at which properties of this were changed for this run of text by the author
public byte _sfxtText;//text animation see spec
public boolean _fDispFldRMark;//see spec
public short _ibstDispFldRMark;//Index to author IDs stored in hsttbfRMark. used when ListNum field numbering has been changed when revision marking was enabled
public int _dttmDispFldRMark;//The date for the ListNum field number change
public byte[] _xstDispFldRMark = new byte[32];//The string value of the ListNum field when revision mark tracking began
public short _shd;//shading
public short[] _brc = new short[2];//border
public short _paddingStart = 0;
public short _paddingEnd = 0;
public CharacterProperties()
{
_istd = 10;
_hps = 20;
_lidDefault = 0x0400;
_lidFE = 0x0400;
setDttmRMark(new short[2]);
setDttmRMarkDel(new short[2]);
setXstDispFldRMark(new byte[32]);
setBrc(new short[2]);;
setHps(20);
setFcPic(-1);
setIstd(10);
setLidFE(0x0400);
setLidDefault(0x0400);
setWCharScale(100);
//setFUsePgsuSettings(-1);
}
public void copy(CharacterProperties toCopy)
{
_bold = toCopy._bold;
_italic = toCopy._italic;
_fRMarkDel = toCopy._fRMarkDel;
_fOutline = toCopy._fOutline;
_fSmallCaps = toCopy._fSmallCaps;
_fCaps = toCopy._fCaps;
_fVanish = toCopy._fVanish;
_fRMark = toCopy._fRMark;
_fSpec = toCopy._fSpec;
_fStrike = toCopy._fStrike;
_fObj = toCopy._fObj;
_fShadow = toCopy._fShadow;
_fLowerCase = toCopy._fLowerCase;
_fData = toCopy._fData;
_fOle2 = toCopy._fOle2;
_fEmboss = toCopy._fEmboss;
_fImprint = toCopy._fImprint;
_fDStrike = toCopy._fDStrike;
_ftcAscii = toCopy._ftcAscii;
_ftcFE = toCopy._ftcFE;
_ftcOther = toCopy._ftcOther;
_ftc = toCopy._ftc;
_hps = toCopy._hps;
_dxaSpace = toCopy._dxaSpace;
_iss = toCopy._iss;
_kul = toCopy._kul;
_ico = toCopy._ico;
_hpsPos = toCopy._hpsPos;
_lidDefault = toCopy._lidDefault;
_lidFE = toCopy._lidFE;
_idctHint = toCopy._idctHint;
_wCharScale = toCopy._wCharScale;
_chse = toCopy._chse;
_specialFC = toCopy._specialFC;
_ibstRMark = toCopy._ibstRMark;
_ibstRMarkDel = toCopy._ibstRMarkDel;
_dttmRMark = toCopy._dttmRMark;
_dttmRMarkDel = toCopy._dttmRMarkDel;
_istd = toCopy._istd;
_baseIstd = toCopy._baseIstd;
_fcPic = toCopy._fcPic;
_ftcSym = toCopy._ftcSym;
_xchSym = toCopy._xchSym;
_ysr = toCopy._ysr;
_chYsr = toCopy._chYsr;
_hpsKern = toCopy._hpsKern;
_fcObj = toCopy._fcObj;
_icoHighlight = toCopy._icoHighlight;
_fChsDiff = toCopy._fChsDiff;
_highlighted = toCopy._highlighted;
_fPropMark = toCopy._fPropMark;
_ibstPropRMark = toCopy._ibstPropRMark;
_dttmPropRMark = toCopy._dttmPropRMark;
_sfxtText = toCopy._sfxtText;
_fDispFldRMark = toCopy._fDispFldRMark;
_ibstDispFldRMark = toCopy._ibstDispFldRMark;
_dttmDispFldRMark = toCopy._dttmDispFldRMark;
_xstDispFldRMark = toCopy._xstDispFldRMark;
_shd = toCopy._shd;
_brc = toCopy._brc;
}
/**
* Used to make a deep copy of this object.
*/
public Object clone() throws CloneNotSupportedException
{
CharacterProperties clone = (CharacterProperties)super.clone();
clone._brc = new short[2];
System.arraycopy(_brc, 0, clone._brc, 0, 2);
clone.setBrc(new short[2]);
System.arraycopy(getBrc(), 0, clone.getBrc(), 0, 2);
System.arraycopy(getDttmRMark(), 0, clone.getDttmRMark(), 0, 2);
System.arraycopy(getDttmRMarkDel(), 0, clone.getDttmRMarkDel(), 0, 2);
System.arraycopy(getXstDispFldRMark(), 0, clone.getXstDispFldRMark(), 0, 32);
return clone;
}
}

View File

@ -55,114 +55,79 @@
package org.apache.poi.hdf.model.hdftypes;
import org.apache.poi.hdf.model.hdftypes.definitions.PAPAbstractType;
/**
* Comment me
*
* @author Ryan Ackley
*/
public class ParagraphProperties implements Cloneable, HDFType
public class ParagraphProperties extends PAPAbstractType implements Cloneable
{
public int _istd;//index to style descriptor.
public byte _jc;//justification code
public byte _fKeep;//keep entire paragraph on one page if possible
public byte _fKeepFollow;//keep paragraph on same page with next paragraph if possible
public byte _fPageBreakBefore;//start this paragraph on new page
public byte _positionByte;//multiple flags see spec;
public byte _brcp;//rectangle border codes for Macword 3.0
public byte _brcl;//border line styles for Macword 3.0
public byte _ilvl;//when non-zero, list level for this paragraph
public byte _fNoLnn;//no line numbering for this paragraph. (makes this an exception to the section property of line numbering)
public int _ilfo;//when non-zero, (1-based) index into the pllfo identifying the list to which the paragraph belongs
public byte _fSideBySide;//when 1, paragraph is a side by side paragraph
public byte _fNoAutoHyph;//when 0, text in paragraph may be auto hyphenated.
public byte _fWindowControl;//when 1, Word will prevent widowed lines in this paragraph from being placed at the beginning of a page
public int _dxaRight;//indent from right margin (signed).
public int _dxaLeft;//indent from left margin (signed)
public int _dxaLeft1;//first line indent; signed number relative to dxaLeft
public int[] _lspd = new int[2];//line spacing descriptor see spec
public int _dyaBefore;// vertical spacing before paragraph (unsigned)
public int _dyaAfter;//vertical spacing after paragraph (unsigned)
public byte[] _phe = new byte[12];//height of current paragraph
public byte _fCrLf;//undocumented
public byte _fUsePgsuSettings;//undocumented
public byte _fAdjustRight;//undocumented
public byte _fKinsoku;// when 1, apply kinsoku rules when performing line wrapping
public byte _fWordWrap;//when 1, perform word wrap
public byte _fOverflowPunct;//when 1, apply overflow punctuation rules when performing line wrapping
public byte _fTopLinePunct;//when 1, perform top line punctuation processing
public byte _fAutoSpaceDE;//when 1, auto space FE and alphabetic characters
public byte _fAutoSpaceDN;// when 1, auto space FE and numeric characters
public int _wAlignFont;//font alignment 0 Hanging 1 Centered 2 Roman 3 Variable 4 Auto
public short _fontAlign;//multiVal see Spec.
public byte _fInTable;//when 1, paragraph is contained in a table row
public byte _fTtp;//when 1, paragraph consists only of the row mark special character and marks the end of a table row
public byte _wr;//Wrap Code for absolute objects
public byte _fLocked;//when 1, paragraph may not be edited
public int _dxaAbs;//see spec
public int _dyaAbs;//see spec
public int _dxaWidth;//when not == 0, paragraph is constrained to be dxaWidth wide, independent of current margin or column settings
public short[] _brcTop = new short[2];//spec for border above paragraph
public short[] _brcLeft = new short[2];//specification for border to the left of
public short[] _brcBottom = new short[2];//paragraphspecification for border below
public short[] _brcRight = new short[2];//paragraphspecification for border to the
public short[] _brcBetween = new short[2];//right of paragraphsee spec
public short[] _brcBar = new short[2];//specification of border to place on
public short _brcTop1;//outside of text when facing pages are to be displayed.spec
public short _brcLeft1;//for border above paragraphspecification for border to the
public short _brcBottom1;//left ofparagraphspecification for border below
public short _brcRight1;//paragraphspecification for border to the
public short _brcBetween1;//right of paragraphsee spec
public short _brcBar1;//specification of border to place on outside of text when facing pages are to be displayed.
public int _dxaFromText;//horizontal distance to be maintained between an absolutely positioned paragraph and any non-absolute positioned text
public int _dyaFromText;//vertical distance to be maintained between an absolutely positioned paragraph and any non-absolute positioned text
public int _dyaHeight;//see spec
public int _shd;//shading
public int _dcs;//drop cap specifier
public byte[] _anld = new byte[84];//autonumber list descriptor (see ANLD definition)
public short _fPropRMark;//when 1, properties have been changed with revision marking on
public short _ibstPropRMark;//index to author IDs stored in hsttbfRMark. used when properties have been changed when revision marking was enabled
public byte[] _dttmPropRMark = new byte[4];//Date/time at which properties of this were changed for this run of text by the author. (Only recorded when revision marking is on.)
public byte[] _numrm = new byte[8];//paragraph numbering revision mark data (see NUMRM)
public short _itbdMac;//number of tabs stops defined for paragraph. Must be >= 0 and <= 64.
public ParagraphProperties()
{
_fWindowControl = 1;
short[] lspd = new short[2];
setFWidowControl((byte)1);
//lspd[0] = 240;
_lspd[1] = 1;
_ilvl = 9;
lspd[1] = 1;
setIlvl((byte)9);
setLspd(lspd);
setBrcBar(new short[2]);
setBrcBottom(new short[2]);
setBrcLeft(new short[2]);
setBrcBetween(new short[2]);
setBrcRight(new short[2]);
setBrcTop(new short[2]);
setPhe(new byte[12]);
setAnld(new byte[84]);
setDttmPropRMark(new byte[4]);
setNumrm(new byte[8]);
}
public Object clone() throws CloneNotSupportedException
{
ParagraphProperties clone = (ParagraphProperties)super.clone();
clone._brcBar = new short[2];
clone._brcBottom = new short[2];
clone._brcLeft = new short[2];
clone._brcBetween = new short[2];
clone._brcRight = new short[2];
clone._brcTop = new short[2];
clone._lspd = new int[2];
clone._phe = new byte[12];
clone._anld = new byte[84];
clone._dttmPropRMark = new byte[4];
clone._numrm = new byte[8];
short[] brcBar = new short[2];
short[] brcBottom = new short[2];
short[] brcLeft = new short[2];
short[] brcBetween = new short[2];
short[] brcRight = new short[2];
short[] brcTop = new short[2];
short[] lspd = new short[2];
byte[] phe = new byte[12];
byte[] anld = new byte[84];
byte[] dttmPropRMark = new byte[4];
byte[] numrm = new byte[8];
System.arraycopy(_brcBar, 0, clone._brcBar, 0, 2);
System.arraycopy(_brcBottom, 0, clone._brcBottom, 0, 2);
System.arraycopy(_brcLeft, 0, clone._brcLeft, 0, 2);
System.arraycopy(_brcBetween, 0, clone._brcBetween, 0, 2);
System.arraycopy(_brcRight, 0, clone._brcRight, 0, 2);
System.arraycopy(_brcTop, 0, clone._brcTop, 0, 2);
System.arraycopy(_lspd, 0, clone._lspd, 0, 2);
System.arraycopy(_phe, 0, clone._phe, 0, 12);
System.arraycopy(_anld, 0, clone._anld, 0, 84);
System.arraycopy(_dttmPropRMark, 0, clone._dttmPropRMark, 0, 4);
System.arraycopy(_numrm, 0, clone._numrm, 0, 8);
System.arraycopy(getBrcBar(), 0, brcBar, 0, 2);
System.arraycopy(getBrcBottom(), 0, brcBottom, 0, 2);
System.arraycopy(getBrcLeft(), 0, brcLeft, 0, 2);
System.arraycopy(getBrcBetween(), 0, brcBetween, 0, 2);
System.arraycopy(getBrcRight(), 0, brcRight, 0, 2);
System.arraycopy(getBrcTop(), 0, brcTop, 0, 2);
System.arraycopy(getLspd(), 0, lspd, 0, 2);
System.arraycopy(getPhe(), 0, phe, 0, 12);
System.arraycopy(getAnld(), 0, anld, 0, 84);
System.arraycopy(getDttmPropRMark(), 0, dttmPropRMark, 0, 4);
System.arraycopy(getNumrm(), 0, numrm, 0, 8);
clone.setBrcBar(brcBar);
clone.setBrcBottom(brcBottom);
clone.setBrcLeft(brcLeft);
clone.setBrcBetween(brcBetween);
clone.setBrcRight(brcRight);
clone.setBrcTop(brcTop);
clone.setLspd(lspd);
clone.setPhe(phe);
clone.setAnld(anld);
clone.setDttmPropRMark(dttmPropRMark);
clone.setNumrm(numrm);
return clone;
}

View File

@ -55,15 +55,16 @@
package org.apache.poi.hdf.model.hdftypes;
import org.apache.poi.hdf.model.hdftypes.definitions.SEPAbstractType;
/**
* Comment me
*
* @author Ryan Ackley
*/
public class SectionProperties implements HDFType
public class SectionProperties extends SEPAbstractType implements HDFType
{
int _index;
/*int _index;
byte _bkc;
boolean _fTitlePage;
boolean _fAutoPgn;
@ -111,28 +112,28 @@ public class SectionProperties implements HDFType
int _dxaColumns;
int[] _rgdxaColumnWidthSpacing;
byte _dmOrientFirst;
byte[] _olstAnn;
byte[] _olstAnn;*/
public SectionProperties()
{
_bkc = 2;
_dyaPgn = 720;
_dxaPgn = 720;
_fEndNote = true;
_fEvenlySpaced = true;
_xaPage = 12240;
_yaPage = 15840;
_dyaHdrTop = 720;
_dyaHdrBottom = 720;
_dmOrientPage = 1;
_dxaColumns = 720;
_dyaTop = 1440;
_dxaLeft = 1800;
_dyaBottom = 1440;
_dxaRight = 1800;
_pgnStart = 1;
setBkc((byte)2);
setDyaPgn(720);
setDxaPgn(720);
setFEndNote(true);
setFEvenlySpaced(true);
setXaPage(12240);
setYaPage(15840);
setDyaHdrTop(720);
setDyaHdrBottom(720);
setDmOrientPage((byte)1);
setDxaColumns(720);
setDyaTop(1440);
setDxaLeft(1800);
setDyaBottom(1440);
setDxaRight(1800);
setPgnStart(1);
}
}

View File

@ -55,6 +55,7 @@
package org.apache.poi.hdf.model.hdftypes;
import org.apache.poi.hdf.model.hdftypes.definitions.TCAbstractType;
import org.apache.poi.util.LittleEndian;
/**
* Comment me
@ -62,10 +63,10 @@ import org.apache.poi.util.LittleEndian;
* @author Ryan Ackley
*/
public class TableCellDescriptor implements HDFType
public class TableCellDescriptor extends TCAbstractType implements HDFType
{
boolean _fFirstMerged;
/*boolean _fFirstMerged;
boolean _fMerged;
boolean _fVertical;
boolean _fBackward;
@ -76,7 +77,7 @@ public class TableCellDescriptor implements HDFType
short[] _brcTop = new short[2];
short[] _brcLeft = new short[2];
short[] _brcBottom = new short[2];
short[] _brcRight = new short [2];
short[] _brcRight = new short [2];*/
public TableCellDescriptor()
{
@ -85,26 +86,31 @@ public class TableCellDescriptor implements HDFType
{
TableCellDescriptor tc = new TableCellDescriptor();
int rgf = LittleEndian.getShort(array, offset);
tc._fFirstMerged = (rgf & 0x0001) > 0;
tc._fMerged = (rgf & 0x0002) > 0;
tc._fVertical = (rgf & 0x0004) > 0;
tc._fBackward = (rgf & 0x0008) > 0;
tc._fRotateFont = (rgf & 0x0010) > 0;
tc._fVertMerge = (rgf & 0x0020) > 0;
tc._fVertRestart = (rgf & 0x0040) > 0;
tc._vertAlign = (short)((rgf & 0x0180) >> 7);
tc.setFFirstMerged((rgf & 0x0001) > 0);
tc.setFMerged((rgf & 0x0002) > 0);
tc.setFVertical((rgf & 0x0004) > 0);
tc.setFBackward((rgf & 0x0008) > 0);
tc.setFRotateFont((rgf & 0x0010) > 0);
tc.setFVertMerge((rgf & 0x0020) > 0);
tc.setFVertRestart((rgf & 0x0040) > 0);
tc.setVertAlign((byte)((rgf & 0x0180) >> 7));
tc._brcTop[0] = LittleEndian.getShort(array, offset + 4);
tc._brcTop[1] = LittleEndian.getShort(array, offset + 6);
short[] brcTop = new short[2];
short[] brcLeft = new short[2];
short[] brcBottom = new short[2];
short[] brcRight = new short[2];
tc._brcLeft[0] = LittleEndian.getShort(array, offset + 8);
tc._brcLeft[1] = LittleEndian.getShort(array, offset + 10);
brcTop[0] = LittleEndian.getShort(array, offset + 4);
brcTop[1] = LittleEndian.getShort(array, offset + 6);
tc._brcBottom[0] = LittleEndian.getShort(array, offset + 12);
tc._brcBottom[1] = LittleEndian.getShort(array, offset + 14);
brcLeft[0] = LittleEndian.getShort(array, offset + 8);
brcLeft[1] = LittleEndian.getShort(array, offset + 10);
tc._brcRight[0] = LittleEndian.getShort(array, offset + 16);
tc._brcRight[1] = LittleEndian.getShort(array, offset + 18);
brcBottom[0] = LittleEndian.getShort(array, offset + 12);
brcBottom[1] = LittleEndian.getShort(array, offset + 14);
brcRight[0] = LittleEndian.getShort(array, offset + 16);
brcRight[1] = LittleEndian.getShort(array, offset + 18);
return tc;
}

View File

@ -55,30 +55,16 @@
package org.apache.poi.hdf.model.hdftypes;
import org.apache.poi.hdf.model.hdftypes.definitions.TAPAbstractType;
/**
* Comment me
*
* @author Ryan Ackley
*/
public class TableProperties implements HDFType
public class TableProperties extends TAPAbstractType
{
short _jc;
int _dxaGapHalf;
int _dyaRowHeight;
boolean _fCantSplit;
boolean _fTableHeader;
boolean _fLastRow;
short _itcMac;
short[] _rgdxaCenter;
short[] _brcLeft = new short[2];
short[] _brcRight = new short[2];
short[] _brcTop = new short[2];
short[] _brcBottom = new short[2];
short[] _brcHorizontal = new short[2];
short[] _brcVertical = new short[2];
TableCellDescriptor[] _rgtc;
public TableProperties()