OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Missing Class in com.sun.star.drawing

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Keymaster
General User
General User


Joined: 17 Feb 2005
Posts: 23
Location: München, Germany

PostPosted: Fri Feb 18, 2005 5:19 am    Post subject: Missing Class in com.sun.star.drawing Reply with quote

I have a big problem. i use this statement in my java application

Object oGraphic = xMSF.createInstance("com.sun.star.drawing.GraphicObjectShape");

The problem is that the oGraphic object is null. I have no GraphicObjectShape in the package com.sun.star.drawing, but why?

The peace of Code is out of a other Thread in this Forum an there it works.

(Sorry for my bad english, i am from germany)

Please help me, i am searching for an solution since 2 Days.
Back to top
View user's profile Send private message
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3655
Location: Columbus, Ohio, USA

PostPosted: Fri Feb 18, 2005 6:35 am    Post subject: Reply with quote

In the other code, did it create an object of this type, or did it obtain the interface? There are two chapters available for free from my book from the publisher. One of the free chapters is the chapter dealing with drawing documents.
_________________
--
Andrew Pitonyak
http://www.pitonyak.org/oo.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Keymaster
General User
General User


Joined: 17 Feb 2005
Posts: 23
Location: München, Germany

PostPosted: Fri Feb 18, 2005 6:48 am    Post subject: Reply with quote

thanks i have found the free Chapter. I hope it will help me
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Sat Feb 19, 2005 10:57 am    Post subject: Re: Missing Class in com.sun.star.drawing Reply with quote

Keymaster wrote:
Object oGraphic = xMSF.createInstance("com.sun.star.drawing.GraphicObjectShape");

The problem is that the oGraphic object is null. I have no GraphicObjectShape in the package com.sun.star.drawing, but why?


What is xMSF?

I would guess from the name, that it is an XMultiServiceFactory of some object. But that object?

Is xMSF the XMultiServiceFactory of the Service Manager? This will not work.

You need to ask the XMultiServiceFactory of the document to create the GraphicObjectShape.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Keymaster
General User
General User


Joined: 17 Feb 2005
Posts: 23
Location: München, Germany

PostPosted: Sat Feb 19, 2005 11:21 am    Post subject: Reply with quote

ok thats one point ^^

the next problem is that there is no GraphicObjectShape at sun.star.drawing
or is GraphicObjectShape not a Class? I am a noob in every OO things
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Sat Feb 19, 2005 11:42 am    Post subject: Reply with quote

Keymaster wrote:
the next problem is that there is no GraphicObjectShape at sun.star.drawing
or is GraphicObjectShape not a Class? I am a noob in every OO things


I can find it in the docs just fine.

Are you sure you don't mean com.sun.star.drawing.GraphicObjectShape.

I was able to use GraphicObjectShape over in this thread just fine.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Keymaster
General User
General User


Joined: 17 Feb 2005
Posts: 23
Location: München, Germany

PostPosted: Sun Feb 20, 2005 3:41 am    Post subject: Reply with quote

Yes normaly everyone can find it at com.sun.star.drawing. I can call the package drawing normally but there is now GraphicObjectShape. I find it in the sun docus and so on but not in my libs. I dont know why but there is no GraphicObjectShape and no other Class having nearly the same name. What OpenOffice Lib i have to include in my java project to use the GraphicObjectShape? Perhaps i have forgotten somthing.

I have included the openOffce jars in program\classes
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Sun Feb 20, 2005 9:20 am    Post subject: Reply with quote

If you are building a component that is installed into the office, and runs within the office, then you need to put the jar files from OOo into your compile-time classpath.

If your java program runs from outside of the office (i.e. a standalone program, or a servlet, for example) then you must include some of the OOo jar files in your runtime classpath.

The jars are found under your
$OOo/program/classes
folder.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Keymaster
General User
General User


Joined: 17 Feb 2005
Posts: 23
Location: München, Germany

PostPosted: Mon Feb 21, 2005 4:06 am    Post subject: Reply with quote

Ok that is whate i have done.

alle these jars are included but no GraphicObjectShape file is available.

Is the GraphicObject Shape a Class ! File ! or is it only something else?

But if i can call it with com.sun.star.drawing.GraphicObjectShape it have to be a class file i think. Or be i wrong?

If it is a class, only god knows why it is not available in my application
Back to top
View user's profile Send private message
Cybb20
Super User
Super User


Joined: 02 Mar 2004
Posts: 1569
Location: Frankfurt, Germany

PostPosted: Mon Feb 21, 2005 10:58 am    Post subject: Reply with quote

Keymaster:
Do you have the SDK installed?
If not, please do that. The Developer's Guide describes the first steps of coding in Java in its first or second chapter, I think.
It's a very simple and good description and will probably help to solve your problems.

Christian
_________________
- Knowledge is Power -
Back to top
View user's profile Send private message Send e-mail
Keymaster
General User
General User


Joined: 17 Feb 2005
Posts: 23
Location: München, Germany

PostPosted: Wed Feb 23, 2005 7:12 am    Post subject: Reply with quote

Yes i have installt the SDK it helps much but solves not all my probs ^^
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Sat Feb 26, 2005 10:22 am    Post subject: Reply with quote

Keymaster wrote:
Is the GraphicObject Shape a Class ! File ! or is it only something else?


The OOo jars will NOT include any classes, such as GraphicObjectShape.

The OOo jars WILL include the interfaces of OOo's API. GraphicObjectShape implements at least one interface. When you createInstance() of a GraphicObjectShape, an interface will be returned. You can queryInterface on this to obtain any of the other interfaces that are also implemented by GraphicObjectShape.

GraphicObjectShape is a service. It exists within the OOo, not within the java process. In Java a proxy object is returned, Actually an interface is returned. Using the queryInterface() function, you can obtain any of the other interfaces to the same object.

You can only get hold of one or more of the interfaces of a Service in OOo. Each Service many offer multiple interfaces to do different things on that Service. You use queryInterface to switch among the different interfaces of the same Service object.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group