Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » examples.shapes - format of saving
examples.shapes - format of saving [message #219633] Thu, 20 July 2006 05:34 Go to next message
Eclipse UserFriend
Originally posted by: dstamkokeng.gmail.com

The current format for saving in the Shapes example given with GEF is
through serializing the ShapesDiagram root object. Has anybody tried
saving the data in any other format which enables easier reading?
I will like to still be able to view the data in the model and edit it
even when I am not opening the program. Thanks in advance people! :)
Re: examples.shapes - format of saving [message #219705 is a reply to message #219633] Thu, 20 July 2006 16:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andrew_NOSPAM_.eisenberg.as

Meo Kok Eng wrote:
> The current format for saving in the Shapes example given with GEF is
> through serializing the ShapesDiagram root object. Has anybody tried
> saving the data in any other format which enables easier reading? I will
> like to still be able to view the data in the model and edit it even
> when I am not opening the program. Thanks in advance people! :)
>
Why can't you send a visitor down your shapes and serialize each shape to some
nice textual format? Reading it back from text would mean parsing the text and
converting to shapes.
Re: examples.shapes - format of saving [message #219713 is a reply to message #219633] Thu, 20 July 2006 17:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

The GEF examples use Java serialization since it was the easiest for us to
implement. The main purpose of the GEF examples is to feature the GEF
functionality, and we don't recommend that GEF clients replicate how we save
our model, manage the files, etc.

As for what you want to do, you can use EMF. http://www.eclipse.org/emf

"Meo Kok Eng" <dstamkokeng@gmail.com> wrote in message
news:2d7a3c54710b8d44eea28f99056c08fc$1@www.eclipse.org...
> The current format for saving in the Shapes example given with GEF is
> through serializing the ShapesDiagram root object. Has anybody tried
> saving the data in any other format which enables easier reading? I will
> like to still be able to view the data in the model and edit it even when
> I am not opening the program. Thanks in advance people! :)
>
Re: examples.shapes - format of saving [message #219745 is a reply to message #219713] Fri, 21 July 2006 01:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dstamkokeng.gmail.com

ic, thanks alot :)

Sorry if my questions are very amatuerish cos I am quite new to eclipse
and gef.
May I know if there is any examples on how to change the view of a model
item when there is a change to the model. Not only to the location and
size.

For example, I might have an extra boolean field called tickBox in
RectangularShape, and when I change the tickBox to true, a box in the
rectangular figure will change color etc.

I have already created a rectangular figure to overwrite the example
implememtation. However I do not know how to create an extra box on top of
the rectangle figure and most importantly, I do not know how to change it
upon change to the model. :(

Any examples will be greatly appreciated so I can understand how things
work by myself. Please help. thanks!
Re: examples.shapes - format of saving [message #219767 is a reply to message #219745] Fri, 21 July 2006 07:01 Go to previous message
Eclipse UserFriend
Originally posted by: reinalt.gmail.com

For the figure part u need to th following things:
1. In the edit part where ur create and return new RectangleFigure, there
do the following :
RectangleFigure r = new RectangleFigure();
setLayout(new StackLayout()) //or u can use ToolbarLayout/FlowLayout.
CheckBox checkBox = new CheckBox(); //draw2d supports this
add(checkBox);

This will take care of ur figure.

On the model part u keep a boolean value tick which tells the current
state of checkbox.U will hv to add a ComboBoxPropertyDescriptor to ur
model figure.This will have values "True" and "False". Then in
ShapeEditPart inside propertyChangeListener u will have to check if the
respective property is selected u will have to call getModel() n change
the boolean value and refreshVisuals accordingly.....
I hope this will do.....

reinalt


ic, thanks alot :)

Sorry if my questions are very amatuerish cos I am quite new to eclipse
and gef. May I know if there is any examples on how to change the view of
a model item when there is a change to the model. Not only to the location
and size. For example, I might have an extra boolean field called tickBox
in RectangularShape, and when I change the tickBox to true, a box in the
rectangular figure will change color etc. I have already created a
rectangular figure to overwrite the example implememtation. However I do
not know how to create an extra box on top of the rectangle figure and
most importantly, I do not know how to change it upon change to the model.
:(

Any examples will be greatly appreciated so I can understand how things
work by myself. Please help. thanks!
Previous Topic:how do I react to property changes visually
Next Topic:Can ConnectionRouters avoid obstacles at all levels?
Goto Forum:
  


Current Time: Sat Apr 27 04:18:12 GMT 2024

Powered by FUDForum. Page generated in 0.03365 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top