summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards/reportbuilder
diff options
context:
space:
mode:
authorRelease Engineers <releng@openoffice.org>2008-12-01 12:31:27 +0000
committerRelease Engineers <releng@openoffice.org>2008-12-01 12:31:27 +0000
commitf0a7951ee7a9bb75519cefa5e226d186633e3e95 (patch)
treee60b8bbac6a8c4b3b0282f5cda72baf0d0ebc6ce /wizards/com/sun/star/wizards/reportbuilder
parent97a48f7a4812bc224729a88dbc8272d940bcb339 (diff)
CWS-TOOLING: integrate CWS dba31e
2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
Diffstat (limited to 'wizards/com/sun/star/wizards/reportbuilder')
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java188
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarSingleColumn.java10
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarThreeColumns.java4
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarTwoColumns.java12
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/layout/DesignTemplate.java49
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsAbove.java9
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsLeft.java9
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java309
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/layout/SectionEmptyObject.java4
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/layout/SectionLabel.java12
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java10
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/layout/SectionTextField.java10
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/layout/Tabular.java13
13 files changed, 326 insertions, 313 deletions
diff --git a/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java b/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java
index f35e0324b420..184bd7cd9fea 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java
@@ -9,7 +9,7 @@
*
* $RCSfile: ReportBuilderImplementation.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.2.36.1 $
*
* This file is part of OpenOffice.org.
*
@@ -29,7 +29,6 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
package com.sun.star.wizards.reportbuilder;
// import com.sun.star.deployment.XPackageInformationProvider;
@@ -70,30 +69,28 @@ import java.util.Vector;
// import com.sun.star.wizards.ui.UIConsts;
import com.sun.star.wizards.common.FileAccess;
// import com.sun.star.wizards.common.Configuration;
-
-
/**
* This class use the IReportDocument Interface to communicate between the UI
* and the ReportBuilderLayouter which communicates to the new Sun Report Builder.
*
* @author ll93751
*/
-public class ReportBuilderImplementation extends ReportImplementationHelper
+public class ReportBuilderImplementation extends ReportImplementationHelper
implements IReportDocument, IReportDefinitionReadAccess
{
+
private static final int MAXIMUM_GROUPCOUNT = 4;
// public ReportTextDocument getDoc()
// {
// throw new UnsupportedOperationException("Not supported yet.");
// }
-
public void clearDocument()
{
// throw new UnsupportedOperationException("Not supported yet.");
}
-
private Resource m_aResource;
- public ReportBuilderImplementation()
+
+ public ReportBuilderImplementation()
{
// super(null, ReportLayouter.SOOPTPORTRAIT);
super(null, ReportLayouter.SOOPTLANDSCAPE);
@@ -126,20 +123,18 @@ public class ReportBuilderImplementation extends ReportImplementationHelper
// {
// throw new UnsupportedOperationException("Not supported yet.");
// }
-
public XWindowPeer getWizardParent()
{
// throw new UnsupportedOperationException("Not supported yet.");
// com.sun.star.frame.XFrame xFrame = thisComponent;
- // openReportBuilderView();
- // XInterface xInterface = (XInterface) getMSF().createInstance("com.sun.star.frame.Desktop");
- // XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, xInterface);
- // XFrame xFrame = xDesktop.getCurrentFrame();
+ // openReportBuilderView();
+ // XInterface xInterface = (XInterface) getMSF().createInstance("com.sun.star.frame.Desktop");
+ // XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, xInterface);
+ // XFrame xFrame = xDesktop.getCurrentFrame();
final XWindowPeer aWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, getFrame().getComponentWindow());
return aWindowPeer;
}
-
private XFrame m_xFrame = null;
// private ReportBuilderLayouter m_aReportBuilderLayouter = null;
private String m_sReportBuilderLayoutName = "";
@@ -153,18 +148,16 @@ public class ReportBuilderImplementation extends ReportImplementationHelper
{
// if (m_aReportBuilderLayouter == null)
// {
- // m_aReportBuilderLayouter = ReportBuilderLayouter.create(getRecordParser().getReportDocuments(), getConnection());
- // m_aReportBuilderLayouter = ReportBuilderLayouter.create(m_xReportDefinition /* , getConnection() */ );
- final IReportBuilderLayouter aReportBuilderLayouter = (IReportBuilderLayouter)getLayoutMap().get(m_sReportBuilderLayoutName);
+ // m_aReportBuilderLayouter = ReportBuilderLayouter.create(getRecordParser().getReportDocuments(), getConnection());
+ // m_aReportBuilderLayouter = ReportBuilderLayouter.create(m_xReportDefinition /* , getConnection() */ );
+ final IReportBuilderLayouter aReportBuilderLayouter = (IReportBuilderLayouter) getLayoutMap().get(m_sReportBuilderLayoutName);
return aReportBuilderLayouter;
- // }
+ // }
}
-
private Object m_aReportDocument;
private XPropertySet m_aDocumentDefinition;
private XReportDefinition m_xReportDefinition;
-
/**
* initialize the Report Builder and open it representation
* @param _aDoc
@@ -189,14 +182,14 @@ public class ReportBuilderImplementation extends ReportImplementationHelper
args[1] = aConnection;
XReportDefinition xReportDefinition = null;
- final XMultiServiceFactory xMSF = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, /* getRecordParser().getReportDocuments() */ _aDoc );
+ final XMultiServiceFactory xMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, /* getRecordParser().getReportDocuments() */ _aDoc);
try
{
final Object aObj = xMSF.createInstanceWithArguments("com.sun.star.sdb.DocumentDefinition", args);
- final XPropertySet aDocumentDefinition = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, aObj);
+ final XPropertySet aDocumentDefinition = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, aObj);
m_aDocumentDefinition = aDocumentDefinition;
- final XCommandProcessor xProcessor = (XCommandProcessor)UnoRuntime.queryInterface(XCommandProcessor.class, aObj);
+ final XCommandProcessor xProcessor = (XCommandProcessor) UnoRuntime.queryInterface(XCommandProcessor.class, aObj);
final com.sun.star.ucb.Command aCommand = new com.sun.star.ucb.Command();
aCommand.Name = "openDesign";
final com.sun.star.ucb.OpenCommandArgument2 aOpenCommand = new com.sun.star.ucb.OpenCommandArgument2();
@@ -204,7 +197,7 @@ public class ReportBuilderImplementation extends ReportImplementationHelper
aCommand.Argument = aOpenCommand;
// com.sun.star.usb.XCommandEnvironment xEnv = new com.sun.star.ucb.XCommandEnvironment();
final Object aObj2 = xProcessor.execute(aCommand, xProcessor.createCommandIdentifier(), null);
- xReportDefinition = (XReportDefinition)UnoRuntime.queryInterface(XReportDefinition.class, aObj2 );
+ xReportDefinition = (XReportDefinition) UnoRuntime.queryInterface(XReportDefinition.class, aObj2);
}
catch (com.sun.star.uno.Exception e)
{
@@ -214,23 +207,24 @@ public class ReportBuilderImplementation extends ReportImplementationHelper
switchOffPropertyBrowser();
switchOffAddFieldWindow();
- setPageOrientation(m_nDefaultPageOrientation, false /* NO_LAYOUT*/ );
- // try
- // {
- // Thread.sleep(1000);
- // }
- // catch (java.lang.InterruptedException e)
- // {
- // }
+ setPageOrientation(m_nDefaultPageOrientation, false /* NO_LAYOUT*/);
+ // try
+ // {
+ // Thread.sleep(1000);
+ // }
+ // catch (java.lang.InterruptedException e)
+ // {
+ // }
}
private XModeSelector getModeSelector()
{
final XController xController = getReportDefinition().getCurrentController();
- final XModeSelector xModeSelector = (XModeSelector)UnoRuntime.queryInterface(XModeSelector.class, xController);
+ final XModeSelector xModeSelector = (XModeSelector) UnoRuntime.queryInterface(XModeSelector.class, xController);
return xModeSelector;
}
+
private void switchOffAddFieldWindow()
{
try
@@ -242,6 +236,7 @@ public class ReportBuilderImplementation extends ReportImplementationHelper
int dummy = 0;
}
}
+
private void switchOnAddFieldWindow()
{
try
@@ -256,25 +251,26 @@ public class ReportBuilderImplementation extends ReportImplementationHelper
private void sleep(int _nSeconds)
{
- try
- {
- Thread.sleep(_nSeconds * 1000);
- }
- catch (java.lang.InterruptedException e)
- {
- }
+ try
+ {
+ Thread.sleep(_nSeconds * 1000);
+ }
+ catch (java.lang.InterruptedException e)
+ {
+ }
}
+
private void switchOffPropertyBrowser()
{
try
{
final XController xController = getReportDefinition().getCurrentController();
- final XDispatchProvider xDP = (XDispatchProvider)UnoRuntime.queryInterface(XDispatchProvider.class, xController);
+ final XDispatchProvider xDP = (XDispatchProvider) UnoRuntime.queryInterface(XDispatchProvider.class, xController);
// Create special service for parsing of given URL.
final Object aURLTransformer = getMSF().createInstance("com.sun.star.util.URLTransformer");
- final XURLTransformer xURLTransformer = (XURLTransformer)UnoRuntime.queryInterface(com.sun.star.util.XURLTransformer.class, aURLTransformer );
+ final XURLTransformer xURLTransformer = (XURLTransformer) UnoRuntime.queryInterface(com.sun.star.util.XURLTransformer.class, aURLTransformer);
com.sun.star.util.URL[] aURL = new com.sun.star.util.URL[1];
aURL[0] = new com.sun.star.util.URL();
@@ -291,16 +287,16 @@ public class ReportBuilderImplementation extends ReportImplementationHelper
}
}
-private void switchOnPropertyBrowser()
-{
- // This is implemented with a toggle algorithm.
- switchOffPropertyBrowser();
-}
+ private void switchOnPropertyBrowser()
+ {
+ // This is implemented with a toggle algorithm.
+ switchOffPropertyBrowser();
+ }
-/**
- * Returns the Frame of the underlieing Document
- * @return Returns the Frame of the parent (underlieing) Document
- */
+ /**
+ * Returns the Frame of the underlieing Document
+ * @return Returns the Frame of the parent (underlieing) Document
+ */
public XFrame getFrame()
{
if (m_xFrame == null)
@@ -308,7 +304,7 @@ private void switchOnPropertyBrowser()
initialize(getRecordParser().getReportDocuments(), getConnection());
// m_xFrame = getFrame();
m_xFrame = getReportDefinition().getCurrentController().getFrame();
- setPageOrientation(m_nDefaultPageOrientation, true /* NO_LAYOUT*/ );
+ setPageOrientation(m_nDefaultPageOrientation, true /* NO_LAYOUT*/);
}
return m_xFrame;
}
@@ -322,7 +318,6 @@ private void switchOnPropertyBrowser()
// {
// throw new UnsupportedOperationException("Not supported yet.");
// }
-
public boolean reconnectToDatabase(XMultiServiceFactory xMSF, PropertyValue[] Properties)
{
throw new UnsupportedOperationException("Not supported yet.");
@@ -343,7 +338,7 @@ private void switchOnPropertyBrowser()
// throw new UnsupportedOperationException("Not supported yet.");
// getReportBuilderLayouter().store(Name);
// store into the ZIP Storage
- if (OpenMode == 1 /* static Report */ )
+ if (OpenMode == 1 /* static Report */)
{
// we will store later
return;
@@ -351,18 +346,18 @@ private void switchOnPropertyBrowser()
try
{
- final XNameAccess aNameAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, m_aReportDocument);
+ final XNameAccess aNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, m_aReportDocument);
final String[] aNames = aNameAccess.getElementNames();
// m_xReportDefinition.storeToStorage(m_xReportDefinition.getDocumentStorage(), m_xReportDefinition.getArgs());
- final XCommandProcessor xProcessor = (XCommandProcessor)UnoRuntime.queryInterface(XCommandProcessor.class, m_aDocumentDefinition);
+ final XCommandProcessor xProcessor = (XCommandProcessor) UnoRuntime.queryInterface(XCommandProcessor.class, m_aDocumentDefinition);
com.sun.star.ucb.Command aCommand = new com.sun.star.ucb.Command();
aCommand.Name = "storeOwn";
final Object aObj2 = xProcessor.execute(aCommand, xProcessor.createCommandIdentifier(), null);
- final XNameContainer aNameContainer = (XNameContainer)UnoRuntime.queryInterface(XNameContainer.class, m_aReportDocument);
+ final XNameContainer aNameContainer = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, m_aReportDocument);
// aNameContainer.insertByName(Name, m_xReportDefinition);
aNameContainer.insertByName(Name, m_aDocumentDefinition);
}
@@ -380,7 +375,7 @@ private void switchOnPropertyBrowser()
{
// removeGroupNamesofRecordTable(iSelCount);
final FieldColumn CurFieldColumn = getRecordParser().getFieldColumnByTitle(CurGroupTitle);
- GroupFieldVector.addElement(CurFieldColumn.FieldName);
+ GroupFieldVector.addElement(CurFieldColumn.m_sFieldName);
}
return true;
}
@@ -394,12 +389,11 @@ private void switchOnPropertyBrowser()
// {
// throw new UnsupportedOperationException("Not supported yet.");
// }
-
public void liveupdate_removeGroupName(String[] NewSelGroupNames, String CurGroupTitle, Vector GroupFieldVector)
{
// throw new UnsupportedOperationException("Not supported yet.");
final FieldColumn CurFieldColumn = getRecordParser().getFieldColumnByTitle(CurGroupTitle);
- GroupFieldVector.removeElement(CurFieldColumn.FieldName);
+ GroupFieldVector.removeElement(CurFieldColumn.m_sFieldName);
}
private void setPageOrientation(int nOrientation, boolean bDoLayout)
@@ -410,6 +404,7 @@ private void switchOnPropertyBrowser()
getReportBuilderLayouter().layout();
}
}
+
public void setPageOrientation(int nOrientation)
{
// throw new UnsupportedOperationException("Not supported yet.");
@@ -435,7 +430,7 @@ private void switchOnPropertyBrowser()
public void setReportBuilderLayouterName(String _sName)
{
final IReportBuilderLayouter aCurrentLayouter = getReportBuilderLayouter();
- final IReportBuilderLayouter aNewLayouter = (IReportBuilderLayouter)m_aLayoutMap.get(_sName);
+ final IReportBuilderLayouter aNewLayouter = (IReportBuilderLayouter) m_aLayoutMap.get(_sName);
if (aNewLayouter != null)
{
m_sReportBuilderLayoutName = _sName;
@@ -443,12 +438,14 @@ private void switchOnPropertyBrowser()
aNewLayouter.layout();
}
}
+
public void liveupdate_changeContentTemplate(String ContentTemplatePath)
{
// throw new UnsupportedOperationException("Not supported yet.");
/* Left Listbox */
setReportBuilderLayouterName(ContentTemplatePath);
}
+
public void layout_setupRecordSection(String TemplateName)
{
// throw new UnsupportedOperationException("Not supported yet.");
@@ -480,12 +477,12 @@ private void switchOnPropertyBrowser()
// XDispatchProvider xDispatcher = (XDispatchProvider)UnoRuntime.queryInterface(XDispatchProvider.class, xController);
// xDispatcher.queryDispatch();
- final XComponent xDocumentComponent = (XComponent)UnoRuntime.queryInterface(XComponent.class, m_aDocumentDefinition);
+ final XComponent xDocumentComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, m_aDocumentDefinition);
xDocumentComponent.dispose();
m_xReportDefinition = null;
- // TODO: dispose() office will be killed.
- // m_xReportDefinition.dispose();
+ // TODO: dispose() office will be killed.
+ // m_xReportDefinition.dispose();
}
catch (Exception e)
{
@@ -514,7 +511,6 @@ private void switchOnPropertyBrowser()
// {
// throw new UnsupportedOperationException("Not supported yet.");
// }
-
public void addReportToDBView()
{
// throw new UnsupportedOperationException("Not supported yet.");
@@ -540,13 +536,17 @@ private void switchOnPropertyBrowser()
// // aProperties[1].Value = Integer.valueOf(com.sun.star.ucb.OpenMode.DOCUMENT);
aProperties[1].Value = aOpenCommand;
- final XCommandProcessor xProcessor = (XCommandProcessor)UnoRuntime.queryInterface(XCommandProcessor.class, m_aDocumentDefinition);
+// aProperties[2] = new PropertyValue();
+// aProperties[2].Name = "Title"; // This name is 'Schall und Rauch'
+// aProperties[2].Value = Name;
+
+ final XCommandProcessor xProcessor = (XCommandProcessor) UnoRuntime.queryInterface(XCommandProcessor.class, m_aDocumentDefinition);
com.sun.star.ucb.Command aCommand = new com.sun.star.ucb.Command();
aCommand.Name = "open";
aCommand.Argument = aProperties;
final Object aObj2 = xProcessor.execute(aCommand, xProcessor.createCommandIdentifier(), null);
- xComponents[0] = (XComponent)UnoRuntime.queryInterface(XComponent.class, aObj2);
+ xComponents[0] = (XComponent) UnoRuntime.queryInterface(XComponent.class, aObj2);
}
catch (com.sun.star.uno.Exception e)
{
@@ -560,13 +560,13 @@ private void switchOnPropertyBrowser()
// XComponent[] xComponents = getReportBuilderLayouter().createFinalReportDocument(Name, getRecordParser().DBConnection ,_bAsTemplate, _bOpenInDesign);
if (_bAsTemplate == true && _bOpenInDesign == false)
{
- final XComponent[] xComponents = createFinalReportDocument(Name, getRecordParser().DBConnection ,_bAsTemplate, _bOpenInDesign);
+ final XComponent[] xComponents = createFinalReportDocument(Name, getRecordParser().DBConnection, _bAsTemplate, _bOpenInDesign);
dispose();
return xComponents;
}
else if (_bAsTemplate == false)
{
- final XComponent[] xComponents = createFinalReportDocument(Name, getRecordParser().DBConnection ,_bAsTemplate, _bOpenInDesign);
+ final XComponent[] xComponents = createFinalReportDocument(Name, getRecordParser().DBConnection, _bAsTemplate, _bOpenInDesign);
boolean bDocisStored = getRecordParser().storeDatabaseDocumentToTempPath(xComponents[0], Name);
if (bDocisStored)
{
@@ -597,7 +597,7 @@ private void switchOnPropertyBrowser()
final com.sun.star.wizards.db.RecordParser a = getRecordParser();
int[] FieldTypes = new int[FieldNames.length];
int[] FieldWidths = new int[FieldNames.length];
- for (int i=0;i<FieldNames.length;i++)
+ for (int i = 0; i < FieldNames.length; i++)
{
FieldTypes[i] = a.FieldColumns[i].FieldType;
FieldWidths[i] = a.FieldColumns[i].FieldWidth;
@@ -622,9 +622,10 @@ private void switchOnPropertyBrowser()
public void setSorting(String[][] _aSortFieldNames)
{
- getRecordParser().setSortFieldNames( _aSortFieldNames );
+ getRecordParser().setSortFieldNames(_aSortFieldNames);
// getRecordParser().createRecordFieldNames();
}
+
public void setGrouping(String[] _aGroupFieldNames)
{
getRecordParser().prependSortFieldNames(_aGroupFieldNames);
@@ -643,11 +644,12 @@ private void switchOnPropertyBrowser()
return "default";
}
private ArrayList m_aReportPath;
+
public ArrayList getReportPath()
{
if (m_aReportPath == null)
{
- // Check general availability of office paths
+ // Check general availability of office paths
try
{
m_aReportPath = FileAccess.getOfficePaths(getMSF(), "Template", "share", "/wizard");
@@ -658,12 +660,14 @@ private void switchOnPropertyBrowser()
}
}
return m_aReportPath;
- // return "";
+ // return "";
}
+
public String getContentPath()
{
return "";
}
+
public int getDefaultPageOrientation()
{
return m_nDefaultPageOrientation;
@@ -682,11 +686,14 @@ private void switchOnPropertyBrowser()
// TODO: Use Package.getPackages(...)
final Class a = Class.forName(_sClassName);
- final Constructor cTor = a.getConstructor(new Class[]{IReportDefinitionReadAccess.class, Resource.class});
+ final Constructor cTor = a.getConstructor(new Class[]
+ {
+ IReportDefinitionReadAccess.class, Resource.class
+ });
Object[] aParams = new Object[2];
aParams[0] = this;
aParams[1] = m_aResource;
- final IReportBuilderLayouter aReportBuilderLayouter = (IReportBuilderLayouter)cTor.newInstance(aParams);
+ final IReportBuilderLayouter aReportBuilderLayouter = (IReportBuilderLayouter) cTor.newInstance(aParams);
return aReportBuilderLayouter;
}
catch (Exception e)
@@ -723,7 +730,6 @@ private void switchOnPropertyBrowser()
// }
return null;
}
-
private LinkedHashMap m_aLayoutMap = null;
private void insertIntoLayoutMap(IReportBuilderLayouter _aLayout)
@@ -743,6 +749,7 @@ private void switchOnPropertyBrowser()
m_aLayoutMap.put(sName, _aLayout);
}
}
+
/**
* Initialize all well known com.sun.star.wizards.report.layout.ReportBuilderLayouter Objects and create exact one instance.
*/
@@ -771,17 +778,17 @@ private void switchOnPropertyBrowser()
return m_aLayoutMap;
}
-/**
- * Return a string array array with all found layouts
- * At the moment these layout are hard coded
- * @return
- */
+ /**
+ * Return a string array array with all found layouts
+ * At the moment these layout are hard coded
+ * @return
+ */
public String[][] getDataLayout()
{
String[][] ContentFiles;
ContentFiles = new String[2][];
- String[] a = new String[ getLayoutMap().size() ];
- String[] b = new String[ getLayoutMap().size() ];
+ String[] a = new String[getLayoutMap().size()];
+ String[] b = new String[getLayoutMap().size()];
// run through the whole layoutmap and
final Set aKeys = getLayoutMap().keySet();
@@ -789,9 +796,9 @@ private void switchOnPropertyBrowser()
int i = 0;
while (aKeyIterator.hasNext())
{
- final String sKey = (String)aKeyIterator.next();
+ final String sKey = (String) aKeyIterator.next();
a[i] = sKey;
- final IReportBuilderLayouter aLayouter = (IReportBuilderLayouter)m_aLayoutMap.get(sKey);
+ final IReportBuilderLayouter aLayouter = (IReportBuilderLayouter) m_aLayoutMap.get(sKey);
b[i++] = aLayouter.getLocalizedName();
}
@@ -799,16 +806,15 @@ private void switchOnPropertyBrowser()
ContentFiles[0] = b;
return ContentFiles;
}
-
-
private String m_sDefaultHeaderLayoutPath;
+
public String[][] getHeaderLayout()
{
String[][] LayoutFiles;
try
{
// TODO: check different languages in header layouts
- ArrayList aReportPath = FileAccess.getOfficePaths(getMSF(), "Template","share", "/wizard");
+ ArrayList aReportPath = FileAccess.getOfficePaths(getMSF(), "Template", "share", "/wizard");
FileAccess.combinePaths(getMSF(), aReportPath, "/wizard/report");
LayoutFiles = FileAccess.getFolderTitles(getMSF(), null, aReportPath, ".otr");
@@ -824,7 +830,7 @@ private void switchOnPropertyBrowser()
LayoutFiles[1] = a;
LayoutFiles[0] = b;
}
- for (int i=0;i<LayoutFiles[0].length;i++)
+ for (int i = 0; i < LayoutFiles[0].length; i++)
{
if (LayoutFiles[0][i].equals("default"))
{
@@ -863,13 +869,13 @@ private void switchOnPropertyBrowser()
{
getRecordParser().Command = _sCommand;
getReportDefinition().setCommand(_sCommand);
- // throw new UnsupportedOperationException("Not supported yet.");
+ // throw new UnsupportedOperationException("Not supported yet.");
}
+
public void setCommandType(int _nCommand)
{
getReportDefinition().setCommandType(_nCommand);
}
-
}
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarSingleColumn.java b/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarSingleColumn.java
index 490b47418ccf..1488a9ca32a5 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarSingleColumn.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarSingleColumn.java
@@ -9,7 +9,7 @@
*
* $RCSfile: ColumnarSingleColumn.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.2.36.1 $
*
* This file is part of OpenOffice.org.
*
@@ -29,7 +29,6 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
package com.sun.star.wizards.reportbuilder.layout;
import com.sun.star.awt.Rectangle;
@@ -42,8 +41,9 @@ import com.sun.star.wizards.ui.UIConsts;
*
* @author ll93751
*/
-public class ColumnarSingleColumn extends ReportBuilderLayouter
+public class ColumnarSingleColumn extends ReportBuilderLayouter
{
+
public ColumnarSingleColumn(IReportDefinitionReadAccess _xDefinitionAccess, Resource _aResource)
{
super(_xDefinitionAccess, _aResource);
@@ -87,7 +87,7 @@ public class ColumnarSingleColumn extends ReportBuilderLayouter
final int nWidth = getPageWidth() - getLeftPageIndent() - getRightPageIndent() - getLeftGroupIndent(getCountOfGroups()) - nLabelWidth;
- for (int i=0;i<aFieldNames.length;i++)
+ for (int i = 0; i < aFieldNames.length; i++)
{
aRect.X = getLeftPageIndent() + getLeftGroupIndent(getCountOfGroups());
final String sLabel = aFieldTitleNames[i];
@@ -100,9 +100,9 @@ public class ColumnarSingleColumn extends ReportBuilderLayouter
xSection.setHeight(aRect.Y);
doNotBreakInTable(xSection);
}
+
protected void insertDetailFieldTitles()
{
// we won't extra field titles
}
-
}
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarThreeColumns.java b/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarThreeColumns.java
index ed5b90c6e2dc..b185c6c990fa 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarThreeColumns.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarThreeColumns.java
@@ -9,7 +9,7 @@
*
* $RCSfile: ColumnarThreeColumns.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.2.36.1 $
*
* This file is part of OpenOffice.org.
*
@@ -30,7 +30,6 @@
*
* **********************************************************************
*/
-
package com.sun.star.wizards.reportbuilder.layout;
import com.sun.star.wizards.common.Resource;
@@ -43,6 +42,7 @@ import com.sun.star.wizards.ui.*;
*/
public class ColumnarThreeColumns extends ColumnarTwoColumns
{
+
public ColumnarThreeColumns(IReportDefinitionReadAccess _xDefinitionAccess, Resource _aResource)
{
super(_xDefinitionAccess, _aResource);
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarTwoColumns.java b/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarTwoColumns.java
index f2cd5409efb3..98147e93c095 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarTwoColumns.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarTwoColumns.java
@@ -9,7 +9,7 @@
*
* $RCSfile: ColumnarTwoColumns.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.2.36.1 $
*
* This file is part of OpenOffice.org.
*
@@ -29,7 +29,6 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
package com.sun.star.wizards.reportbuilder.layout;
import com.sun.star.awt.Rectangle;
@@ -44,6 +43,7 @@ import com.sun.star.wizards.ui.UIConsts;
*/
public class ColumnarTwoColumns extends ReportBuilderLayouter
{
+
public ColumnarTwoColumns(IReportDefinitionReadAccess _xDefinitionAccess, Resource _aResource)
{
super(_xDefinitionAccess, _aResource);
@@ -92,7 +92,7 @@ public class ColumnarTwoColumns extends ReportBuilderLayouter
final int nLabelWidth = getMaxLabelWidth(); // 3000;
final int nUsablePageWidth = getPageWidth() - getLeftPageIndent() - getRightPageIndent() - getLeftGroupIndent(getCountOfGroups());
- int i=0;
+ int i = 0;
int nRows = aFieldNames.length / _nColumns;
if ((aFieldNames.length % _nColumns) != 0)
{
@@ -108,10 +108,10 @@ public class ColumnarTwoColumns extends ReportBuilderLayouter
final SectionObject aSOLabel = getDesignTemplate().getDetailLabel();
aSOLabel.setFontToBold();
final SectionObject aSOTextField = getDesignTemplate().getDetailTextField();
- for (int x=0;x<_nColumns;x++)
+ for (int x = 0; x < _nColumns; x++)
{
aRect.Y = 0;
- for (int y=0;y<nRows;y++)
+ for (int y = 0; y < nRows; y++)
{
aRect.X = getLeftPageIndent() + getLeftGroupIndent(getCountOfGroups()) + x * (nWidth + nLabelWidth);
if (i < aFieldNames.length)
@@ -130,9 +130,9 @@ public class ColumnarTwoColumns extends ReportBuilderLayouter
xSection.setHeight(aRect.Y);
doNotBreakInTable(xSection);
}
+
protected void insertDetailFieldTitles()
{
// we won't extra field titles
}
-
}
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/DesignTemplate.java b/wizards/com/sun/star/wizards/reportbuilder/layout/DesignTemplate.java
index a52be8dc55ff..0b6fe8d4d13b 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/DesignTemplate.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/DesignTemplate.java
@@ -9,7 +9,7 @@
*
* $RCSfile: DesignTemplate.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.2.36.1 $
*
* This file is part of OpenOffice.org.
*
@@ -30,7 +30,6 @@
*
* **********************************************************************
*/
-
package com.sun.star.wizards.reportbuilder.layout;
import com.sun.star.beans.PropertyValue;
@@ -53,13 +52,14 @@ import com.sun.star.wizards.common.Properties;
*/
public class DesignTemplate
{
+
private XReportDefinition m_xReportDefinition;
XMultiServiceFactory m_xGlobalMSF;
String m_sFilename;
private DesignTemplate()
- {}
-
+ {
+ }
// -------------------------------------------------------------------------
// All functions from XReportDefinition, we use
// -------------------------------------------------------------------------
@@ -67,44 +67,51 @@ public class DesignTemplate
{
return m_xReportDefinition.getGroups();
}
+
XSection getDetail()
{
return m_xReportDefinition.getDetail();
}
+
boolean getReportHeaderOn()
{
return m_xReportDefinition.getReportHeaderOn();
}
+
XSection getReportHeader() throws com.sun.star.container.NoSuchElementException
{
return m_xReportDefinition.getReportHeader();
}
+
boolean getReportFooterOn()
{
return m_xReportDefinition.getReportFooterOn();
}
+
XSection getReportFooter() throws com.sun.star.container.NoSuchElementException
{
return m_xReportDefinition.getReportFooter();
}
+
boolean getPageHeaderOn()
{
return m_xReportDefinition.getPageHeaderOn();
}
+
XSection getPageHeader() throws com.sun.star.container.NoSuchElementException
{
return m_xReportDefinition.getPageHeader();
}
+
boolean getPageFooterOn()
{
return m_xReportDefinition.getPageFooterOn();
}
+
XSection getPageFooter() throws com.sun.star.container.NoSuchElementException
{
return m_xReportDefinition.getPageFooter();
- }
-
- // -------------------------------------------------------------------------
+ } // -------------------------------------------------------------------------
private SectionObject m_aDetailLabel;
private SectionObject m_aDetailTextField;
private SectionObject[] m_aGroupLabel;
@@ -118,6 +125,7 @@ public class DesignTemplate
}
return m_aDetailLabel;
}
+
SectionObject getDetailTextField()
{
if (m_aDetailTextField == null)
@@ -167,7 +175,7 @@ public class DesignTemplate
{
final XSection xDetailSection = m_xReportDefinition.getDetail();
final int nDetailCount = xDetailSection.getCount();
- for (int i=0;i<nDetailCount;i++)
+ for (int i = 0; i < nDetailCount; i++)
{
try
{
@@ -176,17 +184,17 @@ public class DesignTemplate
// is aObj a textfield
// m_aDetailLabel_FD
// m_aDetailTextField_FD
- XFixedText aFixedText = (XFixedText)UnoRuntime.queryInterface(XFixedText.class, aObj);
+ XFixedText aFixedText = (XFixedText) UnoRuntime.queryInterface(XFixedText.class, aObj);
if (aFixedText != null &&
- m_aDetailLabel == null )
+ m_aDetailLabel == null)
{
m_aDetailLabel = SectionLabel.create(aFixedText);
}
else
{
- XFormattedField aFormattedField = (XFormattedField)UnoRuntime.queryInterface(XFormattedField.class, aObj);
+ XFormattedField aFormattedField = (XFormattedField) UnoRuntime.queryInterface(XFormattedField.class, aObj);
if (aFormattedField != null &&
- m_aDetailTextField == null )
+ m_aDetailTextField == null)
{
m_aDetailTextField = SectionTextField.create(aFormattedField);
}
@@ -208,33 +216,33 @@ public class DesignTemplate
m_aGroupLabel = new SectionObject[nGroupCount];
m_aGroupTextField = new SectionObject[nGroupCount];
- for (int nGroup=0; nGroup<nGroupCount; nGroup++)
+ for (int nGroup = 0; nGroup < nGroupCount; nGroup++)
{
try
{
Object aGroup = xGroups.getByIndex(nGroup);
- XGroup xGroup = (XGroup)UnoRuntime.queryInterface(XGroup.class, aGroup);
+ XGroup xGroup = (XGroup) UnoRuntime.queryInterface(XGroup.class, aGroup);
XSection xGroupSection = xGroup.getHeader();
final int nCount = xGroupSection.getCount();
- for (int i=0;i<nCount;i++)
+ for (int i = 0; i < nCount; i++)
{
try
{
Object aObj = xGroupSection.getByIndex(i);
- XFixedText aFixedText = (XFixedText)UnoRuntime.queryInterface(XFixedText.class, aObj);
+ XFixedText aFixedText = (XFixedText) UnoRuntime.queryInterface(XFixedText.class, aObj);
// is aObj a label
// is aObj a textfield
if (aFixedText != null &&
- m_aGroupLabel[nGroup] == null )
+ m_aGroupLabel[nGroup] == null)
{
m_aGroupLabel[nGroup] = SectionLabel.create(aFixedText);
}
else
{
- XFormattedField aFormattedField = (XFormattedField)UnoRuntime.queryInterface(XFormattedField.class, aObj);
+ XFormattedField aFormattedField = (XFormattedField) UnoRuntime.queryInterface(XFormattedField.class, aObj);
if (aFormattedField != null &&
- m_aGroupTextField[nGroup] == null )
+ m_aGroupTextField[nGroup] == null)
{
m_aGroupTextField[nGroup] = SectionTextField.create(aFormattedField);
}
@@ -274,6 +282,7 @@ public class DesignTemplate
{
}
}
+
/**
* create a new DesignTemplate by try to load a otr file from the given path.
* Internally we store the loaded ReportDefinition.
@@ -311,7 +320,7 @@ public class DesignTemplate
m_xGlobalMSF = _xMSF;
m_sFilename = _sPath;
final Object aObj = _xMSF.createInstance("com.sun.star.report.ReportDefinition");
- m_xReportDefinition = (XReportDefinition) UnoRuntime.queryInterface(XReportDefinition.class, aObj );
+ m_xReportDefinition = (XReportDefinition) UnoRuntime.queryInterface(XReportDefinition.class, aObj);
PropertyValue[] aLoadProps = new PropertyValue[2];
aLoadProps[0] = Properties.createProperty("URL", _sPath);
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsAbove.java b/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsAbove.java
index 96aca45400c7..df5228e18e4d 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsAbove.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsAbove.java
@@ -9,7 +9,7 @@
*
* $RCSfile: InBlocksLabelsAbove.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.2.36.1 $
*
* This file is part of OpenOffice.org.
*
@@ -30,7 +30,6 @@
*
* **********************************************************************
*/
-
package com.sun.star.wizards.reportbuilder.layout;
import com.sun.star.awt.Rectangle;
@@ -45,6 +44,7 @@ import com.sun.star.wizards.ui.*;
*/
public class InBlocksLabelsAbove extends ColumnarTwoColumns
{
+
public InBlocksLabelsAbove(IReportDefinitionReadAccess _xDefinitionAccess, Resource _aResource)
{
super(_xDefinitionAccess, _aResource);
@@ -85,7 +85,7 @@ public class InBlocksLabelsAbove extends ColumnarTwoColumns
final int nUsablePageWidth = getPageWidth() - getLeftPageIndent() - getRightPageIndent() - getLeftGroupIndent(getCountOfGroups());
- int i=0;
+ int i = 0;
int nCount = aFieldTitleNames.length;
// int x = 0;
aRectLabels.Y = 0;
@@ -106,7 +106,7 @@ public class InBlocksLabelsAbove extends ColumnarTwoColumns
// aRectLabels.X += nFieldWidth;
final int nNextX = aRectFields.X + nFieldWidth;
- if (nNextX > (getPageWidth() - getRightPageIndent()) )
+ if (nNextX > (getPageWidth() - getRightPageIndent()))
{
// all other values are not from interest.
break;
@@ -159,6 +159,7 @@ public class InBlocksLabelsAbove extends ColumnarTwoColumns
xSection.setHeight(aRectFields.Y);
doNotBreakInTable(xSection);
}
+
protected void insertDetailFieldTitles()
{
// we won't extra field titles
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsLeft.java b/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsLeft.java
index 94ceb4032ed5..f6f93e11e574 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsLeft.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsLeft.java
@@ -9,7 +9,7 @@
*
* $RCSfile: InBlocksLabelsLeft.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.2.36.1 $
*
* This file is part of OpenOffice.org.
*
@@ -30,7 +30,6 @@
*
* **********************************************************************
*/
-
package com.sun.star.wizards.reportbuilder.layout;
import com.sun.star.awt.Rectangle;
@@ -45,6 +44,7 @@ import com.sun.star.wizards.ui.*;
*/
public class InBlocksLabelsLeft extends ColumnarTwoColumns
{
+
public InBlocksLabelsLeft(IReportDefinitionReadAccess _xDefinitionAccess, Resource _aResource)
{
super(_xDefinitionAccess, _aResource);
@@ -95,7 +95,7 @@ public class InBlocksLabelsLeft extends ColumnarTwoColumns
nDelta = nDeltaTotal / nFactor;
}
- int i=0;
+ int i = 0;
int nCount = aFieldTitleNames.length;
// int x = 0;
aRectLabelFields.Y = 0;
@@ -114,7 +114,7 @@ public class InBlocksLabelsLeft extends ColumnarTwoColumns
aRectLabelFields = insertFormattedField(xSection, sFieldName, aRectLabelFields, nFieldWidth, aSOTextField);
final int nNextX = aRectLabelFields.X + nLabelWidth + nFieldWidth;
- if (nNextX > (getPageWidth() - getRightPageIndent()) )
+ if (nNextX > (getPageWidth() - getRightPageIndent()))
{
// TODO: label height is fix
aRectLabelFields.Y += aSOTextField.getHeight(500);
@@ -127,6 +127,7 @@ public class InBlocksLabelsLeft extends ColumnarTwoColumns
xSection.setHeight(aRectLabelFields.Y);
doNotBreakInTable(xSection);
}
+
protected void insertDetailFieldTitles()
{
// we won't extra field titles
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java b/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java
index c35e7e8d4f5d..7b0c69c51115 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java
@@ -9,7 +9,7 @@
*
* $RCSfile: ReportBuilderLayouter.java,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.3.6.1 $
*
* This file is part of OpenOffice.org.
*
@@ -29,7 +29,6 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
package com.sun.star.wizards.reportbuilder.layout;
import com.sun.star.awt.FontDescriptor;
@@ -74,19 +73,16 @@ import com.sun.star.wizards.ui.UIConsts;
import java.util.HashMap;
import java.util.Locale;
-
/**
* This class is abstract and more like a helper for create different layouts for Report Builder Wizard.
* @author ll93751
- */
-
-// TODO: let a little bit place between 2 formatted fields
+ */// TODO: let a little bit place between 2 formatted fields
// TODO: move all sectionobjects which have a connect to the right max page width to left if there is a orientation change.
-
abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
{
+
private IReportDefinitionReadAccess m_xReportDefinitionReadAccess;
- private Resource m_aResource;
+ private Resource m_aResource;
/**
* dispose the ReportBuilderLayouter
@@ -95,7 +91,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
{
closeDesignTemplate();
m_xReportDefinitionReadAccess = null;
- // m_xReportBuilderLayouter = null;
+ // m_xReportBuilderLayouter = null;
}
/**
@@ -118,6 +114,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
// we have to ask our parent for this value
return m_xReportDefinitionReadAccess.getReportDefinition();
}
+
/**
* Access to the global MultiServiceFactory
* @return the global Service Factory
@@ -127,7 +124,6 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
return m_xReportDefinitionReadAccess.getGlobalMSF();
}
-
/**
* Layout the complete report new, by all information we know until this time.
*
@@ -173,7 +169,6 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
int dummy = 0;
}
}
-
// -------------------------------------------------------------------------
/**
* Remove all Groups
@@ -190,15 +185,15 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
}
catch (com.sun.star.uno.Exception e)
{
- // Exception not set. Not from interest here.
+ // Exception not set. Not from interest here.
}
}
}
// -------------------------------------------------------------------------
- /**
- * Remove all fields
- * @param _xSectionToClear
- */
+ /**
+ * Remove all fields
+ * @param _xSectionToClear
+ */
private void emptySection(XSection _xSectionToClear)
{
if (_xSectionToClear == null)
@@ -211,7 +206,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
try
{
final Object aObj = _xSectionToClear.getByIndex(0);
- final XShape aShape = (XShape)UnoRuntime.queryInterface(XShape.class, aObj);
+ final XShape aShape = (XShape) UnoRuntime.queryInterface(XShape.class, aObj);
_xSectionToClear.remove(aShape);
}
catch (com.sun.star.uno.Exception e)
@@ -222,17 +217,15 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
}
}
+
private void clearDetails()
{
final XSection xSection = getReportDefinition().getDetail();
emptySection(xSection);
}
-
// public void clearFieldTitles()
// {
// }
-
-
/**
*
* @param _nGroupCount
@@ -253,7 +246,6 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
}
return nIndent;
}
-
/**
* Get left page indent.
* The left indent is the area on the left side which will no be printed.
@@ -261,6 +253,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
* @return the left indent in 1/100mm
*/
int m_nLeftIndent = -1;
+
protected int getLeftPageIndent()
{
if (m_nLeftIndent < 0)
@@ -269,7 +262,6 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
}
return m_nLeftIndent;
}
-
/**
* Get right page indent.
* The right indent is the area on the right side which will no be printed.
@@ -277,6 +269,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
* @return the right indent in 1/100mm
*/
int m_nRightIndent = -1;
+
protected int getRightPageIndent()
{
if (m_nRightIndent < 0)
@@ -298,7 +291,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
// get all Page Styles
final Object aPageStylesObj = xNameAccess.getByName(_sStyleName);
- final XNameAccess xContainer = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, aPageStylesObj);
+ final XNameAccess xContainer = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, aPageStylesObj);
// step over all Page Styles, search the one which is in use
final String[] aElementNames = xContainer.getElementNames();
@@ -306,7 +299,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
{
final String sName = aElementNames[i];
final Object aObj = xContainer.getByName(sName);
- final XStyle xStyle = (XStyle)UnoRuntime.queryInterface(XStyle.class, aObj);
+ final XStyle xStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, aObj);
if (xStyle.isInUse())
{
aUsedStyle = xStyle;
@@ -344,12 +337,12 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
aHelper.setPropertyValueDontThrow(_sStyleName, _aObj);
}
}
-
/**
* Get page width. The default is 21000 1/100mm what is 21cm of DIN A4.
* @return the Width of the page in 1/100mm
*/
int m_nPageWidth = -1;
+
protected int getPageWidth()
{
if (m_nPageWidth < 0)
@@ -367,23 +360,24 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
{
m_aGroupNames = _aGroupNames;
}
+
protected void copyGroupProperties(int _nGroup)
{
- if (getDesignTemplate() != null )
+ if (getDesignTemplate() != null)
{
try
{
final XGroups xForeignGroups = getDesignTemplate().getGroups();
int nGroups = xForeignGroups.getCount();
Object aForeignGroup = xForeignGroups.getByIndex(_nGroup);
- XGroup xForeignGroup = (XGroup)UnoRuntime.queryInterface(XGroup.class, aForeignGroup);
+ XGroup xForeignGroup = (XGroup) UnoRuntime.queryInterface(XGroup.class, aForeignGroup);
XSection xForeignGroupSection = xForeignGroup.getHeader();
if (xForeignGroupSection != null)
{
final XGroups xGroups = getReportDefinition().getGroups();
Object aGroup = xGroups.getByIndex(_nGroup);
- XGroup xGroup = (XGroup)UnoRuntime.queryInterface(XGroup.class, aGroup);
+ XGroup xGroup = (XGroup) UnoRuntime.queryInterface(XGroup.class, aGroup);
XSection xGroupSection = xGroup.getHeader();
// copy Properties
@@ -413,64 +407,64 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
// after done with all groups, we need access to the last group, for set property 'KeepTogether' so we remember it.
XGroup aLastGroup = null;
- for (int i=0;i<m_aGroupNames.length;i++)
+ for (int i = 0; i < m_aGroupNames.length; i++)
{
- final XGroup xGroup = xGroups.createGroup();
- aLastGroup = xGroup;
+ final XGroup xGroup = xGroups.createGroup();
+ aLastGroup = xGroup;
- // TODO: debug what the m_aGroupNames are, "field:[...]" or the "fieldname"
- xGroup.setExpression(m_aGroupNames[i]);
- xGroup.setHeaderOn(true);
- // we don't want any group footer (default off)
- // xGroup.setFooterOn(true);
+ // TODO: debug what the m_aGroupNames are, "field:[...]" or the "fieldname"
+ xGroup.setExpression(m_aGroupNames[i]);
+ xGroup.setHeaderOn(true);
+ // we don't want any group footer (default off)
+ // xGroup.setFooterOn(true);
- try
- {
- // we need to append by hand
- // TODO: documentation is unclear here, that we have to insert by hand
- int nCount = xGroups.getCount();
- xGroups.insertByIndex(nCount, xGroup);
+ try
+ {
+ // we need to append by hand
+ // TODO: documentation is unclear here, that we have to insert by hand
+ int nCount = xGroups.getCount();
+ xGroups.insertByIndex(nCount, xGroup);
- final XSection xGroupSection = xGroup.getHeader();
- copyGroupProperties(nCount);
+ final XSection xGroupSection = xGroup.getHeader();
+ copyGroupProperties(nCount);
- Rectangle aRect = new Rectangle();
- aRect.X = nLeftPageIndent + getLeftGroupIndent(i);
- SectionObject aSO = getDesignTemplate().getGroupLabel(i);
- int nLabelHeight = 0;
+ Rectangle aRect = new Rectangle();
+ aRect.X = nLeftPageIndent + getLeftGroupIndent(i);
+ SectionObject aSO = getDesignTemplate().getGroupLabel(i);
+ int nLabelHeight = 0;
// if (aSO != null)
// {
- nLabelHeight = aSO.getHeight(500);
- aRect = insertLabel(xGroupSection, getTitleFromFieldName(m_aGroupNames[i]), aRect, nLabelWidth, aSO);
+ nLabelHeight = aSO.getHeight(500);
+ aRect = insertLabel(xGroupSection, getTitleFromFieldName(m_aGroupNames[i]), aRect, nLabelWidth, aSO);
// }
// else
// {
// nLabelHeight = 500;
// aRect = insertBoldLabel(xGroupSection, getTitleFromFieldName(m_aGroupNames[i]), aRect, nLabelWidth);
// }
- final String sGroupName = convertToFieldName(m_aGroupNames[i]);
- aSO = getDesignTemplate().getGroupTextField(i);
- insertFormattedField(xGroupSection, sGroupName, aRect, nFieldWidth, aSO);
-
- // draw a line under the label/formattedfield
- aRect.X = nLeftPageIndent + getLeftGroupIndent(i);
- aRect.Y = nLabelHeight;
- final int nLineWidth = getPageWidth() - getRightPageIndent() - aRect.X;
- final int nLineHeight = 250;
- insertHorizontalLine(xGroupSection, aRect, nLineWidth, nLineHeight);
- xGroupSection.setHeight(nLabelHeight + nLineHeight);
- }
- catch (com.sun.star.uno.Exception e)
- {
- // TODO: Exception not set.
- }
- }
-
- // hold the inner group together
- if (aLastGroup != null)
- {
+ final String sGroupName = convertToFieldName(m_aGroupNames[i]);
+ aSO = getDesignTemplate().getGroupTextField(i);
+ insertFormattedField(xGroupSection, sGroupName, aRect, nFieldWidth, aSO);
+
+ // draw a line under the label/formattedfield
+ aRect.X = nLeftPageIndent + getLeftGroupIndent(i);
+ aRect.Y = nLabelHeight;
+ final int nLineWidth = getPageWidth() - getRightPageIndent() - aRect.X;
+ final int nLineHeight = 250;
+ insertHorizontalLine(xGroupSection, aRect, nLineWidth, nLineHeight);
+ xGroupSection.setHeight(nLabelHeight + nLineHeight);
+ }
+ catch (com.sun.star.uno.Exception e)
+ {
+ // TODO: Exception not set.
+ }
+ }
+
+ // hold the inner group together
+ if (aLastGroup != null)
+ {
doNotBreakInTable(aLastGroup);
- }
+ }
}
// -------------------------------------------------------------------------
@@ -486,7 +480,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
// -------------------------------------------------------------------------
protected String getTitleFromFieldName(String _sField)
{
- for (int i=0;i<m_aFieldNames.length;i++)
+ for (int i = 0; i < m_aFieldNames.length; i++)
{
if (m_aFieldNames[i].equals(_sField))
{
@@ -495,9 +489,10 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
}
return "";
}
+
protected boolean listContains(String[] _aList, String _aValue)
{
- for (int i=0;i<_aList.length;i++)
+ for (int i = 0; i < _aList.length; i++)
{
if (_aList[i].equals(_aValue))
{
@@ -517,7 +512,9 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
{
if (_aList == null /* || _aGetResultsFrom == null */)
{
- return new String[]{}; /* empty list */
+ return new String[]
+ {
+ }; /* empty list */
}
if (getCountOfGroups() == 0)
{
@@ -529,8 +526,8 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
}
final int nNewLength = _aList.length - getCountOfGroups();
String[] aNewList = new String[nNewLength];
- int j=0;
- for (int i=0;i<_aList.length;i++)
+ int j = 0;
+ for (int i = 0; i < _aList.length; i++)
{
final String sField = _aList[i];
if (listContains(m_aGroupNames, sField) == true)
@@ -563,6 +560,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
}
return nWidth;
}
+
protected String[] getFieldTitleNames()
{
return getNamesWithoutGroupNames(m_aFieldNames, m_aFieldTitleNames);
@@ -583,12 +581,12 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
{
m_aFieldTypes = _aFieldTypes;
}
+
public void insertFieldWidths(int[] _aFieldWidths)
{
m_aFieldWidths = _aFieldWidths;
}
-
protected int getCountOfGroups()
{
return ((m_aGroupNames == null) ? 0 : m_aGroupNames.length);
@@ -599,11 +597,12 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
{
return getNamesWithoutGroupNames(m_aFieldNames, null);
}
+
abstract protected void insertDetailFields();
protected void copyDetailProperties()
{
- if (getDesignTemplate() != null )
+ if (getDesignTemplate() != null)
{
try
{
@@ -622,7 +621,6 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
}
}
// -------------------------------------------------------------------------
-
protected Rectangle insertLabel(XSection _xSection, String _sLabel, Rectangle _aRect, int _nWidth, SectionObject _aSO)
{
if (_xSection != null)
@@ -630,7 +628,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
try
{
final Object aFixedText = getMSFofReportDefinition().createInstance("com.sun.star.report.FixedText");
- final XFixedText xFixedText = (XFixedText)UnoRuntime.queryInterface(XFixedText.class, aFixedText);
+ final XFixedText xFixedText = (XFixedText) UnoRuntime.queryInterface(XFixedText.class, aFixedText);
int nHeight = 500; // default height of label is fixed.
@@ -699,8 +697,9 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
*/
protected Rectangle insertFormattedField(XSection _xSection, String _sFormattedfield, Rectangle _aRect, int _nWidth, SectionObject _aSO)
{
- return insertFormattedField(_xSection, _sFormattedfield, _aRect, _nWidth, _aSO, (short)com.sun.star.awt.TextAlign.LEFT);
+ return insertFormattedField(_xSection, _sFormattedfield, _aRect, _nWidth, _aSO, (short) com.sun.star.awt.TextAlign.LEFT);
}
+
protected Rectangle insertFormattedField(XSection _xSection, String _sFormattedfield, Rectangle _aRect, int _nWidth, SectionObject _aSO, short _nAlignment)
{
if (_xSection != null)
@@ -708,7 +707,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
try
{
final Object aFormattedField = getMSFofReportDefinition().createInstance("com.sun.star.report.FormattedField");
- final XFormattedField xFormattedField = (XFormattedField)UnoRuntime.queryInterface(XFormattedField.class, aFormattedField);
+ final XFormattedField xFormattedField = (XFormattedField) UnoRuntime.queryInterface(XFormattedField.class, aFormattedField);
// #i86907# not documented right in idl description.
xFormattedField.setDataField(_sFormattedfield);
int nHeight = 500;
@@ -736,7 +735,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
{
XNumberFormatsSupplier x = xFormattedField.getFormatsSupplier();
XNumberFormats xFormats = x.getNumberFormats();
- XNumberFormatTypes x3 = (XNumberFormatTypes)UnoRuntime.queryInterface(XNumberFormatTypes.class, xFormats);
+ XNumberFormatTypes x3 = (XNumberFormatTypes) UnoRuntime.queryInterface(XNumberFormatTypes.class, xFormats);
Locale.getDefault();
com.sun.star.lang.Locale aLocale = new com.sun.star.lang.Locale();
aLocale.Country = Locale.getDefault().getCountry();
@@ -746,12 +745,12 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
xFormattedField.setFormatKey(nFormat);
}
_xSection.add(xFormattedField);
- }
- catch (com.sun.star.uno.Exception e)
- {
- // TODO: Exception not set.
- int dummy = 0;
- }
+ }
+ catch (com.sun.star.uno.Exception e)
+ {
+ // TODO: Exception not set.
+ int dummy = 0;
+ }
}
return _aRect;
}
@@ -766,15 +765,14 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
// getReportDefinition().setCommandType(com.sun.star.sdb.CommandType.TABLE);
getReportDefinition().setCommandType(_aType);
getReportDefinition().setCommand(_sTableName);
- }
-
- // -------------------------------------------------------------------------
+ } // -------------------------------------------------------------------------
protected XMultiServiceFactory m_xMSF;
+
protected XMultiServiceFactory getMSFofReportDefinition()
{
if (m_xMSF == null)
{
- final XMultiServiceFactory xMSF = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, getReportDefinition() );
+ final XMultiServiceFactory xMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, getReportDefinition());
m_xMSF = xMSF;
}
return m_xMSF;
@@ -784,10 +782,12 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
{
return insertLine(_xSection, _aRect, _nWidth, _nHeight, 1);
}
+
protected Rectangle insertHorizontalLine(XSection _xSection, Rectangle _aRect, int _nWidth, int _nHeight)
{
return insertLine(_xSection, _aRect, _nWidth, _nHeight, 0);
}
+
protected Rectangle insertLine(XSection _xSection, Rectangle _aRect, int _nWidth, int _nHeight, int _nOrientation)
{
if (_xSection != null)
@@ -795,7 +795,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
try
{
final Object aFixedLine = getMSFofReportDefinition().createInstance("com.sun.star.report.FixedLine");
- final XFixedLine xFixedLine = (XFixedLine)UnoRuntime.queryInterface(XFixedLine.class, aFixedLine);
+ final XFixedLine xFixedLine = (XFixedLine) UnoRuntime.queryInterface(XFixedLine.class, aFixedLine);
xFixedLine.setOrientation(_nOrientation);
// TODO: line width is fixed
@@ -811,13 +811,12 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
}
catch (com.sun.star.uno.Exception e)
{
- // TODO: Exception not set.
+ // TODO: Exception not set.
int dummy = 0;
}
}
return _aRect;
}
-
// -------------------------------------------------------------------------
protected void clearReportHeader()
{
@@ -867,6 +866,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
}
}
}
+
protected void clearReportFooter()
{
XSection xSection;
@@ -883,6 +883,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
// Exception not set. Not really from interest.
}
}
+
protected void insertReportFooter()
{
if (getDesignTemplate() != null)
@@ -914,7 +915,6 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
}
}
}
-
// -------------------------------------------------------------------------
protected void clearPageHeader()
{
@@ -974,7 +974,6 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
////
//
// }
-
protected void clearPageFooter()
{
XSection xSection;
@@ -989,7 +988,6 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
catch (com.sun.star.container.NoSuchElementException e)
{
// Exception not set. Should not from interest here.
-
}
}
@@ -1020,24 +1018,24 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
m_nPageWidth = -1;
}
-/**
- * Returns the width and height of a given string (_sText) in 1/100mm drawn in the given font descriptor.
- * TODO: This function is a performance leak, we could store already calculated values in a map, to build a cache. Access should be much faster then.
- *
- * @param _sText
- * @param _aFont
- * @return width of given text in 1/100mm
- */
+ /**
+ * Returns the width and height of a given string (_sText) in 1/100mm drawn in the given font descriptor.
+ * TODO: This function is a performance leak, we could store already calculated values in a map, to build a cache. Access should be much faster then.
+ *
+ * @param _sText
+ * @param _aFont
+ * @return width of given text in 1/100mm
+ */
Size getPreferredSize(String _sText, FontDescriptor _aFont)
{
- Size aSizeMM_100TH = new Size(0,0);
+ Size aSizeMM_100TH = new Size(0, 0);
try
{
// Object aControlContainer = getGlobalMSF().createInstance("com.sun.star.awt.UnoControlContainer");
// XControlContainer xControlContainer = (XControlContainer)UnoRuntime.queryInterface(XControlContainer.class, aControlContainer);
final Object aFixedTextModel = getGlobalMSF().createInstance("com.sun.star.awt.UnoControlFixedTextModel");
- final XControlModel xFixedTextModel = (XControlModel)UnoRuntime.queryInterface(XControlModel.class, aFixedTextModel);
+ final XControlModel xFixedTextModel = (XControlModel) UnoRuntime.queryInterface(XControlModel.class, aFixedTextModel);
final PropertySetHelper aPropertySetHelper = new PropertySetHelper(xFixedTextModel);
// aPropertySetHelper.showProperties();
@@ -1047,40 +1045,39 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
// XServiceInfo xServiceInfo2 = (XServiceInfo)UnoRuntime.queryInterface(XServiceInfo.class, aUnoCtrlFixedText);
// String[] sServices2 = xServiceInfo2.getSupportedServiceNames();
- final XWindow xWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, aUnoCtrlFixedText);
+ final XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, aUnoCtrlFixedText);
xWindow.setVisible(false);
- final XControl xControl = (XControl)UnoRuntime.queryInterface(XControl.class, aUnoCtrlFixedText);
+ final XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, aUnoCtrlFixedText);
xControl.setModel(xFixedTextModel);
- final com.sun.star.awt.XFixedText xFixedText = (com.sun.star.awt.XFixedText)UnoRuntime.queryInterface(com.sun.star.awt.XFixedText.class, aUnoCtrlFixedText);
+ final com.sun.star.awt.XFixedText xFixedText = (com.sun.star.awt.XFixedText) UnoRuntime.queryInterface(com.sun.star.awt.XFixedText.class, aUnoCtrlFixedText);
xFixedText.setText(_sText);
- final XLayoutConstrains xLayoutConstraints = (XLayoutConstrains)UnoRuntime.queryInterface(XLayoutConstrains.class, aUnoCtrlFixedText);
+ final XLayoutConstrains xLayoutConstraints = (XLayoutConstrains) UnoRuntime.queryInterface(XLayoutConstrains.class, aUnoCtrlFixedText);
final Size aSizeInPixel = xLayoutConstraints.getPreferredSize();
- final XWindowPeer xPeerOfReportDefinition = (XWindowPeer)UnoRuntime.queryInterface(XWindowPeer.class, getReportDefinition().getCurrentController().getFrame().getComponentWindow());
+ final XWindowPeer xPeerOfReportDefinition = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, getReportDefinition().getCurrentController().getFrame().getComponentWindow());
xControl.createPeer(null, xPeerOfReportDefinition);
final XWindowPeer x = xControl.getPeer();
- final XUnitConversion xConversion = (XUnitConversion)UnoRuntime.queryInterface(XUnitConversion.class, x);
+ final XUnitConversion xConversion = (XUnitConversion) UnoRuntime.queryInterface(XUnitConversion.class, x);
aSizeMM_100TH = xConversion.convertSizeToLogic(aSizeInPixel, com.sun.star.util.MeasureUnit.MM_100TH);
// xToolkit.createScreenCompatibleDevice(_nWidth, _nWidth).
// XWindow x = getReportDefinition().getCurrentController().getFrame().getContainerWindow();
// Object aObj = _xSection.getParent();
// we don't need the created objects any longer
- final XComponent xFixedTextDeleter = (XComponent)UnoRuntime.queryInterface(XComponent.class, xFixedText);
+ final XComponent xFixedTextDeleter = (XComponent) UnoRuntime.queryInterface(XComponent.class, xFixedText);
xFixedTextDeleter.dispose();
- final XComponent xFixedTextModelDeleter = (XComponent)UnoRuntime.queryInterface(XComponent.class, aFixedTextModel);
+ final XComponent xFixedTextModelDeleter = (XComponent) UnoRuntime.queryInterface(XComponent.class, aFixedTextModel);
xFixedTextModelDeleter.dispose();
}
- catch(Exception e)
+ catch (Exception e)
{
// TODO: Exception not set.
-
}
return aSizeMM_100TH;
}
@@ -1111,21 +1108,21 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
return sFirstName + " " + sLastName;
}
-/**
- * Helper function, to copy all not read only properties of _xFromSection to _xToSection
- * @param _xFromSection
- * @param _xToSection
- */
+ /**
+ * Helper function, to copy all not read only properties of _xFromSection to _xToSection
+ * @param _xFromSection
+ * @param _xToSection
+ */
private void copyProperties(Object _aFrom, Object _aTo)
{
- XPropertySet xFrom = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, _aFrom);
- XPropertySet xTo = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, _aTo);
+ XPropertySet xFrom = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, _aFrom);
+ XPropertySet xTo = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, _aTo);
XPropertySetInfo xForeignPropInfo = xFrom.getPropertySetInfo();
XPropertySetInfo xSectionPropInfo = xTo.getPropertySetInfo();
Property[] aAllProperties = xForeignPropInfo.getProperties();
- for(int i=0;i<aAllProperties.length;i++)
+ for (int i = 0; i < aAllProperties.length; i++)
{
String sPropertyName = aAllProperties[i].Name;
if (xSectionPropInfo.hasPropertyByName(sPropertyName))
@@ -1145,11 +1142,11 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
}
}
-/**
- * Helper Funktion to copy the whole content of _xFromSection to the _xToSection
- * @param _xFromSection
- * @param _xToSection
- */
+ /**
+ * Helper Funktion to copy the whole content of _xFromSection to the _xToSection
+ * @param _xFromSection
+ * @param _xToSection
+ */
private void copySection(XSection _xFromSection, XSection _xToSection)
{
copyProperties(_xFromSection, _xToSection);
@@ -1160,7 +1157,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
while (xEnum.hasMoreElements())
{
Object aEnumObj = xEnum.nextElement();
- XReportComponent aComponent = (XReportComponent)UnoRuntime.queryInterface(XReportComponent.class, aEnumObj);
+ XReportComponent aComponent = (XReportComponent) UnoRuntime.queryInterface(XReportComponent.class, aEnumObj);
// XCloneable aClone = (XCloneable)UnoRuntime.queryInterface(XCloneable.class, aEnumObj);
if (aComponent != null)
@@ -1172,7 +1169,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
com.sun.star.awt.Point aPosition = aComponent.getPosition();
Size aSize = aComponent.getSize();
- XShape aShape = (XShape)UnoRuntime.queryInterface(XShape.class, aClone);
+ XShape aShape = (XShape) UnoRuntime.queryInterface(XShape.class, aClone);
String sShapeType = aShape.getShapeType();
com.sun.star.awt.Point aShapePoint = aShape.getPosition();
Size aShapeSize = aShape.getSize();
@@ -1191,8 +1188,8 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
catch (Exception e)
{
}
- // String sName = xForeignSection.getName();
- // int dummy = 0;
+ // String sName = xForeignSection.getName();
+ // int dummy = 0;
}
protected void insertPageHeader()
@@ -1378,7 +1375,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
final int nWidth = nUsablePageWidth;
aRect.X = getLeftPageIndent();
- aRect = insertFormattedField(xSection, "rpt:" + sNoFirstUnusedQuotes, aRect, nWidth, null, (short)com.sun.star.awt.TextAlign.CENTER);
+ aRect = insertFormattedField(xSection, "rpt:" + sNoFirstUnusedQuotes, aRect, nWidth, null, (short) com.sun.star.awt.TextAlign.CENTER);
aRect.Y += 500 + 250;
xSection.setHeight(aRect.Y);
@@ -1389,18 +1386,18 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
}
}
}
+
protected Resource getResource()
{
return m_aResource;
}
-
- protected int m_aCommandType; // Table or Query
- protected String m_sTableName;
+ protected int m_aCommandType; // Table or Query
+ protected String m_sTableName;
protected String[] m_aGroupNames;
protected String[] m_aFieldNames;
protected String[] m_aFieldTitleNames;
- protected int[] m_aFieldWidths;
- protected int[] m_aFieldTypes;
+ protected int[] m_aFieldWidths;
+ protected int[] m_aFieldTypes;
// protected int[] m_nLeftIndent;
private DesignTemplate m_xDesignTemplate = null;
@@ -1408,14 +1405,14 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
{
if (_aOther instanceof ReportBuilderLayouter)
{
- final ReportBuilderLayouter aOther = (ReportBuilderLayouter)_aOther;
+ final ReportBuilderLayouter aOther = (ReportBuilderLayouter) _aOther;
m_aCommandType = aOther.m_aCommandType;
- m_sTableName = aOther.m_sTableName;
+ m_sTableName = aOther.m_sTableName;
m_aGroupNames = aOther.m_aGroupNames;
m_aFieldNames = aOther.m_aFieldNames;
m_aFieldTitleNames = aOther.m_aFieldTitleNames;
m_aFieldWidths = aOther.m_aFieldWidths;
- m_aFieldTypes = aOther.m_aFieldTypes;
+ m_aFieldTypes = aOther.m_aFieldTypes;
// m_nLeftIndent = aOther.m_nLeftIndent;
m_xDesignTemplate = aOther.m_xDesignTemplate;
@@ -1432,12 +1429,12 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
{
int nWidth = 0;
final String[] aFieldTitles = m_aFieldTitleNames; // we want all Field Titles here // getFieldTitleNames();
- for (int i=0; i<aFieldTitles.length; i++)
+ for (int i = 0; i < aFieldTitles.length; i++)
{
final String sLabel = aFieldTitles[i];
nWidth = Math.max(nWidth, getLabelWidth(sLabel));
}
- for (int i=0;i<m_aGroupNames.length;i++)
+ for (int i = 0; i < m_aGroupNames.length; i++)
{
final String sGroupName = m_aGroupNames[i];
final SectionObject a = getDesignTemplate().getGroupLabel(i);
@@ -1465,7 +1462,6 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
{
return getLabelWidth(_sLabel, 0.0f, 0.0f);
}
-
XFixedText m_aFixedTextHelper = null;
HashMap m_aLabelWidthMap;
@@ -1495,7 +1491,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
if (m_aLabelWidthMap.containsKey(sKey))
{
final Object aWidth = m_aLabelWidthMap.get(sKey);
- final Integer aIntegerWidth = (Integer)aWidth;
+ final Integer aIntegerWidth = (Integer) aWidth;
nWidth = aIntegerWidth.intValue();
}
else
@@ -1505,7 +1501,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
if (m_aFixedTextHelper == null)
{
final Object aFixedText = getMSFofReportDefinition().createInstance("com.sun.star.report.FixedText");
- m_aFixedTextHelper = (XFixedText)UnoRuntime.queryInterface(XFixedText.class, aFixedText);
+ m_aFixedTextHelper = (XFixedText) UnoRuntime.queryInterface(XFixedText.class, aFixedText);
}
m_aFixedTextHelper.setLabel(_sLabel);
@@ -1537,8 +1533,8 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
// try
// {
// _xSection.setKeepTogether(true);
- final PropertySetHelper aHelper = new PropertySetHelper(_xSectionOrGroup);
- aHelper.setPropertyValueDontThrow("KeepTogether", Boolean.TRUE);
+ final PropertySetHelper aHelper = new PropertySetHelper(_xSectionOrGroup);
+ aHelper.setPropertyValueDontThrow("KeepTogether", Boolean.TRUE);
// }
// catch (com.sun.star.uno.Exception e)
// {
@@ -1546,7 +1542,6 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
// }
}
-
protected DesignTemplate getDesignTemplate()
{
if (m_xDesignTemplate == null)
@@ -1555,7 +1550,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
String sDefaultHeaderLayout = m_xReportDefinitionReadAccess.getDefaultHeaderLayout();
loadAndSetBackgroundTemplate(sDefaultHeaderLayout);
- // copy all functions from the design template to the current report definition
+ // copy all functions from the design template to the current report definition
// XFunctions xOtherFunctions = m_xDesignTemplate.getReportDefinition().getFunctions();
// final int nFunctionCount = xOtherFunctions.getCount();
// for (int i=0;i<nFunctionCount;i++)
@@ -1586,6 +1581,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
}
return m_xDesignTemplate;
}
+
/**
* If there already exists a foreign report definition, which we use to get the layout from
* close it.
@@ -1599,6 +1595,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
m_xDesignTemplate = null;
}
}
+
/**
* load the given string as a template and use it's content to paint the other
* @param LayoutTemplatePath
@@ -1609,7 +1606,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
String sName = FileAccess.getFilename(LayoutTemplatePath);
if (sName.toLowerCase().equals("default.otr_") ||
- LayoutTemplatePath.equals("DefaultLayoutOfHeaders"))
+ LayoutTemplatePath.equals("DefaultLayoutOfHeaders"))
{
// this is the default layout, we don't want to have a layout for this.
}
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionEmptyObject.java b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionEmptyObject.java
index cf40352648cc..aa777253a7f7 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionEmptyObject.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionEmptyObject.java
@@ -9,7 +9,7 @@
*
* $RCSfile: SectionEmptyObject.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.2.36.1 $
*
* This file is part of OpenOffice.org.
*
@@ -30,7 +30,6 @@
*
* **********************************************************************
*/
-
package com.sun.star.wizards.reportbuilder.layout;
import com.sun.star.awt.FontDescriptor;
@@ -41,6 +40,7 @@ import com.sun.star.awt.FontDescriptor;
*/
public class SectionEmptyObject extends SectionObject
{
+
protected SectionEmptyObject()
{
m_aParentObject = null;
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionLabel.java b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionLabel.java
index 65ee9e65f818..821ccf5a180d 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionLabel.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionLabel.java
@@ -9,7 +9,7 @@
*
* $RCSfile: SectionLabel.java,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.3.6.1 $
*
* This file is part of OpenOffice.org.
*
@@ -30,23 +30,22 @@
*
* **********************************************************************
*/
-
package com.sun.star.wizards.reportbuilder.layout;
import com.sun.star.awt.FontDescriptor;
import com.sun.star.report.XFixedText;
// import com.sun.star.wizards.common.PropertySetHelper;
-
/**
*
* @author ll93751
*/
public class SectionLabel extends SectionObject
{
+
protected SectionLabel(XFixedText _aFixedText)
{
m_aParentObject = _aFixedText;
- // We would like to know, what properties are in this object.
+ // We would like to know, what properties are in this object.
// PropertySetHelper aHelper = new PropertySetHelper(_aFixedText);
// aHelper.showProperties();
}
@@ -66,15 +65,14 @@ public class SectionLabel extends SectionObject
FontDescriptor a = null;
try
{
- final XFixedText aLabel = (XFixedText)getParent();
- a= aLabel.getFontDescriptor();
+ final XFixedText aLabel = (XFixedText) getParent();
+ a = aLabel.getFontDescriptor();
}
catch (com.sun.star.beans.UnknownPropertyException e)
{
}
return a;
}
-
}
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java
index f0eb46fe729a..2bdc2cf8c929 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java
@@ -9,7 +9,7 @@
*
* $RCSfile: SectionObject.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.2.36.1 $
*
* This file is part of OpenOffice.org.
*
@@ -30,19 +30,18 @@
*
* **********************************************************************
*/
-
package com.sun.star.wizards.reportbuilder.layout;
import com.sun.star.awt.FontDescriptor;
import com.sun.star.wizards.common.PropertySetHelper;
-
/**
*
* @author ll93751
*/
abstract public class SectionObject
{
+
Object m_aParentObject; // this could be FixedText or FormattedField or null
PropertySetHelper m_aPropertySetHelper;
@@ -55,6 +54,7 @@ abstract public class SectionObject
{
return m_aParentObject;
}
+
abstract public FontDescriptor getFontDescriptor();
private PropertySetHelper getPropertySetHelper()
@@ -65,20 +65,24 @@ abstract public class SectionObject
}
return m_aPropertySetHelper;
}
+
public int getHeight(int _nDefault)
{
final int nHeight = getPropertySetHelper().getPropertyValueAsInteger("Height", 500);
return nHeight;
}
+
public float getCharWeight(float _nDefault)
{
final float fCharWeight = (float) getPropertySetHelper().getPropertyValueAsDouble("CharWeight", _nDefault);
return fCharWeight;
}
+
public void setFontToBold()
{
setPropertyValue("CharWeight", new Float(com.sun.star.awt.FontWeight.BOLD));
}
+
public void setPropertyValue(String _sKey, Object _nValue)
{
getPropertySetHelper().setPropertyValueDontThrow(_sKey, _nValue);
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionTextField.java b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionTextField.java
index 11a050a7940c..ebf11abacdf7 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionTextField.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionTextField.java
@@ -9,7 +9,7 @@
*
* $RCSfile: SectionTextField.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.2.36.1 $
*
* This file is part of OpenOffice.org.
*
@@ -30,7 +30,6 @@
*
* **********************************************************************
*/
-
package com.sun.star.wizards.reportbuilder.layout;
import com.sun.star.awt.FontDescriptor;
@@ -40,12 +39,13 @@ import com.sun.star.report.XFormattedField;
*
* @author ll93751
*/
-public class SectionTextField extends SectionObject
+public class SectionTextField extends SectionObject
{
+
protected SectionTextField(XFormattedField _aFormattedField)
{
m_aParentObject = _aFormattedField;
- // We would like to know, what properties are in this object.
+ // We would like to know, what properties are in this object.
}
public static SectionObject create(XFormattedField _aFormattedField)
@@ -59,7 +59,7 @@ public class SectionTextField extends SectionObject
FontDescriptor a = null;
try
{
- XFormattedField aField = (XFormattedField)getParent();
+ XFormattedField aField = (XFormattedField) getParent();
a = aField.getFontDescriptor();
}
catch (com.sun.star.beans.UnknownPropertyException e)
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/Tabular.java b/wizards/com/sun/star/wizards/reportbuilder/layout/Tabular.java
index e2d5dd11756b..b5ebc38a0453 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/Tabular.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/Tabular.java
@@ -9,7 +9,7 @@
*
* $RCSfile: Tabular.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.2.36.1 $
*
* This file is part of OpenOffice.org.
*
@@ -29,7 +29,6 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
package com.sun.star.wizards.reportbuilder.layout;
import com.sun.star.awt.Rectangle;
@@ -47,6 +46,7 @@ import com.sun.star.wizards.ui.UIConsts;
*/
public class Tabular extends ReportBuilderLayouter
{
+
public Tabular(IReportDefinitionReadAccess _xDefinitionAccess, Resource _aResource)
{
super(_xDefinitionAccess, _aResource);
@@ -86,7 +86,7 @@ public class Tabular extends ReportBuilderLayouter
final int nWidth = calculateFieldWidth(getLeftGroupIndent(getCountOfGroups()), aFieldNames.length);
final SectionObject aSO = getDesignTemplate().getDetailTextField();
- for (int i=0;i<aFieldNames.length;i++)
+ for (int i = 0; i < aFieldNames.length; i++)
{
final String sFieldName = convertToFieldName(aFieldNames[i]);
aRect = insertFormattedField(xSection, sFieldName, aRect, nWidth, aSO);
@@ -95,7 +95,6 @@ public class Tabular extends ReportBuilderLayouter
xSection.setHeight(nHeight);
}
-
protected void insertDetailFieldTitles()
{
final String[] aFieldTitleNames = getFieldTitleNames();
@@ -130,7 +129,7 @@ public class Tabular extends ReportBuilderLayouter
final XGroups xGroups = getReportDefinition().getGroups();
// we insert the titles in the last group
final Object aGroup = xGroups.getByIndex(nGroups - 1);
- final XGroup xGroup = (XGroup)UnoRuntime.queryInterface(XGroup.class, aGroup);
+ final XGroup xGroup = (XGroup) UnoRuntime.queryInterface(XGroup.class, aGroup);
xSection = xGroup.getHeader();
// We don't need to copy the GroupProperties, because this is done in the insertGroup() member function
@@ -145,7 +144,7 @@ public class Tabular extends ReportBuilderLayouter
aRect.Y = aSO.getHeight(500) + 250; // group height + a little empty line
final int nWidth = calculateFieldWidth(getLeftGroupIndent(getCountOfGroups()), aFieldTitleNames.length);
- for (int i=0;i<aFieldTitleNames.length;i++)
+ for (int i = 0; i < aFieldTitleNames.length; i++)
{
aRect = insertLabel(xSection, aFieldTitleNames[i], aRect, nWidth, aSO);
}
@@ -155,6 +154,4 @@ public class Tabular extends ReportBuilderLayouter
{
}
}
-
-
}