[api-dev] Re: [dev] Programmatic XTextFrame Control with Java

2006-02-07 Thread Christian Junker
Hi Kent Gibson,

this is a pure API topic, so discussion should rather go on over there
(dev@api.openoffice.org). Thus I am forwarding your message.

2006/2/6, Kent Gibson [EMAIL PROTECTED]:
 Hi-ya,

 I would like to create XTextFrames of a fixed
 arbitrary height and width and place them at arbitrary
 x and y coordinates.

 I can manage to get the frame, but I can't seem to
 size it or place it arbitrarily. I have based my code
 on the TextFrameExample() in TextDocuments.java.

 These properties seem to have no effect:

 XInterface xTextFrameInterface = (XInterface)
 mxDocFactory.createInstance(com.sun.star.text.TextFrame);


 XPropertySet xFramePropSet = (XPropertySet)
 UnoRuntime.queryInterface(XPropertySet.class,
 xTextFrameInterface);
 xFramePropSet.setPropertyValue( FrameHeightAbsolute,
 new Long(5000));
 xFramePropSet.setPropertyValue(
 FrameIsAutomaticHeight, new Boolean(false));
 xFramePropSet.setPropertyValue( SizeType, new
 Short((short)1));

 Also when I use xShape to define height and width, it
 doesn't seem to work either. The textframe is only as
 big as the text inside it.

 XShape xShape = ( XShape ) UnoRuntime.queryInterface(
 XShape.class, xFrame );

 // Access the XPropertySet interface of the TextFrame
 XPropertySet xFrameProps = ( XPropertySet )
 UnoRuntime.queryInterface( XPropertySet.class, xFrame
 );

 // Set the size of the new Text Frame using the
 XShape's 'setSize' method
 Size aSize = new Size();
 // this is probably (1/100 mm)
 aSize.Height = 400;
 aSize.Width = 15000;
 xShape.setSize(aSize);

 If anyone has any pointers that would be grand.



--
Best Regards
Christian Junker

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[api-dev] Re: [dev] Programmatic XTextFrame Control with Java

2006-02-07 Thread Kent Gibson
thanks, I am now signed up to the api list. I don't
suppose in the interim my question was answered?

We would really like to integrate openoffice but we
need to able to place text with x,y coords and so far
I can't get it to work. Does anyone even know if this
is possible?

Whenever I set any of these properties on a XTextFrame
they are either ignored or I get
IllegalArgumentException:

HoriOrientPosition
VertOrientPosition
Width
Height
FrameHeightAbsolute
FrameWidthAbsolute
FrameWidthAbsolute
FrameIsAutomaticHeight
SizeType


--- Christian Junker [EMAIL PROTECTED]
wrote:

 Hi Kent Gibson,
 
 this is a pure API topic, so discussion should
 rather go on over there
 (dev@api.openoffice.org). Thus I am forwarding your
 message.
 
 2006/2/6, Kent Gibson [EMAIL PROTECTED]:
  Hi-ya,
 
  I would like to create XTextFrames of a fixed
  arbitrary height and width and place them at
 arbitrary
  x and y coordinates.
 
  I can manage to get the frame, but I can't seem to
  size it or place it arbitrarily. I have based my
 code
  on the TextFrameExample() in TextDocuments.java.
 
  These properties seem to have no effect:
 
  XInterface xTextFrameInterface = (XInterface)
 

mxDocFactory.createInstance(com.sun.star.text.TextFrame);
 
 
  XPropertySet xFramePropSet = (XPropertySet)
  UnoRuntime.queryInterface(XPropertySet.class,
  xTextFrameInterface);
  xFramePropSet.setPropertyValue(
 FrameHeightAbsolute,
  new Long(5000));
  xFramePropSet.setPropertyValue(
  FrameIsAutomaticHeight, new Boolean(false));
  xFramePropSet.setPropertyValue( SizeType, new
  Short((short)1));
 
  Also when I use xShape to define height and width,
 it
  doesn't seem to work either. The textframe is only
 as
  big as the text inside it.
 
  XShape xShape = ( XShape )
 UnoRuntime.queryInterface(
  XShape.class, xFrame );
 
  // Access the XPropertySet interface of the
 TextFrame
  XPropertySet xFrameProps = ( XPropertySet )
  UnoRuntime.queryInterface( XPropertySet.class,
 xFrame
  );
 
  // Set the size of the new Text Frame using the
  XShape's 'setSize' method
  Size aSize = new Size();
  // this is probably (1/100 mm)
  aSize.Height = 400;
  aSize.Width = 15000;
  xShape.setSize(aSize);
 
  If anyone has any pointers that would be grand.
 
 
 
 --
 Best Regards
 Christian Junker
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]