diff options
Diffstat (limited to 'wizards/com/sun/star/wizards/form')
9 files changed, 279 insertions, 303 deletions
diff --git a/wizards/com/sun/star/wizards/form/DataEntrySetter.java b/wizards/com/sun/star/wizards/form/DataEntrySetter.java index ae042fa7de76..de1d9f55c7d0 100644 --- a/wizards/com/sun/star/wizards/form/DataEntrySetter.java +++ b/wizards/com/sun/star/wizards/form/DataEntrySetter.java @@ -66,7 +66,7 @@ public class DataEntrySetter }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTNEWDATAONLY", sNewDataOnly, new Integer(98), new Integer(25), IDataStep, new Short(curtabindex++), new Integer(195) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTNEWDATAONLY", sNewDataOnly, 98, 25, IDataStep, new Short(curtabindex++), 195 }); optDisplayAllData = CurUnoDialog.insertRadioButton("optDisplayAllData", "toggleCheckBoxes", this, @@ -76,7 +76,7 @@ public class DataEntrySetter }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTDISPLAYALLDATA", sDisplayAllData, new Integer(98), new Integer(50), new Short((short) 1), IDataStep, new Short(curtabindex++), new Integer(197) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTDISPLAYALLDATA", sDisplayAllData, 98, 50, new Short((short) 1), IDataStep, new Short(curtabindex++), 197 }); chknomodification = CurUnoDialog.insertCheckBox("chknomodification", null, new String[] @@ -85,7 +85,7 @@ public class DataEntrySetter }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKNOMODIFICATION", sNoModification, new Integer(108), new Integer(62), new Short((short) 0), IDataStep, new Short(curtabindex++), new Integer(189) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKNOMODIFICATION", sNoModification, 108, 62, new Short((short) 0), IDataStep, new Short(curtabindex++), 189 }); chknodeletion = CurUnoDialog.insertCheckBox("chknodeletion", null, new String[] @@ -94,7 +94,7 @@ public class DataEntrySetter }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKNODELETION", sNoDeletion, new Integer(108), new Integer(74), new Short((short) 0), IDataStep, new Short(curtabindex++), new Integer(189) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKNODELETION", sNoDeletion, 108, 74, new Short((short) 0), IDataStep, new Short(curtabindex++), 189 }); chknoaddition = CurUnoDialog.insertCheckBox("chknoaddition", null, new String[] @@ -103,7 +103,7 @@ public class DataEntrySetter }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKNOADDITION", sNoAddition, new Integer(108), new Integer(86), new Short((short) 0), IDataStep, new Short(curtabindex++), new Integer(191) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKNOADDITION", sNoAddition, 108, 86, new Short((short) 0), IDataStep, new Short(curtabindex++), 191 }); CurUnoDialog.insertLabel("lbldontdisplayExistingData", new String[] @@ -112,7 +112,7 @@ public class DataEntrySetter }, new Object[] { - new Integer(8), sdontdisplayExistingData, new Integer(108), new Integer(33), IDataStep, new Short(curtabindex++), new Integer(134) + 8, sdontdisplayExistingData, 108, 33, IDataStep, new Short(curtabindex++), 134 }); } diff --git a/wizards/com/sun/star/wizards/form/FieldLinker.java b/wizards/com/sun/star/wizards/form/FieldLinker.java index b0fecf192bb8..056d06934f55 100644 --- a/wizards/com/sun/star/wizards/form/FieldLinker.java +++ b/wizards/com/sun/star/wizards/form/FieldLinker.java @@ -98,7 +98,7 @@ public class FieldLinker extends DBLimitedFieldSelection }, new Object[] { - new Boolean(bDoEnable), new Integer(8), sSlaveListHeader[i], new Integer(97), new Integer(iCurPosY), IStep, new Short(curtabindex++), new Integer(97) + new Boolean(bDoEnable), 8, sSlaveListHeader[i], 97, new Integer(iCurPosY), IStep, new Short(curtabindex++), 97 }); lstSlaveFields[i] = CurUnoDialog.insertListBox("lstSlaveFieldLink" + new Integer(i + 1).toString(), SOLINKLST[i], null, new ItemListenerImpl(), new String[] @@ -121,11 +121,11 @@ public class FieldLinker extends DBLimitedFieldSelection UIConsts.INTEGER_12, sSlaveHidString, Short.valueOf(UnoDialog.getListBoxLineCount()), - new Integer(97), + 97, new Integer(iCurPosY + 10), IStep, new Short(curtabindex++), - new Integer(97) + 97 }); lblMasterFields[i] = CurUnoDialog.insertLabel("lblMasterFieldLink" + new Integer(i + 1).toString(), @@ -135,7 +135,7 @@ public class FieldLinker extends DBLimitedFieldSelection }, new Object[] { - new Boolean(bDoEnable), new Integer(8), sMasterListHeader[i], new Integer(206), new Integer(iCurPosY), IStep, new Short(curtabindex++), new Integer(97) + new Boolean(bDoEnable), 8, sMasterListHeader[i], 206, new Integer(iCurPosY), IStep, new Short(curtabindex++), 97 }); lstMasterFields[i] = CurUnoDialog.insertListBox("lstMasterFieldLink" + new Integer(i + 1).toString(), SOLINKLST[i], null, new ItemListenerImpl(), @@ -159,11 +159,11 @@ public class FieldLinker extends DBLimitedFieldSelection UIConsts.INTEGER_12, sMasterHidString, Short.valueOf(UnoDialog.getListBoxLineCount()), - new Integer(206), + 206, new Integer(iCurPosY + 10), IStep, new Short(curtabindex++), - new Integer(97) + 97 }); iCurPosY = iCurPosY + 38; } diff --git a/wizards/com/sun/star/wizards/form/Finalizer.java b/wizards/com/sun/star/wizards/form/Finalizer.java index c5f12728e527..997b9a885676 100644 --- a/wizards/com/sun/star/wizards/form/Finalizer.java +++ b/wizards/com/sun/star/wizards/form/Finalizer.java @@ -64,7 +64,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGERS[8], slblFormName, new Integer(97), new Integer(25), UIConsts.INTEGERS[8], new Short(curtabindex++), new Integer(111) + UIConsts.INTEGERS[8], slblFormName, 97, 25, UIConsts.INTEGERS[8], new Short(curtabindex++), 111 }); txtFormName = CurUnoDialog.insertTextField("txtFormName", "toggleFinishButton", this, new String[] @@ -73,7 +73,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGFORM_TXTPATH", new Integer(97), new Integer(35), UIConsts.INTEGERS[8], new Short((short) 82), "", new Integer(185) + UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGFORM_TXTPATH", 97, 35, UIConsts.INTEGERS[8], new Short((short) 82), "", 185 }); CurUnoDialog.insertLabel("lblProceed", new String[] @@ -82,7 +82,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGERS[8], slblProceed, new Integer(97), new Integer(62), UIConsts.INTEGERS[8], new Short(curtabindex++), new Integer(185) + UIConsts.INTEGERS[8], slblProceed, 97, 62, UIConsts.INTEGERS[8], new Short(curtabindex++), 185 }); CurUnoDialog.insertRadioButton("optWorkWithForm", null, new String[] @@ -91,7 +91,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTWORKWITHFORM", sWorkWithForm, new Integer(101), new Integer(77), new Short((short) 1), UIConsts.INTEGERS[8], new Short(curtabindex++), new Integer(107) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTWORKWITHFORM", sWorkWithForm, 101, 77, new Short((short) 1), UIConsts.INTEGERS[8], new Short(curtabindex++), 107 }); optModifyForm = CurUnoDialog.insertRadioButton("optModifyForm", null, new String[] @@ -100,7 +100,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTMODIFYFORM", sModifyForm, new Integer(101), new Integer(89), UIConsts.INTEGERS[8], new Short(curtabindex++), new Integer(107) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTMODIFYFORM", sModifyForm, 101, 89, UIConsts.INTEGERS[8], new Short(curtabindex++), 107 }); } diff --git a/wizards/com/sun/star/wizards/form/FormConfiguration.java b/wizards/com/sun/star/wizards/form/FormConfiguration.java index 9c18ab47d79d..f8cc43a1833b 100644 --- a/wizards/com/sun/star/wizards/form/FormConfiguration.java +++ b/wizards/com/sun/star/wizards/form/FormConfiguration.java @@ -83,7 +83,7 @@ public class FormConfiguration }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKCREATESUBFORM", sSelectManually, new Integer(97), new Integer(26), ISubFormStep, new Short(curtabindex++), new Integer(160) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKCREATESUBFORM", sSelectManually, 97, 26, ISubFormStep, new Short(curtabindex++), 160 }); optOnExistingRelation = CurUnoDialog.insertRadioButton("optOnExistingRelation", STOGGLESTEPS, this, new String[] @@ -92,7 +92,7 @@ public class FormConfiguration }, new Object[] { - Boolean.FALSE, UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTONEXISTINGRELATION", sOnExistingRelation, new Integer(107), new Integer(43), ISubFormStep, new Short(curtabindex++), new Integer(160) + Boolean.FALSE, UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTONEXISTINGRELATION", sOnExistingRelation, 107, 43, ISubFormStep, new Short(curtabindex++), 160 }); optSelectManually = CurUnoDialog.insertRadioButton("optSelectManually", STOGGLESTEPS, this, new String[] @@ -101,7 +101,7 @@ public class FormConfiguration }, new Object[] { - Boolean.FALSE, UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTSELECTMANUALLY", sOnManualRelation, new Integer(107), new Integer(99), new Short((short) 1), ISubFormStep, new Short(curtabindex++), new Integer(160) + Boolean.FALSE, UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTSELECTMANUALLY", sOnManualRelation, 107, 99, new Short((short) 1), ISubFormStep, new Short(curtabindex++), 160 }); lblRelations = CurUnoDialog.insertLabel("lblSelectRelation", new String[] @@ -110,7 +110,7 @@ public class FormConfiguration }, new Object[] { - Boolean.FALSE, new Integer(19), sSelectRelation, Boolean.TRUE, new Integer(119), new Integer(56), ISubFormStep, new Short(curtabindex++), new Integer(80) + Boolean.FALSE, 19, sSelectRelation, Boolean.TRUE, 119, 56, ISubFormStep, new Short(curtabindex++), 80 }); lstRelations = CurUnoDialog.insertListBox("lstrelations", SONEXISTINGRELATIONSELECTION, SONEXISTINGRELATIONSELECTION, this, new String[] @@ -119,7 +119,7 @@ public class FormConfiguration }, new Object[] { - Boolean.FALSE, new Integer(37), "HID:WIZARDS_HID_DLGFORM_lstRELATIONS", new Integer(201), new Integer(55), ISubFormStep, new Short(curtabindex++), new Integer(103) + Boolean.FALSE, 37, "HID:WIZARDS_HID_DLGFORM_lstRELATIONS", 201, 55, ISubFormStep, new Short(curtabindex++), 103 }); lblSubFormDescription = CurUnoDialog.insertLabel("lblSubFormDescription", new String[] @@ -128,7 +128,7 @@ public class FormConfiguration }, new Object[] { - new Integer(59), sSubFormDescription, Boolean.TRUE, new Integer(110), new Integer(120), ISubFormStep, new Short(curtabindex++), new Integer(190) + 59, sSubFormDescription, Boolean.TRUE, 110, 120, ISubFormStep, new Short(curtabindex++), 190 }); CurUnoDialog.insertInfoImage(97, 120, ISubFormStep.intValue()); } diff --git a/wizards/com/sun/star/wizards/form/FormControlArranger.java b/wizards/com/sun/star/wizards/form/FormControlArranger.java index f5478525eab1..8d76f65f6435 100644 --- a/wizards/com/sun/star/wizards/form/FormControlArranger.java +++ b/wizards/com/sun/star/wizards/form/FormControlArranger.java @@ -47,14 +47,13 @@ import com.sun.star.wizards.document.TimeStampControl; public class FormControlArranger { + public static final String LABELCONTROL = "LabelControl"; protected DatabaseControl[] DBControlList = null; - private XNameContainer xFormName; private XMultiServiceFactory xMSF; private Control[] LabelControlList = null; private XStatusIndicator xProgressBar; private FieldColumn[] FieldColumns; - private DatabaseControl curDBControl; // Control curLabelControl; private int icurArrangement; private boolean bIsFirstRun; @@ -68,23 +67,23 @@ public class FormControlArranger private static final double CMAXREDUCTION = 0.7; private FormHandler oFormHandler; private int iReduceWidth; - private int nXTCPos; - private int nYTCPos; - private int nXDBPos; - private int nYDBPos; - private int nTCHeight; - private int nTCWidth; - private int nDBHeight; - private int nDBWidth; - private int nMaxTCWidth; + private int m_currentLabelPosX; + private int m_currentLabelPosY; + private int m_currentControlPosX; + private int m_currentControlPosY; + private int m_LabelHeight; + private int m_LabelWidth; + private int m_dbControlHeight; + private int m_dbControlWidth; + private int m_MaxLabelWidth; private int nFormWidth; private int nFormHeight; - private int nMaxRowY; + private int m_currentMaxRowHeight; private int nSecMaxRowY; - private int nMaxColRightX; + private int m_maxPostionX; private int a; private int StartA; - private int nMaxDBYPos = 0; //the maximum YPosition of a DBControl in the form + private int m_controlMaxPosY = 0; //the maximum YPosition of a DBControl in the form private Short NBorderType = new Short((short) 1); //3-D Border public FormControlArranger(FormHandler _oFormHandler, XNameContainer _xFormName, CommandMetaData oDBMetaData, XStatusIndicator _xProgressBar, Point _StartPoint, Size _FormSize) @@ -102,14 +101,13 @@ public class FormControlArranger } // Note: on all Controls except for the checkbox the Label has to be set // a bit under the DBControl because its Height is also smaller + private int getLabelDiffHeight(int _index) { - if (curDBControl != null) + final DatabaseControl curDBControl = DBControlList[_index]; + if (curDBControl != null && curDBControl.getControlType() == FormHandler.SOCHECKBOX) { - if (curDBControl.getControlType() == FormHandler.SOCHECKBOX) - { - return getCheckBoxDiffHeight(_index); - } + return getCheckBoxDiffHeight(_index); } return oFormHandler.getBasicLabelDiffHeight(); } @@ -126,20 +124,17 @@ public class FormControlArranger private int getCheckBoxDiffHeight(int LastIndex) { - if ((LastIndex < DBControlList.length)) + if (LastIndex < DBControlList.length && DBControlList[LastIndex].getControlType() == FormHandler.SOCHECKBOX) { - if (DBControlList[LastIndex].getControlType() == FormHandler.SOCHECKBOX) - { - return (int) ((oFormHandler.getControlReferenceHeight() - DBControlList[LastIndex].getControlHeight()) / 2); - } + return (int) ((oFormHandler.getControlReferenceHeight() - DBControlList[LastIndex].getControlHeight()) / 2); } return 0; } - private boolean isReducable(int _index) + private boolean isReducable(int _index, int i_labelWidth, int i_dbControlWidth) { boolean bisreducable = false; - int ntype = this.FieldColumns[_index].getFieldType(); + int ntype = FieldColumns[_index].getFieldType(); switch (ntype) { case DataType.TINYINT: @@ -178,7 +173,7 @@ public class FormControlArranger default: bisreducable = true; } - if (nTCWidth > 0.9 * CMAXREDUCTION * nDBWidth) + if (bisreducable && i_labelWidth > 0.9 * CMAXREDUCTION * i_dbControlWidth) { bisreducable = false; } @@ -187,62 +182,54 @@ public class FormControlArranger private int getControlGroupWidth() { - if (nDBWidth > nTCWidth) + if (m_dbControlWidth > m_LabelWidth) { - return nDBWidth; + return m_dbControlWidth; } else { - return nTCWidth; + return m_LabelWidth; } } private void checkJustifiedPosition(int a) { int nBaseWidth = nFormWidth + cXOffset; - int nLeftDist = nMaxColRightX - nBaseWidth; - int nRightDist = nBaseWidth - (DBControlList[a].getPosition().X - this.cHoriDistance); + int nLeftDist = m_maxPostionX - nBaseWidth; + int nRightDist = nBaseWidth - (DBControlList[a].getPosition().X - cHoriDistance); if (nLeftDist < 0.5 * nRightDist) { // Fieldwidths in the line can be made smaller.. adjustLineWidth(StartA, a, nLeftDist, -1); - nYTCPos = nMaxRowY + cVertDistance; - nYDBPos = nYTCPos + nTCHeight; -// if ((nYDBPos + nDBHeight) > nMaxDBYPos) -// nMaxDBYPos = nYDBPos + nDBHeight; - nXTCPos = cXOffset; - nXDBPos = cXOffset; + m_currentLabelPosY = m_currentMaxRowHeight + cVertDistance; + m_currentControlPosY = m_currentLabelPosY + m_LabelHeight; + m_currentLabelPosX = cXOffset; + m_currentControlPosX = cXOffset; bIsFirstRun = true; StartA = a + 1; } else { // FieldWidths in the line can be made wider... - if (nYDBPos + nDBHeight == nMaxRowY) + if (m_currentControlPosY + m_dbControlHeight == m_currentMaxRowHeight) { // The last Control was the highest in the row - nYTCPos = nSecMaxRowY + cVertDistance; + m_currentLabelPosY = nSecMaxRowY; } else { - nYTCPos = nMaxRowY + cVertDistance; + m_currentLabelPosY = m_currentMaxRowHeight; } - nYDBPos = nYTCPos + nTCHeight; - nXDBPos = cXOffset; - nXTCPos = cXOffset; - this.LabelControlList[a].setPosition(new Point(cXOffset, nYTCPos)); - this.DBControlList[a].setPosition(new Point(cXOffset, nYDBPos)); + m_currentLabelPosY += cVertDistance; + m_currentControlPosY = m_currentLabelPosY + m_LabelHeight; + m_currentControlPosX = cXOffset; + m_currentLabelPosX = cXOffset; + LabelControlList[a].setPosition(new Point(cXOffset, m_currentLabelPosY)); + DBControlList[a].setPosition(new Point(cXOffset, m_currentControlPosY)); bIsFirstRun = true; - if (nDBWidth > nTCWidth) - { - checkOuterPoints(nXDBPos, nDBWidth, nYDBPos, nDBHeight, true); - } - else - { - checkOuterPoints(nXDBPos, nTCWidth, nYDBPos, nDBHeight, true); - } - nXTCPos = nMaxColRightX + cHoriDistance; - nXDBPos = nXTCPos; + checkOuterPoints(m_currentControlPosX, m_dbControlWidth > m_LabelWidth ? m_dbControlWidth : m_LabelWidth, m_currentControlPosY, m_dbControlHeight, true); + m_currentLabelPosX = m_maxPostionX + cHoriDistance; + m_currentControlPosX = m_currentLabelPosX; adjustLineWidth(StartA, a - 1, nRightDist, 1); StartA = a; } @@ -278,42 +265,44 @@ public class FormControlArranger for (int i = StartIndex; i <= EndIndex; i++) { int nControlBaseWidth = 0; - curDBControl = this.DBControlList[i]; - Control curLabelControl = this.LabelControlList[i]; + DatabaseControl dbControl = DBControlList[i]; + Control curLabelControl = LabelControlList[i]; if (i != StartIndex) { curLabelControl.setPosition(new Point(iLocTCPosX, curLabelControl.getPosition().Y)); - curDBControl.setPosition(new Point(iLocTCPosX, curLabelControl.getPosition().Y + nTCHeight)); + dbControl.setPosition(new Point(iLocTCPosX, curLabelControl.getPosition().Y + m_LabelHeight)); } - if (((curLabelControl.getSize().Width > curDBControl.getSize().Width)) && (WidthFactor > 0)) + final Size labelSize = curLabelControl.getSize(); + Size controlSize = dbControl.getSize(); + if (((labelSize.Width > controlSize.Width)) && (WidthFactor > 0)) { - nControlBaseWidth = curLabelControl.getSize().Width; + nControlBaseWidth = labelSize.Width; } else { - nControlBaseWidth = curDBControl.getSize().Width; + nControlBaseWidth = controlSize.Width; } if (FieldColumns[i].getFieldType() == DataType.TIMESTAMP) { - TimeStampControl oDBTimeStampControl = (TimeStampControl) curDBControl; + TimeStampControl oDBTimeStampControl = (TimeStampControl) dbControl; nControlBaseWidth = oDBTimeStampControl.getSize().Width; - if (this.isReducable(i) || WidthFactor > 0) - { - oDBTimeStampControl.setSize(new Size(nControlBaseWidth + WidthFactor * CorrWidth, oDBTimeStampControl.getSize().Height)); - } } - else + if (WidthFactor > 0 || isReducable(i, labelSize.Width, controlSize.Width)) { - if (this.isReducable(i) || WidthFactor > 0) - { - curDBControl.setSize(new Size(nControlBaseWidth + WidthFactor * CorrWidth, curDBControl.getSize().Height)); - } + controlSize.Width = nControlBaseWidth + WidthFactor * CorrWidth; + dbControl.setSize(controlSize); + controlSize = dbControl.getSize(); + } + + if (labelSize.Width > controlSize.Width) + { + iLocTCPosX += labelSize.Width; } - iLocTCPosX = curDBControl.getPosition().X + curDBControl.getSize().Width + cHoriDistance; - if (curLabelControl.getSize().Width > curDBControl.getSize().Width) + else { - iLocTCPosX = curLabelControl.getPosition().X + curLabelControl.getSize().Width + cHoriDistance; + iLocTCPosX += controlSize.Width; } + iLocTCPosX += cHoriDistance; } if (WidthFactor > 0) { @@ -325,43 +314,38 @@ public class FormControlArranger } } - private void checkOuterPoints(int nXPos, int nWidth, int nYPos, int nHeight, boolean bIsDBField) + private void checkOuterPoints(int i_nXPos, int i_nWidth, int i_nYPos, int i_nHeight, boolean i_bIsDBField) { - int nColRightX; - if (icurArrangement == FormWizard.SOTOPJUSTIFIED) + if (icurArrangement == FormWizard.IN_BLOCK_TOP && i_bIsDBField) { - if (bIsDBField) + // Only at DBControls you can measure the Value of nMaxRowY + if (bIsFirstRun) { - // Only at DBControls you can measure the Value of nMaxRowY - if (bIsFirstRun) - { - nMaxRowY = nYPos + nHeight; - nSecMaxRowY = nMaxRowY; - } - else + m_currentMaxRowHeight = i_nYPos + i_nHeight; + nSecMaxRowY = m_currentMaxRowHeight; + } + else + { + int nRowY = i_nYPos + i_nHeight; + if (nRowY >= m_currentMaxRowHeight) { - int nRowY = nYPos + nHeight; - if (nRowY >= nMaxRowY) - { - int nOldMaxRowY = nMaxRowY; - nSecMaxRowY = nOldMaxRowY; - nMaxRowY = nRowY; - } + nSecMaxRowY = m_currentMaxRowHeight; + m_currentMaxRowHeight = nRowY; } } } // Find the outer right point if (bIsFirstRun) { - nMaxColRightX = nXPos + nWidth; + m_maxPostionX = i_nXPos + i_nWidth; bIsFirstRun = false; } else { - nColRightX = nXPos + nWidth; - if (nColRightX > nMaxColRightX) + int nColRightX = i_nXPos + i_nWidth; + if (nColRightX > m_maxPostionX) { - nMaxColRightX = nColRightX; + m_maxPostionX = nColRightX; } } } @@ -370,15 +354,15 @@ public class FormControlArranger { try { - this.NBorderType = _NBorderType; - this.setStartPoint(_aStartPoint); + NBorderType = _NBorderType; + setStartPoint(_aStartPoint); icurArrangement = _icurArrangement; initializePosSizes(); initializeControlColumn(-1); bIsVeryFirstRun = true; - nMaxRowY = 0; + m_currentMaxRowHeight = 0; nSecMaxRowY = 0; - this.nMaxColRightX = 0; + m_maxPostionX = 0; xProgressBar.start("", FieldColumns.length); for (int i = 0; i < FieldColumns.length; i++) { @@ -387,13 +371,12 @@ public class FormControlArranger insertLabel(i, _iAlign); insertDBControl(i); bIsVeryFirstRun = false; - DBControlList[i].setPropertyValue("LabelControl", LabelControlList[i].xPropertySet); + DBControlList[i].setPropertyValue(LABELCONTROL, LabelControlList[i].xPropertySet); resetPosSizes(i); xProgressBar.setValue(i + 1); } catch (RuntimeException e) { - int dummy = 0; } } xProgressBar.end(); @@ -426,19 +409,19 @@ public class FormControlArranger private void resetPosSizes(int LastIndex) { - int nYRefPos = nYDBPos; + int nYRefPos = m_currentControlPosY; switch (icurArrangement) { - case FormWizard.SOCOLUMNARLEFT: - nYDBPos = nYDBPos + nDBHeight + cVertDistance + getCheckBoxDiffHeight(LastIndex); - nYRefPos = nYDBPos; - if ((nYDBPos > cYOffset + nFormHeight) || (LastIndex == (FieldColumns.length - 1))) + case FormWizard.COLUMNAR_LEFT: + m_currentControlPosY = m_currentControlPosY + m_dbControlHeight + cVertDistance + getCheckBoxDiffHeight(LastIndex); + nYRefPos = m_currentControlPosY; + if ((m_currentControlPosY > cYOffset + nFormHeight) || (LastIndex == (FieldColumns.length - 1))) { repositionColumnarLeftControls(LastIndex); - nXTCPos = nMaxColRightX + 2 * cHoriDistance; - nXDBPos = nXTCPos + this.cLabelGap + nMaxTCWidth; - nYDBPos = cYOffset; - nYRefPos = nYDBPos; + m_currentLabelPosX = m_maxPostionX + 2 * cHoriDistance; + m_currentControlPosX = m_currentLabelPosX + cLabelGap + m_MaxLabelWidth; + m_currentControlPosY = cYOffset; + nYRefPos = m_currentControlPosY; initializeControlColumn(LastIndex); } else @@ -447,59 +430,63 @@ public class FormControlArranger /* a += 1;*/ ++a; } - nYTCPos = nYDBPos + this.getLabelDiffHeight(LastIndex); - if ((nYRefPos + nDBHeight) > nMaxDBYPos) + m_currentLabelPosY = m_currentControlPosY + getLabelDiffHeight(LastIndex); + if ((nYRefPos + m_dbControlHeight) > m_controlMaxPosY) { - nMaxDBYPos = nYRefPos + nDBHeight; + m_controlMaxPosY = nYRefPos + m_dbControlHeight; } break; - case FormWizard.SOCOLUMNARTOP: - nYTCPos = nYDBPos + nDBHeight + cVertDistance + getCheckBoxDiffHeight(LastIndex); - ; - if ((nYTCPos > cYOffset + nFormHeight) || (LastIndex == (FieldColumns.length - 1))) + case FormWizard.COLUMNAR_TOP: + m_currentLabelPosY = m_currentControlPosY + m_dbControlHeight + cVertDistance + getCheckBoxDiffHeight(LastIndex); + + if ((m_currentLabelPosY > cYOffset + nFormHeight) || (LastIndex == (FieldColumns.length - 1))) { - nXDBPos = nMaxColRightX + cHoriDistance; - nXTCPos = nXDBPos; - nYRefPos = nYDBPos; - nYDBPos = cYOffset + nTCHeight + cVertDistance; - nYTCPos = cYOffset; + m_currentControlPosX = m_maxPostionX + cHoriDistance; + m_currentLabelPosX = m_currentControlPosX; + nYRefPos = m_currentControlPosY; + m_currentControlPosY = cYOffset + m_LabelHeight + cVertDistance; + m_currentLabelPosY = cYOffset; initializeControlColumn(LastIndex); } else { - a = a + 1; + ++a; } - if ((nYRefPos + nDBHeight + cVertDistance) > nMaxDBYPos) + if ((nYRefPos + m_dbControlHeight + cVertDistance) > m_controlMaxPosY) { - nMaxDBYPos = nYRefPos + nDBHeight + cVertDistance; + m_controlMaxPosY = nYRefPos + m_dbControlHeight + cVertDistance; } break; - case FormWizard.SOTOPJUSTIFIED: - if (this.isReducable(a)) + case FormWizard.IN_BLOCK_TOP: + if (isReducable(a, m_LabelWidth, m_dbControlWidth)) { - iReduceWidth = iReduceWidth + 1; + ++iReduceWidth; } - if (nMaxColRightX > cXOffset + nFormWidth) + //if (m_maxPostionX > (nFormWidth-cXOffset-cXOffset)) // cXOffset + nFormWidth + if (m_maxPostionX > cXOffset + nFormWidth) { - int nOldYTCPos = nYTCPos; checkJustifiedPosition(a); - nYRefPos = nYDBPos; + nYRefPos = m_currentControlPosY; } else { - nXTCPos = nMaxColRightX + cHoriDistance; + m_currentLabelPosX = m_maxPostionX + cHoriDistance; + } + if (a == FieldColumns.length - 1) + { + checkJustifiedPosition(a); + nYRefPos = m_currentControlPosY; } - a = a + 1; - if ((nYRefPos + nDBHeight) > nMaxDBYPos) + m_currentControlPosX = m_currentLabelPosX; + ++a; + if ((nYRefPos + m_dbControlHeight) > m_controlMaxPosY) { - nMaxDBYPos = nYRefPos + nDBHeight; + m_controlMaxPosY = nYRefPos + m_dbControlHeight; } break; } -// if ((nYRefPos + nDBHeight) > nMaxDBYPos) -// nMaxDBYPos = nYRefPos + nDBHeight; } private void repositionColumnarLeftControls(int LastIndex) @@ -509,42 +496,41 @@ public class FormControlArranger { if (i == StartA) { - nXTCPos = LabelControlList[i].getPosition().X; - nXDBPos = nXTCPos + nMaxTCWidth + cHoriDistance; + m_currentLabelPosX = LabelControlList[i].getPosition().X; + m_currentControlPosX = m_currentLabelPosX + m_MaxLabelWidth + cHoriDistance; } - LabelControlList[i].setSize(new Size(nMaxTCWidth, nTCHeight)); - resetDBShape(DBControlList[i], nXDBPos); - checkOuterPoints(nXDBPos, nDBWidth, nYDBPos, nDBHeight, true); + LabelControlList[i].setSize(new Size(m_MaxLabelWidth, m_LabelHeight)); + resetDBShape(DBControlList[i], m_currentControlPosX); + checkOuterPoints(m_currentControlPosX, m_dbControlWidth, m_currentControlPosY, m_dbControlHeight, true); } } private void resetDBShape(Shape _curDBControl, int iXPos) { - int nYDBPos = _curDBControl.getPosition().Y; - nDBWidth = _curDBControl.getSize().Width; - nDBHeight = _curDBControl.getSize().Height; - _curDBControl.setPosition(new Point(iXPos, nYDBPos)); + m_dbControlWidth = _curDBControl.getSize().Width; + m_dbControlHeight = _curDBControl.getSize().Height; + _curDBControl.setPosition(new Point(iXPos, _curDBControl.getPosition().Y)); } private void initializePosSizes() { - this.nMaxDBYPos = 0; - nXTCPos = cXOffset; - nTCWidth = 2000; - nDBWidth = 2000; - nDBHeight = oFormHandler.getControlReferenceHeight(); - nTCHeight = oFormHandler.getLabelHeight(); + m_controlMaxPosY = 0; + m_currentLabelPosX = cXOffset; + m_LabelWidth = 2000; + m_dbControlWidth = 2000; + m_dbControlHeight = oFormHandler.getControlReferenceHeight(); + m_LabelHeight = oFormHandler.getLabelHeight(); iReduceWidth = 0; - if (icurArrangement == FormWizard.SOCOLUMNARLEFT) + if (icurArrangement == FormWizard.COLUMNAR_LEFT) { - nYTCPos = cYOffset + this.getLabelDiffHeight(0); - nXDBPos = cXOffset + 3050; - nYDBPos = cYOffset; + m_currentLabelPosY = cYOffset + getLabelDiffHeight(0); + m_currentControlPosX = cXOffset + 3050; + m_currentControlPosY = cYOffset; } else { - nXDBPos = cXOffset; - nYTCPos = cYOffset; + m_currentControlPosX = cXOffset; + m_currentLabelPosY = cYOffset; } } @@ -552,63 +538,63 @@ public class FormControlArranger { try { + Point aPoint = new Point(m_currentLabelPosX, m_currentLabelPosY); + Size aSize = new Size(m_LabelWidth, m_LabelHeight); if (bControlsareCreated) { - LabelControlList[i].setPosition(new Point(nXTCPos, nYTCPos)); - if (icurArrangement != FormWizard.SOCOLUMNARLEFT) + LabelControlList[i].setPosition(aPoint); + if (icurArrangement != FormWizard.COLUMNAR_LEFT) { - nTCWidth = LabelControlList[i].getPreferredWidth(FieldColumns[i].getFieldTitle()); - LabelControlList[i].setSize(new Size(nTCWidth, nTCHeight)); + m_LabelWidth = LabelControlList[i].getPreferredWidth(FieldColumns[i].getFieldTitle()); + aSize.Width = m_LabelWidth; + LabelControlList[i].setSize(aSize); } else { - nTCWidth = LabelControlList[i].getSize().Width; + m_LabelWidth = LabelControlList[i].getSize().Width; } } else { - Point aPoint = new Point(nXTCPos, nYTCPos); - Size aSize = new Size(nTCWidth, nTCHeight); final String sFieldName = FieldColumns[i].getFieldName(); - this.LabelControlList[i] = new Control(oFormHandler, xFormName, FormHandler.SOLABEL, sFieldName, aPoint, aSize); - if (bIsVeryFirstRun) + LabelControlList[i] = new Control(oFormHandler, xFormName, FormHandler.SOLABEL, sFieldName, aPoint, aSize); + if (bIsVeryFirstRun && icurArrangement == FormWizard.COLUMNAR_TOP) { - if (icurArrangement == FormWizard.SOCOLUMNARTOP) - { - nYDBPos = nYTCPos + nTCHeight; - } - } - String sTitle = FieldColumns[i].getFieldTitle(); - nTCWidth = LabelControlList[i].getPreferredWidth(sTitle); + m_currentControlPosY = m_currentLabelPosY + m_LabelHeight; } + final String sTitle = FieldColumns[i].getFieldTitle(); + m_LabelWidth = LabelControlList[i].getPreferredWidth(sTitle); + aSize.Width = m_LabelWidth; + LabelControlList[i].setSize(aSize); + } Control curLabelControl = LabelControlList[i]; - if (icurArrangement == FormWizard.SOCOLUMNARLEFT) + if (icurArrangement == FormWizard.COLUMNAR_LEFT) { // Note This If Sequence must be called before retrieving the outer Points if (bIsFirstRun) { - nMaxTCWidth = nTCWidth; + m_MaxLabelWidth = m_LabelWidth; bIsFirstRun = false; } - else if (nTCWidth > nMaxTCWidth) + else if (m_LabelWidth > m_MaxLabelWidth) { - nMaxTCWidth = nTCWidth; + m_MaxLabelWidth = m_LabelWidth; } } - checkOuterPoints(nXTCPos, nTCWidth, nYTCPos, nTCHeight, false); - if ((icurArrangement == FormWizard.SOCOLUMNARTOP) || (icurArrangement == FormWizard.SOTOPJUSTIFIED)) + checkOuterPoints(m_currentLabelPosX, m_LabelWidth, m_currentLabelPosY, m_LabelHeight, false); + if ((icurArrangement == FormWizard.COLUMNAR_TOP) || (icurArrangement == FormWizard.IN_BLOCK_TOP)) { - nXDBPos = nXTCPos; - nYDBPos = nYTCPos + nTCHeight; - curLabelControl.xPropertySet.setPropertyValue("Align", new Short((short) com.sun.star.awt.TextAlign.LEFT)); + m_currentControlPosX = m_currentLabelPosX; + m_currentControlPosY = m_currentLabelPosY + m_LabelHeight; + curLabelControl.xPropertySet.setPropertyValue(PropertyNames.PROPERTY_ALIGN, new Short((short) com.sun.star.awt.TextAlign.LEFT)); } else { - curLabelControl.xPropertySet.setPropertyValue("Align", new Short((short) _iAlign)); + curLabelControl.xPropertySet.setPropertyValue(PropertyNames.PROPERTY_ALIGN, new Short((short) _iAlign)); } if (!bControlsareCreated) { - curLabelControl.setSize(new Size(nTCWidth, nTCHeight)); + curLabelControl.setSize(new Size(m_LabelWidth, m_LabelHeight)); } // if (CurHelpText != ""){ // oModel.HelpText = CurHelptext; @@ -627,7 +613,7 @@ public class FormControlArranger String sFieldName = FieldColumns[i].getFieldName(); int nFieldType = FieldColumns[i].getFieldType(); - Point aPoint = new Point(nXDBPos, nYDBPos); + Point aPoint = new Point(m_currentControlPosX, m_currentControlPosY); if (bControlsareCreated) { DBControlList[i].setPosition(aPoint); @@ -649,24 +635,25 @@ public class FormControlArranger } } DatabaseControl aDBControl = DBControlList[i]; - nDBHeight = aDBControl.getControlHeight(); - nDBWidth = aDBControl.getControlWidth(); + m_dbControlHeight = aDBControl.getControlHeight(); + m_dbControlWidth = aDBControl.getControlWidth(); if (nFieldType != DataType.TIMESTAMP) { - aDBControl.setSize(new Size(nDBWidth, nDBHeight)); + aDBControl.setSize(new Size(m_dbControlWidth, m_dbControlHeight)); } if (aDBControl.getControlType() == FormHandler.SOCHECKBOX) { - nYDBPos = nYDBPos + /*(int)*/ ((oFormHandler.getControlReferenceHeight() - nDBHeight) / 2); - aPoint = new Point(nXDBPos, nYDBPos); + m_currentControlPosY = m_currentControlPosY + /*(int)*/ ((oFormHandler.getControlReferenceHeight() - m_dbControlHeight) / 2); + aPoint = new Point(m_currentControlPosX, m_currentControlPosY); aDBControl.setPosition(aPoint); } if (nFieldType == DataType.LONGVARCHAR) /* memo */ + { Helper.setUnoPropertyValue(LabelControlList[i], PropertyNames.PROPERTY_MULTILINE, Boolean.TRUE); } - checkOuterPoints(nXDBPos, nDBWidth, nYDBPos, nDBHeight, true); - aDBControl.setPropertyValue("Border", NBorderType); + checkOuterPoints(m_currentControlPosX, m_dbControlWidth, m_currentControlPosY, m_dbControlHeight, true); + aDBControl.setPropertyValue(PropertyNames.PROPERTY_BORDER, NBorderType); } catch (Exception e) { @@ -688,12 +675,12 @@ public class FormControlArranger public int getFormHeight() { - return nMaxDBYPos - this.cYOffset; + return m_controlMaxPosY - cYOffset; } public int getEntryPointY() { - if (this.icurArrangement == FormWizard.SOCOLUMNARTOP) + if (icurArrangement == FormWizard.COLUMNAR_TOP) { Control curLabelControl2 = LabelControlList[0]; return curLabelControl2.getPosition().Y; @@ -707,8 +694,8 @@ public class FormControlArranger public void setStartPoint(Point _aPoint) { - this.cXOffset = _aPoint.X; - this.cYOffset = _aPoint.Y; + cXOffset = _aPoint.X; + cYOffset = _aPoint.Y; } public void adjustYPositions(int _diffY) @@ -717,10 +704,10 @@ public class FormControlArranger { Point aPoint = DBControlList[i].getPosition(); DBControlList[i].setPosition(new Point(aPoint.X, aPoint.Y - _diffY)); - aPoint = this.LabelControlList[i].getPosition(); + aPoint = LabelControlList[i].getPosition(); LabelControlList[i].setPosition(new Point(aPoint.X, aPoint.Y - _diffY)); } - nMaxDBYPos = -_diffY; + m_controlMaxPosY = -_diffY; cYOffset = -_diffY; } diff --git a/wizards/com/sun/star/wizards/form/FormDocument.java b/wizards/com/sun/star/wizards/form/FormDocument.java index 0070fed3ada1..8749f2ce39e8 100644 --- a/wizards/com/sun/star/wizards/form/FormDocument.java +++ b/wizards/com/sun/star/wizards/form/FormDocument.java @@ -152,7 +152,7 @@ public class FormDocument extends TextDocument { if (oControlForms.size() == 0) { - final ControlForm aMainControlForm = new ControlForm(this, SOMAINFORM, aMainFormPoint, getMainFormSize(FormWizard.SOGRID)); + final ControlForm aMainControlForm = new ControlForm(this, SOMAINFORM, aMainFormPoint, getMainFormSize(FormWizard.AS_GRID)); oControlForms.addElement(aMainControlForm); } else @@ -213,7 +213,7 @@ public class FormDocument extends TextDocument int nMainFormHeight = nFormHeight; if (bhasSubForm) { - if (_curArrangement == FormWizard.SOGRID) + if (_curArrangement == FormWizard.AS_GRID) { nMainFormHeight = (int) ((double) (nFormHeight - SOFORMGAP) / 2); } @@ -248,7 +248,7 @@ public class FormDocument extends TextDocument { ControlForm oMainControlForm = (ControlForm) oControlForms.get(0); oMainControlForm.setFormSize(getMainFormSize(oMainControlForm.curArrangement)); - if (oMainControlForm.curArrangement == FormWizard.SOGRID) + if (oMainControlForm.curArrangement == FormWizard.AS_GRID) { oMainControlForm.oGridControl.setSize(oMainControlForm.getFormSize()); } @@ -266,7 +266,7 @@ public class FormDocument extends TextDocument ControlForm oMainControlForm = (ControlForm) oControlForms.get(0); ControlForm oSubControlForm = (ControlForm) oControlForms.get(1); oSubControlForm.setFormSize(new Size(nFormWidth, (int) nFormHeight - oMainControlForm.getFormSize().Height)); - if (oSubControlForm.curArrangement == FormWizard.SOGRID) + if (oSubControlForm.curArrangement == FormWizard.AS_GRID) { Point aPoint = oSubControlForm.oGridControl.getPosition(); int idiffheight = oSubControlForm.getEntryPointY() - oMainControlForm.getActualFormHeight() - oMainControlForm.aStartPoint.Y - SOFORMGAP; @@ -406,13 +406,13 @@ public class FormDocument extends TextDocument } else { - if (curArrangement == FormWizard.SOGRID) + if (curArrangement == FormWizard.AS_GRID) { oFormHandler.moveShapesToNirwana(getLabelControls()); oFormHandler.moveShapesToNirwana(getDatabaseControls()); } } - if (curArrangement == FormWizard.SOGRID) + if (curArrangement == FormWizard.AS_GRID) { insertGridControl(_NBorderType); badaptControlStyles = true; @@ -485,7 +485,7 @@ public class FormDocument extends TextDocument private int getActualFormHeight() { - if (curArrangement == FormWizard.SOGRID) + if (curArrangement == FormWizard.AS_GRID) { return oGridControl.xShape.getSize().Height; } @@ -497,7 +497,7 @@ public class FormDocument extends TextDocument private int getEntryPointY() { - if (curArrangement == FormWizard.SOGRID) + if (curArrangement == FormWizard.AS_GRID) { return oGridControl.xShape.getPosition().Y; } @@ -551,16 +551,16 @@ public class FormDocument extends TextDocument { try { - curArrangement = FormWizard.SOGRID; + curArrangement = FormWizard.AS_GRID; if (Name.equals(SOMAINFORM)) { - oGridControl = new GridControl(xMSF, Name + "_Grid", oFormHandler, xFormContainer, oDBMetaData.FieldColumns, aStartPoint, getMainFormSize(FormWizard.SOGRID)); + oGridControl = new GridControl(xMSF, Name + "_Grid", oFormHandler, xFormContainer, oDBMetaData.FieldColumns, aStartPoint, getMainFormSize(FormWizard.AS_GRID)); } else { oGridControl = new GridControl(xMSF, Name + "_Grid", oFormHandler, xFormContainer, oDBMetaData.FieldColumns, aStartPoint, getSubFormSize()); } - oGridControl.xPropertySet.setPropertyValue("Border", _NBorderType); + oGridControl.xPropertySet.setPropertyValue(PropertyNames.PROPERTY_BORDER, _NBorderType); } catch (Exception e) { @@ -576,7 +576,7 @@ public class FormDocument extends TextDocument { for (int i = 0; i < getLabelControls().length; i++) { - if (curArrangement == FormWizard.SOGRID) + if (curArrangement == FormWizard.AS_GRID) { if ((oLabelControls[i] != null) && (oDBControls[i] != null)) { diff --git a/wizards/com/sun/star/wizards/form/FormWizard.java b/wizards/com/sun/star/wizards/form/FormWizard.java index f75f3e1b84ab..bc49311be433 100644 --- a/wizards/com/sun/star/wizards/form/FormWizard.java +++ b/wizards/com/sun/star/wizards/form/FormWizard.java @@ -66,27 +66,27 @@ public class FormWizard extends DatabaseObjectWizard public static final int SODATA_PAGE = 6; public static final int SOSTYLE_PAGE = 7; public static final int SOSTORE_PAGE = 8; - public static final int SOCOLUMNARLEFT = 1; - public static final int SOCOLUMNARTOP = 2; - public static final int SOGRID = 3; - public static final int SOTOPJUSTIFIED = 4; + public static final int COLUMNAR_LEFT = 1; + public static final int COLUMNAR_TOP = 2; + public static final int AS_GRID = 3; + public static final int IN_BLOCK_TOP = 4; private String slblTables; private boolean m_openForEditing; private boolean m_success = false; private String FormName; - public FormWizard( XMultiServiceFactory i_servicFactory, final PropertyValue[] i_wizardContext ) + public FormWizard(XMultiServiceFactory i_servicFactory, final PropertyValue[] i_wizardContext) { - super( i_servicFactory, 34400, i_wizardContext ); + super(i_servicFactory, 34400, i_wizardContext); super.addResourceHandler("FormWizard", "dbw"); Helper.setUnoPropertyValues(xDialogModel, new String[] { - PropertyNames.PROPERTY_HEIGHT, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Title", PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_MOVEABLE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_TITLE, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Integer(210), Boolean.TRUE, "DialogForm", new Integer(102), new Integer(41), new Integer(1), new Short((short) 0), m_oResource.getResText(UIConsts.RID_FORM), new Integer(310) + 210, Boolean.TRUE, "DialogForm", 102, 41, 1, new Short((short) 0), m_oResource.getResText(UIConsts.RID_FORM), 310 }); drawNaviBar(); if (getFormResources() == true) @@ -117,7 +117,7 @@ public class FormWizard extends DatabaseObjectWizard RelationController oRelationController = new RelationController(curFormDocument.oMainFormDBMetaData, sCommandName); curFormConfiguration.initialize(curSubFormFieldSelection, oRelationController); } - break; + break; case SOSUBFORMFIELDS_PAGE: { String sPreSelectedTableName = curFormConfiguration.getreferencedTableName(); @@ -133,14 +133,14 @@ public class FormWizard extends DatabaseObjectWizard curSubFormFieldSelection.preselectCommand(sPreSelectedTableName, bReadOnly); } } - break; + break; case SOFIELDLINKER_PAGE: { final String[] aMainFieldNames = curFormDocument.oMainFormDBMetaData.getFieldNames(); final String[] aSubFieldNames = curFormDocument.oSubFormDBMetaData.getFieldNames(); curFieldLinker.initialize(aMainFieldNames, aSubFieldNames, curFormDocument.LinkFieldNames); } - break; + break; case SOCONTROL_PAGE: curControlArranger.enableSubFormImageList(curFormConfiguration.hasSubForm()); break; @@ -153,7 +153,7 @@ public class FormWizard extends DatabaseObjectWizard String sTableName = this.curDBCommandFieldSelection.getSelectedCommandName(); this.curFinalizer.initialize(sTableName, curFormDocument); } - break; + break; default: break; } @@ -186,9 +186,10 @@ public class FormWizard extends DatabaseObjectWizard curFormDocument.LinkFieldNames = JavaTools.removeOutdatedFields(curFormDocument.LinkFieldNames, aMainFieldNames, 1); } catch (java.lang.Exception e) - {} + { + } } - break; + break; case SOSUBFORM_PAGE: break; case SOSUBFORMFIELDS_PAGE: @@ -203,9 +204,10 @@ public class FormWizard extends DatabaseObjectWizard curFormDocument.LinkFieldNames = JavaTools.removeOutdatedFields(curFormDocument.LinkFieldNames, aSubFieldNames, 0); } catch (java.lang.Exception e) - {} + { + } } - break; + break; case SOFIELDLINKER_PAGE: curFormDocument.LinkFieldNames = curFieldLinker.getLinkFieldNames(); break; @@ -235,7 +237,7 @@ public class FormWizard extends DatabaseObjectWizard }, new Object[] { - new Integer(28), sShowBinaryFields, Boolean.TRUE, new Integer(95), new Integer(154), new Integer(SOMAIN_PAGE), new Integer(210) + 28, sShowBinaryFields, Boolean.TRUE, 95, 154, new Integer(SOMAIN_PAGE), 210 }); curFormConfiguration = new FormConfiguration(this); @@ -250,7 +252,7 @@ public class FormWizard extends DatabaseObjectWizard }, new Object[] { - new Integer(28), sShowBinaryFields, Boolean.TRUE, new Integer(95), new Integer(154), new Integer(SOSUBFORMFIELDS_PAGE), new Integer(210) + 28, sShowBinaryFields, Boolean.TRUE, 95, 154, new Integer(SOSUBFORMFIELDS_PAGE), 210 }); curFormDocument.xProgressBar.setValue(40); @@ -337,7 +339,7 @@ public class FormWizard extends DatabaseObjectWizard try { curFormDocument = new FormDocument(xMSF); - if ( curFormDocument.oMainFormDBMetaData.getConnection( m_wizardContext ) ) + if (curFormDocument.oMainFormDBMetaData.getConnection(m_wizardContext)) { curFormDocument.oSubFormDBMetaData.getConnection(new PropertyValue[] { @@ -345,16 +347,16 @@ public class FormWizard extends DatabaseObjectWizard }); curFormDocument.xProgressBar.setValue(20); buildSteps(); - this.curDBCommandFieldSelection.preselectCommand( m_wizardContext, false ); + this.curDBCommandFieldSelection.preselectCommand(m_wizardContext, false); XWindowPeer xWindowPeer2 = createWindowPeer(curFormDocument.xWindowPeer); - curFormDocument.oMainFormDBMetaData.setWindowPeer( xWindowPeer2 ); + curFormDocument.oMainFormDBMetaData.setWindowPeer(xWindowPeer2); insertFormRelatedSteps(); short dialogReturn = executeDialog(curFormDocument.xFrame); xComponent.dispose(); - if ( ( dialogReturn == 0 ) && m_success ) + if ((dialogReturn == 0) && m_success) { - curFormDocument.oMainFormDBMetaData.addFormDocument( curFormDocument.xComponent ); - loadSubComponent( DatabaseObject.FORM, FormName, m_openForEditing ); + curFormDocument.oMainFormDBMetaData.addFormDocument(curFormDocument.xComponent); + loadSubComponent(DatabaseObject.FORM, FormName, m_openForEditing); } } } @@ -432,6 +434,7 @@ public class FormWizard extends DatabaseObjectWizard } } // @Override + public void moveItemDown(String item) { } @@ -475,8 +478,3 @@ public class FormWizard extends DatabaseObjectWizard } } } - - - - - diff --git a/wizards/com/sun/star/wizards/form/StyleApplier.java b/wizards/com/sun/star/wizards/form/StyleApplier.java index 5098a1ffbb74..3ce766717c07 100644 --- a/wizards/com/sun/star/wizards/form/StyleApplier.java +++ b/wizards/com/sun/star/wizards/form/StyleApplier.java @@ -116,7 +116,7 @@ public class StyleApplier }, new Object[] { - UIConsts.INTEGERS[8], sPageStyles, new Integer(92), new Integer(25), IStyleStep, new Short(curtabindex++), new Integer(90) + UIConsts.INTEGERS[8], sPageStyles, 92, 25, IStyleStep, new Short(curtabindex++), 90 }); lstStyles = CurUnoDialog.insertListBox("lstStyles", null, SCHANGELAYOUT, this, @@ -126,7 +126,7 @@ public class StyleApplier }, new Object[] { - new Integer(143), "HID:WIZARDS_HID_DLGFORM_LSTSTYLES", new Integer(92), new Integer(35), SelLayoutPos, IStyleStep, this.StyleNames, new Short(curtabindex++), new Integer(90) + 143, "HID:WIZARDS_HID_DLGFORM_LSTSTYLES", 92, 35, SelLayoutPos, IStyleStep, this.StyleNames, new Short(curtabindex++), 90 }); optNoBorder = CurUnoDialog.insertRadioButton("otpNoBorder", SCHANGEBORDERTYPE, this, @@ -136,7 +136,7 @@ public class StyleApplier }, new Object[] { - UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDNOBORDER", sNoBorder, new Integer(196), new Integer(39), IStyleStep, new Short(curtabindex++), "0", new Integer(93) + UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDNOBORDER", sNoBorder, 196, 39, IStyleStep, new Short(curtabindex++), "0", 93 }); opt3DLook = CurUnoDialog.insertRadioButton("otp3DLook", SCHANGEBORDERTYPE, this, @@ -146,7 +146,7 @@ public class StyleApplier }, new Object[] { - UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMD3DBORDER", s3DLook, new Integer(196), new Integer(53), new Short((short) 1), IStyleStep, new Short(curtabindex++), "1", new Integer(93) + UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMD3DBORDER", s3DLook, 196, 53, new Short((short) 1), IStyleStep, new Short(curtabindex++), "1", 93 }); optFlat = CurUnoDialog.insertRadioButton("otpFlat", SCHANGEBORDERTYPE, this, @@ -156,7 +156,7 @@ public class StyleApplier }, new Object[] { - UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDSIMPLEBORDER", sFlat, new Integer(196), new Integer(67), IStyleStep, new Short(curtabindex++), "2", new Integer(93) + UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDSIMPLEBORDER", sFlat, 196, 67, IStyleStep, new Short(curtabindex++), "2", 93 }); CurUnoDialog.insertFixedLine("lnFieldBorder", @@ -166,7 +166,7 @@ public class StyleApplier }, new Object[] { - UIConsts.INTEGERS[8], sFieldBorder, new Integer(192), new Integer(25), IStyleStep, new Short(curtabindex++), new Integer(98) + UIConsts.INTEGERS[8], sFieldBorder, 192, 25, IStyleStep, new Short(curtabindex++), 98 }); // } // catch (Exception e) @@ -281,10 +281,10 @@ public class StyleApplier for (int m = 0; m < curFormDocument.oControlForms.size(); m++) { FormDocument.ControlForm curControlForm = ((FormDocument.ControlForm) curFormDocument.oControlForms.get(m)); - if (curControlForm.getArrangemode() == FormWizard.SOGRID) + if (curControlForm.getArrangemode() == FormWizard.AS_GRID) { GridControl oGridControl = curControlForm.getGridControl(); - oGridControl.xPropertySet.setPropertyValue("Border", IBorderValue); + oGridControl.xPropertySet.setPropertyValue(PropertyNames.PROPERTY_BORDER, IBorderValue); } else { @@ -297,17 +297,17 @@ public class StyleApplier for (int i = 0; i < 2; i++) { XPropertySet xPropertySet = oTimeStampControl.getControlofGroupShapeByIndex(i); - if (xPropertySet.getPropertySetInfo().hasPropertyByName("Border")) + if (xPropertySet.getPropertySetInfo().hasPropertyByName(PropertyNames.PROPERTY_BORDER)) { - xPropertySet.setPropertyValue("Border", IBorderValue); + xPropertySet.setPropertyValue(PropertyNames.PROPERTY_BORDER, IBorderValue); } } } else { - if (DBControls[n].xPropertySet.getPropertySetInfo().hasPropertyByName("Border")) + if (DBControls[n].xPropertySet.getPropertySetInfo().hasPropertyByName(PropertyNames.PROPERTY_BORDER)) { - DBControls[n].xPropertySet.setPropertyValue("Border", IBorderValue); + DBControls[n].xPropertySet.setPropertyValue(PropertyNames.PROPERTY_BORDER, IBorderValue); } } } @@ -439,7 +439,7 @@ public class StyleApplier for (int m = 0; m < curFormDocument.oControlForms.size(); m++) { FormDocument.ControlForm curControlForm = ((FormDocument.ControlForm) curFormDocument.oControlForms.get(m)); - if (curControlForm.getArrangemode() == FormWizard.SOGRID) + if (curControlForm.getArrangemode() == FormWizard.AS_GRID) { if (_iStyleColors[SOLABELTEXTCOLOR] > -1) { diff --git a/wizards/com/sun/star/wizards/form/UIControlArranger.java b/wizards/com/sun/star/wizards/form/UIControlArranger.java index d4cd1ccc7cb6..cbab5c8c8ae6 100644 --- a/wizards/com/sun/star/wizards/form/UIControlArranger.java +++ b/wizards/com/sun/star/wizards/form/UIControlArranger.java @@ -83,7 +83,7 @@ public class UIControlArranger }, new Object[] { - UIConsts.INTEGERS[8], sLabelPlacment, new Integer(97), new Integer(25), IControlStep, new Short(curtabindex++), new Integer(207) + UIConsts.INTEGERS[8], sLabelPlacment, 97, 25, IControlStep, new Short(curtabindex++), 207 }); // Radio Button "Align Left" optAlignLeft = CurUnoDialog.insertRadioButton("optAlignLeft", SOALIGNMETHOD, this, @@ -93,7 +93,7 @@ public class UIControlArranger }, new Object[] { - UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDALIGNLEFT", sAlignLeft, new Integer(107), new Integer(38), new Short((short) 1), IControlStep, new Short(curtabindex++), new Integer(171) + UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDALIGNLEFT", sAlignLeft, 107, 38, new Short((short) 1), IControlStep, new Short(curtabindex++), 171 }); // Radio Button "Align Right" optAlignRight = CurUnoDialog.insertRadioButton("optAlignRight", SOALIGNMETHOD, this, @@ -103,7 +103,7 @@ public class UIControlArranger }, new Object[] { - UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDALIGNRIGHT", sAlignRight, Boolean.TRUE, new Integer(107), new Integer(50), IControlStep, new Short(curtabindex++), new Integer(171) + UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDALIGNRIGHT", sAlignRight, Boolean.TRUE, 107, 50, IControlStep, new Short(curtabindex++), 171 }); @@ -119,7 +119,7 @@ public class UIControlArranger // }, // new Object[] // { -// UIConsts.INTEGERS[8], sArrangementHeader[0], new Integer(97), new Integer(60), IControlStep, new Short(curtabindex++), new Integer(207) +// UIConsts.INTEGERS[8], sArrangementHeader[0], 97, 60, IControlStep, new Short(curtabindex++), 207 // }); // // boolean bEnabled = true; @@ -142,14 +142,14 @@ public class UIControlArranger // new Object[] // { // Boolean.valueOf(bEnabled), -// new Integer(14), +// 14, ///* TODO: WRONG!*/ "HID:WIZARDS_HID_DLGFORM_CMDALIGNRIGHT", // "1", // new Integer(nXPos + nBtnWidth), // new Integer(nYPos), // IControlStep, // new Short(curtabindex++), -// new Integer(16) +// 16 // }); DefaultListModel imageModel = new DefaultListModel(); @@ -206,16 +206,7 @@ public class UIControlArranger public short getAlignValue() { - Short IAlignValue = null; - if (optAlignLeft.getState()) - { - IAlignValue = new Short((short) 0); - } - else - { - IAlignValue = new Short((short) 2); - } - return IAlignValue.shortValue(); + return optAlignLeft.getState() ? (short)0 : (short)2; } public void alignLabelControls() @@ -226,12 +217,12 @@ public class UIControlArranger for (int m = 0; m < curFormDocument.oControlForms.size(); m++) { FormDocument.ControlForm curControlForm = (FormDocument.ControlForm) curFormDocument.oControlForms.get(m); - if (curControlForm.getArrangemode() == FormWizard.SOCOLUMNARLEFT) + if (curControlForm.getArrangemode() == FormWizard.COLUMNAR_LEFT) { Control[] LabelControls = curControlForm.getLabelControls(); for (int n = 0; n < LabelControls.length; n++) { - LabelControls[n].xPropertySet.setPropertyValue("Align", new Short(iAlignValue)); + LabelControls[n].xPropertySet.setPropertyValue(PropertyNames.PROPERTY_ALIGN, new Short(iAlignValue)); } } } @@ -267,7 +258,7 @@ public class UIControlArranger // }, // new Object[] // { -// UIConsts.INTEGERS[8], _sArrangementHeader, new Integer(97), YPos, IControlStep, new Short(curtabindex++), new Integer(207) +// UIConsts.INTEGERS[8], _sArrangementHeader, 97, YPos, IControlStep, new Short(curtabindex++), 207 // }); // // int nypos = SOBASEIMAGEYPOSITION + 12 + _formindex * SOIMAGELISTHEIGHT; @@ -396,11 +387,11 @@ public class UIControlArranger { UIConsts.INTEGERS[8], _sArrangementHeader, - new Integer(97), + 97, YPos, IControlStep, new Short(curtabindex++), - new Integer(207) + 207 }); int nypos = SOBASEIMAGEYPOSITION + 12 - 5 + _formindex * SOIMAGELISTHEIGHT; @@ -421,7 +412,7 @@ public class UIControlArranger m_aButtonList.setListModel(model); m_aButtonList.create(CurUnoDialog); - m_aButtonList.setSelected(FormWizard.SOGRID - 1); + m_aButtonList.setSelected(FormWizard.AS_GRID - 1); m_aButtonList.addItemListener(this); } @@ -450,13 +441,13 @@ public class UIControlArranger final int nSelected0 = (m_aArrangeList[0].m_aButtonList.getSelected() + 1); final int nSelected1 = (m_aArrangeList[1].m_aButtonList.getSelected() + 1); - bEnableAlignControlGroup = ((nSelected0 == FormWizard.SOCOLUMNARLEFT) || - (nSelected1 == FormWizard.SOCOLUMNARLEFT)); + bEnableAlignControlGroup = ((nSelected0 == FormWizard.COLUMNAR_LEFT) || + (nSelected1 == FormWizard.COLUMNAR_LEFT)); } else { final int nSelected0 = (m_aArrangeList[0].m_aButtonList.getSelected() + 1); - bEnableAlignControlGroup = (nSelected0 == FormWizard.SOCOLUMNARLEFT); + bEnableAlignControlGroup = (nSelected0 == FormWizard.COLUMNAR_LEFT); } enableAlignControlGroup(bEnableAlignControlGroup); final Short nBorderType = CurUnoDialog.getBorderType(); |