Java 2D Graphics object

Status
Not open for further replies.

Goran Pilipovic

Usenet Archive
Joined
Dec 10, 2001
Messages
5
Reaction score
0
I'm interesting in one thing. Can I use standard java Graphics class, draw and show that object within the model. If this is possible can I get small example. Please! THANKS.
 
Goran ...

Can I use standard java Graphics class,
draw and show that object within the model.

MicroStation includes a normal implementation of the Java Virtual Machine (JVM). If your program can display graphics in a pure Java application, then it can display graphics in MicroStation.

For examples, use the code delivered with Sun's Java Development Kit.
 
Well John, thanks a lot.
I tried to e-mail you but still no answer. I write my question here again. I try to put some Graphics into the dgn model, not to start some applet-application from Microstation which display such Graphics object. Some of ideas is on my mind, but this is just a begining. The first one is to make a new class derived from Graphics2D... and then what? The second one is to make a class derived from com.bentley.dgn.Element(for example DGNGraphics), and define classes as it private members (classes that has possibilities to draw some Graphics object). That classes is already defined in pure java code. Can I such class (DGNGraphics) draw within dgn model at specific coordinates?

Thanks again.
Best regards,
Goran.

"Jon Summers" wrote:
Goran ...

> Can I use standard java Graphics class,
> draw and show that object within the model.

MicroStation includes a normal implementation of the Java Virtual Machine (JVM). If your program can display graphics in a pure Java application, then it can display graphics in MicroStation.

For examples, use the code delivered with Sun's Java Development Kit.
 
See this http://www.inet.hr/cad_studio/references/ref8.htm - on the bottom of the page....
 
Goran ...

Well John, thanks a lot.
I tried to e-mail you but still no answer. I write my question here again.
I'm happy to contribute to the news-group, but I don't offer a personal consulting service free-of-charge 8-(

I try to put some Graphics into the dgn model, not to start some applet-application from Microstation which display such Graphics object. Some of ideas is on my mind, but this is just a begining. The first one is to make a new class derived from Graphics2D... and then what? The second one is to make a class derived from com.bentley.dgn.Element(for example DGNGraphics), and define classes as it private members (classes that has possibilities to draw some Graphics object).

You can only create graphics elements in MicroStation that are supported by the DGN file format. These elements are all derived classes of the JMDL Element class.

For example, suppose you want to draw a line: use the LineElement class. LineElement has several constructors: two of these accept arrays of DPoint3d or double XYZ co-ordinates. You can use the Element.offset or Element.transform methods to modify the location of the object after you've created it.

Use DgnSession.redrawElement (oYourLineElement, View.NORMALDRAW) to show the new or modified element.

Use DgnModel.addElement (oYourLineElement) to persist the element to the DGN file.
 
Status
Not open for further replies.

Latest threads

Back
Top